]> git.cameronkatri.com Git - dotfiles.git/commitdiff
crossenv.zsh revamp, freebsd-patch
authorCameron Katri <me@cameronkatri.com>
Sun, 20 Jun 2021 17:40:52 +0000 (13:40 -0400)
committerCameron Katri <me@cameronkatri.com>
Sun, 20 Jun 2021 17:40:52 +0000 (13:40 -0400)
.crossenv.zsh
.local/bin/freebsd-patch [new file with mode: 0755]

index fe0b11b4b537e77d0ed09f5d630c2697d28ccebd..fdd543857b84cb677dd5eb951ccd08cb6811d152 100644 (file)
@@ -14,7 +14,7 @@ iphoneos-arm64-proenv() {
        export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
 }
 
-iphoneos-arm64-env() {
+apple_cmds-env() {
        TARGET_SYSROOT='/usr/home/cameron/Documents/iOS/SDK/iPhoneOS12.0.sdk'
        CC='aarch64-apple-darwin-clang' CXX='aarch64-apple-darwin-clang++' AR='aarch64-apple-darwin-ar' LD='aarch64-apple-darwin-ld' CPP='aarch64-apple-darwin-clang -E' RANLIB='aarch64-apple-darwin-ranlib' STRIP='aarch64-apple-darwin-strip' NM='aarch64-apple-darwin-nm' LIPO='aarch64-apple-darwin-lipo' OTOOL='aarch64-apple-darwin-otool' I_N_T='aarch64-apple-darwin-install_name_tool' LDID='ldid'
        CFLAGS='-Os -g -arch arm64 -isysroot /usr/home/cameron/Documents/iOS/SDK/iPhoneOS12.0.sdk -miphoneos-version-min=12.0 -isystem /usr/home/cameron/Documents/iOS/apple_cmds/base/include'
@@ -25,9 +25,50 @@ iphoneos-arm64-env() {
        export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
 }
 
+darwin-env() {
+       CC='aarch64-apple-darwin-clang' CXX='aarch64-apple-darwin-clang++' AR='aarch64-apple-darwin-ar' LD='aarch64-apple-darwin-ld' CPP='aarch64-apple-darwin-clang -E' RANLIB='aarch64-apple-darwin-ranlib' STRIP='aarch64-apple-darwin-strip' NM='aarch64-apple-darwin-nm' LIPO='aarch64-apple-darwin-lipo' OTOOL='aarch64-apple-darwin-otool' I_N_T='aarch64-apple-darwin-install_name_tool' LDID='ldid'
+       OPTIMIZATION_FLAGS="-Os -g -flto=thin"
+       DEFAULT_CFLAGS="${OPTIMIZATION_FLAGS} -isystem ${HOME}/Documents/iOS/include"
+       DEFAULT_CPPFLAGS="${OPTIMIZATION_FLAGS} -isystem ${HOME}/Documents/iOS/include"
+       DEFAULT_CXXLAGS="${OPTIMIZATION_FLAGS} -isystem ${HOME}/Documents/iOS/include"
+       DEFAULT_LDFLAGS="${OPTIMIZATION_FLAGS}"
+       IPHONEOS_CFLAGS="-arch arm64 -isysroot ${IPHONEOS_SYSROOT} -miphoneos-version-min=14.0"
+       WATCHOS_CFLAGS="-arch arm64_32 -isysroot ${WATCHOS_SYSROOT} -mwatchos-version-min=7.0"
+       TVOS_CFLAGS="-arch arm64 -isysroot ${TVOS_SYSROOT} -mappletvos-version-min=14.0"
+       export CC CXX AR LD CPP RANLIB STRIP NM LIPO OTOOL I_N_T LDID
+       export OPTIMIZATION_FLAGS DEFAULT_CFLAGS DEFAULT_CXXFLAGS DEFAULT_CPPFLAGS DEFAULT_LDFLAGS IPHONEOS_CFLAGS WATCHOS_CFLAGS TVOS_CFLAGS
+}
+
+iphoneos-arm64-env() {
+       darwin-env
+       export CFLAGS="${DEFAULT_CFLAGS} ${IPHONEOS_CFLAGS}"
+       export CPPFLAGS="${DEFAULT_CPPFLAGS} ${IPHONEOS_CFLAGS}"
+       export CXXFLAGS="${DEFAULT_CXXFLAGS} ${IPHONEOS_CFLAGS}"
+       export LDFLAGS="${DEFAULT_LDFLAGS} ${IPHONEOS_CFLAGS}"
+}
+
+appletvos-arm64-env() {
+       darwin-env
+       export CFLAGS="${DEFAULT_CFLAGS} ${TVOS_CFLAGS}"
+       export CPPFLAGS="${DEFAULT_CPPFLAGS} ${WATCHOS_CFLAGS}"
+       export CXXFLAGS="${DEFAULT_CXXFLAGS} ${WATCHOS_CFLAGS}"
+       export LDFLAGS="${DEFAULT_LDFLAGS} ${WATCHOS_CFLAGS}"
+}
+
+watchos-arm64_32-env() {
+       darwin-env
+       export CFLAGS="${DEFAULT_CFLAGS} ${WATCHOS_CFLAGS}"
+       export CPPFLAGS="${DEFAULT_CPPFLAGS} ${WATCHOS_CFLAGS}"
+       export CXXFLAGS="${DEFAULT_CXXFLAGS} ${WATCHOS_CFLAGS}"
+       export LDFLAGS="${DEFAULT_LDFLAGS} ${WATCHOS_CFLAGS}"
+}
+
 # Procursus Env Vars
-export TARGET_SYSROOT=/usr/home/cameron/Documents/iOS/SDK/iPhoneOS14.3.sdk
-export MACOSX_SYSROOT=/usr/home/cameron/Documents/iOS/SDK/MacOSX11.1.sdk
+export MACOSX_SYSROOT=/usr/home/cameron/Documents/iOS/SDK/MacOSX12.sdk
+export IPHONEOS_SYSROOT=/usr/home/cameron/Documents/iOS/SDK/iPhoneOS14.3.sdk
+export WATCHOS_SYSROOT=/usr/home/cameron/Documents/iOS/SDK/WatchOS7.2.sdk
+export TVOS_SYSROOT=/usr/home/cameron/Documents/iOS/SDK/AppleTVOS14.3.sdk
+export TARGET_SYSROOT=${IPHONEOS_SYSROOT}
 export DEB_MAINTAINER="Cameron Katri <me@cameronkatri.com>"
 export MEMO_DEVICE_IP=localhost
 export MEMO_DEVICE_PORT=2222
diff --git a/.local/bin/freebsd-patch b/.local/bin/freebsd-patch
new file mode 100755 (executable)
index 0000000..6c1121b
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+for patch in $HOME/Documents/freebsd-patches/*.patch; do
+       patch -d /usr/src -p1 < $patch
+done