aboutsummaryrefslogtreecommitdiffhomepage
path: root/.fmsbw/20-freebsd14-osx-sciteco
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2025-10-04 19:41:25 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2025-10-04 21:04:54 +0200
commitb493b517601219840331d32f405960a81a0c0df3 (patch)
treed0744e37246179b900a277e9f864ea416f140d7a /.fmsbw/20-freebsd14-osx-sciteco
parenta06f071ffce291a694e6936ab1a424c5ffa8bf55 (diff)
downloadsciteco-b493b517601219840331d32f405960a81a0c0df3.tar.gz
added 20-freebsd14-osx-sciteco: this builds OS X nightly binaries via osxcross
* In contrast to the old Github workflow, we can no longer create pkgs, but instead create tar balls. You don't necessarily have to unpack it into the root, though, since the binaries are relocatable. * We cannot execute the resulting binaries, so the testsuite is no longer run under OS X. It could be executed with Darling, but only under Linux. * Resulting binaries are currently apparently fully statically linked.
Diffstat (limited to '.fmsbw/20-freebsd14-osx-sciteco')
-rwxr-xr-x.fmsbw/20-freebsd14-osx-sciteco72
1 files changed, 72 insertions, 0 deletions
diff --git a/.fmsbw/20-freebsd14-osx-sciteco b/.fmsbw/20-freebsd14-osx-sciteco
new file mode 100755
index 0000000..0173924
--- /dev/null
+++ b/.fmsbw/20-freebsd14-osx-sciteco
@@ -0,0 +1,72 @@
+#!/bin/sh
+set -ex
+
+# FIXME: We have to build a native version first since the Mac OS
+# version cannot be bootstrapped.
+# This could be avoided if a separate job would provide FreeBSD nightly builds.
+autoreconf -i
+mkdir build-freebsd
+cd build-freebsd
+../configure --with-interface=ncurses CFLAGS="-O3" CXXFLAGS="-O3"
+gmake install
+cd ..
+
+# Image is based on freebsd14-sciteco.
+#git clone -b 2.0-llvm-based https://github.com/tpoechtrager/osxcross.git /opt/osxcross
+#pkg install libxml2 FreeBSD-liblzma-dev FreeBSD-runtime-dev python3 bash llvm21 gsed cmake FreeBSD-openssl-lib-dev openbsm FreeBSD-clibs-dev openssl
+#pkg remove FreeBSD-clang
+#cd /opt/osxcross
+# The SDK has been extracted from Command_Line_Tools_for_Xcode_26.dmg.
+# I had to use my bhyve-ubuntu24 VM for that.
+#cp /opt/tmp/* tarballs/
+#export CPPFLAGS="-I/usr/local/include"
+#export SDK_VERSION=26.0
+#export PATH=/usr/local/llvm21/bin:/opt/osxcross/target/bin:$PATH
+#UNATTENDED=1 ./build.sh
+#unset CPPFLAGS
+#export MACOSX_DEPLOYMENT_TARGET=10.13
+# FIXME: This is not unattended. Perhaps echo https://nue.de.packages.macports.org/macports/packages >target/macports/MIRROR
+# dylibbundler is available but can't be run naturally.
+#osxcross-macports install --static glib2-devel gtk3-devel
+#
+#pkg install cmake
+#git clone https://github.com/auriamg/macdylibbundler.git /opt/macdylibbundler
+#cd /opt/macdylibbundler
+#cmake .
+#make
+#cp dylibbundler /usr/local/bin/
+
+export PATH=/usr/local/llvm21/bin:/opt/osxcross/target/bin:$PATH
+export MACOSX_DEPLOYMENT_TARGET=10.13
+
+export CFLAGS="-O3 -flto=thin"
+export CXXFLAGS="-O3 -flto=thin"
+export LDFLAGS="-flto=thin"
+
+mkdir build-osx
+cd build-osx
+# FIXME: Perhaps SciTECO's configure.ac should use PKG_CHECK_MODULES_STATIC()
+# whenever --enable-static-executables is used.
+../configure --host=x86_64-apple-darwin25 --disable-bootstrap --with-interface=ncurses \
+ --enable-static-executables --with-scitecodatadir=../share/sciteco \
+ PKG_CONFIG="x86_64-apple-darwin25-pkg-config --static"
+gmake install-strip DESTDIR=`pwd`/temp-install
+# There are libraries we cannot link against statically.
+# We ship them in /usr/local/lib/sciteco so as not to cause collisions with system
+# libraries or libraries installed via Homebrew.
+# System libraries are considered to have stable ABIs and
+# are not currently bundled.
+# FIXME: Is this really true for libc++?
+# Anyway, currently it's apparently fully statically linked.
+dylibbundler -b -x temp-install/usr/local/bin/sciteco \
+ -cd -d temp-install/usr/local/lib/sciteco -p @executable_path/../lib/sciteco \
+ --no-codesign
+(cd temp-install; tar czf ../../sciteco-curses_nightly_macos_x86_64.tar.gz *)
+cd ..
+
+# FIXME: Also build -arch arm64 and package with x86_64-apple-darwin25-lipo into universal binary.
+# x86_64-apple-darwin25-lipo -lipo -create -output sciteco x86_64/usr/local/bin/sciteco arm64/usr/local/bin/sciteco
+# TODO: Build Gtk version as well.
+
+mkdir -p /opt/htdocs/downloads/nightly/
+cp sciteco-curses_nightly_macos_x86_64.tar.gz /opt/htdocs/downloads/nightly/