diff options
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/build-distribution-archives | 21 | ||||
| -rwxr-xr-x | bin/build-python | 2 | ||||
| -rwxr-xr-x | bin/generate-inx-files | 76 |
3 files changed, 84 insertions, 15 deletions
diff --git a/bin/build-distribution-archives b/bin/build-distribution-archives index 021461df..285e5ef8 100644 --- a/bin/build-distribution-archives +++ b/bin/build-distribution-archives @@ -8,8 +8,21 @@ if [ "$BUILD" = "osx" ]; then # adding version to Info.plist plutil -replace CFBundleShortVersionString -string ${VERSION} dist/inkstitch.app/Contents/Info.plist rm -rf dist/inkstitch/ - # this removes the extra dylibs that cause notary to fail. - rm -rf dist/inkstitch.app/Contents/MacOS/shapely/.dylibs + # unlinking the libgeos and dot dylib folder syslinks and fix broken syslinks for notary. + # copying libgeos dylibs with ditto preserves information to pass notary. + unlink dist/inkstitch.app/Contents/Resources/shapely/.dylibs + + unlink dist/inkstitch.app/Contents/Resources/libgeos.3.11.2.dylib + unlink dist/inkstitch.app/Contents/Resources/libgeos_c.1.17.2.dylib + + unlink dist/inkstitch.app/Contents/Frameworks/libgeos.3.11.2.dylib + unlink dist/inkstitch.app/Contents/Frameworks/libgeos_c.1.17.2.dylib + + ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos.3.11.2.dylib dist/inkstitch.app/Contents/Resources/ + ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos_c.1.17.2.dylib dist/inkstitch.app/Contents/Resources/ + + ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos.3.11.2.dylib dist/inkstitch.app/Contents/Frameworks/ + ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos_c.1.17.2.dylib dist/inkstitch.app/Contents/Frameworks/ # Install location for pkgbuild PKG_INSTALL_PATH="/tmp/inkstitch/" # Checking arch of macos and setting path of electron for arm64 or intel @@ -36,7 +49,7 @@ if [ "$BUILD" = "osx" ]; then DEV_IDENT="Developer ID Application: Lex Neva (929A568N58)" echo "Signing of inkstitch.app" # Coyping inkstitch-gui.app into inkstitch - ditto "${ELECTRON_BUILD_PATH}" dist/inkstitch.app/Contents/MacOS/electron + ditto "${ELECTRON_BUILD_PATH}" dist/inkstitch.app/Contents/Frameworks/electron # signing the binary may fix notary issue /usr/bin/codesign -s "${DEV_IDENT}" \ --deep \ @@ -92,7 +105,7 @@ if [ "$BUILD" = "osx" ]; then fi else # local builds will not be signed or notarized - cp -a "${ELECTRON_BUILD_PATH}" dist/inkstitch.app/Contents/MacOS/electron + cp -a "${ELECTRON_BUILD_PATH}" dist/inkstitch.app/Contents/Frameworks/electron pkgbuild --root dist/inkstitch.app \ --component-plist installer_scripts/inkstitch.plist \ --ownership recommended \ diff --git a/bin/build-python b/bin/build-python index 4c27e5d8..cd3e84a2 100755 --- a/bin/build-python +++ b/bin/build-python @@ -2,6 +2,8 @@ set -e info_year=$( date "+%Y" ) +# PyInstaller v6.x rearranges folder configuration causing broken builds, This re-enables old onedir layout. +pyinstaller_args+="--contents-directory . " # We need to use the precompiled bootloader linked with graphical Mac OS X # libraries if we develop a GUI application for Mac: diff --git a/bin/generate-inx-files b/bin/generate-inx-files index 44edea15..553e184d 100755 --- a/bin/generate-inx-files +++ b/bin/generate-inx-files @@ -1,19 +1,73 @@ #!/usr/bin/env python +# Implemented support for multiple diverse versions of Inkstitch extensions in Inkscape. +# - useful for testing and development +# - useful for comparing different versions of Inkstitch + + +# this script generates inx files in inx/ directory from xml templates in templates/ directory +# - added support for alternative id registration and menu names for Inkscape extensions +# - each xml template should be modified to use the new id_inkstitch and menu_inkstitch: +# <id>org.inkstitch.....</id> ---> <id>org.{{ id_inkstitch }}.....</id> +# <submenu name="Ink/Stitch" ---> <submenu name="{{ menu_inkstitch }}" +# or input/output xml template should be modified to use the filetypename: +# <filetypename>Ink/Stitch:... ---> <filetypename>{{ menu_inkstitch }}:... + + +# Here's an example of how to use two Inkstitch extensions: +# - install Inkstitch in two different locations (e.g. inkstitch and inkstitch-k) +# - check out the Inkstitch repository in two different locations +# - ensure 'make inx' is executed in both locations +# - this will generate also inx/locale/ files +# - generate modified inx files for second location +# - in the second location: +# > generate-inx-files -a k +# - install the inx files in Inkscape extensions directory +# - symlink .config/inkscape/extensions/inkstitch -> inkstitch +# - symlink .config/inkscape/extensions/inkstitch-k -> inkstitch-k +# - modify .config/inkscape/keys/default.xml if necessary +# - run Inkscape with both Inkstitch extensions enabled +# - first version: Extensions > Ink/Stitch +# - second version: Extensions > Ink/Stitch-k + import sys import os -from os.path import dirname +from pathlib import Path +import argparse + +# add inkstitch lib dir to python path +parent_dir = Path(__file__).resolve().parents[1] +sys.path.append(str(parent_dir)) # we need import from lib/ directory + +# find inkex module +try: + import inkex # if it is already in the path, do nothing +except ImportError: # if not, add inkscape version + import subprocess + inkscape_path = 'inkscape' + # for now assume inkscape is in the path and raise an error if inkscape is not in the path + system_path = subprocess.run([inkscape_path, "--system-data-directory"], capture_output=True, text=True).stdout.strip() + inkex_path = os.path.join(system_path, "extensions") + sys.path.append(inkex_path) + + # possible last attempt to import inkex may be as follows: + # sys.path.append(os.path.join("/usr/share/inkscape/extensions")) + # default inkex.py location on macOS + # sys.path.append("/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/") + + +from lib.inx.generate import generate_inx_files -# add inkstitch libs to python path -parent_dir = os.path.join(dirname(dirname(__file__))) -sys.path.append(parent_dir) +# parse arguments +# -a, --alter letter a-z: generate inx files for the given alter +parser = argparse.ArgumentParser(description='Generate INX files, supporting multiple active inkstitch extensions in inkscape.') +parser.add_argument('-a', '--alter', type=str, help='Letter a-z representing the alter') +args = parser.parse_args() -# try find add inkex.py et al. as well -sys.path.append(os.path.join(parent_dir, "inkscape", "share", "extensions")) -sys.path.append(os.path.join("/usr/share/inkscape/extensions")) -# default inkex.py location on macOS -sys.path.append("/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/") +# print(f"generate_inx_files: alter={args.alter}") -from lib.inx import generate_inx_files +inx_path = parent_dir / "inx" +inx_path.mkdir(parents=True, exist_ok=True) -generate_inx_files() +# if -a is not given, args.alter is None - not alternative inx, but generate default inx +generate_inx_files(args.alter) |
