#!/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 # NOTE: Make sure we pick up the SDK's ncurses instead of the one pulled in # via MacPorts. ../configure --host=x86_64-apple-darwin25 --disable-bootstrap --with-interface=ncurses \ --enable-static-executables --with-scitecodatadir=../share/sciteco \ CURSES_CFLAGS="-D_DARWIN_C_SOURCE -DNCURSES_WIDECHAR" CURSES_LIBS="-lncurses" 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 # FIXME: Perhaps create pkg using fpm (https://github.com/jordansissel/fpm)? (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/