├── .gitignore ├── .gitmodules ├── LICENSE ├── Package.swift ├── README.md ├── basic_Info.plist ├── basic_Info_OSX.plist ├── basic_Info_Simulator.plist ├── build_all_packages.sh ├── build_fftw.sh ├── build_freetype.sh ├── build_gdal.sh ├── build_gdal_fw.sh ├── build_geos.sh ├── build_geos_fw.sh ├── build_libffi.sh ├── build_libheif.sh ├── build_libjpg.sh ├── build_libpng.sh ├── build_libspatialindex.sh ├── build_libtiff.sh ├── build_libxslt.sh ├── build_libzma.sh ├── build_libzmq.sh ├── build_openblas.sh ├── build_openssl.sh ├── build_proj.sh ├── compute_checksums.sh ├── create_xcframeworks.sh └── libffi.patch /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libffi"] 2 | path = libffi 3 | url = https://github.com/libffi/libffi.git 4 | [submodule "libzmq"] 5 | path = libzmq 6 | url = https://github.com/zeromq/libzmq.git 7 | [submodule "OpenBLAS"] 8 | path = OpenBLAS 9 | url = https://github.com/xianyi/OpenBLAS.git 10 | [submodule "harfbuzz"] 11 | path = harfbuzz 12 | url = https://github.com/harfbuzz/harfbuzz.git 13 | [submodule "libxslt"] 14 | path = libxslt 15 | url = https://gitlab.gnome.org/GNOME/libxslt.git 16 | [submodule "libheif"] 17 | path = libheif 18 | url = https://github.com/strukturag/libheif.git 19 | [submodule "geos"] 20 | path = geos 21 | url = https://git.osgeo.org/gitea/geos/geos.git 22 | [submodule "GDAL"] 23 | path = GDAL 24 | url = https://github.com/OSGeo/GDAL.git 25 | [submodule "libspatialindex"] 26 | path = libspatialindex 27 | url = https://github.com/libspatialindex/libspatialindex.git 28 | [submodule "xeus"] 29 | path = xeus 30 | url = https://github.com/jupyter-xeus/xeus 31 | [submodule "json"] 32 | path = json 33 | url = git@github.com:nlohmann/json.git 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Nicolas Holzschuch 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "Python-aux", 7 | products: [ 8 | .library(name: "Python-aux", targets: ["libpng", "libffi", "libzmq", "openblas", "freetype", "harfbuzz", "crypto", "openssl", "libjpeg", "libtiff", "libxlst", "libexslt"]) 9 | ], 10 | dependencies: [ 11 | ], 12 | targets: [ 13 | .binaryTarget( 14 | name: "libpng", 15 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libpng.xcframework.zip", 16 | checksum: "e9717e039c6f80076ddc6bec3ab56fd4213c30c16058dcc9fe1da2f0f980e17e" 17 | ), 18 | .binaryTarget( 19 | name: "libffi", 20 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libffi.xcframework.zip", 21 | checksum: "f3f39a73e7268e3a17e61db4d95c44cb9b08d8f1f95ec5ea9447ad6f3d058602" 22 | ), 23 | .binaryTarget( 24 | name: "libzmq", 25 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libzmq.xcframework.zip", 26 | checksum: "d2882a48cab72e96883b8e3c09af7bc115d16cd2d5c97136880e950a69e760d5" 27 | ), 28 | .binaryTarget( 29 | name: "openblas", 30 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/openblas.xcframework.zip", 31 | checksum: "13fd3c1b44ed1bf3db230adb8f8151ab17e77e9fb61df675074d7f16fec411c6" 32 | ), 33 | .binaryTarget( 34 | name: "freetype", 35 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/freetype.xcframework.zip", 36 | checksum: "f547dd4944465e889e944cf809662af66109bc35fe09b88f231f0e2228e8aba4" 37 | ), 38 | .binaryTarget( 39 | name: "harfbuzz", 40 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/harfbuzz.xcframework.zip", 41 | checksum: "d28dc80e57df750f1ae62f48785297c031874e33328888ccba96b1496b39a031" 42 | ), 43 | .binaryTarget( 44 | name: "crypto", 45 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/crypto.xcframework.zip", 46 | checksum: "26682e31ab3bdad7bfb02236dafdd06409c3fd4fa9ef8ec2b404180d2c3c82c4" 47 | ), 48 | .binaryTarget( 49 | name: "openssl", 50 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/openssl.xcframework.zip", 51 | checksum: "dda71e88ac9a1f02a44d5a7918ca5a14998653bed2d21a2a2874040861dc680c" 52 | ), 53 | .binaryTarget( 54 | name: "libjpeg", 55 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libjpeg.xcframework.zip", 56 | checksum: "aeaaf1e14a1c5ea9b312fe8ade12d8d9d80d23f0e329cb407c53c4e16511b8f5" 57 | ), 58 | .binaryTarget( 59 | name: "libtiff", 60 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libtiff.xcframework.zip", 61 | checksum: "bbda6117dec4495aeeb4f96c8a1cdb3fac7f0e79375dd7bce5117108d694110e" 62 | ), 63 | .binaryTarget( 64 | name: "libxslt", 65 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libxslt.xcframework.zip", 66 | checksum: "1c7e513edcc5c9a3a7dedfaaef966c851c7862cf854b3bd7185515412244d66d" 67 | ), 68 | .binaryTarget( 69 | name: "libexslt", 70 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libexslt.xcframework.zip", 71 | checksum: "c4fc441665de546dde80d6e25b02d96f51a39c7ad4263376f6d37900cb947889" 72 | ), 73 | .binaryTarget( 74 | name: "libfftw3", 75 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libfftw3.xcframework.zip", 76 | checksum: "d6ece560b5af600c01b520dac21d7b3f4667ecee44aab33a35f902c88b5fff7b" 77 | ), 78 | .binaryTarget( 79 | name: "libfftw3_threads", 80 | url: "https://github.com/holzschu/Python-aux/releases/download/1.0/libfftw3_threads.xcframework.zip", 81 | checksum: "5f78dcd006d0a0186a2a1db19915815cb8d16c9d142b10251a6099516395d1d3" 82 | ) 83 | ] 84 | ) 85 | /* 86 | libpng 87 | e9717e039c6f80076ddc6bec3ab56fd4213c30c16058dcc9fe1da2f0f980e17e 88 | libffi 89 | f3f39a73e7268e3a17e61db4d95c44cb9b08d8f1f95ec5ea9447ad6f3d058602 90 | libzmq 91 | d2882a48cab72e96883b8e3c09af7bc115d16cd2d5c97136880e950a69e760d5 92 | openblas 93 | 13fd3c1b44ed1bf3db230adb8f8151ab17e77e9fb61df675074d7f16fec411c6 94 | freetype 95 | f547dd4944465e889e944cf809662af66109bc35fe09b88f231f0e2228e8aba4 96 | harfbuzz 97 | d28dc80e57df750f1ae62f48785297c031874e33328888ccba96b1496b39a031 98 | crypto 99 | 26682e31ab3bdad7bfb02236dafdd06409c3fd4fa9ef8ec2b404180d2c3c82c4 100 | openssl 101 | dda71e88ac9a1f02a44d5a7918ca5a14998653bed2d21a2a2874040861dc680c 102 | libjpeg 103 | aeaaf1e14a1c5ea9b312fe8ade12d8d9d80d23f0e329cb407c53c4e16511b8f5 104 | libtiff 105 | bbda6117dec4495aeeb4f96c8a1cdb3fac7f0e79375dd7bce5117108d694110e 106 | libxslt 107 | 1c7e513edcc5c9a3a7dedfaaef966c851c7862cf854b3bd7185515412244d66d 108 | libexslt 109 | c4fc441665de546dde80d6e25b02d96f51a39c7ad4263376f6d37900cb947889 110 | libfftw3 111 | d6ece560b5af600c01b520dac21d7b3f4667ecee44aab33a35f902c88b5fff7b 112 | libfftw3_threads 113 | 5f78dcd006d0a0186a2a1db19915815cb8d16c9d142b10251a6099516395d1d3 114 | */ 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python-aux 2 | 3 | Auxiliary libraries needed for Python3 compilation, precompiled (libpng, harfbuzz, freetype...). They can be useful for many other OpenSource projects on iOS, too. 4 | 5 | What we have: 6 | - [libpng](http://www.libpng.org/pub/png/libpng.html) (1.6.37) 7 | - [libffi](https://github.com/libffi/libffi) (main branch) 8 | - [libzmq](https://github.com/zeromq/libzmq) (zeroMQ) (main branch) 9 | - [OpenBLAS](https://github.com/xianyi/OpenBLAS) (develop branch) 10 | - [freetype](https://www.freetype.org) (2.10.2) 11 | - [harfbuzz](https://github.com/harfbuzz/harfbuzz) (main branch) 12 | 13 | ## How to use: 14 | 15 | In your Xcode project, use the menu File -> "Swift Packages" -> "Add Package Dependency". In the window that opens, enter the address for this repository (https://github.com/holzschu/Python-aux.git). 16 | 17 | In the rightmost column, you will see "Swift Package Dependencies", and under it "Python-aux". Under "Referenced Binaries", you have all the libraries, precompiled, as "xcframework". You can link with them, embed them, and Xcode will extract the iOS or Simulator version as needed. 18 | 19 | ## How to compile: 20 | 21 | In this repository, run `build_all_packages.sh`. This will update the code, compile the packages, create the frameworks, create and compress the xcframeworks and output the hash sums. 22 | 23 | For use in your own repository, update the hash sums in `Package.swift`, publish the xcframeworks.zip in the right place and enjoy. 24 | 25 | ## Work in progress: 26 | 27 | - libheif: needs libpng (OK), libde265 and libx265 (WIP): https://github.com/strukturag/libde265 28 | -------------------------------------------------------------------------------- /basic_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18C54 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | pythonA-kiwisolver 11 | CFBundleIdentifier 12 | Nicolas-Holzschuch.pythonA-kiwisolver 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | pythonA-kiwisolver 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | iPhoneOS 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 16B91 31 | DTPlatformName 32 | iphoneos 33 | DTPlatformVersion 34 | 14.0 35 | DTSDKBuild 36 | 16B91 37 | DTSDKName 38 | iphoneos14.0 39 | DTXcode 40 | 1010 41 | DTXcodeBuild 42 | 10B61 43 | MinimumOSVersion 44 | 14.0 45 | UIDeviceFamily 46 | 47 | 1 48 | 2 49 | 50 | UIRequiredDeviceCapabilities 51 | 52 | arm64 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /basic_Info_OSX.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18C54 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | pythonA-kiwisolver 11 | CFBundleIdentifier 12 | Nicolas-Holzschuch.pythonA-kiwisolver 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | pythonA-kiwisolver 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | iPhoneSimulator 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 16B91 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 11.0 35 | DTSDKBuild 36 | 16B91 37 | DTSDKName 38 | macosx11.0 39 | DTXcode 40 | 1010 41 | DTXcodeBuild 42 | 10B61 43 | MinimumOSVersion 44 | 11.0 45 | UIDeviceFamily 46 | 47 | 1 48 | 2 49 | 50 | UIRequiredDeviceCapabilities 51 | 52 | arm64 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /basic_Info_Simulator.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18C54 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | pythonA-kiwisolver 11 | CFBundleIdentifier 12 | Nicolas-Holzschuch.pythonA-kiwisolver 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | pythonA-kiwisolver 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | iPhoneSimulator 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 16B91 31 | DTPlatformName 32 | iphonesimulator 33 | DTPlatformVersion 34 | 14.0 35 | DTSDKBuild 36 | 16B91 37 | DTSDKName 38 | iphonesimulator14.0 39 | DTXcode 40 | 1010 41 | DTXcodeBuild 42 | 10B61 43 | MinimumOSVersion 44 | 14.0 45 | UIDeviceFamily 46 | 47 | 1 48 | 2 49 | 50 | UIRequiredDeviceCapabilities 51 | 52 | arm64 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /build_all_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # update libffi, OpenBLAS, harfbuzz and libzmq source: 4 | git submodule update --init --recursive 5 | 6 | # Using Xcode to create frameworks from archived libraries (lib.a) is failing randomly. 7 | # We stick to creating frameworks from dynamic libraries. 8 | 9 | # building libpng: 10 | ./build_libpng.sh 11 | 12 | # libffi and libzmq produce static libraries. We can still put them into xcframeworks: 13 | ./build_libffi.sh 14 | ./build_libzmq.sh 15 | 16 | # OpenBLAS creates dynamic libraries: 17 | ./build_openblas.sh 18 | 19 | # Building harfbuzz and freetype (together): 20 | ./build_freetype.sh 21 | 22 | # Building libjpeg: 23 | ./build_libjpg.sh 24 | 25 | #libtiff: 26 | ./build_libtiff.sh 27 | 28 | # XSLT/EXSLT 29 | ./build_libxslt.sh 30 | 31 | # OpenSSL: 32 | ./build_openssl.sh 33 | 34 | # FFTW: 35 | ./build_fftw.sh 36 | 37 | # then, merge frameworks into XCframeworks: 38 | ./create_xcframeworks.sh 39 | # and compute checksums: 40 | ./compute_checksums.sh 41 | 42 | # crypto openssl libjpeg 43 | -------------------------------------------------------------------------------- /build_fftw.sh: -------------------------------------------------------------------------------- 1 | # Required with Xcode 12 beta: 2 | export M4=$(xcrun -f m4) 3 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 4 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 5 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 6 | 7 | curl -OL http://www.fftw.org/fftw-3.3.10.tar.gz 8 | tar xzf fftw-3.3.10.tar.gz 9 | rm fftw-3.3.10.tar.gz 10 | 11 | SOURCE_DIR=fftw-3.3.10 12 | pushd $SOURCE_DIR 13 | 14 | make distclean 15 | ./configure CC=clang CXX=clang++ \ 16 | CFLAGS="-isysroot ${OSX_SDKROOT} -fembed-bitcode" \ 17 | CPPFLAGS="-isysroot ${OSX_SDKROOT} -fembed-bitcode" \ 18 | CXXFLAGS="-isysroot ${OSX_SDKROOT} -fembed-bitcode" \ 19 | F77="gfortran" --enable-threads 20 | make -j4 --quiet 21 | # in include: fftw3.h fftw3.f fftw3l.f03 fftw3q.f03 22 | # in lib: libfftw3.a 23 | 24 | mkdir -p build-macosx 25 | mkdir -p build-macosx/include 26 | cp .libs/libfftw3.a build-macosx 27 | cp threads/.libs/libfftw3_threads.a build-macosx 28 | cp api/fftw3.h api/fftw3.f api/fftw3l.f03 api/fftw3q.f03 build-macosx/include 29 | 30 | 31 | make distclean 32 | ./configure CC=clang CXX=clang++ \ 33 | CFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 34 | CPPFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 35 | CXXFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 36 | F77="/usr/local/bin/aarch64-apple-darwin20-gfortran" \ 37 | --build=x86_64-apple-darwin --host=armv8-apple-darwin --enable-threads cross_compiling=yes 38 | make -j4 --quiet 39 | # in include: fftw3.h fftw3.f fftw3l.f03 fftw3q.f03 40 | # in lib: libfftw3.a 41 | 42 | mkdir -p build-iphoneos 43 | mkdir -p build-iphoneos/include 44 | cp .libs/libfftw3.a build-iphoneos 45 | cp threads/.libs/libfftw3_threads.a build-iphoneos 46 | cp api/fftw3.h api/fftw3.f api/fftw3l.f03 api/fftw3q.f03 build-iphoneos/include 47 | 48 | make distclean 49 | ./configure CC=clang CXX=clang++ \ 50 | CFLAGS="-arch x86_64 -mios-simulator-version-min=14.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 51 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=14.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 52 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=14.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 53 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin --enable-threads cross_compiling=yes 54 | make -j4 --quiet 55 | mkdir -p build-iphonesimulator 56 | mkdir -p build-iphonesimulator/include 57 | cp .libs/libfftw3.a build-iphonesimulator 58 | cp threads/.libs/libfftw3_threads.a build-iphonesimulator 59 | cp api/fftw3.h api/fftw3.f api/fftw3l.f03 api/fftw3q.f03 build-iphonesimulator/include 60 | popd 61 | 62 | 63 | # then, merge them into XCframeworks: 64 | framework=libfftw3 65 | rm -rf $framework.xcframework 66 | xcodebuild -create-xcframework \ 67 | -library $SOURCE_DIR/build-macosx/libfftw3.a -headers $SOURCE_DIR/build-iphoneos/include \ 68 | -library $SOURCE_DIR/build-iphoneos/libfftw3.a -headers $SOURCE_DIR/build-iphoneos/include \ 69 | -library $SOURCE_DIR/build-iphonesimulator/libfftw3.a -headers $SOURCE_DIR/build-iphonesimulator/include \ 70 | -output $framework.xcframework 71 | 72 | framework=libfftw3_threads 73 | rm -rf $framework.xcframework 74 | xcodebuild -create-xcframework \ 75 | -library $SOURCE_DIR/build-macosx/libfftw3_threads.a \ 76 | -library $SOURCE_DIR/build-iphoneos/libfftw3_threads.a \ 77 | -library $SOURCE_DIR/build-iphonesimulator/libfftw3_threads.a \ 78 | -output $framework.xcframework 79 | 80 | 81 | -------------------------------------------------------------------------------- /build_freetype.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # In case we use Xcode-beta, use the proper m4: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | freetype=freetype-2.10.2 10 | # step 1: build freetype without harfbuzz support: 11 | echo "Downloading freetype and building freetype without harfbuzz:" 12 | curl -OL https://download.savannah.gnu.org/releases/freetype/$freetype.tar.gz 13 | tar xvzf $freetype.tar.gz 14 | rm $freetype.tar.gz 15 | pushd $freetype 16 | make distclean 17 | ./configure CC=clang CXX=clang++ \ 18 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 19 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT}" \ 20 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 21 | LDFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 22 | CC_BUILD="clang -isysroot ${OSX_SDKROOT}" \ 23 | --build=x86_64-apple-darwin --host=armv8-apple-darwin --with-harfbuzz=no \ 24 | --with-png=yes LIBPNG_CFLAGS="-I ${PWD}/../build/Release-iphoneos/libpng.framework/Headers" \ 25 | LIBPNG_LIBS="-F${PWD}/../build/Release-iphoneos -framework libpng" \ 26 | cross_compiling=yes 27 | make -j 4 28 | mkdir -p build-iphoneos 29 | cp objs/.libs/libfreetype.a build-iphoneos 30 | cp objs/.libs/libfreetype.dylib build-iphoneos 31 | make distclean 32 | ./configure CC=clang CXX=clang++ \ 33 | CFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 34 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT}" \ 35 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 36 | LDFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 37 | CC_BUILD="clang -isysroot ${OSX_SDKROOT}" \ 38 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin --with-harfbuzz=no \ 39 | --with-png=yes LIBPNG_CFLAGS="-I ${PWD}/../build/Release-iphonesimulator/libpng.framework/Headers" \ 40 | LIBPNG_LIBS="-F${PWD}/../build/Release-iphonesimulator -framework libpng" \ 41 | cross_compiling=yes 42 | make -j 4 43 | mkdir -p build-iphonesimulator 44 | cp objs/.libs/libfreetype.a build-iphonesimulator 45 | cp objs/.libs/libfreetype.dylib build-iphonesimulator 46 | popd 47 | 48 | # step 2: build harfbuzz using freetype 49 | 50 | echo "Building harfbuzz with freetype support:" 51 | # Note: need to call ./autogen.sh but only once. 52 | pushd harfbuzz 53 | ./configure CC=clang CXX=clang++ \ 54 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT}" \ 55 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT}" \ 56 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT}" \ 57 | LDFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -L${PWD}/../${freetype}/build-iphoneos/" \ 58 | --build=x86_64-apple-darwin --host=armv8-apple-darwin --enable-static=yes --with-glib=no --with-cairo=no --with-freetype=yes FREETYPE_CFLAGS="-I${PWD}/../${freetype}/include/" FREETYPE_LIBS="-lfreetype" 59 | make -j4 --quiet 60 | mkdir -p build-iphoneos 61 | cp src/.libs/libharfbuzz.a build-iphoneos 62 | cp src/.libs/libharfbuzz.0.dylib build-iphoneos/libharfbuzz.dylib 63 | make distclean 64 | ./configure CC=clang CXX=clang++ \ 65 | CFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT}" \ 66 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT}" \ 67 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT}" \ 68 | LDFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot${SIM_SDKROOT} -L${PWD}/../${freetype}/build-iphonesimulator/" \ 69 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin --enable-static=yes --with-glib=no --with-cairo=no --with-freetype=yes FREETYPE_CFLAGS="-I${PWD}/../${freetype}/include/" FREETYPE_LIBS="-lfreetype" cross_compiling=yes 70 | make -j4 --quiet 71 | mkdir -p build-iphonesimulator 72 | cp src/.libs/libharfbuzz.a build-iphonesimulator 73 | cp src/.libs/libharfbuzz.0.dylib build-iphonesimulator/libharfbuzz.dylib 74 | make distclean 75 | popd 76 | 77 | # step 3: recompile freetype with harfbuzz support: 78 | pushd $freetype 79 | make distclean 80 | ./configure CC=clang CXX=clang++ \ 81 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 82 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT}" \ 83 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 84 | LDFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 85 | CC_BUILD="clang -isysroot ${OSX_SDKROOT}" \ 86 | --build=x86_64-apple-darwin --host=armv8-apple-darwin --with-harfbuzz=no \ 87 | --with-png=yes LIBPNG_CFLAGS="-I ${PWD}/../build/Release-iphoneos/libpng.framework/Headers" \ 88 | LIBPNG_LIBS="-F${PWD}/../build/Release-iphoneos -framework libpng" \ 89 | --with-harfbuzz=yes HARFBUZZ_CFLAGS="-I${PWD}/../harfbuzz/src/" HARFBUZZ_LIBS="-L${PWD}/../harfbuzz/build-iphoneos -lharfbuzz" \ 90 | cross_compiling=yes 91 | make -j 4 92 | mkdir -p build-iphoneos 93 | cp objs/.libs/libfreetype.a build-iphoneos 94 | cp objs/.libs/libfreetype.dylib build-iphoneos 95 | make distclean 96 | ./configure CC=clang CXX=clang++ \ 97 | CFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 98 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT}" \ 99 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 100 | LDFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 101 | CC_BUILD="clang -isysroot ${OSX_SDKROOT}" \ 102 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin --with-harfbuzz=no \ 103 | --with-png=yes LIBPNG_CFLAGS="-I ${PWD}/../build/Release-iphonesimulator/libpng.framework/Headers" \ 104 | LIBPNG_LIBS="-F${PWD}/../build/Release-iphonesimulator -framework libpng" \ 105 | --with-harfbuzz=yes HARFBUZZ_CFLAGS="-I${PWD}/../harfbuzz/src/" HARFBUZZ_LIBS="-L${PWD}/../harfbuzz/build-iphonesimulator -lharfbuzz" \ 106 | cross_compiling=yes 107 | make -j 4 108 | mkdir -p build-iphonesimulator 109 | cp objs/.libs/libfreetype.a build-iphonesimulator 110 | cp objs/.libs/libfreetype.dylib build-iphonesimulator 111 | popd 112 | 113 | # step 4: create the frameworks: 114 | for platform in iphoneos iphonesimulator 115 | do 116 | for binary in freetype harfbuzz 117 | do 118 | FRAMEWORK_DIR=build/Release-${platform}/${binary}.framework 119 | rm -rf ${FRAMEWORK_DIR} 120 | mkdir -p ${FRAMEWORK_DIR} 121 | mkdir -p ${FRAMEWORK_DIR}/Headers 122 | if [ "$binary" == "freetype" ]; then 123 | cp -R $freetype/include/* ${FRAMEWORK_DIR}/Headers 124 | cp $freetype/build-${platform}/libfreetype.dylib ${FRAMEWORK_DIR}/$binary 125 | install_name_tool -change /usr/local/lib/libharfbuzz.0.dylib @rpath/harfbuzz.framework/harfbuzz ${FRAMEWORK_DIR}/$binary 126 | fi 127 | if [ "$binary" == "harfbuzz" ]; then 128 | cp -R harfbuzz/src/* ${FRAMEWORK_DIR}/Headers 129 | cp harfbuzz/build-${platform}/libharfbuzz.dylib ${FRAMEWORK_DIR}/$binary 130 | install_name_tool -change /usr/local/lib/libfreetype.6.dylib @rpath/freetype.framework/freetype ${FRAMEWORK_DIR}/$binary 131 | fi 132 | if [ "$platform" == "iphoneos" ]; then 133 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 134 | else 135 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 136 | fi 137 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 138 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 139 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 140 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 141 | done 142 | done 143 | -------------------------------------------------------------------------------- /build_gdal.sh: -------------------------------------------------------------------------------- 1 | # Required with Xcode 12 beta: 2 | export M4=$(xcrun -f m4) 3 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 4 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 5 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 6 | BASE=$PWD 7 | # OSX 11: required to run gfortran 8 | if [ -z "${LIBRARY_PATH}" ]; then 9 | export LIBRARY_PATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" 10 | else 11 | export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" 12 | fi 13 | 14 | 15 | # TODO: add sqlite3 library, to enable gpkg driver. 16 | 17 | SOURCE_DIR=GDAL 18 | pushd $SOURCE_DIR 19 | 20 | make distclean 21 | cp ${BASE}/libproj.xcframework/macos-x86_64/libproj.framework/libproj ./libproj.dylib 22 | cp ${BASE}/libgeos_c.xcframework/macos-x86_64/libgeos_c.framework/libgeos_c ./libgeos_c.dylib 23 | # Edited configure to use "-L." for lgeos_c (line 38518) (and keep LDFLAGS) 24 | ./configure CC=clang CXX=clang++ \ 25 | CFLAGS="-isysroot ${OSX_SDKROOT} -fembed-bitcode -I ${BASE}/libproj.xcframework/macos-x86_64/libproj.framework/Headers/" \ 26 | CPPFLAGS="-isysroot ${OSX_SDKROOT} -fembed-bitcode -I ${BASE}/libproj.xcframework/macos-x86_64/libproj.framework/Headers/" \ 27 | CXXFLAGS="-isysroot ${OSX_SDKROOT} -fembed-bitcode -I ${BASE}/libproj.xcframework/macos-x86_64/libproj.framework/Headers/" \ 28 | LDFLAGS="-L${BASE}/${SOURCE_DIR}" \ 29 | --with-threads=no --with-png=internal --with-jpeg=internal --with-libtiff=internal --with-libz=internal --with-geos=yes --with-sqlite3=${OSX_SDKROOT}/usr 30 | make -j4 --quiet 31 | mkdir -p build-osx 32 | mkdir -p build-osx/include 33 | cp .libs/libgdal.dylib build-osx 34 | cp port/*.h build-osx/include 35 | cp gcore/*.h build-osx/include 36 | cp frmts/vrt/*.h build-osx/include 37 | cp frmts/mem/*.h build-osx/include 38 | cp alg/*.h build-osx/include 39 | cp ogr/*.h build-osx/include 40 | cp generated_headers/*.h build-osx/include 41 | 42 | make distclean 43 | unset LIBRARY_PATH 44 | cp ${BASE}/libproj.xcframework/ios-arm64/libproj.framework/libproj ./libproj.dylib 45 | cp ${BASE}/libgeos_c.xcframework/ios-arm64/libgeos_c.framework/libgeos_c ./libgeos_c.dylib 46 | ./configure CC=clang CXX=clang++ \ 47 | CFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -I ${BASE}/libproj.xcframework/ios-arm64/libproj.framework/Headers/" \ 48 | CPPFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -I ${BASE}/libproj.xcframework/ios-arm64/libproj.framework/Headers/" \ 49 | CXXFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -I ${BASE}/libproj.xcframework/ios-arm64/libproj.framework/Headers/" \ 50 | LDFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -L${BASE}/${SOURCE_DIR} -liconv" \ 51 | --build=x86_64-apple-darwin --host=armv8-apple-darwin \ 52 | --with-threads=no --with-png=internal --with-jpeg=internal --with-libtiff=internal --with-libz=internal --with-geos=yes --with-sqlite3=${IOS_SDKROOT}/usr 53 | # LDFLAGS="-arch arm64 -miphoneos-version-min=14.0 -isysroot ${IOS_SDKROOT} -L${BASE}/${SOURCE_DIR} -liconv" make -j4 --quiet 54 | make -j4 --quiet 55 | mkdir -p build-iphoneos 56 | mkdir -p build-iphoneos/include 57 | cp .libs/libgdal.dylib build-iphoneos 58 | cp port/*.h build-iphoneos/include 59 | cp gcore/*.h build-iphoneos/include 60 | cp frmts/vrt/*.h build-iphoneos/include 61 | cp frmts/mem/*.h build-iphoneos/include 62 | cp alg/*.h build-iphoneos/include 63 | cp ogr/*.h build-iphoneos/include 64 | cp generated_headers/*.h build-iphoneos/include 65 | 66 | 67 | make distclean 68 | cp ${BASE}/libproj.xcframework/ios-x86_64-simulator/libproj.framework/libproj ./libproj.dylib 69 | cp ${BASE}/libgeos_c.xcframework/ios-x86_64-simulator/libgeos_c.framework/libgeos_c ./libgeos_c.dylib 70 | ./configure CC=clang CXX=clang++ \ 71 | CFLAGS="-arch x86_64 -mios-simulator-version-min=14.0 -isysroot ${SIM_SDKROOT} -I ${BASE}/libproj.xcframework/ios-x86_64-simulator/libproj.framework/Headers/" \ 72 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=14.0 -isysroot ${SIM_SDKROOT} -I ${BASE}/libproj.xcframework/ios-x86_64-simulator/libproj.framework/Headers/" \ 73 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=14.0 -isysroot ${SIM_SDKROOT} -I ${BASE}/libproj.xcframework/ios-x86_64-simulator/libproj.framework/Headers/" \ 74 | LDFLAGS="-arch x86_64 -mios-simulator-version-min=14.0 -isysroot ${SIM_SDKROOT} -L${BASE}/${SOURCE_DIR} -liconv" \ 75 | --host=x86_64-apple-darwin \ 76 | --with-threads=no --with-png=internal --with-jpeg=internal --with-libtiff=internal --with-libz=internal --with-geos=yes --with-sqlite3=${SIM_SDKROOT}/usr 77 | make -j4 --quiet 78 | mkdir -p build-iphonesimulator 79 | mkdir -p build-iphonesimulator/include 80 | cp .libs/libgdal.dylib build-iphonesimulator 81 | cp port/*.h build-iphonesimulator/include 82 | cp gcore/*.h build-iphonesimulator/include 83 | cp frmts/vrt/*.h build-iphonesimulator/include 84 | cp frmts/mem/*.h build-iphonesimulator/include 85 | cp alg/*.h build-iphonesimulator/include 86 | cp ogr/*.h build-iphonesimulator/include 87 | cp generated_headers/*.h build-iphonesimulator/include 88 | popd 89 | 90 | 91 | # Now create frameworks: 92 | for platform in osx iphoneos iphonesimulator 93 | do 94 | for binary in libgdal 95 | do 96 | FRAMEWORK_DIR=build/Release-${platform}/${binary}.framework 97 | rm -rf ${FRAMEWORK_DIR} 98 | mkdir -p ${FRAMEWORK_DIR} 99 | mkdir -p ${FRAMEWORK_DIR}/Headers 100 | cp -r $SOURCE_DIR/build-${platform}/include/* ${FRAMEWORK_DIR}/Headers 101 | cp $SOURCE_DIR/build-$platform/$binary.dylib ${FRAMEWORK_DIR}/$binary 102 | install_name_tool -change @rpath/libgdal.31.dylib @rpath/libproj.framework/libgdal ${FRAMEWORK_DIR}/$binary 103 | if [ "$platform" == "iphoneos" ]; then 104 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 105 | elif [ "$platform" == "iphonesimulator" ]; then 106 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 107 | else 108 | cp basic_Info_OSX.plist ${FRAMEWORK_DIR}/Info.plist 109 | fi 110 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 111 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 112 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 113 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 114 | done 115 | done 116 | 117 | -------------------------------------------------------------------------------- /build_gdal_fw.sh: -------------------------------------------------------------------------------- 1 | # Required with Xcode 12 beta: 2 | export M4=$(xcrun -f m4) 3 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 4 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 5 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 6 | BASE=$PWD 7 | # OSX 11: required to run gfortran 8 | if [ -z "${LIBRARY_PATH}" ]; then 9 | export LIBRARY_PATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" 10 | else 11 | export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" 12 | fi 13 | 14 | SOURCE_DIR=GDAL 15 | 16 | # Now create frameworks: 17 | for platform in osx iphoneos iphonesimulator 18 | do 19 | for binary in libgdal 20 | do 21 | FRAMEWORK_DIR=build/Release-${platform}/${binary}.framework 22 | rm -rf ${FRAMEWORK_DIR} 23 | mkdir -p ${FRAMEWORK_DIR} 24 | mkdir -p ${FRAMEWORK_DIR}/Headers 25 | cp -r $SOURCE_DIR/build-${platform}/include/* ${FRAMEWORK_DIR}/Headers 26 | cp $SOURCE_DIR/build-$platform/$binary.dylib ${FRAMEWORK_DIR}/$binary 27 | install_name_tool -change @rpath/libgdal.31.dylib @rpath/libproj.framework/libgdal ${FRAMEWORK_DIR}/$binary 28 | if [ "$platform" == "iphoneos" ]; then 29 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 30 | elif [ "$platform" == "iphonesimulator" ]; then 31 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 32 | else 33 | cp basic_Info_OSX.plist ${FRAMEWORK_DIR}/Info.plist 34 | fi 35 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 36 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 37 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 38 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 39 | done 40 | done 41 | 42 | # 3 architectures framework 43 | for framework in libgdal 44 | do 45 | rm -rf $framework.xcframework 46 | xcodebuild -create-xcframework -framework build/Release-iphoneos/$framework.framework -framework build/Release-iphonesimulator/$framework.framework -framework build/Release-osx/$framework.framework -output $framework.xcframework 47 | done 48 | 49 | -------------------------------------------------------------------------------- /build_geos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # M4 Required with Xcode beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | mkdir -p geos-osx 10 | pushd geos-osx 11 | cmake ../geos -DGEOS_ENABLE_TESTS=OFF \ 12 | -DGEOS_ENABLE_INLINE=OFF \ 13 | -DGEOS_ENABLE_MACOSX_FRAMEWORK=ON \ 14 | -DGEOS_ENABLE_MACOSX_FRAMEWORK_UNIXCOMPAT=ON \ 15 | -DCMAKE_INSTALL_PREFIX=@rpath \ 16 | -DCMAKE_BUILD_TYPE=Release \ 17 | -DCMAKE_OSX_SYSROOT=${OSX_SDKROOT} \ 18 | -DCMAKE_C_COMPILER=$(xcrun --sdk macosx -f clang) \ 19 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk macosx -f clang++) \ 20 | -DCMAKE_LIBRARY_PATH=${OSX_SDKROOT}/lib/ \ 21 | -DCMAKE_INCLUDE_PATH=${OSX_SDKROOT}/include/ 22 | make 23 | popd 24 | 25 | mkdir -p geos-iphoneos 26 | pushd geos-iphoneos 27 | cmake ../geos -DGEOS_ENABLE_TESTS=OFF \ 28 | -DGEOS_ENABLE_INLINE=OFF \ 29 | -DGEOS_ENABLE_MACOSX_FRAMEWORK=ON \ 30 | -DGEOS_ENABLE_MACOSX_FRAMEWORK_UNIXCOMPAT=ON \ 31 | -DCMAKE_INSTALL_PREFIX=@rpath \ 32 | -DCMAKE_BUILD_TYPE=Release \ 33 | -DCMAKE_OSX_SYSROOT=${IOS_SDKROOT} \ 34 | -DCMAKE_C_COMPILER=$(xcrun --sdk iphoneos -f clang) \ 35 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk iphoneos -f clang++) \ 36 | -DCMAKE_C_FLAGS="-arch arm64 -target arm64-apple-darwin19.6.0 -O2 -miphoneos-version-min=14 " \ 37 | -DCMAKE_CXX_FLAGS="-arch arm64 -target arm64-apple-darwin19.6.0 -O2 -miphoneos-version-min=14 " \ 38 | -DCMAKE_LIBRARY_PATH=${IOS_SDKROOT}/lib/ \ 39 | -DCMAKE_INCLUDE_PATH=${IOS_SDKROOT}/include/ 40 | make 41 | popd 42 | 43 | mkdir -p geos-iphonesimulator 44 | pushd geos-iphonesimulator 45 | cmake ../geos -DGEOS_ENABLE_TESTS=OFF \ 46 | -DGEOS_ENABLE_INLINE=OFF \ 47 | -DGEOS_ENABLE_MACOSX_FRAMEWORK=ON \ 48 | -DGEOS_ENABLE_MACOSX_FRAMEWORK_UNIXCOMPAT=ON \ 49 | -DCMAKE_INSTALL_PREFIX=@rpath \ 50 | -DCMAKE_BUILD_TYPE=Release \ 51 | -DCMAKE_OSX_SYSROOT=${SIM_SDKROOT} \ 52 | -DCMAKE_C_COMPILER=$(xcrun --sdk iphonesimulator -f clang) \ 53 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk iphonesimulator -f clang++) \ 54 | -DCMAKE_C_FLAGS="-target x86_64-apple-darwin19.6.0 -O2 -mios-simulator-version-min=14.0 " \ 55 | -DCMAKE_CXX_FLAGS="-target x86_64-apple-darwin19.6.0 -O2 -mios-simulator-version-min=14.0 " \ 56 | -DCMAKE_LIBRARY_PATH=${SIM_SDKROOT}/lib/ \ 57 | -DCMAKE_INCLUDE_PATH=${SIM_SDKROOT}/include/ 58 | make 59 | popd 60 | 61 | # Now create frameworks: 62 | for platform in osx iphoneos iphonesimulator 63 | do 64 | for binary in libgeos_c libgeos 65 | do 66 | FRAMEWORK_DIR=build/Release-${platform}/${binary}.framework 67 | rm -rf ${FRAMEWORK_DIR} 68 | mkdir -p ${FRAMEWORK_DIR} 69 | mkdir -p ${FRAMEWORK_DIR}/Headers 70 | mkdir -p ${FRAMEWORK_DIR}/Headers/capi 71 | cp -R geos/include/* ${FRAMEWORK_DIR}/Headers 72 | cp geos-$platform/include/geos/* ${FRAMEWORK_DIR}/Headers/geos 73 | cp geos-$platform/capi/geos_c.h ${FRAMEWORK_DIR}/Headers/ 74 | cp geos-$platform/lib/$binary.dylib ${FRAMEWORK_DIR}/$binary 75 | install_name_tool -change @rpath/libgeos_c.1.dylib @rpath/libgeos_c.framework/libgeos_c ${FRAMEWORK_DIR}/$binary 76 | install_name_tool -change @rpath/libgeos.3.11.0.dylib @rpath/libgeos.framework/libgeos ${FRAMEWORK_DIR}/$binary 77 | if [ "$platform" == "iphoneos" ]; then 78 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 79 | elif [ "$platform" == "iphonesimulator" ]; then 80 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 81 | else 82 | cp basic_Info_OSX.plist ${FRAMEWORK_DIR}/Info.plist 83 | fi 84 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 85 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 86 | # underscore is not allowed in CFBundleIdentifier: 87 | signature=${binary//_/-} 88 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$signature ${FRAMEWORK_DIR}/Info.plist 89 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 90 | done 91 | done 92 | 93 | 94 | -------------------------------------------------------------------------------- /build_geos_fw.sh: -------------------------------------------------------------------------------- 1 | # Required with Xcode 12 beta: 2 | export M4=$(xcrun -f m4) 3 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 4 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 5 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 6 | BASE=$PWD 7 | # OSX 11: required to run gfortran 8 | if [ -z "${LIBRARY_PATH}" ]; then 9 | export LIBRARY_PATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" 10 | else 11 | export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" 12 | fi 13 | 14 | 15 | # 3 architectures framework 16 | for framework in libgeos libgeos_c 17 | do 18 | rm -rf $framework.xcframework 19 | xcodebuild -create-xcframework -framework build/Release-iphoneos/$framework.framework -framework build/Release-iphonesimulator/$framework.framework -framework build/Release-osx/$framework.framework -output $framework.xcframework 20 | done 21 | 22 | -------------------------------------------------------------------------------- /build_libffi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Currently, libffi and libzmq scripts produce static libraries. 4 | # libffi: 5 | export M4=$(xcrun -f m4) 6 | pushd libffi 7 | # we need to patch libffi to allow compilation with Xcode12, but only once: 8 | # patch -p1 < ../libffi.patch 9 | xcodebuild -project libffi.xcodeproj -target libffi-iOS -sdk iphoneos -arch arm64 -configuration Debug -quiet 10 | xcodebuild -project libffi.xcodeproj -target libffi-iOS -sdk iphonesimulator -arch x86_64 -configuration Debug -quiet 11 | # Python also need ffi_common.h and fficonfig.h 12 | cp build_iphoneos-arm64/fficonfig.h build/Debug-iphoneos/include/ffi/ 13 | cp include/ffi_common.h build/Debug-iphoneos/include/ffi/ 14 | cp build_iphonesimulator-x86_64/fficonfig.h build/Debug-iphonesimulator/include/ffi/ 15 | cp include/ffi_common.h build/Debug-iphonesimulator/include/ffi/ 16 | popd 17 | # then, merge them into XCframeworks: 18 | framework=libffi 19 | rm -rf $framework.xcframework 20 | xcodebuild -create-xcframework \ 21 | -library $framework/build/Debug-iphoneos/libffi.a -headers $framework/build/Debug-iphoneos/include \ 22 | -library $framework/build/Debug-iphonesimulator/libffi.a -headers $framework/build/Debug-iphonesimulator/include \ 23 | -output $framework.xcframework 24 | 25 | -------------------------------------------------------------------------------- /build_libheif.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required with Xcode 12 beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | SOURCE_DIR=libheif 10 | # libpng 11 | pushd $SOURCE_DIR 12 | 13 | # copy things in place: 14 | make distclean 15 | sh ./configure CC=clang CXX=clang++ \ 16 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 17 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 18 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 19 | libpng_CFLAGS="-I${PWD}/include_iphoneos" \ 20 | libpng_LIBS="-L${PWD}/lib_iphoneos -lpng" \ 21 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 22 | make -j4 23 | mkdir -p build-iphoneos 24 | mkdir -p build-iphoneos/include 25 | mkdir -p build-iphoneos/libxslt/include/libxslt/ 26 | mkdir -p build-iphoneos/libexslt/include/libexslt/ 27 | cp libxslt/.libs/libxslt.a build-iphoneos 28 | cp libexslt/.libs/libexslt.a build-iphoneos 29 | cp libxslt/*.h build-iphoneos/libxslt/include/libxslt/ 30 | cp libexslt/*.h build-iphoneos/libexslt/include/libexslt/ 31 | 32 | make distclean 33 | sh ./configure CC=clang CXX=clang++ \ 34 | CFLAGS="-arch x86_64 -miphonesimulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 35 | CPPFLAGS="-arch x86_64 -miphonesimulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 36 | CXXFLAGS="-arch x86_64 -miphonesimulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 37 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 38 | make -j4 39 | mkdir -p build-iphonesimulator 40 | mkdir -p build-iphonesimulator/include 41 | mkdir -p build-iphonesimulator/libxslt/include/libxslt/ 42 | mkdir -p build-iphonesimulator/libexslt/include/libexslt/ 43 | cp libxslt/.libs/libxslt.a build-iphonesimulator 44 | cp libexslt/.libs/libexslt.a build-iphonesimulator 45 | cp libxslt/*.h build-iphonesimulator/libxslt/include/libxslt/ 46 | cp libexslt/*.h build-iphonesimulator/libexslt/include/libexslt/ 47 | popd 48 | 49 | # then, merge them into XCframeworks: 50 | for framework in libxslt libexslt 51 | do 52 | rm -rf $framework.xcframework 53 | xcodebuild -create-xcframework \ 54 | -library $SOURCE_DIR/build-iphoneos/$framework.a -headers $SOURCE_DIR/build-iphoneos/$framework/include/ \ 55 | -library $SOURCE_DIR/build-iphonesimulator/$framework.a -headers $SOURCE_DIR/build-iphonesimulator/$framework/include/ \ 56 | -output $framework.xcframework 57 | done 58 | -------------------------------------------------------------------------------- /build_libjpg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required with Xcode 12 beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | curl -OL http://ijg.org/files/jpegsrc.v9d.tar.gz 10 | tar xzf jpegsrc.v9d.tar.gz 11 | rm jpegsrc.v9d.tar.gz 12 | 13 | SOURCE_DIR=jpeg-9d 14 | # libpng 15 | pushd $SOURCE_DIR 16 | make distclean 17 | ./configure CC=clang CXX=clang++ \ 18 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 19 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 20 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 21 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 22 | make -j4 --quiet 23 | mkdir -p build-iphoneos 24 | mkdir -p build-iphoneos/include 25 | cp .libs/libjpeg.a build-iphoneos 26 | cp j*.h build-iphoneos/include 27 | 28 | make distclean 29 | ./configure CC=clang CXX=clang++ \ 30 | CFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 31 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 32 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 33 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin cross_compiling=yes 34 | make -j4 --quiet 35 | mkdir -p build-iphonesimulator 36 | mkdir -p build-iphonesimulator/include 37 | cp .libs/libjpeg.a build-iphonesimulator 38 | cp j*.h build-iphonesimulator/include 39 | 40 | # Library is now in: .libs/libjpeg.a. Create xcframework: 41 | popd 42 | # then, merge them into XCframeworks: 43 | framework=libjpeg 44 | rm -rf $framework.xcframework 45 | xcodebuild -create-xcframework \ 46 | -library $SOURCE_DIR/build-iphoneos/libjpeg.a -headers $SOURCE_DIR/build-iphoneos/include \ 47 | -library $SOURCE_DIR/build-iphonesimulator/libjpeg.a -headers $SOURCE_DIR/build-iphonesimulator/include \ 48 | -output $framework.xcframework 49 | -------------------------------------------------------------------------------- /build_libpng.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required with Xcode 12 beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | curl -OL https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz 10 | tar xzf libpng-1.6.37.tar.gz 11 | rm libpng-1.6.37.tar.gz 12 | export DYLD_ROOT_PATH\=$(xcrun --sdk iphonesimulator --show-sdk-path) 13 | 14 | # libpng 15 | pushd libpng-1.6.37 16 | make distclean 17 | ./configure CC=clang CXX=clang++ \ 18 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 19 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 20 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 21 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 22 | make -j4 --quiet 23 | # We're going to need them: 24 | mkdir -p ../libheif/lib_iphoneos 25 | mkdir -p ../libheif/include_iphoneos 26 | cp .libs/libpng16.16.dylib ../libheif/lib_iphoneos/libpng.dylib 27 | cp png.h pnglibconf.h pngconf.h ../libheif/include_iphoneos/ 28 | # Library is now in: .libs/libpng16.16.dylib. Create framework: 29 | popd 30 | binary=libpng 31 | FRAMEWORK_DIR=build/Release-iphoneos/$binary.framework 32 | rm -rf ${FRAMEWORK_DIR} 33 | mkdir -p ${FRAMEWORK_DIR} 34 | mkdir -p ${FRAMEWORK_DIR}/Headers 35 | cp libpng-1.6.37/png.h ${FRAMEWORK_DIR}/Headers 36 | cp libpng-1.6.37/pnglibconf.h ${FRAMEWORK_DIR}/Headers 37 | cp libpng-1.6.37/pngconf.h ${FRAMEWORK_DIR}/Headers 38 | cp libpng-1.6.37/.libs/libpng16.16.dylib ${FRAMEWORK_DIR}/$binary 39 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 40 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 41 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 42 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 43 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 44 | pushd libpng-1.6.37 45 | make distclean 46 | ./configure CC=clang CXX=clang++ \ 47 | CFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 48 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 49 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 50 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin cross_compiling=yes 51 | make -j4 --quiet 52 | # We're going to need them: 53 | mkdir -p ../libheif/lib_iphonesimulator 54 | mkdir -p ../libheif/include_iphonesimulator 55 | cp .libs/libpng16.16.dylib ../libheif/lib_iphonesimulator/libpng.dylib 56 | cp png.h pnglibconf.h pngconf.h ../libheif/include_iphonesimulator/ 57 | popd 58 | FRAMEWORK_DIR=build/Release-iphonesimulator/$binary.framework 59 | rm -rf ${FRAMEWORK_DIR} 60 | mkdir -p ${FRAMEWORK_DIR} 61 | mkdir -p ${FRAMEWORK_DIR}/Headers 62 | cp libpng-1.6.37/png.h ${FRAMEWORK_DIR}/Headers 63 | cp libpng-1.6.37/pnglibconf.h ${FRAMEWORK_DIR}/Headers 64 | cp libpng-1.6.37/pngconf.h ${FRAMEWORK_DIR}/Headers 65 | cp libpng-1.6.37/.libs/libpng16.16.dylib ${FRAMEWORK_DIR}/$binary 66 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 67 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 68 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 69 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 70 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 71 | 72 | 73 | -------------------------------------------------------------------------------- /build_libspatialindex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # M4 Required with Xcode beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | mkdir -p libspatialindex-osx 10 | pushd libspatialindex-osx 11 | cmake ../libspatialindex \ 12 | -DCMAKE_INSTALL_PREFIX=@rpath \ 13 | -DCMAKE_BUILD_TYPE=Release \ 14 | -DCMAKE_OSX_SYSROOT=${OSX_SDKROOT} \ 15 | -DCMAKE_C_COMPILER=$(xcrun --sdk macosx -f clang) \ 16 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk macosx -f clang++) \ 17 | -DCMAKE_LIBRARY_PATH=${OSX_SDKROOT}/lib/ \ 18 | -DCMAKE_INCLUDE_PATH=${OSX_SDKROOT}/include/ 19 | make 20 | popd 21 | 22 | mkdir -p libspatialindex-iphoneos 23 | pushd libspatialindex-iphoneos 24 | cmake ../libspatialindex \ 25 | -DCMAKE_INSTALL_PREFIX=@rpath \ 26 | -DCMAKE_BUILD_TYPE=Release \ 27 | -DCMAKE_OSX_SYSROOT=${IOS_SDKROOT} \ 28 | -DCMAKE_C_COMPILER=$(xcrun --sdk iphoneos -f clang) \ 29 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk iphoneos -f clang++) \ 30 | -DCMAKE_C_FLAGS="-arch arm64 -target arm64-apple-darwin19.6.0 -O2 -miphoneos-version-min=14 " \ 31 | -DCMAKE_CXX_FLAGS="-arch arm64 -target arm64-apple-darwin19.6.0 -O2 -miphoneos-version-min=14 " \ 32 | -DCMAKE_LIBRARY_PATH=${IOS_SDKROOT}/lib/ \ 33 | -DCMAKE_INCLUDE_PATH=${IOS_SDKROOT}/include/ 34 | make 35 | popd 36 | 37 | mkdir -p libspatialindex-iphonesimulator 38 | pushd libspatialindex-iphonesimulator 39 | cmake ../libspatialindex \ 40 | -DCMAKE_INSTALL_PREFIX=@rpath \ 41 | -DCMAKE_BUILD_TYPE=Release \ 42 | -DCMAKE_OSX_SYSROOT=${SIM_SDKROOT} \ 43 | -DCMAKE_C_COMPILER=$(xcrun --sdk iphonesimulator -f clang) \ 44 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk iphonesimulator -f clang++) \ 45 | -DCMAKE_C_FLAGS="-target x86_64-apple-darwin19.6.0 -O2 -mios-simulator-version-min=14.0 " \ 46 | -DCMAKE_CXX_FLAGS="-target x86_64-apple-darwin19.6.0 -O2 -mios-simulator-version-min=14.0 " \ 47 | -DCMAKE_LIBRARY_PATH=${SIM_SDKROOT}/lib/ \ 48 | -DCMAKE_INCLUDE_PATH=${SIM_SDKROOT}/include/ 49 | make 50 | popd 51 | 52 | # Now create frameworks: 53 | for platform in osx iphoneos iphonesimulator 54 | do 55 | for binary in libspatialindex_c libspatialindex 56 | do 57 | FRAMEWORK_DIR=build/Release-${platform}/${binary}.framework 58 | rm -rf ${FRAMEWORK_DIR} 59 | mkdir -p ${FRAMEWORK_DIR} 60 | mkdir -p ${FRAMEWORK_DIR}/Headers 61 | cp -R libspatialindex/include/* ${FRAMEWORK_DIR}/Headers 62 | cp libspatialindex-$platform/bin/$binary.dylib ${FRAMEWORK_DIR}/$binary 63 | install_name_tool -change @rpath/libspatialindex_c.6.dylib @rpath/libspatialindex_c.framework/libspatialindex_c ${FRAMEWORK_DIR}/$binary 64 | install_name_tool -change @rpath/libspatialindex.6.dylib @rpath/libspatialindex.framework/libspatialindex ${FRAMEWORK_DIR}/$binary 65 | if [ "$platform" == "iphoneos" ]; then 66 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 67 | elif [ "$platform" == "iphonesimulator" ]; then 68 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 69 | else 70 | cp basic_Info_OSX.plist ${FRAMEWORK_DIR}/Info.plist 71 | fi 72 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 73 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 74 | # underscore is not allowed in CFBundleIdentifier: 75 | signature=${binary//_/-} 76 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$signature ${FRAMEWORK_DIR}/Info.plist 77 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 78 | done 79 | done 80 | 81 | 82 | -------------------------------------------------------------------------------- /build_libtiff.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required with Xcode 12 beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | curl -OL http://download.osgeo.org/libtiff/tiff-4.1.0.zip 10 | unzip -o tiff-4.1.0.zip 11 | rm tiff-4.1.0.zip 12 | 13 | SOURCE_DIR=tiff-4.1.0 14 | # libpng 15 | pushd $SOURCE_DIR 16 | make distclean 17 | ./configure CC=clang CXX=clang++ \ 18 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 19 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 20 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 21 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 22 | make -j4 --quiet 23 | mkdir -p build-iphoneos 24 | mkdir -p build-iphoneos/include 25 | cp libtiff/.libs/libtiff.a build-iphoneos 26 | cp libtiff/tiff.h libtiff/tiffio.h libtiff/tiffvers.h libtiff/tiffio.hxx libtiff/tiffconf.h build-iphoneos/include 27 | 28 | make distclean 29 | ./configure CC=clang CXX=clang++ \ 30 | CFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 31 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 32 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 33 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin cross_compiling=yes 34 | make -j4 --quiet 35 | mkdir -p build-iphonesimulator 36 | mkdir -p build-iphonesimulator/include 37 | cp libtiff/.libs/libtiff.a build-iphonesimulator 38 | cp libtiff/tiff.h libtiff/tiffio.h libtiff/tiffvers.h libtiff/tiffio.hxx libtiff/tiffconf.h build-iphonesimulator/include 39 | popd 40 | 41 | # then, merge them into XCframeworks: 42 | framework=libtiff 43 | rm -rf $framework.xcframework 44 | xcodebuild -create-xcframework \ 45 | -library $SOURCE_DIR/build-iphoneos/libtiff.a -headers $SOURCE_DIR/build-iphoneos/include \ 46 | -library $SOURCE_DIR/build-iphonesimulator/libtiff.a -headers $SOURCE_DIR/build-iphonesimulator/include \ 47 | -output $framework.xcframework 48 | -------------------------------------------------------------------------------- /build_libxslt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required with Xcode 12 beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | SOURCE_DIR=libxslt 10 | # libpng 11 | pushd $SOURCE_DIR 12 | make distclean 13 | sh ./configure CC=clang CXX=clang++ \ 14 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 15 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 16 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 17 | EXSLT_LIBS="-lexslt -lxslt -L${IOS_SDKROOT}/usr/lib -lxml2 -lz -lpthread -licucore -lm" \ 18 | LIBXML_CFLAGS="-I ${IOS_SDKROOT}/usr/include" \ 19 | LIBXML_LIBS=" -L${IOS_SDKROOT}/usr/lib -lxml2 -lz -lpthread -licucore -lm" \ 20 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 21 | make -j4 22 | mkdir -p build-iphoneos 23 | mkdir -p build-iphoneos/include 24 | mkdir -p build-iphoneos/libxslt/include/libxslt/ 25 | mkdir -p build-iphoneos/libexslt/include/libexslt/ 26 | cp libxslt/.libs/libxslt.a build-iphoneos 27 | cp libexslt/.libs/libexslt.a build-iphoneos 28 | cp libxslt/*.h build-iphoneos/libxslt/include/libxslt/ 29 | cp libexslt/*.h build-iphoneos/libexslt/include/libexslt/ 30 | 31 | make distclean 32 | sh ./configure CC=clang CXX=clang++ \ 33 | CFLAGS="-arch x86_64 -miphonesimulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 34 | CPPFLAGS="-arch x86_64 -miphonesimulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 35 | CXXFLAGS="-arch x86_64 -miphonesimulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 36 | EXSLT_LIBS="-lexslt -lxslt -L${SIM_SDKROOT}/usr/lib -lxml2 -lz -lpthread -licucore -lm" \ 37 | LIBXML_CFLAGS="-I ${SIM_SDKROOT}/usr/include" \ 38 | LIBXML_LIBS=" -L${SIM_SDKROOT}/usr/lib -lxml2 -lz -lpthread -licucore -lm" \ 39 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 40 | make -j4 41 | mkdir -p build-iphonesimulator 42 | mkdir -p build-iphonesimulator/include 43 | mkdir -p build-iphonesimulator/libxslt/include/libxslt/ 44 | mkdir -p build-iphonesimulator/libexslt/include/libexslt/ 45 | cp libxslt/.libs/libxslt.a build-iphonesimulator 46 | cp libexslt/.libs/libexslt.a build-iphonesimulator 47 | cp libxslt/*.h build-iphonesimulator/libxslt/include/libxslt/ 48 | cp libexslt/*.h build-iphonesimulator/libexslt/include/libexslt/ 49 | popd 50 | 51 | # then, merge them into XCframeworks: 52 | for framework in libxslt libexslt 53 | do 54 | rm -rf $framework.xcframework 55 | xcodebuild -create-xcframework \ 56 | -library $SOURCE_DIR/build-iphoneos/$framework.a -headers $SOURCE_DIR/build-iphoneos/$framework/include/ \ 57 | -library $SOURCE_DIR/build-iphonesimulator/$framework.a -headers $SOURCE_DIR/build-iphonesimulator/$framework/include/ \ 58 | -output $framework.xcframework 59 | done 60 | -------------------------------------------------------------------------------- /build_libzma.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required with Xcode 12 beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | # curl -OL https://tukaani.org/xz/xz-5.2.5.tar.gz 10 | # tar xzf xz-5.2.5.tar.gz 11 | # rm xz-5.2.5.tar.gz 12 | 13 | SOURCE_DIR=xz-5.2.5 14 | # libpng 15 | pushd $SOURCE_DIR 16 | make distclean 17 | ./configure CC=clang CXX=clang++ \ 18 | CFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 19 | CPPFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 20 | CXXFLAGS="-arch arm64 -miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -fembed-bitcode" \ 21 | --build=x86_64-apple-darwin --host=armv8-apple-darwin cross_compiling=yes 22 | make -j4 --quiet 23 | mkdir -p build-iphoneos 24 | mkdir -p build-iphoneos/include 25 | cp src/liblzma/.libs/liblzma.a build-iphoneos 26 | cp -r src/liblzma/api/* build-iphoneos/include 27 | 28 | make distclean 29 | ./configure CC=clang CXX=clang++ \ 30 | CFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 31 | CPPFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 32 | CXXFLAGS="-arch x86_64 -mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -fembed-bitcode" \ 33 | --build=x86_64-apple-darwin --host=x86_64-apple-darwin cross_compiling=yes 34 | make -j4 --quiet 35 | mkdir -p build-iphonesimulator 36 | mkdir -p build-iphonesimulator/include 37 | cp src/liblzma/.libs/liblzma.a build-iphonesimulator 38 | cp -r src/liblzma/api/* build-iphonesimulator/include 39 | 40 | # Library is now in: .libs/liblzma.a. Create xcframework: 41 | popd 42 | # then, merge them into XCframeworks: 43 | framework=liblzma 44 | rm -rf $framework.xcframework 45 | xcodebuild -create-xcframework \ 46 | -library $SOURCE_DIR/build-iphoneos/liblzma.a -headers $SOURCE_DIR/build-iphoneos/include \ 47 | -library $SOURCE_DIR/build-iphonesimulator/liblzma.a -headers $SOURCE_DIR/build-iphonesimulator/include \ 48 | -output $framework.xcframework 49 | -------------------------------------------------------------------------------- /build_libzmq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # libzmq: 4 | # create the static libraries 5 | export M4=$(xcrun -f m4) 6 | pushd libzmq 7 | make distclean 8 | sh builds/ios/build_ios.sh 9 | popd 10 | # then, merge them into XCframeworks: 11 | framework=libzmq 12 | rm -rf $framework.xcframework 13 | xcodebuild -create-xcframework \ 14 | -library $framework/builds/ios/libzmq_build/arm64/lib/libzmq.a -headers $framework/builds/ios/libzmq_build/arm64/include \ 15 | -library $framework/builds/ios/libzmq_build/x86_64/lib/libzmq.a -headers $framework/builds/ios/libzmq_build/x86_64/include \ 16 | -output $framework.xcframework 17 | 18 | 19 | -------------------------------------------------------------------------------- /build_openblas.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required with Xcode 12 beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | # Set to 1 if you have gfortran for arm64 installed. gfortran support is highly experimental. 10 | # You might need to edit the script as well. 11 | USE_FORTRAN=0 12 | if [ -e "/usr/local/aarch64-apple-darwin20/lib/libgfortran.dylib" ];then 13 | USE_FORTRAN=1 14 | fi 15 | # OSX 11: required for many things 16 | if [ -z "${LIBRARY_PATH}" ]; then 17 | export LIBRARY_PATH="/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/lib" 18 | else 19 | export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" 20 | fi 21 | 22 | # Using Xcode to create frameworks from archived libraries (lib.a) is failing randomly. 23 | # We stick to creating frameworks from dynamic libraries. 24 | # We currently have a fortran compiler for iOS (experimental, gfortran) and OSX (gfortran), 25 | # but not yet for the simulator, so the simulator is built with NOFORTRAN. 26 | 27 | # We have modified (slightly) Makefile and Makefile.system 28 | pushd OpenBLAS 29 | # Having the exact same script inside Xcode does not work. Strange but true. 30 | # iphoneos: 31 | if [ $USE_FORTRAN == 0 ]; 32 | then 33 | make TARGET=ARMV8 BINARY=64 \ 34 | HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 35 | CC="clang" \ 36 | CFLAGS="-miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -arch arm64 -fembed-bitcode" \ 37 | NOFORTRAN=1 \ 38 | AR="$(xcrun -f ar)" clean 39 | make TARGET=ARMV8 BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 40 | CC="clang" \ 41 | CFLAGS="-miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -arch arm64 -fembed-bitcode" \ 42 | NOFORTRAN=1 \ 43 | AR="$(xcrun -f ar)" libs shared 44 | else 45 | make TARGET=ARMV8 BINARY=64 \ 46 | HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 47 | CC="clang" \ 48 | CFLAGS="-miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -arch arm64 -fembed-bitcode" \ 49 | AR="$(xcrun -f ar)" clean 50 | make TARGET=ARMV8 BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 51 | CC="clang" \ 52 | CFLAGS="-miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -arch arm64 -fembed-bitcode" \ 53 | FC="/usr/local/bin/aarch64-apple-darwin20-gfortran" \ 54 | LDFLAGS="-miphoneos-version-min=11.0 -arch arm64 " \ 55 | FFLAGS="-miphoneos-version-min=11.0 -arch arm64 -Wa,-miphoneos-version-min=11.0 -Wl,-platform_version -Wl,ios -Wl,14.0.0 -Wl,16.4" \ 56 | ASFLAGS="-miphoneos-version-min=11.0 -arch arm64" \ 57 | AR="$(xcrun -f ar)" all 58 | # gemm_tcopy.S and gemm_ncopy.S both create issues. Commented out in KERNEL.ARMV8. 59 | # same with sgemm_tcopy (scikit-learn) and presumably sgemm_ncopy. Commented out. 60 | # What if you don't give a target? (no assembly code, obviously). 61 | # make has created the libopenblas....dylib with no platform. Let's do it: 62 | pushd exports 63 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -dynamic -dylib -arch arm64 -dylib_install_name /Users/holzschu/src/Xcode_iPad/Python-aux/OpenBLAS/exports/../libopenblas.0.dylib -all_load -headerpad_max_install_names -weak_reference_mismatches non-weak -o ../libopenblas_armv8p-r0.3.13.dev.dylib -L/usr/local/lib/gcc/aarch64-apple-darwin20/10.2.1 -L/usr/local/lib/gcc/aarch64-apple-darwin20/10.2.1/../../../../aarch64-apple-darwin20/lib -L/usr/local/lib/gcc/aarch64-apple-darwin20/10.2.1 -L/usr/local/lib/gcc/aarch64-apple-darwin20/10.2.1/../../../../aarch64-apple-darwin20/lib -L/usr/local/lib/gcc/aarch64-apple-darwin20/10.2.1 -L/usr/local/lib/gcc/aarch64-apple-darwin20/10.2.1/../../../../aarch64-apple-darwin20/lib ../libopenblas_armv8p-r0.3.13.dev.a -exported_symbols_list osx.def -lSystem -lgfortran -lemutls_w -lemutls_w -lSystem -lgfortran -lemutls_w -lemutls_w -lSystem -lgfortran -lemutls_w -lgcc -lm -lemutls_w -lgcc -lSystem -lgcc -platform_version ios 11.0 11.0 64 | popd 65 | fi 66 | 67 | mkdir -p build-iphoneos 68 | cp libopenblas_armv8p-r0.3.13.dev.a build-iphoneos/libopenblas.a 69 | cp libopenblas_armv8p-r0.3.13.dev.dylib build-iphoneos/libopenblas.dylib 70 | # for the headers: 71 | make BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" CC="clang" CFLAGS="-miphoneos-version-min=11.0 -isysroot ${IOS_SDKROOT} -arch arm64 -fembed-bitcode" install PREFIX=./install 72 | # simulator 73 | make BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 74 | CC="clang" \ 75 | CFLAGS="-mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -arch x86_64 -fembed-bitcode" \ 76 | NOFORTRAN=1 clean 77 | make BINARY=64 HOSTCC="clang -isysroot${OSX_SDKROOT}" \ 78 | CC="clang" \ 79 | CFLAGS="-mios-simulator-version-min=11.0 -isysroot ${SIM_SDKROOT} -arch x86_64 -fembed-bitcode" \ 80 | NOFORTRAN=1 libs shared 81 | mkdir -p build-iphonesimulator 82 | cp libopenblas_haswellp-r0.3.13.dev.a build-iphonesimulator/libopenblas.a 83 | cp libopenblas_haswellp-r0.3.13.dev.dylib build-iphonesimulator/libopenblas.dylib 84 | # OSX: 85 | if [ $USE_FORTRAN == 0 ]; 86 | then 87 | make BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 88 | CC="clang" CFLAGS="-isysroot${OSX_SDKROOT} -fembed-bitcode" \ 89 | AR="$(xcrun -f ar)" NOFORTRAN=1 clean 90 | make BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 91 | CC="clang" CFLAGS="-isysroot${OSX_SDKROOT} -fembed-bitcode -mmacosx-version-min=10.15" \ 92 | AR="$(xcrun -f ar)" NOFORTRAN=1 all 93 | else 94 | make BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 95 | CC="clang" CFLAGS="-isysroot${OSX_SDKROOT} -fembed-bitcode" \ 96 | AR="$(xcrun -f ar)" clean 97 | make BINARY=64 HOSTCC="clang -isysroot ${OSX_SDKROOT}" \ 98 | CC="clang" CFLAGS="-isysroot${OSX_SDKROOT} -fembed-bitcode -mmacosx-version-min=10.15" \ 99 | AR="$(xcrun -f ar)" all 100 | fi 101 | mkdir -p build-osx 102 | cp libopenblas_skylakexp-r0.3.13.dev.a build-osx/libopenblas.a 103 | cp libopenblas_skylakexp-r0.3.13.dev.dylib build-osx/libopenblas.dylib 104 | popd 105 | 106 | binary=openblas 107 | FRAMEWORK_DIR=build/Release-iphoneos/$binary.framework 108 | rm -rf ${FRAMEWORK_DIR} 109 | mkdir -p ${FRAMEWORK_DIR} 110 | mkdir -p ${FRAMEWORK_DIR}/Headers 111 | cp OpenBLAS/install/include/*.h ${FRAMEWORK_DIR}/Headers 112 | cp OpenBLAS/build-iphoneos/libopenblas.dylib ${FRAMEWORK_DIR}/$binary 113 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 114 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 115 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 116 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 117 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 118 | 119 | FRAMEWORK_DIR=build/Release-iphonesimulator/$binary.framework 120 | rm -rf ${FRAMEWORK_DIR} 121 | mkdir -p ${FRAMEWORK_DIR} 122 | mkdir -p ${FRAMEWORK_DIR}/Headers 123 | cp OpenBLAS/install/include/*.h ${FRAMEWORK_DIR}/Headers 124 | cp OpenBLAS/build-iphonesimulator/libopenblas.dylib ${FRAMEWORK_DIR}/$binary 125 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 126 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 127 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 128 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 129 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 130 | 131 | FRAMEWORK_DIR=build/Release-osx/$binary.framework 132 | rm -rf ${FRAMEWORK_DIR} 133 | mkdir -p ${FRAMEWORK_DIR} 134 | mkdir -p ${FRAMEWORK_DIR}/Headers 135 | cp OpenBLAS/install/include/*.h ${FRAMEWORK_DIR}/Headers 136 | cp OpenBLAS/build-osx/libopenblas.dylib ${FRAMEWORK_DIR}/$binary 137 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 138 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 139 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 140 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 141 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 142 | 143 | 144 | -------------------------------------------------------------------------------- /build_openssl.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | rm -rf openssl-1.1.1i 4 | curl -OL https://www.openssl.org/source/openssl-1.1.1i.tar.gz 5 | tar xvzf openssl-1.1.1i.tar.gz 6 | rm openssl-1.1.1i.tar.gz 7 | 8 | pushd openssl-1.1.1i 9 | 10 | make distclean 11 | ./Configure ios64-xcrun 12 | make 13 | rm -rf build_iphoneos 14 | mkdir -p build_iphoneos 15 | mv libcrypto.a build_iphoneos 16 | mv libcrypto.dylib build_iphoneos 17 | mv libssl.a build_iphoneos 18 | mv libssl.dylib build_iphoneos 19 | cp -r include build_iphoneos 20 | 21 | make distclean 22 | ./Configure iossimulator-xcrun 23 | make 24 | rm -rf build_iphonesimulator 25 | mkdir -p build_iphonesimulator 26 | mv libcrypto.a build_iphonesimulator 27 | mv libcrypto.dylib build_iphonesimulator 28 | mv libssl.a build_iphonesimulator 29 | mv libssl.dylib build_iphonesimulator 30 | cp -r include build_iphonesimulator 31 | 32 | popd 33 | 34 | # Create (static) xcframeworks, distribute. 35 | # then, merge them into XCframeworks: 36 | framework=openssl 37 | rm -rf $framework.xcframework 38 | xcodebuild -create-xcframework \ 39 | -library openssl-1.1.1i/build_iphoneos/libssl.a -headers openssl-1.1.1i/build_iphoneos/include/openssl \ 40 | -library openssl-1.1.1i/build_iphonesimulator/libssl.a -headers openssl-1.1.1i/build_iphonesimulator/include/openssl \ 41 | -output $framework.xcframework 42 | 43 | framework=crypto 44 | rm -rf $framework.xcframework 45 | xcodebuild -create-xcframework \ 46 | -library openssl-1.1.1i/build_iphoneos/libcrypto.a -headers openssl-1.1.1i/build_iphoneos/include/crypto \ 47 | -library openssl-1.1.1i/build_iphonesimulator/libcrypto.a -headers openssl-1.1.1i/build_iphonesimulator/include/crypto \ 48 | -output $framework.xcframework 49 | 50 | -------------------------------------------------------------------------------- /build_proj.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # M4 Required with Xcode beta: 4 | export M4=$(xcrun -f m4) 5 | OSX_SDKROOT=$(xcrun --sdk macosx --show-sdk-path) 6 | IOS_SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) 7 | SIM_SDKROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) 8 | 9 | export OSX_VERSION=11.5 10 | export MACOSX_DEPLOYMENT_TARGET=$OSX_VERSION 11 | 12 | # curl -OL https://download.osgeo.org/proj/proj-9.1.0.tar.gz 13 | # tar xzf proj-9.1.0.tar.gz 14 | # rm proj-9.1.0.tar.gz 15 | source_dir=proj-9.1.0 16 | 17 | # proj dos not use SYSROOT or CFLAGS with cmake, so we use configure 18 | 19 | mkdir -p proj-osx 20 | pushd proj-osx 21 | cmake ../$source_dir \ 22 | -DENABLE_CURL=OFF -DENABLE_TIFF=OFF -DBUILD_TESTING=OFF -DBUILD_PROJSYNC=OFF \ 23 | -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_VERSION} \ 24 | -DCMAKE_INSTALL_PREFIX=@rpath \ 25 | -DCMAKE_BUILD_TYPE=Release \ 26 | -DCMAKE_OSX_SYSROOT=${OSX_SDKROOT} \ 27 | -DCMAKE_C_COMPILER=$(xcrun --sdk macosx -f clang) \ 28 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk macosx -f clang++) \ 29 | -DCMAKE_LIBRARY_PATH=${OSX_SDKROOT}/lib/ \ 30 | -DCMAKE_INCLUDE_PATH=${OSX_SDKROOT}/include/ 31 | make 32 | popd 33 | 34 | mkdir -p proj-iphoneos 35 | pushd proj-iphoneos 36 | cmake ../$source_dir \ 37 | -DENABLE_CURL=OFF -DENABLE_TIFF=OFF -DBUILD_TESTING=OFF -DBUILD_PROJSYNC=OFF \ 38 | -DCMAKE_INSTALL_PREFIX=@rpath \ 39 | -DCMAKE_BUILD_TYPE=Release \ 40 | -DCMAKE_OSX_SYSROOT=${IOS_SDKROOT} \ 41 | -DCMAKE_C_COMPILER=$(xcrun --sdk iphoneos -f clang) \ 42 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk iphoneos -f clang++) \ 43 | -DCMAKE_C_FLAGS="-arch arm64 -target arm64-apple-darwin19.6.0 -O2 -miphoneos-version-min=14 " \ 44 | -DCMAKE_CXX_FLAGS="-arch arm64 -target arm64-apple-darwin19.6.0 -O2 -miphoneos-version-min=14 " \ 45 | -DCMAKE_LIBRARY_PATH=${IOS_SDKROOT}/lib/ \ 46 | -DCMAKE_INCLUDE_PATH=${IOS_SDKROOT}/include/ 47 | make 48 | popd 49 | 50 | mkdir -p proj-iphonesimulator 51 | pushd proj-iphonesimulator 52 | cmake ../$source_dir \ 53 | -DENABLE_CURL=OFF -DENABLE_TIFF=OFF -DBUILD_TESTING=OFF -DBUILD_PROJSYNC=OFF \ 54 | -DCMAKE_INSTALL_PREFIX=@rpath \ 55 | -DCMAKE_BUILD_TYPE=Release \ 56 | -DCMAKE_OSX_SYSROOT=${SIM_SDKROOT} \ 57 | -DCMAKE_C_COMPILER=$(xcrun --sdk iphonesimulator -f clang) \ 58 | -DCMAKE_CXX_COMPILER=$(xcrun --sdk iphonesimulator -f clang++) \ 59 | -DCMAKE_C_FLAGS="-target x86_64-apple-darwin19.6.0 -O2 -mios-simulator-version-min=14.0 " \ 60 | -DCMAKE_CXX_FLAGS="-target x86_64-apple-darwin19.6.0 -O2 -mios-simulator-version-min=14.0 " \ 61 | -DCMAKE_LIBRARY_PATH=${SIM_SDKROOT}/lib/ \ 62 | -DCMAKE_INCLUDE_PATH=${SIM_SDKROOT}/include/ 63 | make 64 | popd 65 | 66 | # Now create frameworks: 67 | for platform in osx iphoneos iphonesimulator 68 | do 69 | for binary in libproj 70 | do 71 | FRAMEWORK_DIR=build/Release-${platform}/${binary}.framework 72 | rm -rf ${FRAMEWORK_DIR} 73 | mkdir -p ${FRAMEWORK_DIR} 74 | mkdir -p ${FRAMEWORK_DIR}/Headers 75 | cp -r $source_dir/include/proj ${FRAMEWORK_DIR}/Headers 76 | cp $source_dir/src/*.h ${FRAMEWORK_DIR}/Headers 77 | cp proj-$platform/src/proj_config.h ${FRAMEWORK_DIR}/Headers/proj/ 78 | cp proj-$platform/lib/$binary.dylib ${FRAMEWORK_DIR}/$binary 79 | install_name_tool -change @rpath/libproj.22.dylib @rpath/libproj.framework/libproj ${FRAMEWORK_DIR}/$binary 80 | if [ "$platform" == "iphoneos" ]; then 81 | cp basic_Info.plist ${FRAMEWORK_DIR}/Info.plist 82 | elif [ "$platform" == "iphonesimulator" ]; then 83 | cp basic_Info_Simulator.plist ${FRAMEWORK_DIR}/Info.plist 84 | else 85 | cp basic_Info_OSX.plist ${FRAMEWORK_DIR}/Info.plist 86 | fi 87 | plutil -replace CFBundleExecutable -string $binary ${FRAMEWORK_DIR}/Info.plist 88 | plutil -replace CFBundleName -string $binary ${FRAMEWORK_DIR}/Info.plist 89 | plutil -replace CFBundleIdentifier -string Nicolas-Holzschuch.$binary ${FRAMEWORK_DIR}/Info.plist 90 | install_name_tool -id @rpath/$binary.framework/$binary ${FRAMEWORK_DIR}/$binary 91 | done 92 | done 93 | 94 | 95 | -------------------------------------------------------------------------------- /compute_checksums.sh: -------------------------------------------------------------------------------- 1 | for framework in libpng \ 2 | libffi \ 3 | libzmq \ 4 | openblas \ 5 | freetype \ 6 | harfbuzz \ 7 | crypto \ 8 | openssl \ 9 | libjpeg \ 10 | libtiff \ 11 | libxslt \ 12 | libexslt \ 13 | libfftw3 \ 14 | libfftw3_threads \ 15 | libspatialindex_c \ 16 | libspatialindex \ 17 | libgdal \ 18 | libproj \ 19 | libgeos_c \ 20 | libgeos \ 21 | liblzma 22 | do 23 | echo $framework 24 | rm -f $framework.xcframework.zip 25 | zip -rq $framework.xcframework.zip $framework.xcframework 26 | swift package compute-checksum $framework.xcframework.zip 27 | done 28 | 29 | 30 | -------------------------------------------------------------------------------- /create_xcframeworks.sh: -------------------------------------------------------------------------------- 1 | # 2 architectures framework 2 | for framework in libpng freetype harfbuzz 3 | do 4 | rm -rf $framework.xcframework 5 | xcodebuild -create-xcframework -framework build/Release-iphoneos/$framework.framework -framework build/Release-iphonesimulator/$framework.framework -output $framework.xcframework 6 | done 7 | 8 | # 3 architectures framework 9 | for framework in openblas libgeos libgeos_c libproj libgdal libspatialindex libspatialindex_c 10 | do 11 | rm -rf $framework.xcframework 12 | xcodebuild -create-xcframework -framework build/Release-iphoneos/$framework.framework -framework build/Release-iphonesimulator/$framework.framework -framework build/Release-osx/$framework.framework -output $framework.xcframework 13 | done 14 | 15 | 16 | -------------------------------------------------------------------------------- /libffi.patch: -------------------------------------------------------------------------------- 1 | diff -Naurbw libffi/libffi.xcodeproj/project.pbxproj libffi_patched/libffi.xcodeproj/project.pbxproj 2 | --- libffi/libffi.xcodeproj/project.pbxproj 2020-07-10 18:54:35.000000000 +0200 3 | +++ libffi_patched/libffi.xcodeproj/project.pbxproj 2020-07-10 18:57:12.000000000 +0200 4 | @@ -433,6 +433,7 @@ 5 | developmentRegion = English; 6 | hasScannedForEncodings = 0; 7 | knownRegions = ( 8 | + English, 9 | en, 10 | ); 11 | mainGroup = DB13B15B1849DEB70010F42D; 12 | @@ -662,7 +663,7 @@ 13 | "$(inherited)", 14 | darwin_ios/include, 15 | ); 16 | - IPHONEOS_DEPLOYMENT_TARGET = 8.0; 17 | + IPHONEOS_DEPLOYMENT_TARGET = 9.0; 18 | PRODUCT_NAME = ffi; 19 | SDKROOT = iphoneos; 20 | SKIP_INSTALL = YES; 21 | @@ -695,7 +696,7 @@ 22 | "$(inherited)", 23 | darwin_ios/include, 24 | ); 25 | - IPHONEOS_DEPLOYMENT_TARGET = 8.0; 26 | + IPHONEOS_DEPLOYMENT_TARGET = 9.0; 27 | PRODUCT_NAME = ffi; 28 | SDKROOT = iphoneos; 29 | SKIP_INSTALL = YES; 30 | --------------------------------------------------------------------------------