Build a standalone Linux package.

This commit is contained in:
Jussi Pakkanen 2015-03-17 02:52:46 +02:00
parent 78fc8fcc43
commit efbbcd3786
4 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,12 @@
#!/bin/sh
curdir=`pwd`
rm -rf buildtmp
mkdir buildtmp
~/meson/meson.py buildtmp --buildtype=release --prefix=/tmp/myapp --libdir=lib
ninja -C buildtmp install
rm -rf buildtmp
cd /tmp/
tar czf myapp.tar.gz myapp
mv myapp.tar.gz "$curdir"
rm -rf myapp

View File

@ -2,7 +2,7 @@
rm -rf buildtmp
mkdir buildtmp
~/meson/meson.py buildtmp --prefix=/tmp/myapp.app --bindir=Contents/MacOS
~/meson/meson.py buildtmp --buildtype=release --prefix=/tmp/myapp.app --bindir=Contents/MacOS
ninja -C buildtmp install
rm -rf buildtmp
mkdir -p mnttmp

View File

@ -0,0 +1,7 @@
#!/bin/sh
libdir="${MESON_INSTALL_PREFIX}/lib"
mkdir -p $libdir
sdlfile=`ldd ${MESON_INSTALL_PREFIX}/bin/myapp | grep libSDL | cut -d ' ' -f 3`
cp $sdlfile "${libdir}"
strip "${libdir}/libSDL"*

View File

@ -2,6 +2,10 @@ project('myapp', 'c')
sdl = dependency('sdl2')
if meson.get_compiler('c').get_id() != 'msvc'
add_global_arguments('-std=c++11', language : 'cpp')
endif
if host.name() == 'darwin'
install_data('myapp.sh',
install_dir : 'Contents/MacOS')