Reworked OSX bundle test to allow adding Linux in the future.

This commit is contained in:
Jussi Pakkanen 2015-03-17 02:13:30 +02:00
parent fa2c659825
commit 78fc8fcc43
11 changed files with 48 additions and 22 deletions

View File

@ -1,18 +0,0 @@
project('myapp', 'c')
sdl = dependency('sdl2')
prog = executable('myapp', 'myapp.c',
dependencies : sdl,
install : true)
install_data('myapp.sh',
install_dir : 'Contents/MacOS')
install_data('myapp.icns',
install_dir : 'Contents/Resources')
install_data('Info.plist',
install_dir : 'Contents')
meson.set_install_script('install_script.sh')

View File

@ -1,4 +0,0 @@
#!/bin/bash
cd "${0%/*}"
./myapp

View File

@ -0,0 +1,26 @@
project('myapp', 'c')
sdl = dependency('sdl2')
if host.name() == 'darwin'
install_data('myapp.sh',
install_dir : 'Contents/MacOS')
install_data('myapp.icns',
install_dir : 'Contents/Resources')
install_data('Info.plist',
install_dir : 'Contents')
meson.set_install_script('osx_bundler.sh')
endif
if host.name() == 'linux'
install_data('myapp.sh', install_dir : '.')
meson.set_install_script('linux_bundler.sh')
endif
prog = executable('myapp', 'myapp.c',
dependencies : sdl,
install : true)

View File

@ -0,0 +1,10 @@
#!/bin/bash
cd "${0%/*}"
if [ `uname` == 'Darwin' ]; then
./myapp
else
export LD_LIBRARY_PATH="`pwd`/lib"
bin/myapp
fi

View File

@ -0,0 +1,12 @@
This directory shows how you can build redistributable binaries. On
OSX this menans building an app bundle and a .dmg installer. On Linux
it means building a binary that bundles its dependencies. On Windows
it means probably building an .exe installer or something (not done
yet).
To build each package you run the corresponding build_ARCH.sh build script.
On Linux you must build the package on the oldest distribution you
plan to support (Debian stable/oldstable and old CentOS are usually
the choice here).