fix deb build (#167)

* fix deb build:

change makefile and deb_from_installation to invoke it with the new
build directory (changed in #143).

deb_from_installation will exit 0 if dpkg-deb missing so we dont try
to run it as part of `make package` on non-deb systems, but other errors
should cause the makefile to fail, which should catch regressions like
this sooner in the future.

* thank you fgsch for style fix
pull/170/head wasi-sdk-12
Pat Hickey 4 years ago committed by GitHub
parent 6ad31edf79
commit b36c433738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -216,7 +216,7 @@ package: build/package.BUILT
build/package.BUILT: build strip
mkdir -p dist
command -v dpkg-deb >/dev/null && ./deb_from_installation.sh $(shell pwd)/dist || true
./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)"
./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)"
touch build/package.BUILT

@ -1,5 +1,14 @@
#!/usr/bin/env sh
set -x
command -v dpkg-deb >/dev/null
if [ $? -ne 0 ]; then
echo "required tool dpkg-deb missing. exiting"
exit 0
fi
set -ex
if [ -n "$1" ]; then
OUTDIR=$1
else
@ -12,10 +21,21 @@ else
VERSION=`./version.sh`
fi
if [ -n "$3" ]; then
INSTALL_DIR="$3"
else
INSTALL_DIR=/opt/wasi-sdk
fi
if [ ! -d $INSTALL_DIR ] ; then
echo "Directory $INSTALL_DIR doesn't exist. Nothing to copy from."
exit 1
fi
rm -rf build/pkg
mkdir -p build/pkg/opt
mkdir -p build/pkg/DEBIAN
sed -e s/VERSION/$VERSION/ wasi-sdk.control > build/pkg/DEBIAN/control
cp -R /opt/wasi-sdk build/pkg/opt/
cp -R $INSTALL_DIR build/pkg/opt/
cd build && dpkg-deb -b pkg wasi-sdk_$VERSION\_amd64.deb && cd ..
mv build/wasi-sdk_$VERSION\_amd64.deb $OUTDIR/

Loading…
Cancel
Save