gen_sdk_package_*.sh: Accept relative Xcode paths (closes #189)

This commit is contained in:
Thomas Pöchtrager 2019-08-16 10:09:22 +02:00
parent 16efae8992
commit 37894c5839
4 changed files with 30 additions and 7 deletions

View File

@ -22,6 +22,8 @@ if [ $# -eq 0 ]; then
exit 1
fi
XCODEDMG=$(make_absolute_path $1 $(get_exec_dir))
mkdir -p $BUILD_DIR
require modinfo
@ -75,6 +77,6 @@ function cleanup()
trap cleanup EXIT
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TARGET_DIR_SDK_TOOLS/lib \
$TARGET_DIR/SDK/tools/bin/darling-dmg $1 $TMP
$TARGET_DIR/SDK/tools/bin/darling-dmg $XCODEDMG $TMP
XCODEDIR=$TMP ./tools/gen_sdk_package.sh

View File

@ -21,10 +21,7 @@ if [ $# -eq 0 ]; then
exit 1
fi
case $1 in
/*) XCODEDMG="$1" ;;
*) XCODEDMG="$PWD/$1" ;;
esac
XCODEDMG=$(make_absolute_path $1 $(get_exec_dir))
mkdir -p $BUILD_DIR

View File

@ -15,6 +15,8 @@ if [ $# -eq 0 ]; then
exit 1
fi
XCODE=$(make_absolute_path $1 $(get_exec_dir))
mkdir -p $BUILD_DIR
pushd $BUILD_DIR &>/dev/null
@ -36,10 +38,10 @@ create_tmp_dir
pushd $TMP_DIR &>/dev/null
echo "Extracting $1 (this may take several minutes) ..."
echo "Extracting $XCODE (this may take several minutes) ..."
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TARGET_DIR/lib \
verbose_cmd "$TARGET_DIR/bin/xar -xf $1 -C $TMP_DIR"
verbose_cmd "$TARGET_DIR/bin/xar -xf $XCODE -C $TMP_DIR"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TARGET_DIR/lib \
verbose_cmd "$TARGET_DIR/SDK/tools/bin/pbzx -n Content | cpio -i"

View File

@ -189,6 +189,28 @@ function extract()
}
function get_exec_dir()
{
local dirs=$(dirs)
echo ${dirs##* }
}
function make_absolute_path()
{
local current_path
if [ $# -eq 1 ]; then
current_path=$PWD
else
current_path=$2
fi
case $1 in
/*) echo "$1" ;;
*) echo "${current_path}/$1" ;;
esac
}
function cleanup_tmp_dir()
{
if [ -n "$OC_KEEP_TMP_DIR" ]; then