mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 09:32:53 -06:00
bin/build-binary-dist.sh: remove hardwired install path and version number
Also improved tolerance to paths containing white space.
This commit is contained in:
@@ -12,8 +12,8 @@ hw=$(uname -m) # Hardware name (e.g. i686 or x86_64)
|
|||||||
# GF version number:
|
# GF version number:
|
||||||
ver=$(grep -i ^version: gf.cabal | sed -e 's/version://' -e 's/ //g')
|
ver=$(grep -i ^version: gf.cabal | sed -e 's/version://' -e 's/ //g')
|
||||||
|
|
||||||
name=gf-$ver
|
name="gf-$ver"
|
||||||
destdir=$PWD/dist/$name # assemble binary dist here
|
destdir="$PWD/dist/$name" # assemble binary dist here
|
||||||
prefix=${PREFIX:-/usr/local} # where to install
|
prefix=${PREFIX:-/usr/local} # where to install
|
||||||
fmt=${FMT:-tar.gz} # binary package format (tar.gz or pkg)
|
fmt=${FMT:-tar.gz} # binary package format (tar.gz or pkg)
|
||||||
|
|
||||||
@@ -26,15 +26,15 @@ set -x # print commands before exuting them
|
|||||||
|
|
||||||
## First configure & build the C run-time system
|
## First configure & build the C run-time system
|
||||||
pushd src/runtime/c
|
pushd src/runtime/c
|
||||||
bash setup.sh configure --prefix=$prefix
|
bash setup.sh configure --prefix="$prefix"
|
||||||
bash setup.sh build
|
bash setup.sh build
|
||||||
bash setup.sh install prefix=$destdir$prefix
|
bash setup.sh install prefix="$destdir$prefix"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
## Build the python binding to the C run-time system
|
## Build the python binding to the C run-time system
|
||||||
pushd src/runtime/python
|
pushd src/runtime/python
|
||||||
EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build
|
EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build
|
||||||
python setup.py install --prefix=$destdir$prefix
|
python setup.py install --prefix="$destdir$prefix"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
## Build the Java binding to the C run-time system
|
## Build the Java binding to the C run-time system
|
||||||
@@ -44,22 +44,22 @@ popd
|
|||||||
|
|
||||||
## Build GF, with C run-time support enabled
|
## Build GF, with C run-time support enabled
|
||||||
cabal install --only-dependencies
|
cabal install --only-dependencies
|
||||||
cabal configure --prefix=$prefix -fserver -fc-runtime $extra
|
cabal configure --prefix="$prefix" -fserver -fc-runtime $extra
|
||||||
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
|
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
|
||||||
cabal copy --destdir=$destdir
|
cabal copy --destdir="$destdir"
|
||||||
libdir=$(dirname $(find $destdir -name PGF.hi))
|
libdir=$(dirname $(find "$destdir" -name PGF.hi))
|
||||||
cabal register --gen-pkg-config=$libdir/gf-$ver.conf
|
cabal register --gen-pkg-config=$libdir/gf-$ver.conf
|
||||||
|
|
||||||
case $fmt in
|
case $fmt in
|
||||||
tar.gz)
|
tar.gz)
|
||||||
targz=$name-bin-$hw-$os.tar.gz # the final tar file
|
targz="$name-bin-$hw-$os.tar.gz" # the final tar file
|
||||||
tar -C $destdir/$prefix -zcf dist/$targz .
|
tar -C "$destdir/$prefix" -zcf "dist/$targz" .
|
||||||
echo "Created $targz, consider renaming it to something more user friendly"
|
echo "Created $targz, consider renaming it to something more user friendly"
|
||||||
;;
|
;;
|
||||||
pkg)
|
pkg)
|
||||||
pkg=$name.pkg
|
pkg=$name.pkg
|
||||||
pkgbuild --identifier org.grammaticalframework.gf.pkg --version 3.6 --root $destdir/usr --install-location /usr dist/$pkg
|
pkgbuild --identifier org.grammaticalframework.gf.pkg --version "$ver" --root "$destdir/usr" --install-location "$prefix" dist/$pkg
|
||||||
echo "Created $pkg"
|
echo "Created $pkg"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
rm -r $destdir
|
rm -r "$destdir"
|
||||||
|
|||||||
Reference in New Issue
Block a user