build system fixups

pull/2/head
Pat Hickey 6 years ago
parent cdf0981d3f
commit 2a3fadc96f

@ -0,0 +1,9 @@
FROM ubuntu:xenial as build-env
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
clang \
cmake \
python \
&& rm -rf /var/lib/apt/lists/*

@ -5,11 +5,11 @@ ROOT_DIR=${CURDIR}
PREFIX?=/opt/wasi-sdk
CLANG_VERSION=8.0.0
VERSION=0.2
DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasmception://v$(VERSION)
VERSION=$(shell version.sh)
DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)
default: build
echo "Use -fdebug-prefix-map=$(ROOT_DIR)=wasmception://v$(VERSION)"
echo "Use -fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)"
clean:
rm -rf build $(PREFIX)
@ -125,8 +125,8 @@ strip: build/llvm.BUILT
package: build/package.BUILT
build/package.BUILT: build
./package.sh
build/package.BUILT: build strip
./deb_from_installation.sh
touch build/package.BUILT
.PHONY: default clean build strip package

@ -0,0 +1,15 @@
#!/usr/bin/env sh
if [ -n "$1" ]; then
export VERSION="$1"
else
export VERSION=`./version.sh`
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/
dpkg-deb -b build/pkg build/wasi-sdk_$VERSION\_amd64.deb
rm -rf build/pkg

@ -0,0 +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

@ -1,15 +0,0 @@
#!/usr/bin/env sh
if [ -n "$1" ]; then
export VERSION="$1"
else
export VERSION=`./version.sh`
fi
rm -rf pkg
mkdir -p pkg/opt
mkdir pkg/DEBIAN
sed -e s/VERSION/$VERSION/ wasi-sdk.control > pkg/DEBIAN/control
cp -R /opt/wasi-sdk pkg/opt/
dpkg-deb -b pkg wasi-sdk_$VERSION\_amd64.deb
rm -rf pkg

@ -1 +1 @@
Subproject commit 8f7cfecfbfe73198f5419f13f0150d7102df97ef
Subproject commit d39b590a4123aadff60a1b5c808fae6ab7cea362

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
GIT_DESCR=$(git describe --long --candidates=999 --match='wasi-sdk-*' --dirty='+m' --abbrev=12)
GIT_PACKAGE_VERSION=$(echo $GIT_DESCR | perl -ne 'if(/^wasi-sdk-(\d+)-(\d+)-g([0-9a-f]{7,12})([+]m)?$/) { print "$1.$2g$3$4"; exit } else { print "could not parse git description"; exit 1 }';)
GIT_PACKAGE_VERSION=$(echo $GIT_DESCR | perl -ne 'if(/^wasi-sdk-(\d+)-(\d+)-g([0-9a-f]{7,12})([+]m)?$/) { if($2 == 0) { print "$1.$2$4" } else { print "$1.$2g$3$4" } exit } else { print "could not parse git description"; exit 1 }';)
echo $GIT_PACKAGE_VERSION

Loading…
Cancel
Save