parent
f9f51b1ac7
commit
b4b2e8d533
9 changed files with 107 additions and 0 deletions
@ -0,0 +1,26 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CFBundleGetInfoString</key> |
||||
<string>MyApp</string> |
||||
<key>CFBundleExecutable</key> |
||||
<string>myapp.sh</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>com.example.me</string> |
||||
<key>CFBundleName</key> |
||||
<string>myapp</string> |
||||
<key>CFBundleIconFile</key> |
||||
<string>myapp.icns</string> |
||||
<key>CFBundleShortVersionString</key> |
||||
<string>1.0</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>APPL</string> |
||||
<key>IFMajorVersion</key> |
||||
<integer>0</integer> |
||||
<key>IFMinorVersion</key> |
||||
<integer>1</integer> |
||||
</dict> |
||||
</plist> |
@ -0,0 +1,21 @@ |
||||
#!/bin/sh |
||||
|
||||
rm -rf buildtmp |
||||
mkdir buildtmp |
||||
~/meson/meson.py buildtmp --prefix=/tmp/myapp.app --bindir=Contents/MacOS |
||||
ninja -C buildtmp install |
||||
rm -rf buildtmp |
||||
mkdir -p mnttmp |
||||
rm -f working.dmg |
||||
gunzip < template.dmg.gz > working.dmg |
||||
hdiutil attach working.dmg -noautoopen -quiet -mountpoint mnttmp |
||||
# NOTE: output of hdiutil changes every now and then. |
||||
# Verify that this is still working. |
||||
DEV=`hdiutil info|tail -1|awk '{print $1}'` |
||||
rm -rf mnttmp/myapp.app |
||||
mv /tmp/myapp.app mnttmp |
||||
hdiutil detach ${DEV} |
||||
rm -rf mnttmp |
||||
rm -f myapp.dmg |
||||
hdiutil convert working.dmg -quiet -format UDZO -imagekey zlib-level=9 -o myapp.dmg |
||||
rm -f working.dmg |
@ -0,0 +1,6 @@ |
||||
#!/bin/sh |
||||
|
||||
mkdir -p ${MESON_INSTALL_PREFIX}/Contents/Frameworks |
||||
cp -r /Library/Frameworks/SDL2.framework ${MESON_INSTALL_PREFIX}/Contents/Frameworks |
||||
|
||||
install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2 ${MESON_INSTALL_PREFIX}/Contents/MacOS/myapp |
@ -0,0 +1,18 @@ |
||||
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') |
@ -0,0 +1,31 @@ |
||||
#include<SDL.h> |
||||
|
||||
int main(int argc, char **argv) { |
||||
SDL_Window *window; |
||||
SDL_Surface *screenSurface; |
||||
SDL_Event e; |
||||
int keepGoing = 1; |
||||
if(SDL_Init( SDL_INIT_VIDEO ) < 0) { |
||||
printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() ); |
||||
} |
||||
|
||||
window = SDL_CreateWindow( "My application", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN ); |
||||
|
||||
screenSurface = SDL_GetWindowSurface( window ); |
||||
|
||||
while(keepGoing) { |
||||
while(SDL_PollEvent(&e) != 0) { |
||||
if(e.type == SDL_QUIT) { |
||||
keepGoing = 0; |
||||
break; |
||||
} |
||||
} |
||||
SDL_FillRect( screenSurface, NULL, SDL_MapRGB( screenSurface->format, 0xFF, 0x00, 0x00 ) );
|
||||
SDL_UpdateWindowSurface( window ); |
||||
SDL_Delay(100); |
||||
} |
||||
|
||||
SDL_DestroyWindow(window); |
||||
SDL_Quit(); |
||||
return 0; |
||||
} |
Binary file not shown.
@ -0,0 +1,4 @@ |
||||
#!/bin/bash |
||||
|
||||
cd "${0%/*}" |
||||
./myapp |
Binary file not shown.
Loading…
Reference in new issue