produce deb and tars

this should hopefully work on the mac, ill have to get someone to test
it
pull/2/head wasi-sdk-1
Pat Hickey 6 years ago
parent 2a3fadc96f
commit cea537aef1

1
.gitignore vendored

@ -0,0 +1 @@
build

@ -6,4 +6,5 @@ RUN apt-get update \
clang \
cmake \
python \
git \
&& rm -rf /var/lib/apt/lists/*

@ -5,7 +5,7 @@ ROOT_DIR=${CURDIR}
PREFIX?=/opt/wasi-sdk
CLANG_VERSION=8.0.0
VERSION=$(shell version.sh)
VERSION:=$(shell ./version.sh)
DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)
default: build
@ -49,7 +49,7 @@ build/compiler-rt.BUILT: build/llvm.BUILT
mkdir -p build/compiler-rt
cd build/compiler-rt; cmake -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_TOOLCHAIN_FILE=$(ROOT_DIR)/wasmi-sdk.cmake \
-DCMAKE_TOOLCHAIN_FILE=$(ROOT_DIR)/wasi-sdk.cmake \
-DCOMPILER_RT_BAREMETAL_BUILD=On \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
@ -126,7 +126,8 @@ strip: build/llvm.BUILT
package: build/package.BUILT
build/package.BUILT: build strip
./deb_from_installation.sh
command -v dpkg-deb >/dev/null && ./deb_from_installation.sh || true
./tar_from_installation.sh
touch build/package.BUILT
.PHONY: default clean build strip package

@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
if [ -n "$1" ]; then
export VERSION="$1"
else
@ -11,5 +11,4 @@ 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/
dpkg-deb -b build/pkg build/wasi-sdk_$VERSION\_amd64.deb
rm -rf build/pkg
cd build && dpkg-deb -b pkg wasi-sdk_$VERSION\_amd64.deb

@ -1,4 +1,4 @@
#!/usr/bin/env sh
set -e
docker build -t wasi-sdk-builder:latest .
docker run --mount type=bind,src=$PWD,target=/wasi-sdk wasi-sdk-builder:latest -w /wasi-sdk make package
docker run --mount type=bind,src=$PWD,target=/workspace --workdir /workspace wasi-sdk-builder:latest make package

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -ex
if [ -n "$1" ]; then
export VERSION="$1"
else
export VERSION=`./version.sh`
fi
PKGDIR=build/wasi-sdk-$VERSION
case "$(uname -s)" in
Linux*) MACHINE=linux;;
Darwin*) MACHINE=macos;;
CYGWIN*) MACHINE=cygwin;;
MINGW*) MACHINE=mingw;;
*) MACHINE="UNKNOWN"
esac
rm -rf $PKGDIR
mkdir -p $PKGDIR/opt
cp -R /opt/wasi-sdk $PKGDIR/opt/
cd build && tar czf wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION
Loading…
Cancel
Save