Skip to content

Commit

Permalink
Build script / Travis CI packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Nov 17, 2019
1 parent fb3e0ef commit fa81f51
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
*~
/build
/linux_build
/wavbreaker-*linux
/wavbreaker-*linux.zip
/macos_build
/Applications
/wavbreaker-*macos.zip
/win32_build
/wavbreaker-win32
/wavbreaker-*win32
/wavbreaker-*win32.zip
po/POTFILES
po/*.gmo
po/stamp-po
Expand Down
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ matrix:
- os: linux
dist: bionic
language: c
env: BUILD_TYPE=windows CONFIGURE_SCRIPT="docker build -t wavbreaker-win32-build scripts/win32" BUILD_SCRIPT="sh scripts/win32/run-build.sh"
env: BUILD_TYPE=windows
- os: osx
osx_image: xcode11.2
sudo: required
Expand Down Expand Up @@ -36,5 +36,4 @@ addons:
- gettext

script:
- ${CONFIGURE_SCRIPT:-meson build}
- ${BUILD_SCRIPT:-ninja -C build -v}
- scripts/build.sh $BUILD_TYPE
44 changes: 44 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

DOCFILES="AUTHORS CONTRIBUTORS COPYING README.md"

VERSION=$(sed -n "s/^ version : '\(.*\)',/\1/p" meson.build)

USAGE="Usage: $0 <linux|windows|macos>"

if [ $# -eq 0 ]; then
echo "$USAGE"
exit 1
fi

set -e -x

case "$1" in
linux)
meson linux_build
DESTDIR="$(pwd)/wavbreaker-$VERSION-linux/" ninja -C linux_build install -v
mkdir -p dist
zip -r "dist/wavbreaker-$VERSION-linux.zip" "wavbreaker-$VERSION-linux" $DOCFILES
;;
windows)
docker build -t wavbreaker-win32-build scripts/win32
sh scripts/win32/run-build.sh
rm -rf "wavbreaker-$VERSION-win32"
mv wavbreaker-win32 "wavbreaker-$VERSION-win32"
mkdir -p dist
zip -r "dist/wavbreaker-$VERSION-win32.zip" "wavbreaker-$VERSION-win32" $DOCFILES
;;
macos)
meson --prefix=/Applications/wavbreaker.app \
--bindir=Contents/MacOS \
-Dmacos_app=true \
macos_build
DESTDIR=$(pwd)/ ninja -C macos_build install -v
mkdir -p dist
zip -r "dist/wavbreaker-$VERSION-macos.zip" Applications $DOCFILES
;;
*)
echo "$USAGE"
exit 1
;;
esac

0 comments on commit fa81f51

Please sign in to comment.