Skip to content

Commit

Permalink
Add Ghostscript
Browse files Browse the repository at this point in the history
Change the mechanism how we override 'python' because we need the
$bundle_bin directory in $PATH for Ghostscript.

Update toolset link.
  • Loading branch information
dehesselle committed Sep 28, 2019
1 parent 0d6c1e6 commit 79bfd7a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
3 changes: 2 additions & 1 deletion 020-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ URL_CPPUNIT=https://dev-www.libreoffice.org/src/cppunit-1.14.0.tar.gz
URL_DOUBLE_CONVERSION=https://github.com/google/double-conversion/archive/v3.1.4.tar.gz
URL_GC=https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz
URL_GDL=https://github.com/GNOME/gdl/archive/GDL_3_28_0.tar.gz
URL_GHOSTSCRIPT=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs927/ghostscript-9.27.tar.gz
URL_GSL=http://ftp.fau.de/gnu/gsl/gsl-2.5.tar.gz
URL_GTK_MAC_BUNDLER=https://gitlab.gnome.org/GNOME/gtk-mac-bundler/-/archive/93edee7e2d0ec8230aaf5acb21452202b10cd678.tar.gz
URL_GTK_OSX=https://raw.githubusercontent.com/dehesselle/gtk-osx/inkscape
Expand All @@ -145,7 +146,7 @@ URL_PYTHON3_BIN=https://github.com/dehesselle/py3framework/releases/download/py3
URL_PYTHON36_SRC=https://github.com/dehesselle/py3framework/archive/py369.3.tar.gz
URL_PYTHON36_BIN=https://github.com/dehesselle/py3framework/releases/download/py369.3/py369_framework_3.tar.xz
# A pre-built version of the complete toolset.
URL_TOOLSET_CACHE=https://github.com/dehesselle/mibap/releases/download/v0.20/mibap_v0.20.tar.xz
URL_TOOLSET_CACHE=https://github.com/dehesselle/mibap/releases/download/v0.22/mibap_v0.22.tar.xz

### Python packages ############################################################

Expand Down
5 changes: 5 additions & 0 deletions 150-jhbuild-inkdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,8 @@ configure_make_makeinstall --with-libpotrace
get_source $URL_OPENMP
cmake_make_makeinstall

### install Ghostscript ########################################################

get_source $URL_GHOSTSCRIPT
configure_make_makeinstall

27 changes: 19 additions & 8 deletions 220-inkscape-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,20 @@ python3 -m compileall -f $APP_DIR || true

# Default interpreter is an unversioned environment lookup for 'python', so
# we prepare to override it.
mkdir -p $APP_BIN_DIR
cd $APP_BIN_DIR
ln -sf ../../Frameworks/Python.framework/Versions/Current/bin/python3 python
mkdir -p $APP_BIN_DIR/python_override
cd $APP_BIN_DIR/python_override
ln -sf ../../../Frameworks/Python.framework/Versions/Current/bin/python3 python

# add override check to launch script
insert_before $APP_EXE_DIR/Inkscape '\$EXEC' '\
INKSCAPE_PREFERENCES=\"$HOME/Library/Application Support/Inkscape/config/inkscape/preferences.xml\"\
if [ -f \"$INKSCAPE_PREFERENCES\" ]; then # Has Inkscape been launched before?\
if [ -f \"$INKSCAPE_PREFERENCES\" ]; then # Has Inkscape been launched before?\
PYTHON_INTERPRETER=$\(xmllint --xpath '\''string\(//inkscape/group[@id=\"extensions\"]/@python-interpreter\)'\'' \"$INKSCAPE_PREFERENCES\"\)\
if [ -z $PYTHON_INTERPRETER ]\; then # No override for Python interpreter?\
export PATH=$bundle_bin:$PATH # make bundled Python default one\
if [ -z $PYTHON_INTERPRETER ]\; then # No override for Python interpreter?\
export PATH=$bundle_bin/python_override:$PATH # make bundled Python default one\
fi\
else # Inkscape has not been launched before\
export PATH=$bundle_bin:$PATH # make bundled Python default one\
else # Inkscape has not been launched before?\
export PATH=$bundle_bin/python_override:$PATH # make bundled Python default one\
fi\
'

Expand Down Expand Up @@ -239,3 +239,14 @@ replace_line $APP_EXE_DIR/Inkscape AppleCollationOrder \
replace_line $APP_EXE_DIR/Inkscape '-a -n $APPLECOLLATION;' \
'if test -z ${LANG} -a -n "$APPLECOLLATION"; then'

### Ghostscript ################################################################

relocate_dependency @executable_path/../lib/libz.1.dylib $APP_BIN_DIR/gs
relocate_dependency @executable_path/../lib/libfontconfig.1.dylib $APP_BIN_DIR/gs
relocate_dependency @executable_path/../lib/libfreetype.6.dylib $APP_BIN_DIR/gs

### final changes to PATH ######################################################

insert_before $APP_EXE_DIR/Inkscape '\$EXEC' \
'export PATH=$bundle_bin:$PATH'

10 changes: 10 additions & 0 deletions inkscape.bundle
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
<binary>
${prefix}/lib/libgirepository-1.0.1.dylib
</binary>
<!-- Ghostscript -->
<binary>
${prefix}/bin/gs
</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
Expand Down Expand Up @@ -142,6 +146,12 @@
<data>
${prefix}/share/inkscape
</data>
<data>
${prefix}/share/ghostscript
</data>
<data>
${prefix}/bin/ps2pdf*
</data>
<!-- Copy in the themes data. You may want to trim this to save space
in your bundle. -->
<data>
Expand Down

0 comments on commit 79bfd7a

Please sign in to comment.