add darling-dmg packaging method (#33)

This commit is contained in:
Thomas Pöchtrager 2015-05-30 21:01:48 +02:00
parent 25051c6ab6
commit bae6ac72cd
7 changed files with 94 additions and 31 deletions

View File

@ -4,6 +4,7 @@ changed:
* improved and colorized wrapper error/warning/debug/info messages * improved and colorized wrapper error/warning/debug/info messages
added: added:
* darling-dmg sdk packaging script
* include path warnings for /usr/include and /usr/local/include * include path warnings for /usr/include and /usr/local/include
(can be switched off via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1') (can be switched off via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1')
* an option to silence osxcross extension warnings * an option to silence osxcross extension warnings

View File

@ -71,10 +71,6 @@ You can turn this behavior off with `OSXCROSS_GCC_NO_STATIC_RUNTIME=1` (env).
### PACKAGING THE SDK: ### ### PACKAGING THE SDK: ###
If you need a recent SDK, then you must do the SDK packaging on OS X.
Recent Xcode images are compressed, but the Linux kernel does not
support HFS+ compression.
##### Packaging the SDK on Mac OS X: ##### ##### Packaging the SDK on Mac OS X: #####
1. [Download [Xcode](https://developer.apple.com/downloads/index.action?name=Xcode%205.1.1) \*\*] 1. [Download [Xcode](https://developer.apple.com/downloads/index.action?name=Xcode%205.1.1) \*\*]
@ -101,19 +97,12 @@ Step 1. and 2. can be skipped if you have Xcode installed.
\*\* SHA1 Sum: 1a06882638996dfbff65ea6b4c6625842903ead3. \*\* SHA1 Sum: 1a06882638996dfbff65ea6b4c6625842903ead3.
##### Packing the SDK on Linux, Method 2 (*UNSUPPORTED* - but works with Xcode >= 4.3): ##### ##### Packing the SDK on Linux, Method 2 (works with Xcode >= 4.3): #####
1. Download Xcode like described in 'Packaging the SDK on Mac OS X' 1. Download Xcode like described in 'Packaging the SDK on Mac OS X'
2. Download and build [HFSExplorer](http://www.catacombae.org/hfsexplorer/) 2. Install `cmake`, `libxml2-dev` and `fuse`
(you will need `openjdk` and `ant`) 3. run `./gen_sdk_package_darling_dmg.sh <xcode>.dmg`
3. Open the HFSExplorer GUI (do *NOT* use the command line utility) 4. Copy or move the SDK into the tarballs/ directory
4. Open the Xcode image
5. Right click on the Xcode (not Xcode.app) folder and choose 'extract data'
6. Answer the 'Follow Symlinks' dialog with 'No'
7. Click on '>>' and choose 'Quiet mode'
8. Click away all the annoying Java errors
9. Run: `XCODEDIR=/path/to/extracted-xcode/Xcode ./tools/gen_sdk_package.sh`
10. Copy or move the SDK into the tarballs/ directory
### USAGE EXAMPLES: ### ### USAGE EXAMPLES: ###

View File

@ -76,15 +76,8 @@ if [ -z "$OSX_VERSION_MIN" ]; then
fi fi
fi fi
# Don't change this
OSXCROSS_VERSION=0.10 OSXCROSS_VERSION=0.10
TARBALL_DIR=$BASE_DIR/tarballs
BUILD_DIR=$BASE_DIR/build
TARGET_DIR=$BASE_DIR/target
PATCH_DIR=$BASE_DIR/patches
SDK_DIR=$TARGET_DIR/SDK
if [ -z "$OSX_VERSION_MIN" ]; then if [ -z "$OSX_VERSION_MIN" ]; then
OSX_VERSION_MIN="default" OSX_VERSION_MIN="default"
fi fi

View File

@ -7,9 +7,6 @@ USESYSTEMCOMPILER=1
source tools/tools.sh source tools/tools.sh
TARBALL_DIR=$BASE_DIR/tarballs
BUILD_DIR=$BASE_DIR/build
mkdir -p $BUILD_DIR mkdir -p $BUILD_DIR
if [ -z "$SKIP_GCC_CHECK" ]; then if [ -z "$SKIP_GCC_CHECK" ]; then

View File

@ -9,6 +9,10 @@ if [ $(uname -s) != "Darwin" ]; then
echo "... Or with XCODEDIR=... on Linux" echo "... Or with XCODEDIR=... on Linux"
exit 1 exit 1
else else
case $XCODEDIR in
/*) ;;
*) XCODEDIR="$PWD/$XCODEDIR" ;;
esac
XCODEDIR+="/$(ls "$XCODEDIR" | grep "^Xcode.*" | head -n1)" XCODEDIR+="/$(ls "$XCODEDIR" | grep "^Xcode.*" | head -n1)"
fi fi
else else
@ -27,7 +31,7 @@ else
fi fi
if [ ! -d $XCODEDIR ]; then if [ ! -d $XCODEDIR ]; then
echo "cannot find Xcode (XCODEDIR=$XCODEDIR)" echo "cannot find Xcode (XCODEDIR=$XCODEDIR)" 1>&2
exit 1 exit 1
fi fi
@ -62,10 +66,12 @@ if [ -d "Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" ]; then
else else
if [ -d "../Packages" ]; then if [ -d "../Packages" ]; then
pushd "../Packages" &>/dev/null pushd "../Packages" &>/dev/null
elif [ -d "Packages" ]; then
pushd "Packages" &>/dev/null
else else
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Xcode (or this script) is out of date" echo "Xcode (or this script) is out of date" 1>&2
echo "trying some magic to find the SDKs anyway ..." echo "trying some magic to find the SDKs anyway ..." 1>&2
SDKDIR=$(find . -name SDKs -type d | grep MacOSX | head -n1) SDKDIR=$(find . -name SDKs -type d | grep MacOSX | head -n1)
@ -82,7 +88,7 @@ fi
SDKS=$(ls | grep "^MacOSX10.*" | grep -v "Patch") SDKS=$(ls | grep "^MacOSX10.*" | grep -v "Patch")
if [ -z "$SDKS" ]; then if [ -z "$SDKS" ]; then
echo "No SDK found" echo "No SDK found" 1>&2
exit 1 exit 1
fi fi

View File

@ -0,0 +1,69 @@
#!/usr/bin/env bash
pushd "${0%/*}/.." &>/dev/null
source tools/tools.sh
if [ $PLATFORM == "Darwin" ]; then
echo "Use gen_sdk_package.sh on Mac OS X" 1>&2
exit 1
fi
if [ $# -eq 0 ]; then
echo "Usage: $0 <xcode.dmg>" 1>&2
exit 1
fi
mkdir -p $BUILD_DIR
require git
require cmake
require modinfo
require fusermount
set +e
modinfo fuse &>/dev/null
if [ $? -ne 0 ]; then
echo "required kernel module 'fuse' not loaded" 1>&2
echo "please run 'insmod fuse' as root" 1>&2
exit 1
fi
set -e
pushd $BUILD_DIR &>/dev/null
if [ ! -f $TARGET_DIR/bin/darling-dmg ]; then
rm -f have_darling_dmg
fi
if [ ! -f "have_darling_dmg" ]; then
rm -rf darling-dmg*
git clone https://github.com/LubosD/darling-dmg.git
pushd darling-dmg &>/dev/null
mkdir -p build
pushd build &>/dev/null
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$TARGET_DIR
make -j $JOBS install
popd &>/dev/null
popd &>/dev/null
touch "have_darling_dmg"
fi
popd &>/dev/null # build dir
TMP=$(mktemp -d /tmp/XXXXXXXXX)
function cleanup() {
fusermount -u $TMP || true
rm -rf $TMP
}
trap cleanup EXIT
$TARGET_DIR/bin/darling-dmg $1 $TMP
XCODEDIR=$TMP ./tools/gen_sdk_package.sh

View File

@ -1,8 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
export LC_ALL="C"
BASE_DIR=$PWD BASE_DIR=$PWD
export LC_ALL="C" TARBALL_DIR=$BASE_DIR/tarballs
BUILD_DIR=$BASE_DIR/build
TARGET_DIR=$BASE_DIR/target
PATCH_DIR=$BASE_DIR/patches
SDK_DIR=$TARGET_DIR/SDK
if [ -z "$USESYSTEMCOMPILER" ]; then if [ -z "$USESYSTEMCOMPILER" ]; then
export CC=clang export CC=clang
@ -23,7 +29,9 @@ if [[ $SCRIPT != *wrapper/build.sh ]]; then
JOBS=${JOBS:=`tools/get_cpu_count.sh`} JOBS=${JOBS:=`tools/get_cpu_count.sh`}
if [ $SCRIPT != "build.sh" -a $SCRIPT != "build_clang.sh" -a \ if [ $SCRIPT != "build.sh" -a $SCRIPT != "build_clang.sh" -a \
$SCRIPT != "mount_xcode_image.sh" ]; then $SCRIPT != "mount_xcode_image.sh" -a \
$SCRIPT != "gen_sdk_package_darling_dmg.sh" -a \
$SCRIPT != "gen_sdk_package_p7zip.sh" ]; then
`tools/osxcross_conf.sh` `tools/osxcross_conf.sh`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then