summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorRené de Hesselle <dehesselle@web.de>2019-05-01 17:04:22 +0000
committerRené de Hesselle <dehesselle@web.de>2019-05-01 18:18:44 +0000
commit7450f944defc96d6a47be948af567e97a26655c8 (patch)
tree3dc75512c5f87cd50a94523b1cbb612f89e387cb /packaging
parentMerge branch 'master' of gitlab.com:inkscape/inkscape (diff)
downloadinkscape-7450f944defc96d6a47be948af567e97a26655c8.tar.gz
inkscape-7450f944defc96d6a47be948af567e97a26655c8.zip
Add fontconfig to the application bundle
This fixes fonts not showing up and un-breaks the font tool. Add more localizations.
Diffstat (limited to 'packaging')
-rw-r--r--packaging/macos/020-vars.sh1
-rwxr-xr-xpackaging/macos/220-inkscape-package.sh21
-rw-r--r--packaging/macos/fonts.conf77
-rw-r--r--packaging/macos/inkscape.bundle24
4 files changed, 120 insertions, 3 deletions
diff --git a/packaging/macos/020-vars.sh b/packaging/macos/020-vars.sh
index 5a3711c0c..6da06ffe9 100644
--- a/packaging/macos/020-vars.sh
+++ b/packaging/macos/020-vars.sh
@@ -111,6 +111,7 @@ APP_DIR=$ARTIFACT_DIR/Inkscape.app
APP_CON_DIR=$APP_DIR/Contents
APP_RES_DIR=$APP_CON_DIR/Resources
APP_BIN_DIR=$APP_RES_DIR/bin
+APP_ETC_DIR=$APP_RES_DIR/etc
APP_EXE_DIR=$APP_CON_DIR/MacOS
APP_LIB_DIR=$APP_RES_DIR/lib
APP_PLIST=$APP_CON_DIR/Info.plist
diff --git a/packaging/macos/220-inkscape-package.sh b/packaging/macos/220-inkscape-package.sh
index ceff8e04d..08d9477fb 100755
--- a/packaging/macos/220-inkscape-package.sh
+++ b/packaging/macos/220-inkscape-package.sh
@@ -100,3 +100,24 @@ export PATH=$P36_DIR/bin:$PATH # use Python interpreter from inside the app
$P36_DIR/bin/pip3 install lxml
$P36_DIR/bin/pip3 install numpy
+### fontconfig #################################################################
+
+# Mimic the behavior of having all files under 'share' and linking the
+# active ones to 'etc'.
+cd $APP_ETC_DIR/fonts/conf.d
+
+for file in ./*.conf; do
+ ln -sf ../../../share/fontconfig/conf.avail/$(basename $file)
+done
+
+insert_before $APP_EXE_DIR/Inkscape '\$EXEC' \
+ 'export FONTCONFIG_PATH=$bundle_res/etc/fonts'
+
+# Our customized version loses all the non-macOS paths and sets a cache
+# directory below '$HOME/Library/Application Support/Inkscape'.
+cp $SELF_DIR/fonts.conf $APP_ETC_DIR/fonts
+
+### GIO modules path ###########################################################
+
+insert_before $APP_EXE_DIR/Inkscape '\$EXEC' 'export GIO_MODULE_DIR=$bundle_lib/gio/modules'
+
diff --git a/packaging/macos/fonts.conf b/packaging/macos/fonts.conf
new file mode 100644
index 000000000..364bd3bd2
--- /dev/null
+++ b/packaging/macos/fonts.conf
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- /etc/fonts/fonts.conf file to configure system font access -->
+<fontconfig>
+ <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
+ <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
+ </its:rules>
+
+ <description>Default configuration file</description>
+
+<!--
+ Usually you'll find the "DO NOT EDIT THIS FILE" warning here.
+ I removed it since I clearly edited this file. I removed the
+ non-macOS paths and configured the cachedir.
+
+ Rene de Hesselle
+-->
+
+<!-- Font directory list -->
+
+ <dir>/System/Library/Fonts</dir> <dir>/Library/Fonts</dir> <dir>~/Library/Fonts</dir>
+<!--
+ Accept deprecated 'mono' alias, replacing it with 'monospace'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>mono</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>monospace</string>
+ </edit>
+ </match>
+
+<!--
+ Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans serif</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>sans-serif</string>
+ </edit>
+ </match>
+
+<!--
+ Accept deprecated 'sans' alias, replacing it with 'sans-serif'
+-->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans</string>
+ </test>
+ <edit name="family" mode="assign" binding="same">
+ <string>sans-serif</string>
+ </edit>
+ </match>
+
+<!--
+ Load local system customization file
+-->
+ <include ignore_missing="yes">conf.d</include>
+
+<!-- Font cache directory list -->
+
+ <cachedir>~/Library/Application Support/Inkscape/cache/fontconfig</cachedir>
+
+ <config>
+<!--
+ Rescan configuration every 30 seconds when FcFontSetList is called
+ -->
+ <rescan>
+ <int>30</int>
+ </rescan>
+ </config>
+
+</fontconfig>
+
diff --git a/packaging/macos/inkscape.bundle b/packaging/macos/inkscape.bundle
index 59d6deecd..ed2cc3512 100644
--- a/packaging/macos/inkscape.bundle
+++ b/packaging/macos/inkscape.bundle
@@ -80,10 +80,23 @@
<binary>
${prefix}/lib/libssl.1.1.dylib
</binary>
+ <binary>
+ ${prefix}/lib/gio/modules/*.so
+ </binary>
+ <!-- fontconfig binaries -->
+ <binary>
+ ${prefix}/bin/fc-*
+ </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="gdk-pixbuf">
+ ${prefix}/share/locale
+ </translations>
+ <translations name="gdl-3">
+ ${prefix}/share/locale
+ </translations>
<translations name="gtk30">
${prefix}/share/locale
</translations>
@@ -107,9 +120,14 @@
<!-- Copy in the themes data. You may want to trim this to save space
in your bundle. -->
<data>
- ${prefix}/share/themes
+ ${prefix}/etc/fonts
+ </data>
+ <data>
+ ${prefix}/share/fontconfig
+ </data>
+ <data>
+ ${prefix}/share/glib-2.0
</data>
-
<data>
${prefix}/share/icons
</data>
@@ -117,7 +135,7 @@
${prefix}/share/inkscape
</data>
<data>
- ${prefix}/share/glib-2.0
+ ${prefix}/share/themes
</data>
<!-- Copy icons. Note that the .icns file is an Apple format which