Browse Source

package: apple: refactor xcode interoperability

Alexandre Janniaux 5 years ago
parent
commit
f507ceecb3
  1. 31
      extras/package/apple/xcode.sh
  2. 75
      extras/package/apple/xcodegen.yml

31
extras/package/apple/xcode.sh

@ -0,0 +1,31 @@
#!/usr/bin/env bash
SCRIPTDIR="$(cd $(dirname "$0"); pwd)"
SRCROOT="${SCRIPTDIR}/../../../"
if [ ! -f "${SRCROOT}/configure" ]; then
(cd "${SRCROOT}" && ./bootstrap)
fi
# https://developer.apple.com/documentation/xcode-release-notes/build-system-release-notes-for-xcode-10
# > The new build system passes undefined_arch as the value for the ARCH
# > environment variable when running shell script build phases. The value was
# > previously not well defined. Any shell scripts depending on this value must
# > behave correctly for all defined architectures being built, available via
# > the ARCHS environment variable.
MAKEFLAGS="-j6"
for arch in $ARCHS; do
echo "\n==========\n"
echo "Building platform ${PLATFORM_NAME} for arch ${arch}"
BUILD_DIR="${BUILT_PRODUCTS_DIR}/build-${PLATFORM_NAME}-${arch}/"
if [ ! -f "${BUILD_DIR}/build/config.h" ]; then
mkdir -p "${BUILD_DIR}"
(cd "${BUILD_DIR}" && env -i V=1 VERBOSE=1 "${SCRIPTDIR}/build.sh" \
--enable-shared --enable-merge-plugins --enable-bitcode \
--arch="${arch}" --sdk="${PLATFORM_NAME}")
else
(cd "${BUILD_DIR}/build/" && env -i ./compile V=1 VERBOSE=1)
fi
done

75
extras/package/apple/xcodegen.yml

@ -88,36 +88,43 @@ targets:
- target: VLCAutomake
info:
path: "vlc_plugin/Info.plist"
sources:
- path: ${VLC_BUILD_DIR}/modules/.libs/libvlc_plugin.dylib
optional: true
attributes:
- CodeSignOnCopy
buildPhase:
copyFiles:
destination: productsDirectory
subpath: vlc_plugin.framework/
postBuildScripts:
- name: Override vlc_plugin library
- name: Copy vlc_plugin library
script: |
mv ${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/libvlc_plugin.dylib \
${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/vlc_plugin
install_name_tool -id @rpath/vlc_plugin.framework/vlc_plugin \
${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/vlc_plugin
install_name_tool -change @rpath/libvlccore.dylib @rpath/vlccore.framework/vlccore \
${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/vlc_plugin
INPUT_FILES=()
for arch in ${ARCHS}; do
input_file="${BUILT_PRODUCTS_DIR}/build-${PLATFORM_NAME}-${arch}/build/modules/.libs/libvlc_plugin.dylib"
echo " + Adding input $input_file"
INPUT_FILES+=( "$input_file" )
done
lipo -create \
-output "${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/vlc_plugin" \
"${INPUT_FILES[@]}"
# mv ${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/libvlc_plugin.dylib \
# ${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/vlc_plugin
# install_name_tool -id @rpath/vlc_plugin.framework/vlc_plugin \
# ${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/vlc_plugin
# install_name_tool -change @rpath/libvlccore.dylib @rpath/vlccore.framework/vlccore \
# ${BUILT_PRODUCTS_DIR}/vlc_plugin.framework/vlc_plugin
vlc:
type: "library.static"
platform: ${VLC_PLATFORM}
dependencies:
- target: VLCAutomake
sources:
- path: ${VLC_BUILD_DIR}/lib/.libs/libvlc.a
optional: true
buildPhase:
copyFiles:
destination: productsDirectory
postBuildScripts:
- name: Copy libvlc library
script: |
INPUT_FILES=()
for arch in ${ARCHS}; do
input_file="${BUILT_PRODUCTS_DIR}/build-${PLATFORM_NAME}-${arch}/build/lib/.libs/libvlc.a"
echo " + Adding input $input_file"
INPUT_FILES+=( "$input_file" )
done
lipo -create \
-output "${BUILT_PRODUCTS_DIR}/libvlc.a" \
"${INPUT_FILES[@]}"
vlccore:
type: "framework"
@ -127,23 +134,19 @@ targets:
info:
path: "vlccore/Info.plist"
sources:
- path: ${VLC_BUILD_DIR}/src/.libs/libvlccore.dylib
name: vlccore
optional: true
attributes:
- CodeSignOnCopy
buildPhase:
copyFiles:
destination: productsDirectory
subpath: vlccore.framework/
- path: ${VLC_SRC_DIR}/include/
includes: "vlc_*.h"
buildPhase: headers
headerVisibility: public
postBuildScripts:
- name: Override vlccore library
- name: Copy vlccore library
script: |
mv ${BUILT_PRODUCTS_DIR}/vlccore.framework/libvlccore.dylib \
${BUILT_PRODUCTS_DIR}/vlccore.framework/vlccore
install_name_tool -id @rpath/vlccore.framework/vlccore \
${BUILT_PRODUCTS_DIR}/vlccore.framework/vlccore
INPUT_FILES=()
for arch in ${ARCHS}; do
input_file="${BUILT_PRODUCTS_DIR}/build-${PLATFORM_NAME}-${arch}/build/src/.libs/libvlccore.dylib"
echo " + Adding input $input_file"
INPUT_FILES+=( "$input_file" )
done
lipo -create \
-output "${BUILT_PRODUCTS_DIR}/vlccore.framework/vlccore" \
"${INPUT_FILES[@]}"

Loading…
Cancel
Save