kopia lustrzana https://github.com/inkstitch/inkstitch
Pkg inkscape check (#1622)
* add warning if Inkscape not installed (mac) enable local build with arm linux and mac Authored-by: rejbasket <rejbasket@users.noreply.github.com>pull/1620/head
rodzic
a53d4aa229
commit
35b748c46c
|
@ -171,7 +171,7 @@ jobs:
|
||||||
# with --no-binary argument may fix notary issues as well shapely speedups error issue
|
# with --no-binary argument may fix notary issues as well shapely speedups error issue
|
||||||
pip install -U lxml --no-binary lxml
|
pip install -U lxml --no-binary lxml
|
||||||
pip uninstall --yes shapely
|
pip uninstall --yes shapely
|
||||||
pip install -U Shapely==1.8.0 --no-binary Shapely
|
pip install -v -U Shapely --no-binary Shapely
|
||||||
pip install pyinstaller
|
pip install pyinstaller
|
||||||
|
|
||||||
echo "${{ env.pythonLocation }}/bin" >> $GITHUB_PATH
|
echo "${{ env.pythonLocation }}/bin" >> $GITHUB_PATH
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
VERSION="$(echo ${GITHUB_REF} | sed -e 's|refs/heads/||' -e 's|refs/tags/||' -e 's|/|-|g')"
|
VERSION="$(echo ${GITHUB_REF} | sed -e 's|refs/heads/||' -e 's|refs/tags/||' -e 's|/|-|g')"
|
||||||
OS="${BUILD:-$(uname)}"
|
OS="${BUILD:-$(uname)}"
|
||||||
|
ARCH="$(uname -m)"
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
|
|
||||||
if [ "$BUILD" = "osx" ]; then
|
if [ "$BUILD" = "osx" ]; then
|
||||||
|
@ -7,9 +8,19 @@ if [ "$BUILD" = "osx" ]; then
|
||||||
# adding version to Info.plist
|
# adding version to Info.plist
|
||||||
sed -i '' 's/0.0.0/'${VERSION}'/' dist/inkstitch.app/Contents/Info.plist
|
sed -i '' 's/0.0.0/'${VERSION}'/' dist/inkstitch.app/Contents/Info.plist
|
||||||
rm -rf dist/inkstitch/
|
rm -rf dist/inkstitch/
|
||||||
temp_path="/tmp/inkstitch/"
|
# Install location for pkgbuild
|
||||||
|
PKG_INSTALL_PATH="/tmp/inkstitch/"
|
||||||
|
# Checking arch of macos and setting path of electron for arm64 or intel
|
||||||
|
echo "Checking for macOS arch."
|
||||||
|
if [ "${ARCH}" = "arm64" ]; then
|
||||||
|
ELECTRON_BUILD_PATH="electron/build/mac-arm64"
|
||||||
|
echo "found arm64"
|
||||||
|
else
|
||||||
|
ELECTRON_BUILD_PATH="electron/build/mac"
|
||||||
|
echo "found intel"
|
||||||
|
fi
|
||||||
# inside the scripts folder are:
|
# inside the scripts folder are:
|
||||||
# - preinstaller (checks for previously installed inkstitch and deletes it) and
|
# - preinstaller (checks for previously installed inkstitch and deletes it, Inkscape check with error message) and
|
||||||
# - postinstaller (moves inkstitch folder from /tmp to user Inkscape extensions folder in $HOME)
|
# - postinstaller (moves inkstitch folder from /tmp to user Inkscape extensions folder in $HOME)
|
||||||
# The postinstaller is a workaround for a proper way to install in user $HOME space
|
# The postinstaller is a workaround for a proper way to install in user $HOME space
|
||||||
|
|
||||||
|
@ -23,7 +34,7 @@ if [ "$BUILD" = "osx" ]; then
|
||||||
DEV_IDENT="Developer ID Application: Lex Neva (929A568N58)"
|
DEV_IDENT="Developer ID Application: Lex Neva (929A568N58)"
|
||||||
echo "Signing of inkstitch.app"
|
echo "Signing of inkstitch.app"
|
||||||
# Coyping inkstitch-gui.app into inkstitch
|
# Coyping inkstitch-gui.app into inkstitch
|
||||||
ditto electron/build/mac dist/inkstitch.app/Contents/MacOS/electron
|
ditto "${ELECTRON_BUILD_PATH}" dist/inkstitch.app/Contents/MacOS/electron
|
||||||
# signing the binary may fix notary issue
|
# signing the binary may fix notary issue
|
||||||
/usr/bin/codesign -s "${DEV_IDENT}" \
|
/usr/bin/codesign -s "${DEV_IDENT}" \
|
||||||
--deep \
|
--deep \
|
||||||
|
@ -49,7 +60,7 @@ if [ "$BUILD" = "osx" ]; then
|
||||||
--identifier org.inkstitch.installer \
|
--identifier org.inkstitch.installer \
|
||||||
--version ${VERSION} \
|
--version ${VERSION} \
|
||||||
--scripts installer_scripts/scripts \
|
--scripts installer_scripts/scripts \
|
||||||
--install-location ${temp_path}inkstitch.app \
|
--install-location ${PKG_INSTALL_PATH}inkstitch.app \
|
||||||
artifacts/inkstitch-${VERSION}-${OS}.pkg
|
artifacts/inkstitch-${VERSION}-${OS}.pkg
|
||||||
if [[ "${GITHUB_REF}" =~ ^refs/tags/v[0-9.]+$ || $NOTARIZE_DEVELOPMENT_BUILDS == true ]]; then
|
if [[ "${GITHUB_REF}" =~ ^refs/tags/v[0-9.]+$ || $NOTARIZE_DEVELOPMENT_BUILDS == true ]]; then
|
||||||
echo "Notary starting"
|
echo "Notary starting"
|
||||||
|
@ -61,14 +72,14 @@ if [ "$BUILD" = "osx" ]; then
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# local builds will not be signed or notarized
|
# local builds will not be signed or notarized
|
||||||
cp -a electron/build/mac dist/inkstitch.app/Contents/MacOS/electron
|
cp -a "${ELECTRON_BUILD_PATH}" dist/inkstitch.app/Contents/MacOS/electron
|
||||||
pkgbuild --root dist/inkstitch.app \
|
pkgbuild --root dist/inkstitch.app \
|
||||||
--component-plist installer_scripts/inkstitch.plist \
|
--component-plist installer_scripts/inkstitch.plist \
|
||||||
--ownership recommended \
|
--ownership recommended \
|
||||||
--identifier org.inkstitch.installer \
|
--identifier org.inkstitch.installer \
|
||||||
--version ${VERSION} \
|
--version ${VERSION} \
|
||||||
--scripts installer_scripts/scripts \
|
--scripts installer_scripts/scripts \
|
||||||
--install-location ${temp_path}inkstitch.app \
|
--install-location ${PKG_INSTALL_PATH}inkstitch.app \
|
||||||
artifacts/inkstitch-${VERSION}-${OS}.pkg
|
artifacts/inkstitch-${VERSION}-${OS}.pkg
|
||||||
fi
|
fi
|
||||||
# Creating the zip for Drag n' Drop install
|
# Creating the zip for Drag n' Drop install
|
||||||
|
|
|
@ -2,11 +2,20 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
ARCH="$(uname -m)"
|
||||||
|
# Check for cpu arch to build mac and linux electron arch
|
||||||
|
if [[ "$ARCH" = "arm64" ]] || [[ "$ARCH" = "aarch64" ]]; then
|
||||||
|
echo "Found ARM"
|
||||||
|
sed -i'' -e 's/CPU_ARCH/'arm64'/' electron/package.json
|
||||||
|
else
|
||||||
|
echo "Found x64"
|
||||||
|
sed -i'' -e 's/CPU_ARCH/'x64'/' electron/package.json
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$BUILD" = "windows" ]; then
|
if [ "$BUILD" = "windows" ]; then
|
||||||
args="-w --ia32"
|
args="-w --ia32"
|
||||||
elif [ "$BUILD" = "linux" ]; then
|
elif [ "$BUILD" = "linux" ]; then
|
||||||
args="-l --x64"
|
args="-l"
|
||||||
elif [ "$BUILD" = "osx" ]; then
|
elif [ "$BUILD" = "osx" ]; then
|
||||||
cp installer_scripts/electron-entitlements.plist electron/build/
|
cp installer_scripts/electron-entitlements.plist electron/build/
|
||||||
args="-m"
|
args="-m"
|
||||||
|
|
|
@ -3,13 +3,12 @@
|
||||||
set -e
|
set -e
|
||||||
info_year=$( date "+%Y" )
|
info_year=$( date "+%Y" )
|
||||||
site_packages="$(python -c "import os; print(os.path.dirname(os.__file__) + '/site-packages')")"
|
site_packages="$(python -c "import os; print(os.path.dirname(os.__file__) + '/site-packages')")"
|
||||||
|
arch=$(uname -m)
|
||||||
if [ "$BUILD" = "linux" ]; then
|
if [ "$BUILD" = "linux" ]; then
|
||||||
# pyinstaller misses these
|
pyinstaller_args+="--add-binary /usr/lib/"$arch"-linux-gnu/gio/modules/libgiolibproxy.so:. "
|
||||||
pyinstaller_args+="--add-binary /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so:. "
|
pyinstaller_args+="--add-binary /usr/lib/"$arch"-linux-gnu/libproxy.so.1:. "
|
||||||
pyinstaller_args+="--add-binary /usr/lib/x86_64-linux-gnu/libproxy.so.1:. "
|
pyinstaller_args+="--add-binary /lib/"$arch"-linux-gnu/libnsl.so.1:. "
|
||||||
pyinstaller_args+="--add-binary /lib/x86_64-linux-gnu/libnsl.so.1:. "
|
pyinstaller_args+="--add-binary /usr/lib/"$arch"-linux-gnu/libxcb.so.1:. "
|
||||||
pyinstaller_args+="--add-binary /usr/lib/x86_64-linux-gnu/libxcb.so.1:. "
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This one's tricky. ink/stitch doesn't actually _use_ gi.repository.Gtk,
|
# This one's tricky. ink/stitch doesn't actually _use_ gi.repository.Gtk,
|
||||||
|
@ -41,7 +40,7 @@ if [ "$BUILD" = "osx" ]; then
|
||||||
pyinstaller_args+="--osx-bundle-identifier org.inkstitch.app "
|
pyinstaller_args+="--osx-bundle-identifier org.inkstitch.app "
|
||||||
pyinstaller_args+="-i electron/build/icons/mac/inkstitch.icns"
|
pyinstaller_args+="-i electron/build/icons/mac/inkstitch.icns"
|
||||||
if [[ -z ${GITHUB_REF} ]]; then
|
if [[ -z ${GITHUB_REF} ]]; then
|
||||||
:
|
echo "Dev or Local Build"
|
||||||
else
|
else
|
||||||
bash bin/import-macos-keys
|
bash bin/import-macos-keys
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -20,7 +20,14 @@
|
||||||
],
|
],
|
||||||
"linux": {
|
"linux": {
|
||||||
"icon": "build/icons",
|
"icon": "build/icons",
|
||||||
"target": "dir"
|
"target": [
|
||||||
|
{
|
||||||
|
"target": "dir",
|
||||||
|
"arch": [
|
||||||
|
"CPU_ARCH"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "build/icons/win/inkstitch.ico",
|
"icon": "build/icons/win/inkstitch.ico",
|
||||||
|
@ -28,7 +35,14 @@
|
||||||
},
|
},
|
||||||
"mac": {
|
"mac": {
|
||||||
"icon": "build/icons/mac/inkstitch.icns",
|
"icon": "build/icons/mac/inkstitch.icns",
|
||||||
"target": "dir",
|
"target": [
|
||||||
|
{
|
||||||
|
"target": "dir",
|
||||||
|
"arch": [
|
||||||
|
"CPU_ARCH"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"hardenedRuntime": true,
|
"hardenedRuntime": true,
|
||||||
"gatekeeperAssess": false,
|
"gatekeeperAssess": false,
|
||||||
"entitlements": "build/electron-entitlements.plist",
|
"entitlements": "build/electron-entitlements.plist",
|
||||||
|
@ -47,7 +61,6 @@
|
||||||
"@svgdotjs/svg.js": "^3.0.16",
|
"@svgdotjs/svg.js": "^3.0.16",
|
||||||
"@svgdotjs/svg.panzoom.js": "https://github.com/inkstitch/svg.panzoom.js",
|
"@svgdotjs/svg.panzoom.js": "https://github.com/inkstitch/svg.panzoom.js",
|
||||||
"axios": "^0.19.0",
|
"axios": "^0.19.0",
|
||||||
"electron-compile": "^6.4.4",
|
|
||||||
"lodash.throttle": "^4.1.1",
|
"lodash.throttle": "^4.1.1",
|
||||||
"mousetrap": "^1.6.3",
|
"mousetrap": "^1.6.3",
|
||||||
"query-string": "^6.8.2",
|
"query-string": "^6.8.2",
|
||||||
|
@ -80,11 +93,10 @@
|
||||||
"del": "^3.0.0",
|
"del": "^3.0.0",
|
||||||
"devtron": "^1.4.0",
|
"devtron": "^1.4.0",
|
||||||
"easygettext": "^2.7.0",
|
"easygettext": "^2.7.0",
|
||||||
"electron": "4.1.3",
|
"electron": "11.2.0",
|
||||||
"electron-builder": "22.8.0",
|
"electron-builder": "22.8.0",
|
||||||
"electron-debug": "^1.5.0",
|
"electron-debug": "^3.0.0",
|
||||||
"electron-devtools-installer": "^2.2.4",
|
"electron-devtools-installer": "^3.2.0",
|
||||||
"electron-prebuilt-compile": "4.0.0",
|
|
||||||
"eslint": "^4.19.1",
|
"eslint": "^4.19.1",
|
||||||
"eslint-config-standard": "^11.0.0",
|
"eslint-config-standard": "^11.0.0",
|
||||||
"eslint-friendly-formatter": "^4.0.1",
|
"eslint-friendly-formatter": "^4.0.1",
|
||||||
|
|
|
@ -1,6 +1,30 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
inkstitch_folder=($HOME/Library/Application\ Support/org.inkscape.Inkscape/config/inkscape/extensions/inkstitch)
|
inkstitch_folder=($HOME/Library/Application\ Support/org.inkscape.Inkscape/config/inkscape/extensions/inkstitch)
|
||||||
|
location_inkscape=(/Applications/Inkscape.app)
|
||||||
|
|
||||||
|
# Checking if Inkscape is installed
|
||||||
|
if [[ -d "${location_inkscape}" ]]; then
|
||||||
|
echo "Inkscape is found and installed "${location_Inkscape}"."
|
||||||
|
else
|
||||||
|
osascript <<-AppleScript
|
||||||
|
set theDialogText to "Ink/Stich is an Inkscape plugin. Please install and run Inkscape before installing Ink/Stitch."
|
||||||
|
display dialog theDialogText buttons {"Okay"} default button "Okay"
|
||||||
|
AppleScript
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Checking if Inkscape configuration folders are created
|
||||||
|
if [[ -d "${inkstitch_folder%config*}" ]]; then
|
||||||
|
echo "Inkscape configs are found and installed "${inkstitch_folder%config*}"."
|
||||||
|
else
|
||||||
|
osascript <<-AppleScript
|
||||||
|
set theDialogText to "Please run Inkscape before installing Ink/Stitch."
|
||||||
|
display dialog theDialogText buttons {"Okay"} default button "Okay"
|
||||||
|
AppleScript
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -L "${inkstitch_folder}" ]]; then
|
if [[ -L "${inkstitch_folder}" ]]; then
|
||||||
unlink "${inkstitch_folder}"
|
unlink "${inkstitch_folder}"
|
||||||
echo "Unlinking manual install, to avoid damaging user local repository."
|
echo "Unlinking manual install, to avoid damaging user local repository."
|
||||||
|
|
Ładowanie…
Reference in New Issue