mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Add quick script to automate Mac dmg creation
This basically automates what is documented in the README Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									b1dbdf6322
								
							
						
					
					
						commit
						79d204dde8
					
				
					 2 changed files with 35 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,9 @@
 | 
			
		|||
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
 | 
			
		||||
 | 
			
		||||
  $ gtk-mac-bundler subsurface.bundle
 | 
			
		||||
| 
						 | 
				
			
			@ -19,6 +22,7 @@ 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:
 | 
			
		||||
 | 
			
		||||
cd packaging/macosx/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 ; \
 | 
			
		||||
| 
						 | 
				
			
			@ -26,12 +30,12 @@ done
 | 
			
		|||
 | 
			
		||||
Finally, you need to change the IDs of the libraries:
 | 
			
		||||
 | 
			
		||||
cd packagin/macosx/staging/Subsurface.app/Contents
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
 hdiutil create -volname Subsurface -srcfolder staging Subsurface-<version>.dmg
 | 
			
		||||
cd ../../..
 | 
			
		||||
hdiutil create -volname Subsurface -srcfolder staging Subsurface-<version>.dmg
 | 
			
		||||
 | 
			
		||||
Caveats
 | 
			
		||||
-------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										29
									
								
								packaging/macosx/make-package.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										29
									
								
								packaging/macosx/make-package.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
#!/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
 | 
			
		||||
 | 
			
		||||
VERSION=`grep -1 CFBundleVersionString Info.plist | tail -1 | cut -d\> -f 2 | cut -d\< -f 1`
 | 
			
		||||
BUNDLER="../../../.local/bin/gtk-mac-bundler"
 | 
			
		||||
 | 
			
		||||
${BUNDLER} subsurface.bundle
 | 
			
		||||
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 ;
 | 
			
		||||
done
 | 
			
		||||
for i in Resources/lib/*.dylib;
 | 
			
		||||
do
 | 
			
		||||
	install_name_tool -id "@executable_path/../$i" $i
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
cd ../../..
 | 
			
		||||
if [ -f Subsurface-${VERSION}.dmg ]; then
 | 
			
		||||
	mv Subsurface-${VERSION}.dmg Subsurface-${VERSION}.dmg.bak
 | 
			
		||||
fi
 | 
			
		||||
hdiutil create -volname Subsurface -srcfolder staging Subsurface-${VERSION}.dmg
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue