Skip to content

Commit

Permalink
Try and rescue macos libpng builds for Pharo
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nicolas-cellier-aka-nice committed Jan 3, 2021
1 parent 08a50c2 commit 61faabb
Show file tree
Hide file tree
Showing 22 changed files with 155 additions and 46 deletions.
9 changes: 5 additions & 4 deletions build.macos32x86/pharo.cog.spur.lowcode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
9 changes: 6 additions & 3 deletions build.macos32x86/pharo.cog.spur.minheadless/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@ 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

# 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
LDFLAGS+= -L$(THIRDPARTYOUTDIR)/lib -lSDL2
7 changes: 4 additions & 3 deletions build.macos32x86/pharo.cog.spur/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
7 changes: 4 additions & 3 deletions build.macos32x86/pharo.cog.v3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
7 changes: 4 additions & 3 deletions build.macos32x86/pharo.sista.spur/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
7 changes: 4 additions & 3 deletions build.macos32x86/pharo.stack.spur.lowcode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
7 changes: 4 additions & 3 deletions build.macos32x86/pharo.stack.spur/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
6 changes: 3 additions & 3 deletions build.macos32x86/third-party/Makefile.libpng
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -37,4 +37,4 @@ $(LIBPNGLIB): $(THIRDPARTYLIBDIR)/$(LIBPNGLIBNAME)
done
@echo "DONE"

libpng: $(LIBPNGLIB)
libpng: $(LIBPNGLIB)
40 changes: 40 additions & 0 deletions build.macos32x86/third-party/Makefile.zlib
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 6 additions & 3 deletions build.macos64x64/pharo.cog.spur.lowcode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
7 changes: 5 additions & 2 deletions build.macos64x64/pharo.cog.spur/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
7 changes: 5 additions & 2 deletions build.macos64x64/pharo.sista.spur/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
9 changes: 6 additions & 3 deletions build.macos64x64/pharo.stack.spur.lowcode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
7 changes: 5 additions & 2 deletions build.macos64x64/pharo.stack.spur/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
2 changes: 2 additions & 0 deletions build.macos64x64/squeak.stack.spur/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build.macos64x64/third-party/Makefile.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ $(CAIROLIB): pkgconfig libpng freetype2 pixman $(THIRDPARTYLIBDIR)/$(CAIROLIBNAM
done
@echo "DONE"

cairo: $(CAIROLIB)
cairo: $(CAIROLIB)
Loading

0 comments on commit 61faabb

Please sign in to comment.