From d18eaf839b42b32c44ab627f1d98b567688b363e Mon Sep 17 00:00:00 2001 From: "Mark K. Kim" Date: Sun, 1 Apr 2018 15:35:07 -0400 Subject: [PATCH] Update build process for macOS. --- Makefile | 2 +- macos/Info.plist | 2 +- macos/README.txt | 68 ++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7a2111e1d..0a9c0dec3 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ linux_ARCH_LIBS:=obj/postscript_print.o ARCH_LIBS:=$($(OS)_ARCH_LIBS) windows_ARCH_CFLAGS:= -osx_ARCH_CFLAGS:=-isystem /opt/local/include -DHAVE_STRCASESTR -w -headerpad_max_install_names +osx_ARCH_CFLAGS:=-mmacosx-version-min=10.7 -isystem /opt/local/include -DHAVE_STRCASESTR -w -headerpad_max_install_names beos_ARCH_CFLAGS:= linux_ARCH_CFLAGS:= ARCH_CFLAGS:=$($(OS)_ARCH_CFLAGS) diff --git a/macos/Info.plist b/macos/Info.plist index 2d098809c..316e863af 100644 --- a/macos/Info.plist +++ b/macos/Info.plist @@ -23,6 +23,6 @@ CFBundleSignature TXPT CFBundleVersion - 2017-11-27 + 2017-12-24 diff --git a/macos/README.txt b/macos/README.txt index 13d2bd312..0c499f184 100644 --- a/macos/README.txt +++ b/macos/README.txt @@ -10,8 +10,11 @@ Linux application. REQUIREMENTS ------------ Although Tux Paint is run without the XCode IDE, XCode itself is still required -to build Tux Paint. Download it from the App Store, and launch it once to -accept its license agreements. +to build Tux Paint. Download it from the App Store, and launch it once to +accept its license agreements. Also install XCode command line tools using the +command: + + xcode-select --install Building Tux Paint also requires various libraries from MacPorts. Install them to the default /opt/local path according to the instructions found on their @@ -23,6 +26,7 @@ As of this writing, the required libraries are: cairo fribidi + lbzip2 libpaper libpng librsvg @@ -55,3 +59,63 @@ Simply, run: ... to create the TuxPaint.app application bundle that can be run in-place or copied to /Applications. Zip it up for distribution. + +KNOWN BUGS +---------- +On macOS 10.13 High Sierra: +- The cursor appears with an invert-transparent background due to an issue + with SDL1 on macOS 10.13. The following bug reports have been made: + + MacPorts defect #55804 - https://trac.macports.org/ticket/55804 + SDL bug #4076 - https://bugzilla.libsdl.org/show_bug.cgi?id=4076 + + +BACKWARD COMPATIBILITY +---------------------- +Broadly speaking, a Mac binary built on macOS 10.12 Sierra (for example) runs +only on macOS 10.12 and later. To compile a binary that can also execute on an +earlier version of macOS (say, 10.7 Lion and later), one of the following must +be done: + + (A) Pass the flag -mmacosx-version-min=10.7 to the compiler. + (B) Or set the environment variable MACOSX_DEPLOYMENT_TARGET to 10.7 + +Tux Paint binary itself is built by doing (A) in the Makefile (by passing the +parameter to osx_ARCH_CFLAGS). However, the MacPorts libraries used by Tux +Paint are not, so Tux Paint package itself will not run on any version of macOS +earlier than the macOS on which it is built. + +To build the Tux Paint package that can run on earlier versions of macOS, the +MacPorts libraries also need to be built with either #1 or #2. This is done by +configuring MacPorts to install all packages from their sources and build them +to run on macOS 10.7 and later: + + 1. Install the MacPorts base normally. + 2. Before installing any MacPorts package, add the following settings to + /opt/local/etc/macports/macports.conf: + + buildfromsource always + macosx_deployment_target 10.7 + + 3. Install all packages normally. + +... then build Tux Paint normally. + +Please note building MacPorts packages from the source takes significantly +longer than installing the prebuilt packages. + +If you have already installed MacPorts' prebuilt packages, it is possible to +uninstall them, add the above configuration from step #2, then install them +again from the source. The MacPorts webpage on migration explains how uninstall +packages and reinstall them after making system changes: + + https://trac.macports.org/wiki/Migration + +Even when Tux Paint and MacPorts are built to run on a specific version of +macOS, it is possible Tux Paint will not compile for or run on that version of +macOS. As of this writing, 10.7 is the oldest version of macOS that can be +targetted without errors when compiling the sources of MacPorts libraries +required by Tux Paint. + +4th March 2018 +Mark K. Kim