mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Merge branch 'macosx-app-bundle-1' of git://github.com/henrik242/subsurface
* 'macosx-app-bundle-1' of git://github.com/henrik242/subsurface: Use the new packaging directory for MacOSX specific files, and provide shell script workaround to make the svg icon reachable. Ignore process serial number argument when run as native MacOSX app Add basic MacOSX app bundle install target
This commit is contained in:
commit
5076397df0
6 changed files with 45 additions and 0 deletions
13
Makefile
13
Makefile
|
@ -22,6 +22,9 @@ ICONFILE = $(NAME).svg
|
|||
DESKTOPFILE = $(NAME).desktop
|
||||
MANFILES = $(NAME).1
|
||||
|
||||
MACOSXINSTALL = /Applications/Subsurface.app
|
||||
MACOSXFILES = packaging/macosx
|
||||
|
||||
# find libdivecomputer
|
||||
# First deal with the cross compile environment.
|
||||
# For the native case, Linus doesn't want to trust pkg-config given
|
||||
|
@ -102,6 +105,16 @@ GLIB2CFLAGS = $(shell $(PKGCONFIG) --cflags glib-2.0)
|
|||
GCONF2CFLAGS = $(shell $(PKGCONFIG) --cflags gconf-2.0)
|
||||
GTK2CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-2.0)
|
||||
|
||||
install-macosx: $(NAME)
|
||||
$(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/Resources
|
||||
$(INSTALL) -d -m 755 $(MACOSXINSTALL)/Contents/MacOS
|
||||
$(INSTALL) $(NAME) $(MACOSXINSTALL)/Contents/MacOS/
|
||||
$(INSTALL) $(MACOSXFILES)/subsurface.sh $(MACOSXINSTALL)/Contents/MacOS/
|
||||
$(INSTALL) $(MACOSXFILES)/PkgInfo $(MACOSXINSTALL)/Contents/
|
||||
$(INSTALL) $(MACOSXFILES)/Info.plist $(MACOSXINSTALL)/Contents/
|
||||
$(INSTALL) $(ICONFILE) $(MACOSXINSTALL)/Contents/Resources/
|
||||
$(INSTALL) $(MACOSXFILES)/Subsurface.icns $(MACOSXINSTALL)/Contents/Resources/
|
||||
|
||||
parse-xml.o: parse-xml.c dive.h
|
||||
$(CC) $(CFLAGS) $(GLIB2CFLAGS) -c $(XML2CFLAGS) parse-xml.c
|
||||
|
||||
|
|
6
main.c
6
main.c
|
@ -167,6 +167,12 @@ static void parse_argument(const char *arg)
|
|||
return;
|
||||
}
|
||||
/* fallthrough */
|
||||
case 'p':
|
||||
/* ignore process serial number argument when run as native macosx app */
|
||||
if (strncmp(arg, "-psn_", 5) == 0) {
|
||||
return;
|
||||
}
|
||||
/* fallthrough */
|
||||
default:
|
||||
fprintf(stderr, "Bad argument '%s'\n", arg);
|
||||
exit(1);
|
||||
|
|
20
packaging/macosx/Info.plist
Normal file
20
packaging/macosx/Info.plist
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Subsurface</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Subsurface</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Rough divelog in C and Gtk</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>subsurface.sh</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>torvalds.subsurface</string>
|
||||
</dict>
|
||||
</plist>
|
1
packaging/macosx/PkgInfo
Normal file
1
packaging/macosx/PkgInfo
Normal file
|
@ -0,0 +1 @@
|
|||
APPL????
|
BIN
packaging/macosx/Subsurface.icns
Normal file
BIN
packaging/macosx/Subsurface.icns
Normal file
Binary file not shown.
5
packaging/macosx/subsurface.sh
Executable file
5
packaging/macosx/subsurface.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd `dirname $0`/../Resources
|
||||
../MacOS/subsurface &
|
||||
exit 0
|
Loading…
Reference in a new issue