File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+
5+ _IFS=" $IFS " ; IFS=' :'
6+ for dir in $PKG_CONFIG_PATH ` pkg-config --variable pc_path pkg-config` ; do
7+ if [ -d " ${dir} " -a -w " ${dir} " -a -d " ${dir} /../../include" ]; then
8+ DST=" $dir "
9+ break
10+ fi
11+ done
12+ IFS=" $_IFS " ; unset _IFS
13+
14+ if [ -z " ${DST} " ]; then
15+ echo " no suitable pkg-config directory found."
16+ exit 1
17+ fi
18+
19+ if [ ` basename $0 ` = " pkg-install.sh" ]; then
20+ SRC=` dirname $0 `
21+ SRC=` (cd $SRC /..; [ -d .git ] && pwd)`
22+ fi
23+
24+ export DST
25+ cd ${TMPDIR:-/ tmp}
26+
27+ trap ' rm -rf blst.$$' 0
28+ git clone ${SRC:- " https://github.com/supranational/blst" } blst.$$
29+ ( trap ' [ $? -ne 0 ] && rm "${DST}/blst.pc" 2>/dev/null' 0
30+ cd blst.$$
31+ tag=` git tag --sort=v:refname | tail -1`
32+ git checkout --detach ${tag}
33+ ./build.sh " $@ "
34+ cp libblst.a " ${DST} /.."
35+ cp bindings/blst.h* " ${DST} /../../include"
36+ cat > " ${DST} /blst.pc" << blst.pc
37+ libdir=\$ {pcfiledir}/..
38+ incdir=\$ {pcfiledir}/../../include
39+ Name: blst
40+ Version: $tag
41+ Description: blst core library
42+ Cflags: -I\$ {incdir}
43+ Libs: -L\$ {libdir} -lblst
44+ blst.pc
45+ )
You can’t perform that action at this time.
0 commit comments