Skip to content

Commit

Permalink
[osx] - adapt osx packaging - make it similar to what we do on ios an…
Browse files Browse the repository at this point in the history
…d atv2 for consistency reasons
  • Loading branch information
Memphiz committed Mar 21, 2013
1 parent 7c45c17 commit b2ab5da
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 32 deletions.
10 changes: 5 additions & 5 deletions docs/README.osx
Expand Up @@ -216,11 +216,11 @@ distribution.

1. build XBMC.app from XCode so that the application bundle is correctly updated.

2. make -C tools/darwin/packaging/xbmc-osx
2. $ cd tools/darwin/packaging/xbmc-osx

3. If completed successfully, a disk image named XBMC_for_Mac.dmg will be
present in the users XBMC build directory:
3. $ ./mkdmg-xbmc-osx.sh release

Remember to unmount/eject XBMC.dmg before attempting to recreate it,
otherwise dmgmaker.pl will fail.
4. Use release or debug - you have to be sure that you build the corresponding
version before.

6. Find the corresponding dmg in the packaging dir.
18 changes: 0 additions & 18 deletions tools/darwin/packaging/xbmc-osx/Makefile

This file was deleted.

16 changes: 7 additions & 9 deletions tools/darwin/packaging/xbmc-osx/dmgmaker.pl
Expand Up @@ -32,10 +32,8 @@ sub make_dmg {
$ext = "mpkg" if !$ext;

# thanks to http://dev.simon-cozens.org/songbee/browser/release-manager-tools/build-dmg.sh
`rm -fr dist`;
`mkdir dist`;
`hdiutil create -fs HFS+ -volname "$volname" -format UDRW -srcfolder "$mpkg" "dist/$volname.dmg"`;
$dev_handle = `hdiutil attach -readwrite -noverify -noautoopen "dist/$volname.dmg" | grep Apple_HFS`;
`hdiutil create -fs HFS+ -volname "$volname" -format UDRW -srcfolder "$mpkg" "$volname.dmg"`;
$dev_handle = `hdiutil attach -readwrite -noverify -noautoopen "$volname.dmg" | grep Apple_HFS`;
chomp $dev_handle;
$dev_handle = $1 if $dev_handle =~ /^\/dev\/(disk.)/;
die("Could not obtain device handle\n") if !$dev_handle;
Expand Down Expand Up @@ -63,10 +61,10 @@ sub make_dmg {
}
`xcrun SetFile -a C "/Volumes/$volname/"`;
`hdiutil detach $dev_handle`;
`hdiutil convert "dist/$volname.dmg" -format UDZO -imagekey zlib-level=9 -o "dist/$volname.udzo.dmg"`;
`rm -f "dist/$volname.dmg"`;
`mv "dist/$volname.udzo.dmg" "dist/$volname.dmg"`;
`hdiutil internet-enable -yes "dist/$volname.dmg"`;
`hdiutil convert "$volname.dmg" -format UDZO -imagekey zlib-level=9 -o "$volname.udzo.dmg"`;
`rm -f "$volname.dmg"`;
`mv "$volname.udzo.dmg" "$volname.dmg"`;
`hdiutil internet-enable -yes "$volname.dmg"`;
}

if (! defined $ARGV[0]) {
Expand All @@ -80,4 +78,4 @@ sub make_dmg {
exit;
}

make_dmg($ARGV[0], "XBMC", "XBMC");
make_dmg($ARGV[0], $ARGV[1], "XBMC");
41 changes: 41 additions & 0 deletions tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh
@@ -0,0 +1,41 @@
#!/bin/sh

# usage: ./mkdmg-xbmc-osx.sh release/debug (case insensitive)
# Allows us to run mkdmg-xbmc-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/xbmc-osx folder only
SWITCH=`echo $1 | tr [A-Z] [a-z]`
DIRNAME=`dirname $0`

if [ ${SWITCH:-""} = "debug" ]; then
echo "Packaging Debug target for OSX"
XBMC="$DIRNAME/../../../../build/Debug/XBMC.app"
elif [ ${SWITCH:-""} = "release" ]; then
echo "Packaging Release target for OSX"
XBMC="$DIRNAME/../../../../build/Release/XBMC.app"
else
echo "You need to specify the build target"
exit 1
fi

if [ ! -d $XBMC ]; then
echo "XBMC.app not found! are you sure you built $1 target?"
exit 1
fi
ARCHITECTURE=`file $XBMC/Contents/MacOS/XBMC | awk '{print $NF}'`

PACKAGE=org.xbmc.xbmc-osx

VERSION=13.0
REVISION=0~alpha2
ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_macosx-intel-${ARCHITECTURE}

echo Creating $PACKAGE package version $VERSION revision $REVISION
${SUDO} rm -rf $DIRNAME/$ARCHIVE

if [ -e "/Volumes/XBMC" ]
then
umount /Volumes/XBMC
fi

$DIRNAME/dmgmaker.pl $XBMC $ARCHIVE

echo "done"

0 comments on commit b2ab5da

Please sign in to comment.