Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
18c3d8b
initial ios junk
Jun 13, 2022
cbdd54e
i hate apple
Jun 13, 2022
5cc6089
squash
Jun 13, 2022
4b54f72
Revert "squash"
Jun 13, 2022
76eeddc
squash
Jun 13, 2022
e56eef1
squash
Jun 14, 2022
0cad6e9
it actually start to build omg
Jun 14, 2022
1da239f
squash
Jun 14, 2022
2b9e2e7
remove submodule
Jun 14, 2022
17e5ed8
squash
Jun 14, 2022
5a7fa2a
tmp
Jun 14, 2022
e3aa9e8
OH MY FUCKING SWEET BABY JESUS SON OF THE VIRGIN MARY IT FUCKING COMP…
Jun 15, 2022
02d4f78
cleanups
Jun 15, 2022
a793057
add iphone to ci
Jun 15, 2022
e5496a1
all the stuff for the ci pipeline, probably
Jun 15, 2022
e343417
squashme
Jun 15, 2022
0c55630
squashme
Jun 15, 2022
aee7296
format
Jun 15, 2022
8d5ae38
WITH_ to USE_
Jun 15, 2022
9af52af
squashme
Jun 15, 2022
acf8a07
submodule
Jun 15, 2022
a770bd5
fix up cross.sh
Jun 15, 2022
075dc79
check libuv submodule
Jun 15, 2022
7ff9678
build ios first
Jun 15, 2022
239d0ec
only pack liblokinet-embedded.a in iphone ci pipeline
Jun 15, 2022
89b499d
use uv static build when using submodule
Jun 15, 2022
5051739
move logic out of ci into ios builder script
Jun 16, 2022
7c978cc
restructure build for iphone
Jun 16, 2022
e0b978e
fix typos
Jun 16, 2022
d00a60e
clean up static deps for cross targets
Jun 16, 2022
8b83137
fix up compiler flags and make shit smaller
Jul 6, 2022
65d3c0e
fall back to null vpn platform when we have no implementation for the…
majestrate Jun 22, 2022
8a905db
Updated the ios.sh to create fat libraries and generate a .xcframework
mpretty-cyro Jul 7, 2022
8585d53
Merge pull request #5 from mpretty-cyro/ios-ci-2022-06-13
Jul 7, 2022
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
Prev Previous commit
Next Next commit
restructure build for iphone
  • Loading branch information
