Merge pull request #685 from andreasb242/mac-gtk-build

Mac gtk build
presentation
andreasb242 7 years ago committed by GitHub
commit 5e68d13ed3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      mac-setup/.gitignore
  2. 2
      mac-setup/Info.plist
  3. 32
      mac-setup/README.md
  4. 45
      mac-setup/build-app.sh
  5. 12
      mac-setup/build-gtk3.sh
  6. 29
      mac-setup/build-poppler.sh
  7. 81
      mac-setup/xournalpp.bundle
  8. 12
      readme/MacBuild.md

@ -1,3 +1,10 @@
macdylibbundler
Xournal++.app
gtk-osx-build-setup.sh
tmp-jhbuild-revision
poppler-*
poppler.tar.xz
openjpeg*
gtk-mac-bundler
.xournalpp*
*.zip

@ -76,7 +76,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Xournal++ 1.0.6</string>
<string>Xournal++</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

@ -0,0 +1,32 @@
## Build Xournal++ .app
Do not install macports or homebrew. If you have installed it, you need to
create a new user, and use this for the whole process. jhbuild does not work,
if there is such an environment installed.
### Make sure the Development environement is installed
Open a Terminal, and type in **git**, confirm popup from Appstore with "Install" to install development tools.
### Build GTK
Execute in this folder.
````bash
./build-gtk3.sh
````
The build will fail. After first failure (missing python module six)
Download from here: https://pypi.org/project/six/
Execute
````bash
$HOME/gtk/inst/bin/python setup.py install
````
### Build Xournal++
````bash
cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/gtk/inst -DENABLE_MATHTEX=OFF ..
make -j 4
make install
````
### Build App
````bash
./build-app.sh
````

@ -11,43 +11,42 @@ cd "${0%/*}"
# delete old app, if there
echo "clean old app"
export PATH="$HOME/.local/bin:$HOME/gtk/inst/bin:$PATH"
rm -rf ./Xournal++.app
rm ./Xournal++.zip
echo "prepare macdylibbundler"
if [ ! -d "macdylibbundler" ]; then
git clone https://github.com/auriamg/macdylibbundler.git macdylibbundler
cd macdylibbundler
echo "prepare gtk-mac-bundler"
if [ ! -d "gtk-mac-bundler" ]; then
git clone https://gitlab.gnome.org/GNOME/gtk-mac-bundler.git
cd gtk-mac-bundler
else
cd macdylibbundler
cd gtk-mac-bundler
git pull
fi
make -j 2
make install
cd ..
echo "copy binaries"
mkdir -p Xournal++.app/Contents/MacOS
mkdir -p Xournal++.app/Contents/Resources
cp ../build/src/xournalpp ./Xournal++.app/Contents/MacOS/xournalpp
echo "create package"
./macdylibbundler/dylibbundler -od -b -x ./Xournal++.app/Contents/MacOS/xournalpp -d ./Xournal++.app/Contents/libs/
gtk-mac-bundler xournalpp.bundle
mdkir -p ./Xournal++.app/Contents/lib
mkdir -p Xournal++.app/Contents/Resources
echo "copy pixbuf libs"
cp -r /usr/local/lib/gdk-pixbuf-2.0 ./Xournal++.app/Contents/lib
export bundle_etc="./Xournal++.app/Contents/Resources/etc"
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
echo "copy pixbuf lib dependencies"
./macdylibbundler/dylibbundler -od -b -x ./Xournal++.app/Contents/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.so -d ./Xournal++.app/Contents/libs/
mkdir -p ./Xournal++.app/Contents/Resources/etc/gtk-2.0/
gdk-pixbuf-query-loaders > ./Xournal++.app/Contents/Resources/etc/gtk-2.0/gdk-pixbuf.loaders
sed -i -e "s:$HOME/gtk/inst/:@executable_path/../Resources/:g" ./Xournal++.app/Contents/Resources/etc/gtk-2.0/gdk-pixbuf.loaders
echo "copy icons"
## TODO
echo "Copy UI"
echo "finalize packaging"
cp -rp ../ui ./Xournal++.app/Contents/Resources/
cp icon/xournalpp.icns ./Xournal++.app/Contents/Resources/xournalpp.icns
cp Info.plist ./Xournal++.app/Contents/Info.plist
cp -rvp ../ui ./Xournal++.app/Contents/Resources/
echo "Create zip"
zip -r Xournal++.zip Xournal++.app
echo "finished"

