From 61faabba1f68c1b5ba6b161f8571020b0ce755ec Mon Sep 17 00:00:00 2001 From: Nicolas Cellier Date: Sun, 3 Jan 2021 04:00:22 +0100 Subject: [PATCH] Try and rescue macos libpng builds for Pharo On macosx, zlib is a pre-requisite of libpng, so it has to be compiled While at it, upgrade libpng to 1.16.37 due to CVE-2019-7317 - see http://www.libpng.org/pub/png/libpng.html --- .../pharo.cog.spur.lowcode/Makefile | 9 +++-- .../pharo.cog.spur.minheadless/Makefile | 9 +++-- build.macos32x86/pharo.cog.spur/Makefile | 7 ++-- build.macos32x86/pharo.cog.v3/Makefile | 7 ++-- build.macos32x86/pharo.sista.spur/Makefile | 7 ++-- .../pharo.stack.spur.lowcode/Makefile | 7 ++-- build.macos32x86/pharo.stack.spur/Makefile | 7 ++-- build.macos32x86/third-party/Makefile.libpng | 6 +-- build.macos32x86/third-party/Makefile.zlib | 40 +++++++++++++++++++ .../pharo.cog.spur.lowcode/Makefile | 9 +++-- build.macos64x64/pharo.cog.spur/Makefile | 7 +++- build.macos64x64/pharo.sista.spur/Makefile | 7 +++- .../pharo.stack.spur.lowcode/Makefile | 9 +++-- build.macos64x64/pharo.stack.spur/Makefile | 7 +++- build.macos64x64/squeak.stack.spur/Makefile | 2 + build.macos64x64/third-party/Makefile.cairo | 2 +- .../third-party/Makefile.freetype2 | 2 +- build.macos64x64/third-party/Makefile.libpng | 6 +-- build.macos64x64/third-party/Makefile.zlib | 40 +++++++++++++++++++ platforms/iOS/plugins/FT2Plugin/Makefile | 1 + third-party/libpng.spec | 7 ++-- third-party/zlib.spec | 3 +- 22 files changed, 155 insertions(+), 46 deletions(-) create mode 100644 build.macos32x86/third-party/Makefile.zlib create mode 100644 build.macos64x64/third-party/Makefile.zlib diff --git a/build.macos32x86/pharo.cog.spur.lowcode/Makefile b/build.macos32x86/pharo.cog.spur.lowcode/Makefile index 03ecb532b1..54d1fc1eb0 100644 --- a/build.macos32x86/pharo.cog.spur.lowcode/Makefile +++ b/build.macos32x86/pharo.cog.spur.lowcode/Makefile @@ -10,9 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo - -#CFLAGS=$(CFLAGS) -DNSZombieEnabled=YES +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo + +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -21,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos32x86/pharo.cog.spur.minheadless/Makefile b/build.macos32x86/pharo.cog.spur.minheadless/Makefile index 4810cddab8..571f2014fa 100644 --- a/build.macos32x86/pharo.cog.spur.minheadless/Makefile +++ b/build.macos32x86/pharo.cog.spur.minheadless/Makefile @@ -10,9 +10,11 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo EXTRAVMLIBS=libsdl2 +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo + # Now include the Makefile proper, which is common to all Mac OS builds. # include ../common.minheadless/Makefile.app @@ -20,16 +22,17 @@ include ../common.minheadless/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo # extras for headless VM to open world with SDL2 # CFLAGS+= -I$(THIRDPARTYINCLUDEDIR)/SDL2 -DHAVE_SDL2=1 -LDFLAGS+= -L$(THIRDPARTYOUTDIR)/lib -lSDL2 \ No newline at end of file +LDFLAGS+= -L$(THIRDPARTYOUTDIR)/lib -lSDL2 diff --git a/build.macos32x86/pharo.cog.spur/Makefile b/build.macos32x86/pharo.cog.spur/Makefile index 391fd8485b..1ff23e236f 100644 --- a/build.macos32x86/pharo.cog.spur/Makefile +++ b/build.macos32x86/pharo.cog.spur/Makefile @@ -10,9 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo -#CFLAGS=$(CFLAGS) -DNSZombieEnabled=YES +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -21,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos32x86/pharo.cog.v3/Makefile b/build.macos32x86/pharo.cog.v3/Makefile index 2ff22fc3b8..433ca90eca 100644 --- a/build.macos32x86/pharo.cog.v3/Makefile +++ b/build.macos32x86/pharo.cog.v3/Makefile @@ -10,9 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo -#CFLAGS=$(CFLAGS) -DNSZombieEnabled=YES +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -21,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos32x86/pharo.sista.spur/Makefile b/build.macos32x86/pharo.sista.spur/Makefile index b256374ae8..e2ff82b079 100644 --- a/build.macos32x86/pharo.sista.spur/Makefile +++ b/build.macos32x86/pharo.sista.spur/Makefile @@ -10,9 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo -#CFLAGS=$(CFLAGS) -DNSZombieEnabled=YES +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -21,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos32x86/pharo.stack.spur.lowcode/Makefile b/build.macos32x86/pharo.stack.spur.lowcode/Makefile index d9e62adb91..c2c438e866 100644 --- a/build.macos32x86/pharo.stack.spur.lowcode/Makefile +++ b/build.macos32x86/pharo.stack.spur.lowcode/Makefile @@ -10,9 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo -#CFLAGS=$(CFLAGS) -DNSZombieEnabled=YES +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -21,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos32x86/pharo.stack.spur/Makefile b/build.macos32x86/pharo.stack.spur/Makefile index b8c791328c..3d0bde7443 100644 --- a/build.macos32x86/pharo.stack.spur/Makefile +++ b/build.macos32x86/pharo.stack.spur/Makefile @@ -10,9 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo -#CFLAGS=$(CFLAGS) -DNSZombieEnabled=YES +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -21,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos32x86/third-party/Makefile.libpng b/build.macos32x86/third-party/Makefile.libpng index d93452988f..989bf06940 100644 --- a/build.macos32x86/third-party/Makefile.libpng +++ b/build.macos32x86/third-party/Makefile.libpng @@ -22,11 +22,11 @@ $(LIBPNGARCHIVE): $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME): $(LIBPNGARCHIVE) tar x -f $(LIBPNGARCHIVE) -C $(THIRDPARTYDIR) cd $(LIBPNGDIR) \ - && ./configure --prefix='$(THIRDPARTYOUTDIR)' CFLAGS='-arch i386' LDFLAGS='-arch i386' \ + && ./configure --prefix='$(THIRDPARTYOUTDIR)' CFLAGS='-arch i386' LDFLAGS='-arch i386 -L$(THIRDPARTYOUTDIR)/lib' \ && make \ && make install -$(LIBPNGLIB): $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) +$(LIBPNGLIB): zlib $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) cp -f $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) $(THIRDPARTYINSTALLDIR) install_name_tool -id "@executable_path/Plugins/$(LIBPNGLIBNAME)" $(LIBPNGLIB) @echo "Installing links" @@ -37,4 +37,4 @@ $(LIBPNGLIB): $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) done @echo "DONE" -libpng: $(LIBPNGLIB) \ No newline at end of file +libpng: $(LIBPNGLIB) diff --git a/build.macos32x86/third-party/Makefile.zlib b/build.macos32x86/third-party/Makefile.zlib new file mode 100644 index 0000000000..dfadd7a3d4 --- /dev/null +++ b/build.macos32x86/third-party/Makefile.zlib @@ -0,0 +1,40 @@ +ifndef THIRDPARTYDIR + include ../common/Makefile.lib.extra +endif +include ../../third-party/zlib.spec + +# plugin definitions +ZLIBURL:=$(zlib_spec_download_url) +ZLIBLIBNAME:=$(zlib_spec_product_name_macOS) +ZLIBDIR:=$(THIRDPARTYDIR)/$(zlib_spec_unpack_dir_name) +ZLIBARCHIVE:=$(THIRDPARTYCACHEDIR)/$(zlib_spec_archive_name) +ZLIBLIB:=$(THIRDPARTYINSTALLDIR)/$(ZLIBLIBNAME) +ZLIBSYMLINKS:=$(zlib_spec_symlinks_macOS) + +# ensure third-party library is built and recognised by plugins +INCDIRS:=$(INCDIRS) $(THIRDPARTYINCLUDEDIR) +EXTRALIBS:=$(EXTRALIBS) $(ZLIBLIB) +PLUGINREQS:=$(THIRDPARTYLIBS) + +$(ZLIBARCHIVE): + curl -o $(ZLIBARCHIVE) -L $(ZLIBURL) + +$(THIRDPARTYLIBDIR)/$(ZLIBLIBNAME): $(ZLIBARCHIVE) + tar x -f $(ZLIBARCHIVE) -C $(THIRDPARTYDIR) + cd $(ZLIBDIR) \ + && ./configure --prefix='$(THIRDPARTYOUTDIR)' --archs='-arch i386' \ + && make \ + && make install + +$(ZLIBLIB): $(THIRDPARTYLIBDIR)/$(ZLIBLIBNAME) + cp -f $(THIRDPARTYLIBDIR)/$(ZLIBLIBNAME) $(THIRDPARTYINSTALLDIR) + install_name_tool -id "@executable_path/Plugins/$(ZLIBLIBNAME)" $(ZLIBLIB) + @echo "Installing links" + @for each in $(THIRDPARTYLIBDIR)/$(ZLIBSYMLINKS); do \ + if [ -L $$each ]; then \ + cp -a $$each $(THIRDPARTYINSTALLDIR); \ + fi \ + done + @echo "DONE" + +zlib: $(ZLIBLIB) diff --git a/build.macos64x64/pharo.cog.spur.lowcode/Makefile b/build.macos64x64/pharo.cog.spur.lowcode/Makefile index 8a00b17d9c..6f6e424b98 100644 --- a/build.macos64x64/pharo.cog.spur.lowcode/Makefile +++ b/build.macos64x64/pharo.cog.spur.lowcode/Makefile @@ -10,7 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo + +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -19,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 -#include ../third-party/Makefile.libgit2 +include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos64x64/pharo.cog.spur/Makefile b/build.macos64x64/pharo.cog.spur/Makefile index 0affccb9a9..1bd0c8b102 100644 --- a/build.macos64x64/pharo.cog.spur/Makefile +++ b/build.macos64x64/pharo.cog.spur/Makefile @@ -10,7 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo + +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -19,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos64x64/pharo.sista.spur/Makefile b/build.macos64x64/pharo.sista.spur/Makefile index 25319dd891..d336d3cb35 100644 --- a/build.macos64x64/pharo.sista.spur/Makefile +++ b/build.macos64x64/pharo.sista.spur/Makefile @@ -10,7 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo + +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -19,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos64x64/pharo.stack.spur.lowcode/Makefile b/build.macos64x64/pharo.stack.spur.lowcode/Makefile index 9cca84ad64..7186a20760 100644 --- a/build.macos64x64/pharo.stack.spur.lowcode/Makefile +++ b/build.macos64x64/pharo.stack.spur.lowcode/Makefile @@ -10,7 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo + +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -19,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 -#include ../third-party/Makefile.libgit2 +include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos64x64/pharo.stack.spur/Makefile b/build.macos64x64/pharo.stack.spur/Makefile index 69e0cad791..c8e7ec25a6 100644 --- a/build.macos64x64/pharo.stack.spur/Makefile +++ b/build.macos64x64/pharo.stack.spur/Makefile @@ -10,7 +10,9 @@ APPNAME:=Pharo APPNAMEDEF:=$(APPNAME) APPIDENTIFIER:=org.pharo.$(APPNAME) USEPLUGINASDYLIB:=TRUE -THIRDPARTYLIBS:=pkgconfig freetype2 openssl libssh2 libgit2 libsdl2 pixman libpng cairo +THIRDPARTYLIBS:=pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo + +.PHONY: pkgconfig zlib libpng freetype2 openssl libssh2 libgit2 libsdl2 pixman cairo # Now include the Makefile proper, which is common to all Mac OS builds. # @@ -19,11 +21,12 @@ include ../common/Makefile.app # third-party libraries # include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib +include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../third-party/Makefile.openssl include ../third-party/Makefile.libssh2 include ../third-party/Makefile.libgit2 include ../third-party/Makefile.libsdl2 include ../third-party/Makefile.pixman -include ../third-party/Makefile.libpng include ../third-party/Makefile.cairo diff --git a/build.macos64x64/squeak.stack.spur/Makefile b/build.macos64x64/squeak.stack.spur/Makefile index 6d2d3eca33..837b538e56 100644 --- a/build.macos64x64/squeak.stack.spur/Makefile +++ b/build.macos64x64/squeak.stack.spur/Makefile @@ -3,6 +3,8 @@ # Do make init to allow make -n to function. # +BIT_IDENTICAL_FLOATING_POINT=BIT_IDENTICAL_FLOATING_POINT + VMSRCDIR:= ../../spurstack64src/vm SOURCEFILE:=SqueakV50.sources diff --git a/build.macos64x64/third-party/Makefile.cairo b/build.macos64x64/third-party/Makefile.cairo index b80f5e1ce6..2200e40b10 100644 --- a/build.macos64x64/third-party/Makefile.cairo +++ b/build.macos64x64/third-party/Makefile.cairo @@ -50,4 +50,4 @@ $(CAIROLIB): pkgconfig libpng freetype2 pixman $(THIRDPARTYLIBDIR)/$(CAIROLIBNAM done @echo "DONE" -cairo: $(CAIROLIB) \ No newline at end of file +cairo: $(CAIROLIB) diff --git a/build.macos64x64/third-party/Makefile.freetype2 b/build.macos64x64/third-party/Makefile.freetype2 index 7ded33df66..a9edce860e 100644 --- a/build.macos64x64/third-party/Makefile.freetype2 +++ b/build.macos64x64/third-party/Makefile.freetype2 @@ -43,4 +43,4 @@ $(FREETYPE2LIB): pkgconfig libpng $(THIRDPARTYLIBDIR)/$(FREETYPE2LIBNAME) done @echo "DONE" -freetype2: $(FREETYPE2LIB) \ No newline at end of file +freetype2: $(FREETYPE2LIB) diff --git a/build.macos64x64/third-party/Makefile.libpng b/build.macos64x64/third-party/Makefile.libpng index de2b95c99a..c4279f7e27 100644 --- a/build.macos64x64/third-party/Makefile.libpng +++ b/build.macos64x64/third-party/Makefile.libpng @@ -22,11 +22,11 @@ $(LIBPNGARCHIVE): $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME): $(LIBPNGARCHIVE) tar x -f $(LIBPNGARCHIVE) -C $(THIRDPARTYDIR) cd $(LIBPNGDIR) \ - && ./configure --prefix='$(THIRDPARTYOUTDIR)' CFLAGS='-arch x86_64' LDFLAGS='-arch x86_64' \ + && ./configure --prefix='$(THIRDPARTYOUTDIR)' CFLAGS='-arch x86_64' LDFLAGS='-arch x86_64 -L$(THIRDPARTYOUTDIR)/lib' \ && make \ && make install -$(LIBPNGLIB): $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) +$(LIBPNGLIB): zlib $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) cp -f $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) $(THIRDPARTYINSTALLDIR) install_name_tool -id "@executable_path/Plugins/$(LIBPNGLIBNAME)" $(LIBPNGLIB) @echo "Installing links" @@ -37,4 +37,4 @@ $(LIBPNGLIB): $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME) done @echo "DONE" -libpng: $(LIBPNGLIB) \ No newline at end of file +libpng: $(LIBPNGLIB) diff --git a/build.macos64x64/third-party/Makefile.zlib b/build.macos64x64/third-party/Makefile.zlib new file mode 100644 index 0000000000..2b1eeb3fa5 --- /dev/null +++ b/build.macos64x64/third-party/Makefile.zlib @@ -0,0 +1,40 @@ +ifndef THIRDPARTYDIR + include ../common/Makefile.lib.extra +endif +include ../../third-party/zlib.spec + +# plugin definitions +ZLIBURL:=$(zlib_spec_download_url) +ZLIBLIBNAME:=$(zlib_spec_product_name_macOS) +ZLIBDIR:=$(THIRDPARTYDIR)/$(zlib_spec_unpack_dir_name) +ZLIBARCHIVE:=$(THIRDPARTYCACHEDIR)/$(zlib_spec_archive_name) +ZLIBLIB:=$(THIRDPARTYINSTALLDIR)/$(ZLIBLIBNAME) +ZLIBSYMLINKS:=$(zlib_spec_symlinks_macOS) + +# ensure third-party library is built and recognised by plugins +INCDIRS:=$(INCDIRS) $(THIRDPARTYINCLUDEDIR) +EXTRALIBS:=$(EXTRALIBS) $(ZLIBLIB) +PLUGINREQS:=$(THIRDPARTYLIBS) + +$(ZLIBARCHIVE): + curl -o $(ZLIBARCHIVE) -L $(ZLIBURL) + +$(THIRDPARTYLIBDIR)/$(ZLIBLIBNAME): $(ZLIBARCHIVE) + tar x -f $(ZLIBARCHIVE) -C $(THIRDPARTYDIR) + cd $(ZLIBDIR) \ + && ./configure --prefix='$(THIRDPARTYOUTDIR)' --archs='-arch x86_64' \ + && make \ + && make install + +$(ZLIBLIB): $(THIRDPARTYLIBDIR)/$(ZLIBLIBNAME) + cp -f $(THIRDPARTYLIBDIR)/$(ZLIBLIBNAME) $(THIRDPARTYINSTALLDIR) + install_name_tool -id "@executable_path/Plugins/$(ZLIBLIBNAME)" $(ZLIBLIB) + @echo "Installing links" + @for each in $(THIRDPARTYLIBDIR)/$(ZLIBSYMLINKS); do \ + if [ -L $$each ]; then \ + cp -a $$each $(THIRDPARTYINSTALLDIR); \ + fi \ + done + @echo "DONE" + +zlib: $(ZLIBLIB) diff --git a/platforms/iOS/plugins/FT2Plugin/Makefile b/platforms/iOS/plugins/FT2Plugin/Makefile index c4ce18d3f2..e0d6a2e99b 100644 --- a/platforms/iOS/plugins/FT2Plugin/Makefile +++ b/platforms/iOS/plugins/FT2Plugin/Makefile @@ -1,5 +1,6 @@ THIRDPARTYLIBS:=pkgconfig libpng freetype2 include ../third-party/Makefile.pkgconfig +include ../third-party/Makefile.zlib include ../third-party/Makefile.libpng include ../third-party/Makefile.freetype2 include ../common/Makefile.plugin diff --git a/third-party/libpng.spec b/third-party/libpng.spec index 0d53538879..99c90f9448 100644 --- a/third-party/libpng.spec +++ b/third-party/libpng.spec @@ -1,6 +1,7 @@ -libpng_spec_download_url:=https://downloads.sourceforge.net/project/libpng/libpng16/1.6.36/libpng-1.6.36.tar.gz -libpng_spec_archive_name:=libpng-1.6.36.tar.gz -libpng_spec_unpack_dir_name:=libpng-1.6.36 +libpng_spec_download_url:=https://downloads.sourceforge.net/project/libpng/libpng16/1.6.37/libpng-1.6.37.tar.gz +libpng_spec_archive_name:=libpng-1.6.37.tar.gz +libpng_spec_unpack_dir_name:=libpng-1.6.37 +#yes 16.16 - don't ask... libpng_spec_product_name_macOS:=libpng16.16.dylib libpng_spec_product_name_linux:= libpng_spec_product_name_windows:=libpng16-16.dll diff --git a/third-party/zlib.spec b/third-party/zlib.spec index eb19edb4d5..4a47bbe0e0 100644 --- a/third-party/zlib.spec +++ b/third-party/zlib.spec @@ -1,6 +1,7 @@ zlib_spec_download_url:=http://zlib.net/zlib-1.2.11.tar.gz zlib_spec_archive_name:=zlib-1.2.11.tar.gz zlib_spec_unpack_dir_name:=zlib-1.2.11 -zlib_spec_product_name_macOS:= +zlib_spec_product_name_macOS:=libz.1.2.11.dylib zlib_spec_product_name_linux:= zlib_spec_product_name_windows:=zlib1.dll +zlib_spec_symlinks_macOS:=libz.dylib libz.1.dylib