diff --git a/.drone.jsonnet b/.drone.jsonnet index 15cc443f6..34d36293f 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -278,7 +278,13 @@ local mac_builder(name, // basic system headers. WTF apple: 'export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"', 'ulimit -n 1024', // because macos sets ulimit to 256 for some reason yeah idk - './contrib/mac.sh ' + ci_mirror_opts + (if build_type == 'Debug' then ' -DWARN_DEPRECATED=OFF ' else '') + codesign, + './contrib/mac-configure.sh ' + ci_mirror_opts + (if build_type == 'Debug' then ' -DWARN_DEPRECATED=OFF ' else '') + codesign, + 'cd build-mac', + // We can't use the 'package' target here because making a .dmg requires an active logged in + // macos gui to invoke Finder to invoke the partitioning tool to create a partitioned (!) + // disk image. Most likely the GUI is required because if you lose sight of how pretty the + // surface of macOS is you might see how ugly the insides are. + 'ninja -j' + jobs + ' assemble_gui', ] + extra_cmds, }, ], diff --git a/contrib/ci/drone-static-upload.sh b/contrib/ci/drone-static-upload.sh index 4eb4921b5..460d001c2 100755 --- a/contrib/ci/drone-static-upload.sh +++ b/contrib/ci/drone-static-upload.sh @@ -51,8 +51,9 @@ elif [ -e build-docs ]; then cp -av build-docs/docs/mkdocs.yml build-docs/docs/markdown "$base" tar cJvf "$archive" "$base" elif [ -e build-mac ]; then - archive="$base.dmg" - mv build-mac/Lokinet*.dmg "$archive" + archive="$base.tar.xz" + mv build-mac/Lokinet*/ "$base" + tar cJvf "$archive" "$base" else cp -av daemon/lokinet daemon/lokinet-vpn "$base" cp -av ../contrib/bootstrap/mainnet.signed "$base/bootstrap.signed" diff --git a/contrib/mac-configure.sh b/contrib/mac-configure.sh new file mode 100755 index 000000000..fa45a960b --- /dev/null +++ b/contrib/mac-configure.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e +set -x + +if ! [ -f LICENSE ] || ! [ -d llarp ]; then + echo "You need to run this as ./contrib/mac.sh from the top-level lokinet project directory" >&2 + exit 1 +fi + +mkdir -p build-mac +cd build-mac +cmake \ + -G Ninja \ + -DBUILD_STATIC_DEPS=ON \ + -DBUILD_LIBLOKINET=OFF \ + -DWITH_TESTS=OFF \ + -DWITH_BOOTSTRAP=OFF \ + -DNATIVE_BUILD=OFF \ + -DWITH_LTO=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DMACOS_SYSTEM_EXTENSION=ON \ + -DCODESIGN=ON \ + -DBUILD_PACKAGE=ON \ + "$@" \ + .. + +echo "cmake build configured in build-mac" diff --git a/contrib/mac.sh b/contrib/mac.sh index 70bf4d090..5455457e1 100755 --- a/contrib/mac.sh +++ b/contrib/mac.sh @@ -11,27 +11,14 @@ set -e set -x if ! [ -f LICENSE ] || ! [ -d llarp ]; then - echo "You need to run this as ./contrib/mac.sh from the top-level lokinet project directory" + echo "You need to run this as ./contrib/mac.sh from the top-level lokinet project directory" >&2 + exit 1 fi -mkdir -p build-mac -cd build-mac -cmake \ - -G Ninja \ - -DBUILD_STATIC_DEPS=ON \ - -DBUILD_LIBLOKINET=OFF \ - -DWITH_TESTS=OFF \ - -DWITH_BOOTSTRAP=OFF \ - -DNATIVE_BUILD=OFF \ - -DWITH_LTO=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DMACOS_SYSTEM_EXTENSION=ON \ - -DCODESIGN=ON \ - -DBUILD_PACKAGE=ON \ - "$@" \ - .. -ninja -j1 package +./contrib/mac-configure.sh "$@" +cd build-mac +ninja -j${JOBS:-1} package cd .. echo -e "Build complete, your app is here:\n"