Skip to content

Commit

Permalink
Fix macOS build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
culler committed Jan 25, 2024
1 parent a9c9024 commit 88a9083
Showing 1 changed file with 43 additions and 36 deletions.
79 changes: 43 additions & 36 deletions ci/macOS/build_mac_tkgl.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
#!/bin/bash
set -e

TCL8_VERSION=8.6.13
TCL9_VERSION=9.0b1
TCL8_URL=https://prdownloads.sourceforge.net/tcl/tcl$TCL8_VERSION-src.tar.gz
TK8_URL=https://prdownloads.sourceforge.net/tcl/tk$TCL8_VERSION-src.tar.gz
TCL9_URL=https://prdownloads.sourceforge.net/tcl/tcl$TCL9_VERSION-src.tar.gz
TK9_URL=https://prdownloads.sourceforge.net/tcl/tk$TCL9_VERSION-src.tar.gz
TCL8_SOURCE=tcl8.6.13-src.tar.gz
TCL9_SOURCE=tcl9.0b1-src.tar.gz
TK8_SOURCE=tk8.6.13-src.tar.gz
TK9_SOURCE=tk9.0b1-src.tar.gz
TCL8_URL=https://prdownloads.sourceforge.net/tcl/$TCL8_SOURCE
TK8_URL=https://prdownloads.sourceforge.net/tcl/$TK8_SOURCE
TCL9_URL=https://prdownloads.sourceforge.net/tcl/$TCL9_SOURCE
TK9_URL=https://prdownloads.sourceforge.net/tcl/$TK9_SOURCE

mkdir -p dist/Tkgl1.0
rm -rf tcl9 tk9 tcl8 tk8
mkdir tcl9 tk9 tcl8 tk8
rm -rf tcl8 tk8 tcl9 tk9
mkdir tcl8 tk8 tcl9 tk9

if ! [ -e tcl9.tar.gz ] || ! [ -e tcl9 ] ; then
wget --no-check-certificate -O tcl9.tgz $TCL9_URL
tar xf tcl9.tgz --directory=tcl9 --strip-components=1
if ! [ -e $TCL8_SOURCE ]; then
wget -nv --no-check-certificate $TCL8_URL
fi
if ! [ -e tk9.tar.gx $Tk9_URL ] || ! [ -e tk9 ] ; then
wget --no-check-certificate -O tk9.tar.gz $TK9_URL
tar xf tk9.tar.gz --directory=tk9 --strip-components=1
if ! [ -e $TK8_SOURCE ] || ! [ -e tk8 ] ; then
wget -nv --no-check-certificate $TK8_URL
fi
cd tcl9/macosx
./configure
cd ../../tk9/macosx
./configure
cd ../..

if ! [ -e tcl8.tar.gz ] || ! [ -e tcl8 ] ; then
wget --no-check-certificate -O tcl8.tgz $TCL9_URL
tar xf tcl8.tgz --directory=tcl8 --strip-components=1
if ! [ -e $TCL9_SOURCE ] ; then
wget -nv --no-check-certificate $TCL9_URL
fi
if ! [ -e tk8.tar.gx $Tk8_URL ] || ! [ -e tk8 ] ; then
wget --no-check-certificate -O tk8.tgz $TK9_URL
tar xf tk8.tgz --directory=tk8 --strip-components=1
if ! [ -e $TK9_SOURCE ]; then
wget -nv --no-check-certificate $TK9_URL
fi
cd tcl8/macosx
./configure
cd ../../tk8/macosx
./configure --with-tcl=../../tcl8
cd ../..

tar xf $TCL8_SOURCE --directory=tcl8 --strip-components=1
tar xf $TK8_SOURCE --directory=tk8 --strip-components=1
tar xf $TCL9_SOURCE --directory=tcl9 --strip-components=1
tar xf $TK9_SOURCE --directory=tk9 --strip-components=1

cp ci/macOS/mac_configure configure
./configure --with-tcl=tcl8/macosx --with-tk=tk8/macosx
make
./configure --with-tcl=tcl9/macosx --with-tk=tk9/macosx
make

cd tcl8
make -j4 -C macosx CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
cd ../tk8
make -j4 -C macosx CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
cd ..
mv build build8
./configure --with-tcl=build8/tcl/Tcl.framework --with-tk=build8/tk/Tk.framework
make CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
mv libTkgl1.0.dylib dist/Tkgl1.0
mv libtcl9Tkgl1.0.dylib Tkgl1.0

cd tcl9
make -j4 -C macosx CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
cd ../tk9/
make -j4 -C macosx CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
cd ..
mv build build9
./configure --with-tcl=build9/tcl/Tcl.framework --with-tk=build9/tk/Tk.framework
make CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
mv libtcl9Tkgl1.0.dylib dist/Tkgl1.0
mv pkgIndex.tcl dist/Tkgl1.0

0 comments on commit 88a9083

Please sign in to comment.