@ -0,0 +1,12 @@
export PATH="$HOME/.local/bin:$PATH"
# missing six python lib:
# after first failure download, unpack and install with
# /Users/yourname/gtk/inst/bin/python setup.py install
curl https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/gtk-osx-build-setup.sh -o gtk-osx-build-setup.sh
chmod +x gtk-osx-build-setup.sh
./gtk-osx-build-setup.sh
jhbuild bootstrap
jhbuild build python meta-gtk-osx-bootstrap meta-gtk-osx-gtk3

@ -0,0 +1,29 @@
export PATH="$HOME/.local/bin:$PATH"
curl -L https://github.com/uclouvain/openjpeg/archive/v2.3.0.tar.gz -o openjpeg.tar.gz
tar xf openjpeg.tar.gz
cd openjpeg-*
mkdir build
cd build
echo "Build OpenJpeg"
pwd
$HOME/gtk/inst/bin/cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/gtk/inst ..
make -j8
make install
cd ..
cd ..
export LIBRARY_PATH="$HOME/gtk/inst/lib:$LIBRARY_PATH"
curl https://poppler.freedesktop.org/poppler-0.72.0.tar.xz -o poppler.tar.xz
tar xf poppler.tar.xz
cd poppler-*
mkdir build
cd build
echo "Build Poppler"
pwd
$HOME/gtk/inst/bin/cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/gtk/inst ..
make -j8
make install
cd ..
cd ..

@ -0,0 +1,81 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<app-bundle>
<meta>
<prefix name="default">${env:HOME}/gtk/inst</prefix>
<destination overwrite="yes">.</destination>
<!-- Comment this out to keep the install names in binaries -->
<run-install-name-tool/>
<!-- Optionally specify a launcher script to use. If the
application sets up everything needed itself, like
environment variable, linker paths, etc, a launcher script is
not needed. If the source path is left out, the default
script will be used.
-->
<launcher-script></launcher-script >
<gtk>gtk+-3.0</gtk>
</meta>
<plist>${project}/Info.plist</plist>
<main-binary>${prefix}/bin/xournalpp</main-binary>
<!-- Copy in the input methods. Dunno if they actually work with
OSX. Note the ${gtkdir} macro, which expands to the correct
library subdirectory for the specified gtk version. -->
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so
</binary>
<!-- And the print backends -->
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
</binary>
<!-- Starting with 2.24, gdk-pixbuf installs into its own directory. -->
<binary>
${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so
</binary>
<!-- Poppler -->
<binary>
${prefix}/lib/libpoppler-glib*.dynlib
</binary>
<!-- Translation filenames, one for each program or library that you
want to copy in to the bundle. The "dest" attribute is
optional, as usual. Bundler will find all translations of that
library/program under the indicated directory and copy them.-->
<translations name="gtk30">
${prefix}/share/locale
</translations>
<!-- Data to copy in, usually Glade/UI files, images, sounds files
etc. The destination inside the bundle can be specified if the
files should end up at a different location, by using the
"dest" property. The destination must then start with the macro
"${bundle}", which refers to the bundle root directory.
-->
<!-- data>
${prefix}/share/gtk3-demo
</data -->
<!-- Copy in the themes data. You may want to trim this to save space
in your bundle. -->
<data>
${prefix}/share/themes
</data>
<data>
${prefix}/share/icons
</data>
<data dest="${bundle}/Contents/Resources">
${project}/icon/xournalpp.icns
</data>
</app-bundle>

@ -1,4 +1,6 @@
# Xournal++ Mac Build
# Xournal++ Mac Build (development)
**To create an .app see [Mac Setup](../mac-setup/README.md)**
## Install Homebrew
https://brew.sh/
@ -21,11 +23,3 @@ cd build
cmake .. -DENABLE_MATHTEX=OFF
make
````
## APP Building
Currently not ready, Xournal++ can be executed from Build directory with
````bash
./src/xournalpp
````
Work in progress

Loading…
Cancel
Save