Skip to content

Building OSX X86_64 Third Party Dependencies

Pablo Tesone edited this page Aug 17, 2022 · 9 revisions

Note: Replace /Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ with the path to use as fakeroot during the building. So the building does not affect the building system and performs a clean build.

SDL2-2.0.18

wget https://libsdl.org/release/SDL2-2.0.18.tar.gz

tar xvfz SDL2-2.0.18.tar.gz
cd SDL2-2.0.18

LDFLAGS="-Z -L/usr/lib -F/Library/Frameworks -F/System/Library/Frameworks" \
CFLAGS="-mmacosx-version-min=10.14 -Werror=partial-availability" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib/pkgconfig" \
./configure --prefix=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ 

make install

cd ../lib

install_name_tool -id @executable_path/Plugins/libSDL2-2.0.0.dylib libSDL2-2.0.0.dylib

libpng-1.6.37

wget https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz
tar xvfz libpng-1.6.37.tar.gz
cd libpng-1.6.37

LDFLAGS="-Z -L/usr/lib -F/Library/Frameworks -F/System/Library/Frameworks" \
CFLAGS="-mmacosx-version-min=10.14 -Werror=partial-availability" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib/pkgconfig" \
cmake . -DCMAKE_PREFIX_PATH=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ -DCMAKE_INSTALL_PREFIX:PATH=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/

make install

cd ../lib

install_name_tool -id @executable_path/Plugins/libpng16.16.dylib libpng16.16.37.0.dylib

freetype-2.10.0

wget https://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.gz
tar xvfz freetype-2.10.0.tar.gz
cd freetype-2.10.0

mkdir build
cd build

LDFLAGS="-Z -L/usr/lib -F/Library/Frameworks -F/System/Library/Frameworks" \
CFLAGS="-mmacosx-version-min=10.14 -Werror=partial-availability" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib/pkgconfig" cmake .. \
 -DBUILD_SHARED_LIBS:BOOL=true \
 -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE \
 -DCMAKE_PREFIX_PATH=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ \
 -DCMAKE_INSTALL_PREFIX:PATH=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/

make install

cd ../lib

install_name_tool -id @executable_path/Plugins/libfreetype.6.dylib libfreetype.6.16.0.dylib
install_name_tool -change @rpath/libpng16.16.dylib @executable_path/Plugins/libpng16.16.dylib libfreetype.6.16.0.dylib

fontconfig-2.13.1

wget https://freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.gz
tar xvfz fontconfig-2.13.1.tar.gz
cd fontconfig-2.13.1

LDFLAGS="-Z -L/usr/lib -F/Library/Frameworks -F/System/Library/Frameworks" \
CFLAGS="-mmacosx-version-min=10.14 -Werror=partial-availability" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib/pkgconfig" \
FREETYPE_CFLAGS="-I/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/include/freetype2" \
FREETYPE_LIBS="-L/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib -lfreetype" \
./configure \
--prefix=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ 

make install

cd ../lib

install_name_tool -id @executable_path/Plugins/libfontconfig.1.dylib libfontconfig.1.dylib

pixman-0.40.0

wget https://www.cairographics.org/releases/pixman-0.40.0.tar.gz
tar xvfz pixman-0.40.0.tar.gz

cd pixman-0.40.0

LDFLAGS="-Z -L/usr/lib -F/Library/Frameworks -F/System/Library/Frameworks" \
CFLAGS="-mmacosx-version-min=10.14 -Werror=partial-availability" \
./configure --prefix=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ 

make install

cd ../lib
install_name_tool -id @executable_path/Plugins/libpixman-1.0.dylib libpixman-1.0.40.0.dylib

cairo-1.16.0

wget https://cairographics.org/snapshots/cairo-1.17.4.tar.xz
tar xvf cairo-1.17.4.tar.xz
cd cairo-1.17.4

FONTCONFIG_LIBS="-L/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib -lfontconfig" \
FONTCONFIG_CFLAGS="-I/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/include/fontconfig" \
CFLAGS="-mmacosx-version-min=10.14 -Werror=partial-availability -I/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/include" \
LDFLAGS="-Z -L/usr/lib -F/Library/Frameworks -F/System/Library/Frameworks -L/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib/pkgconfig" \
./configure --prefix=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ --disable-xlib --disable-xcb

make install

cd ../lib
install_name_tool -id @executable_path/Plugins/libcairo.2.dylib libcairo.2.dylib

openssl-1.1.1k

wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
tar -xvf openssl-1.1.1k.tar.gz
cd openssl-1.1.1k

./config --prefix=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64 && make install

cd ../lib

install_name_tool -id @executable_path/Plugins/libcrypto.1.1.dylib libcrypto.1.1.dylib
install_name_tool -id @executable_path/Plugins/libssl.1.1.dylib libssl.1.1.dylib

install_name_tool -change /Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib/libcrypto.1.1.dylib @executable_path/Plugins/libcrypto.1.1.dylib libssl.1.1.dylib

libssh2-1.9.0

git clone [email protected]:libssh2/libssh2.git
cd libssh2
git checkout libssh2-1.9.0 
cd ..


cmake . -DCMAKE_INSTALL_PREFIX:PATH=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64 -DCMAKE_PREFIX_PATH=/Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/ -DBUILD_SHARED_LIBS=ON
make install

install_name_tool -id @executable_path/Plugins/libssh2.1.0.1.dylib libssh2.1.0.1.dylib

libgit2-1.4.4

git clone [email protected]:libgit2/libgit2.git
cd libgit2
git checkout v1.4.4 
cd ..

cmake -S libgit2 -B buildLibgit2 -DUSE_SSH=ON -DCMAKE_INSTALL_PREFIX:PATH=`pwd` -DCMAKE_PREFIX_PATH="`pwd`"
cmake --build buildLibgit2 --target install

cd lib
install_name_tool -id @executable_path/Plugins/libgit2.1.4.4.dylib libgit2.1.4.4.dylib
install_name_tool -change libssh2.1.dylib @executable_path/Plugins/libssh2.1.dylib libgit2.1.4.4.dylib

Build Bundles

cd /Users/admin/dev/Pharo/thirdparty/Darwin-x86_64/lib

zip -y SDL2-2.0.18.zip libSDL2*.dylib
zip -y libpng-1.6.37.zip libpng*.dylib
zip -y freetype-2.10.0.zip libfreetype.*dylib
zip -y fontconfig-2.13.1.zip libfontconfig*.dylib
zip -y pixman-0.40.0.zip libpixman*.dylib
zip -y cairo-1.16.0.zip libcairo.*dylib

zip -y openssl-1.1.1k.zip libssl*dylib
zip -y openssl-1.1.1k.zip libcry*dylib
zip -y libssh2-1.9.0.zip libssh*dylib
zip -y libgit2-1.4.4.zip libgit2*dylib

More dependencies to come

Clone this wiki locally