jeff committed Jul 6, 2022
commit 7c978ccf141b5edef44264b7396ea12876b19ed1
6 changes: 1 addition & 5 deletions contrib/ci/drone-static-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ elif [ -e build-docs ]; then
tar cJvf "$archive" "$base"
elif [ -e build/iphone/ ]; then
archive="$base.tar.xz"
mkdir -p "$base/sim"
mkdir -p "$base/device"
cp -av build/iphone/sim/llarp/liblokinet-embedded.a "$base/sim/liblokinet-embedded.a"
cp -av build/iphone/device/llarp/liblokinet-embedded.a "$base/device/liblokinet-embedded.a"
tar cJvf "$archive" "$base"
mv build/iphone/*.tar.xz "$archive"
else
cp -av daemon/lokinet daemon/lokinet-vpn "$base"
cp -av ../contrib/bootstrap/mainnet.signed "$base/bootstrap.signed"
Expand Down
73 changes: 21 additions & 52 deletions contrib/ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,28 @@ if ! [ -f LICENSE ] || ! [ -d llarp ]; then
echo "You need to run this as ./contrib/ios.sh from the top-level lokinet project directory"
fi

unset SDKROOT
export SDKROOT="$(xcrun --sdk iphoneos --show-sdk-path)"

mkdir -p build/iphone/{sim,device}
root="$(readlink -f $(dirname $0)/../)"

cmake \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE=./contrib/cross/ios.toolchain.cmake -DPLATFORM=OS -DDEPLOYMENT_TARGET=13 -DENABLE_VISIBILITY=ON -DENABLE_BITCODE=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER= -DCMAKE_C_COMPILER_LAUNCHER= \
-DBUILD_STATIC_DEPS=ON \
-DBUILD_PACKAGE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EMBEDDED_LOKINET=ON \
-DWITH_TESTS=OFF \
-DNATIVE_BUILD=OFF \
-DSTATIC_LINK=ON \
-DWITH_SYSTEMD=OFF \
-DWITH_BOOTSTRAP=OFF \
-DBUILD_DAEMON=OFF \
-DFORCE_OXENMQ_SUBMODULE=ON \
-DFORCE_OXENC_SUBMODULE=ON \
-DFORCE_NLOHMANN_SUBMODULE=ON \
-DFORCE_LIBUV_SUBMODULE=ON \
-DSUBMODULE_CHECK=ON \
-DWITH_LTO=OFF \
-S . -B build/iphone/device \
$@
build_dir="$root/build/iphone"

cmake \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE=./contrib/cross/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DDEPLOYMENT_TARGET=13 -DENABLE_VISIBILITY=ON -DENABLE_BITCODE=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER= -DCMAKE_C_COMPILER_LAUNCHER= \
-DBUILD_STATIC_DEPS=ON \
-DBUILD_PACKAGE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EMBEDDED_LOKINET=ON \
-DWITH_TESTS=OFF \
-DNATIVE_BUILD=OFF \
-DSTATIC_LINK=ON \
-DWITH_SYSTEMD=OFF \
-DWITH_BOOTSTRAP=OFF \
-DBUILD_DAEMON=OFF \
-DFORCE_OXENMQ_SUBMODULE=ON \
-DFORCE_OXENC_SUBMODULE=ON \
-DFORCE_NLOHMANN_SUBMODULE=ON \
-DFORCE_LIBUV_SUBMODULE=ON \
-DSUBMODULE_CHECK=ON \
-DWITH_LTO=OFF \
-S . -B build/iphone/sim \
$@
./contrib/ios/ios-configure.sh "$build_dir/device" OS $@
./contrib/ios/ios-configure.sh "$build_dir/sim" SIMULATORARM64 $@

for targ in device sim ; do
cmake --build build/iphone/$targ --target lokinet-embedded
done
./contrib/ios/ios-build.sh "$build_dir/device"
./contrib/ios/ios-build.sh "$build_dir/sim"

pkg_name="iphone_lokinet_embedded_$(date +%s)"
pkg_dir="$build_dir/$pkg_name"
mkdir -p "$pkg_dir/include"
mkdir -p "$pkg_dir/lib/device"
mkdir -p "$pkg_dir/lib/sim"

cp -a "$build_dir/device/llarp/liblokinet-embedded.a" "$pkg_dir/lib/device/"
cp -a "$build_dir/sim/llarp/liblokinet-embedded.a" "$pkg_dir/lib/sim/"
cp -a "$root"/include/lokinet{,/*}.h "$pkg_dir/include/"

cd "$build_dir"
tar cfv "$pkg_name.tar" $pkg_name
cd -
xz -T 0 "$build_dir/$pkg_name.tar"
7 changes: 7 additions & 0 deletions contrib/ios/ios-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
#
# Build the shit for iphone

test -e $1 || ( echo "run ios-configure.sh first" ; exit 1 )

cmake --build $1 --target lokinet-embedded
39 changes: 39 additions & 0 deletions contrib/ios/ios-configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
#
# configure step for ios

root="$(readlink -f $(dirname $0)/../../)"

unset SDKROOT
export SDKROOT="$(xcrun --sdk iphoneos --show-sdk-path)"

targ=$1
plat=$2
shift
shift

mkdir -p $targ

cmake \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE=./contrib/cross/ios.toolchain.cmake -DPLATFORM=$plat -DDEPLOYMENT_TARGET=13 -DENABLE_VISIBILITY=ON -DENABLE_BITCODE=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER= -DCMAKE_C_COMPILER_LAUNCHER= \
-DBUILD_STATIC_DEPS=ON \
-DBUILD_PACKAGE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EMBEDDED_LOKINET=ON \
-DWITH_TESTS=OFF \
-DNATIVE_BUILD=OFF \
-DSTATIC_LINK=ON \
-DWITH_SYSTEMD=OFF \
-DWITH_BOOTSTRAP=OFF \
-DBUILD_DAEMON=OFF \
-DFORCE_OXENMQ_SUBMODULE=ON \
-DFORCE_OXENC_SUBMODULE=ON \
-DFORCE_NLOHMANN_SUBMODULE=ON \
-DFORCE_LIBUV_SUBMODULE=ON \
-DSUBMODULE_CHECK=ON \
-DWITH_LTO=OFF \
-S $root -B $targ \
$@
6 changes: 2 additions & 4 deletions contrib/ios/readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
the internet is gripped by a spectre, the spectre of developing for the apple iphone.
our scientists have yet to reverse engineer the correct way to use the apple build process as dictated on the official apple documentation so we have a made a hack to make it work until that occurs.

the build process for embedded lokinet on iphone is as follows:

* obtain holy water, sprinkle onto keyboard and single button trackpad accordingly.
* run ./contrib/ios.sh
* after it runs and the proper number of goats have been offered to the slaughter you will get a static object archive somewhere in ./build/iphone/
* after it runs and the proper number of goats have been offered to the slaughter you will get an xz's tarball in the build/iphone/ directory

additional cmake flags can be passed to ./contrib/ios.sh as command line arguments like so:

$ ./contrib/ios.sh -DPLATFORM=SIMULATOR64
$ ./contrib/ios.sh -DYOLO_SWAG=ON