summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
Diffstat (limited to 'packaging')
-rw-r--r--packaging/macosx/README45
-rwxr-xr-xpackaging/macosx/make-package.sh51
-rw-r--r--packaging/macosx/subsurface.bundle11
3 files changed, 86 insertions, 21 deletions
diff --git a/packaging/macosx/README b/packaging/macosx/README
index 47d49661c..b996413c5 100644
--- a/packaging/macosx/README
+++ b/packaging/macosx/README
@@ -4,23 +4,27 @@ Creating a Subsurface bundle
(we now have a small shell script that should automate this process;
look for make-package.sh)
-install gtk-mac-bundler (this has been tested with version 0.7.0) and run
+After you build Subsurface and install it on your Mac
+
+make install-macosx
+
+you need gtk-mac-bundler (this has been tested with version 0.7.3); run
$ gtk-mac-bundler subsurface.bundle
-This should install a self-contained Subsurface application under
+This should install an almost self-contained Subsurface application under
./staging/Subsurface.app
Sadly because of the way gettext accesses the gtk20.mo file, this fails
-for localized use - in that case you need to rebuild MacPorts with
+for localized use - so I ended up building MacPorts with
-prefix /Applications/Subsurface.app/Contents/Resources
And then things work correctly IFF the app gets installed with that path.
What a pain.
-Worse, gtk-mac-bundler misses fails to catch the .so files that
-are part of the gdk-pixbuf loader infrastructure. So we need to
-manually adjust the load paths in them:
+Worse, gtk-mac-bundler fails to catch the .so files that are part of the
+gdk-pixbuf loader infrastructure. So we need to manually adjust the load
+paths in them:
cd packaging/macosx/staging/Subsurface.app/Contents
for i in Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/* ; do \
@@ -32,10 +36,23 @@ Finally, you need to change the IDs of the libraries:
for i in Resources/lib/*.dylib; do install_name_tool -id "@executable_path/../$i" $i; done
-You still need to manually build a DMG if you want to easily distribute this.
+Next you should sign your binaries if you plan to use them 10.8 (or later).
+
+Then you can use git://github.com/dirkhh/yoursway-create-dmg.git to create
+a DMG (use the readlink-fix branch - unless this has been pulled into the
+main project by the time you read this).
+
+Here is roughly how I run this to create the official DMG
-cd ../../..
-hdiutil create -volname Subsurface -srcfolder staging Subsurface-<version>.dmg
+~/yoursway-create-dmg/create-dmg --background ./Subsurface-Background.png \
+ --window-size 500 300 --icon-size 96 \
+ --volname "Subsurface-${VERSION}" --app-drop-link 380 205 \
+ --volicon ~/subsurface/packaging/macosx/Subsurface.icns \
+ --icon "Subsurface" 110 205 ./Subsurface-${VERSION}.dmg ./staging
+
+The --volicon doesn't appear to work for me even though it does create the
+correct file in the DMG. I'm leaving it in here to remind me to
+investigate this issue.
Caveats
-------
@@ -44,7 +61,9 @@ Caveats
$ sudo port install pango +builtin_modules +no_x11 +quartz
-Without the builtin modules the installed application fails to find the modules and doesn't render any text.
+Without the builtin modules the installed application fails to find the
+modules and doesn't render any text.
+
Also note the comment above about the -prefix
* It seems that gtk-mac-bundler expects the charset.alias file to be
@@ -53,6 +72,6 @@ Also note the comment above about the -prefix
$ sudo cp /usr/lib/charset.alias /opt/local/lib
-* libdivecomputer needs to be configured with --with-prefix=/opt/local
- (or /Applications/Subsurface.app/Contents/Resources for localized builds)
-
+* libdivecomputer needs to be configured with
+ --with-prefix=/Applications/Subsurface.app/Contents/Resources
+ as well.
diff --git a/packaging/macosx/make-package.sh b/packaging/macosx/make-package.sh
index 328e73454..81e0f80f8 100755
--- a/packaging/macosx/make-package.sh
+++ b/packaging/macosx/make-package.sh
@@ -1,20 +1,45 @@
#!/bin/bash
#
# this simply automates the steps to create a DMG we can ship
+#
# for this to work you need to have a custom build of MacPorts / gtk / etc
# with prefix=/Applications/Subsurface.app/Contents/Resources
# yes, that's a major hack, but otherwise gettext cannot seem to find
# the gtk related .mo files and localization is only partial
#
-# run this from the packaging/macosx directory
+# run this from the top subsurface directory
+
+# adjust to your install location of gtk-mac-bundler. I appear to need at
+# least 0.7.2
+BUNDLER="../.local/bin/gtk-mac-bundler"
+BUNDLER_SRC="${HOME}/gtk-mac-bundler"
+
+# install location of yourway-create-dmg
+DMGCREATE="../yoursway-create-dmg/create-dmg"
+
+# This is the directory into which MacPorts, libdivecomputer and all the
+# other components have been installed
+PREFIX="/Applications/Subsurface.app/Contents/Resources"
+
+# maybe we want to update this to use the git tag magic instead. That
+# would be more consistent
+VERSION=`grep -1 CFBundleVersionString packaging/macosx/Info.plist | tail -1 | cut -d\> -f 2 | cut -d\< -f 1`
-VERSION=`grep -1 CFBundleVersionString Info.plist | tail -1 | cut -d\> -f 2 | cut -d\< -f 1`
-BUNDLER="../../../.local/bin/gtk-mac-bundler"
+# gtk-mac-bundler allegedly supports signing by setting this environment
+# variable, but this fails as we change the shared objects below and all
+# the signatures become invalid.
+# export APPLICATION_CERT="Dirk"
-${BUNDLER} subsurface.bundle
+# first clean up the staging area
+rm -rf ./staging
+
+# now populate it with the bundle
+${BUNDLER} packaging/macosx/subsurface.bundle
+
+# correct the paths and names
cd staging/Subsurface.app/Contents
for i in Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/* ; do
- ~/gtk-mac-bundler/bundler/run-install-name-tool-change.sh $i /Applications/Subsurface.app/Contents/Resources Resources change ;
+ ${BUNDLER_SRC}/bundler/run-install-name-tool-change.sh $i ${PREFIX} Resources change ;
done
for i in Resources/lib/*.dylib;
do
@@ -22,8 +47,18 @@ do
done
cd ../../..
-if [ -f Subsurface-${VERSION}.dmg ]; then
- mv Subsurface-${VERSION}.dmg Subsurface-${VERSION}.dmg.bak
+
+codesign -s Dirk ./staging/Subsurface.app/Contents/MacOS/subsurface \
+ ./staging/Subsurface.app/Contents/MacOS/subsurface-bin
+
+if [ -f ./Subsurface-${VERSION}.dmg ]; then
+ rm ./Subsurface-${VERSION}.dmg.bak
+ mv ./Subsurface-${VERSION}.dmg ./Subsurface-${VERSION}.dmg.bak
fi
-hdiutil create -volname Subsurface -srcfolder staging Subsurface-${VERSION}.dmg
+
+${DMGCREATE} --background ./packaging/macosx/DMG-Background.png \
+ --window-size 500 300 --icon-size 96 --volname Subsurface-${VERSION} \
+ --app-drop-link 380 205 \
+ --volicon ~/subsurface/packaging/macosx/Subsurface.icns \
+ --icon "Subsurface" 110 205 ./Subsurface-${VERSION}.dmg ./staging
diff --git a/packaging/macosx/subsurface.bundle b/packaging/macosx/subsurface.bundle
index 7cbeb9ee0..6f767b508 100644
--- a/packaging/macosx/subsurface.bundle
+++ b/packaging/macosx/subsurface.bundle
@@ -110,6 +110,17 @@
${prefix}/share/themes
</data>
+ <!-- Copy the mime.cache -->
+ <data>
+ ${prefix}/share/mime/mime.cache
+ </data>
+
+ <!-- Copy the jpeg library that is missed by the dependency generation
+ -->
+ <data>
+ ${prefix}/lib/libjpeg.9.dylib
+ </data>
+
<!-- Copy icons. Note that the .icns file is an Apple format which
contains up to 4 sizes of icon. You can use
/Developer/Applications/Utilities/Icon Composer.app to import