forked from xournalpp/xournalpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MacOS: Update the build environment to gtk 3.24.3 - switch to macports
The MacOS build does not recognize the Wacom pen due to a problem which is fixed in gtk 3.24.23. I did not manage to create the build environment with jhbuild so I switched to macports. The Readme explains how to create the build environment. The gtk-mac-integration and the gtk-mac-bundler is still used, i.e. this build produces an application bundle which runs standalone. See: xournalpp#1772
- Loading branch information
Showing
5 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# How to build for MacOS | ||
|
||
The MacOS build will build most prerequisites via macports. Some updated versions are installed via the manual configure/make/make install. The build environment is located in $HOME/gtk/inst for historical reasons. You need to have Apple XCode installed. | ||
|
||
``` | ||
cd mac-setup | ||
./installmacports.sh | ||
./cleanmacports.sh | ||
./build-gettext.sh | ||
./build-mac-integration.sh | ||
``` | ||
|
||
Then your build environment is ready and you can create the app bundle | ||
|
||
``` | ||
./complete-build.sh $HOME/gtk | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export PATH="/usr/bin:/bin" | ||
|
||
gettextversion=0.21 | ||
rm -rf ./gettext | ||
curl -L https://ftp.gnu.org/pub/gnu/gettext/gettext-$gettextversion.tar.xz -o gettext.tar.xy | ||
tar -xJf ./gettext.tar.xy | ||
rm ./gettext.tar.xy | ||
mv gettext-$gettextversion gettext | ||
cd gettext | ||
./configure --prefix=$HOME/gtk/inst \ | ||
--disable-csharp \ | ||
--disable-java \ | ||
--disable-native-java \ | ||
--disable-openmp \ | ||
--without-emacs \ | ||
--with-included-gettext \ | ||
--with-included-glib \ | ||
--with-included-libcroco \ | ||
--with-included-libunistring \ | ||
--with-included-libxml | ||
|
||
make -j8 | ||
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash -xve | ||
|
||
# Cleanup the macports build environment | ||
|
||
|
||
# Copyright (C) 2020 Friedrich Beckmann | ||
# Released under GNU General Public License, either version 3 | ||
# or any later option | ||
|
||
topdir=$HOME/gtk | ||
|
||
# This is the installation directory which will be used as macports prefix | ||
# and as pspp configure prefix. | ||
bundleinstall=$topdir/inst | ||
|
||
export PATH=$bundleinstall/bin:$bundleinstall/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin | ||
|
||
for i in {1..10}; do port -N uninstall leaves || true ; done | ||
|
||
rm -rf $bundleinstall/var/macports | ||
rm -rf $topdir/macports-ports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/bin/bash -xve | ||
|
||
# Install macports and all dependencies for xournalpp in $HOME/gtk/inst | ||
# macports is all recompiled because it uses the quartz backend instead of x11 | ||
|
||
portindexversion=8e06b840b02731c3ef712f4aa6c4ff138a64a604 | ||
|
||
# Copyright (C) 2020 Friedrich Beckmann | ||
# Released under GNU General Public License, either version 3 | ||
# or any later option | ||
|
||
echo `date` | ||
|
||
# Check if we are on MacOS | ||
if ! test `uname` = "Darwin"; then | ||
echo "This only works on MacOS" | ||
exit | ||
fi | ||
|
||
# Check if XCode is installed - Assume clang indicates xcode. | ||
if ! test -f /usr/bin/clang; then | ||
echo "/usr/bin/clang not found - please install XCode CLT" | ||
exit | ||
fi | ||
|
||
topdir=$HOME/gtk | ||
|
||
# This is the installation directory which will be used as macports prefix | ||
# and as pspp configure prefix. | ||
bundleinstall=$topdir/inst | ||
|
||
export PATH=$bundleinstall/bin:$bundleinstall/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin | ||
|
||
# Target macports install directory for the pspp bundle | ||
if test -d $bundleinstall; then | ||
echo "Found existing macports directory $bundleinstall - continue" | ||
else | ||
echo "Creating Macports installation in $bundleinstall" | ||
mkdir -p $bundleinstall | ||
# Install macports | ||
rm -rf /tmp/macports | ||
mkdir /tmp/macports | ||
pushd /tmp/macports | ||
macportsversion=2.6.3 | ||
curl https://distfiles.macports.org/MacPorts/MacPorts-$macportsversion.tar.gz -O | ||
tar xvzf Macports-$macportsversion.tar.gz | ||
cd Macports-$macportsversion | ||
./configure --prefix=$bundleinstall \ | ||
--with-applications-dir=$bundleinstall/Applications \ | ||
--with-no-root-privileges | ||
make | ||
make install | ||
popd | ||
rm -rf /tmp/macports | ||
# Modify the default variants to use quartz | ||
echo "-x11 +no_x11 +quartz" > $bundleinstall/etc/macports/variants.conf | ||
# Make the build compatible with previous OSX Versions | ||
# echo "macosx_deployment_target 10.7" >> $bundleinstall/etc/macports/macports.conf | ||
# dbus tries to install startup items which are under superuser account | ||
echo "startupitem_install no" >> $bundleinstall/etc/macports/macports.conf | ||
echo "buildfromsource always" >> $bundleinstall/etc/macports/macports.conf | ||
# Activate step failed due to bsdtar problem | ||
echo "hfscompression no" >> $bundleinstall/etc/macports/macports.conf | ||
# Fix the macports version for reproducible builds | ||
pushd $topdir | ||
git clone --single-branch https://github.com/macports/macports-ports.git | ||
cd macports-ports | ||
git checkout $portindexversion | ||
portindex | ||
popd | ||
echo "file://$topdir/macports-ports" > $bundleinstall/etc/macports/sources.conf | ||
echo "rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]" >> $bundleinstall/etc/macports/sources.conf | ||
fi | ||
|
||
echo `date` | ||
# Install the packages for pspp | ||
port -v selfupdate | ||
port upgrade outdated || true | ||
# Install the build dependencies | ||
|
||
|
||
buildports="pkgconfig \ | ||
gtk3 \ | ||
gtk-doc \ | ||
adwaita-icon-theme \ | ||
cmake \ | ||
automake \ | ||
autoconf \ | ||
poppler \ | ||
libzip \ | ||
portaudio \ | ||
libsndfile" | ||
|
||
port -N install $buildports | ||
port -N setrequested $buildports | ||
|
||
# gtk-mac-integration needs gettext 0.20 but macports has still 0.19 | ||
# so you need to uninstall gettext via macports and install it via the script | ||
# build-gettext.sh | ||
|
||
port -Nf uninstall gettext |