2016-08-31 10:09:41 +00:00
|
|
|
Pod::Spec.new do |spec|
|
|
|
|
spec.name = "miniupnp"
|
|
|
|
spec.summary = "Mini UPnP client"
|
|
|
|
spec.homepage = 'http://miniupnp.free.fr/'
|
|
|
|
spec.authors = "The MiniUPnP Authors"
|
|
|
|
spec.license = { type: "BSD", file: "miniupnpc/LICENSE" }
|
|
|
|
|
2016-10-21 09:50:08 +00:00
|
|
|
spec.version = "2.0.0.2"
|
2016-08-31 10:09:41 +00:00
|
|
|
spec.source = {
|
2023-01-30 14:09:13 +00:00
|
|
|
git: 'https://github.com/miniupnp/miniupnp.git',
|
2016-08-31 10:09:41 +00:00
|
|
|
tag: "v#{spec.version}"
|
|
|
|
}
|
|
|
|
|
|
|
|
spec.platform = :ios
|
|
|
|
spec.ios.deployment_target = '8.0'
|
|
|
|
|
|
|
|
spec.prepare_command = <<-CMD
|
|
|
|
build_for_ios() {
|
|
|
|
build_for_architecture iphoneos armv7 arm-apple-darwin
|
|
|
|
build_for_architecture iphonesimulator i386 i386-apple-darwin
|
|
|
|
build_for_architecture iphoneos arm64 arm-apple-darwin
|
|
|
|
build_for_architecture iphonesimulator x86_64 x86_64-apple-darwin
|
|
|
|
create_universal_library
|
|
|
|
}
|
|
|
|
|
|
|
|
build_for_architecture() {
|
|
|
|
PLATFORM=$1
|
|
|
|
ARCH=$2
|
|
|
|
HOST=$3
|
|
|
|
SDKPATH=`xcrun -sdk $PLATFORM --show-sdk-path`
|
|
|
|
PREFIX="build-ios/$ARCH"
|
|
|
|
mkdir -p "$PREFIX"
|
|
|
|
xcrun -sdk $PLATFORM make clean
|
|
|
|
xcrun -sdk $PLATFORM make -j 16 install \
|
|
|
|
PREFIX="$PREFIX" \
|
|
|
|
CC=`xcrun -sdk $PLATFORM -find cc` \
|
|
|
|
CFLAGS="-arch $ARCH -isysroot $SDKPATH" \
|
|
|
|
LIBTOOL=`xcrun -sdk $PLATFORM -find libtool` \
|
2016-09-07 11:42:50 +00:00
|
|
|
LDFLAGS="-arch $ARCH -headerpad_max_install_names"
|
2016-08-31 10:09:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
create_universal_library() {
|
2016-09-07 11:42:50 +00:00
|
|
|
lipo -create -output libminiupnpc.dylib \
|
2016-08-31 10:09:41 +00:00
|
|
|
build-ios/{armv7,arm64,i386,x86_64}/usr/lib/libminiupnpc.dylib
|
2016-10-21 09:50:08 +00:00
|
|
|
install_name_tool -id "@rpath/libminiupnpc.dylib" libminiupnpc.dylib
|
2016-08-31 10:09:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cd miniupnpc
|
|
|
|
build_for_ios
|
|
|
|
CMD
|
|
|
|
|
|
|
|
spec.source_files = "miniupnpc/build-ios/armv7/usr/include/**/*.h"
|
2016-09-07 11:42:50 +00:00
|
|
|
spec.ios.vendored_libraries = "miniupnpc/libminiupnpc.dylib"
|
2016-08-31 10:09:41 +00:00
|
|
|
end
|