Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xCFrameworks fix final #417

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions apothecary/apothecary
Original file line number Diff line number Diff line change
Expand Up @@ -1545,19 +1545,25 @@ function frameworkFormula() {
mkdir -p $XLIBSLOCAL
fi
export XLIBS_DIR_REAL=$(realpath $XLIBSLOCAL)

if [[ $TYPE == "osx" ]]; then
TYPE_OUT="macos"
else
TYPE_OUT=${TYPE}
fi

if [ ! -e "$LIBS_DIR/$1" ] ; then
echoVerbose " Nothing to create framework from to merge in lib dest dir: \"$1\""
elif [ $1 == "pkg-config" ] || [ $1 == "kiss" ]; then
echoVerbose " No need to create framework for: \"$1\""
else
rm -rf $LIBS_DIR_REAL/$1/lib/$TYPE/*.xcframework
rm -rf $LIBS_DIR_REAL/$1/lib/$TYPE_OUT/*.xcframework

echoSuccess " Framework lib dest dir: \"$1\" \"$LIBS_DIR_REAL/$1/lib/$TYPE/\" "
echoSuccess " Framework lib dest dir: \"$1\" \"$LIBS_DIR_REAL/$1/lib/$TYPE_OUT/\" "
xcframework_flags=""

XDIR="${XLIBS_DIR_REAL}/"
X_LIBS="$XDIR/${1}/lib/${TYPE}/"
X_LIBS="$XDIR/${1}/lib/${TYPE_OUT}/"
X_INCLUDE=$XDIR/${1}/include
X_LICENSE=$XDIR/${1}/license

Expand All @@ -1566,9 +1572,9 @@ function frameworkFormula() {

if [[ $1 == "fmod" ]] || [[ $1 == "fmodex" ]] || [[ $1 == "glm" ]] || [[ $1 == "json" ]] || [[ $1 == "utf8" ]]; then
if ! command -v rsync &> /dev/null; then
if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${TYPE}/" ]]; then
if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${TYPE_OUT}/" ]]; then
mkdir -p "${X_LIBS}"
cp -av "${LIBS_DIR_REAL}/${1}/lib/${TYPE}/"* ${X_LIBS}
cp -av "${LIBS_DIR_REAL}/${1}/lib/${TYPE_OUT}/"* ${X_LIBS}
fi
if [[ -e "${LIBS_DIR_REAL}/${1}/include/" ]]; then
cp -av "${LIBS_DIR_REAL}/${1}/include/"* ${X_INCLUDE}
Expand All @@ -1577,9 +1583,9 @@ function frameworkFormula() {
cp -av "${LIBS_DIR_REAL}/${1}/license/"* ${X_LICENSE}
fi
else
if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${TYPE}" ]]; then
if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${TYPE_OUT}" ]]; then
mkdir -p "${X_LIBS}"
rsync -av --delete "${LIBS_DIR_REAL}/${1}/lib/${TYPE}/" ${X_LIBS}
rsync -av --delete "${LIBS_DIR_REAL}/${1}/lib/${TYPE_OUT}/" ${X_LIBS}
fi
if [[ -e "${LIBS_DIR_REAL}/${1}/include/" ]]; then
rsync -av --delete "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE}
Expand Down Expand Up @@ -1618,7 +1624,7 @@ function frameworkFormula() {
LIB_NAME=""
CURRENT_TYPE=$TYPE
BINARY_NAME=""
XCFRAMEWORK_PATH="${LIBS_DIR_REAL}/${1}/lib/${TYPE}/$1.xcframework"
XCFRAMEWORK_PATH="${LIBS_DIR_REAL}/${1}/lib/${TYPE_OUT}/$1.xcframework"
declare -a merged_dirs=()
LIB_NAME=""
for CURRENT_TYPE in "${PLATFORM_TYPES[@]}"; do
Expand Down Expand Up @@ -1752,11 +1758,7 @@ function frameworkFormula() {
echoSuccess " flags: [\"$1\" \"$xcframework_flags\"]"
HERE_DIR=$(cd $(dirname "./"); pwd -P)

if [[ $TYPE == "osx" ]]; then
TYPE_OUT="macos"
else
TYPE_OUT=${TYPE}
fi



XCFRAMEWORK_PATH="${LIBS_DIR_REAL}/${1}/lib/${TYPE_OUT}/$1.xcframework"
Expand Down
Loading