Author: Andy Green Date: Sat Dec 05 19:26:37 2020 +0000 osx: m1 and plist scripts diff --git a/READMEs/README-systemd-nspawn.md b/READMEs/README-systemd-nspawn.md index b622746..e6b120a 100644 --- a/READMEs/README-systemd-nspawn.md +++ b/READMEs/README-systemd-nspawn.md @@ -327,6 +327,14 @@ Container # make -j && make -j install && ldconfig For OSX, you'll need to add something like `-DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/opt/openssl@1.1/include -DLWS_OPENSSL_LIBRARIES="/usr/local/opt/openssl/lib/libssl.dylib;/usr/local/opt/openssl/lib/libcrypto.dylib"` to the cmake line +For newer M1 based OSX + +``` +cmake .. -DLWS_OPENSSL_INCLUDE_DIRS=/opt/homebrew/Cellar/openssl@1.1/1.1.1h/include '-DLWS_OPENSSL_LIBRARIES=/opt/homebrew/Cellar/openssl@1.1/1.1.1h/lib/libssl.dylib;/opt/homebrew/Cellar/openssl@1.1/1.1.1h/lib/libcrypto.dylib' -DLWS_WITH_MINIMAL_EXAMPLES=0 -DLWS_WITH_JOSE=1 -DLWS_UNIX_SOCK=1 -DLWS_WITH_STRUCT_JSON=1 \ + -DLWS_WITH_GENCRYPTO=1 -DLWS_WITH_SPAWN=1 \ + -DLWS_WITH_SECURE_STREAMS=1 -DLWS_WITH_THREADPOOL=1 -DLWS_WITH_JOSE=1 +``` + ### Windows: build libgit2 For Windows, after following the way to build lws in @@ -388,7 +396,15 @@ Also in the Administrator window, copy and edit the sai-builder config For OSX, you'll need to adapt the cmake to something like +``` cmake .. -DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/opt/openssl@1.1/include -DLWS_OPENSSL_LIBRARIES="/usr/local/opt/openssl/lib/libssl.dylib;/usr/local/opt/openssl/lib/libcrypto.dylib" +``` + +On the newer M1 OSX, honebrew has to be teleported in /opt, the following worked + +``` +cmake .. -DSAI_SERVER=0 -DSAI_GIT2_INC_PATH=/opt/homebrew/Cellar/libgit2/1.1.0/include -DSAI_GIT2_LIB_PATH=/opt/homebrew/Cellar/libgit2/1.1.0/lib/libgit2.dylib -DLWS_OPENSSL_INCLUDE_DIRS=/opt/homebrew/Cellar/openssl@1.1/1.1.1h/include '-DLWS_OPENSSL_LIBRARIES=/opt/homebrew/Cellar/openssl@1.1/1.1.1h/lib/libssl.dylib;/opt/homebrew/Cellar/openssl@1.1/1.1.1h/lib/libcrypto.dylib' +``` Make sai-builder run as a daemon, create the file `/Library/LaunchDaemons/com.warmcat.sai-builder.plist` diff --git a/assets/arch-aarch64-apple-m1.svg b/assets/arch-aarch64-apple-m1.svg new file mode 100644 index 0000000..09c068a --- /dev/null +++ b/assets/arch-aarch64-apple-m1.svg @@ -0,0 +1,16 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/assets/netbsd-OSX-bigsur.svg b/assets/netbsd-OSX-bigsur.svg new file mode 100644 index 0000000..3f5276c --- /dev/null +++ b/assets/netbsd-OSX-bigsur.svg @@ -0,0 +1 @@ + diff --git a/scripts/com.warmcat.sai-builder.plist b/scripts/com.warmcat.sai-builder.plist new file mode 100644 index 0000000..bc7cb31 --- /dev/null +++ b/scripts/com.warmcat.sai-builder.plist @@ -0,0 +1,23 @@ + + + + + PATH + /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin + Label + com.warmcat.sai-builder + ServiceDescription + Sai Builder Daemon + ProgramArguments + + /usr/local/bin/sai-builder + + RunAtLoad + + + StandardErrorPath + /var/log/sai-builder.log + + + diff --git a/src/builder/b-nspawn.c b/src/builder/b-nspawn.c index f755f41..fd99352 100644 --- a/src/builder/b-nspawn.c +++ b/src/builder/b-nspawn.c @@ -210,7 +210,7 @@ static const char * const runscript = static const char * const runscript = "#!/bin/bash -x\n" #if defined(__APPLE__) - "export PATH=/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin\n" + "export PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin\n" #endif "export SAI_OVN=%s\n" "export SAI_PROJECT=%s\n"