diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | github-pr-18.patch | 35 |
3 files changed, 50 insertions, 2 deletions
@@ -1,7 +1,7 @@ pkgbase = inkscape-axidraw-bin pkgdesc = Inkscape extension for Axidraw pkgver = 3.9.5 - pkgrel = 1 + pkgrel = 2 url = https://wiki.evilmadscientist.com/Axidraw_Software_Installation#Linux arch = x86_64 license = GPL2 @@ -12,6 +12,8 @@ pkgbase = inkscape-axidraw-bin conflicts = inkscape-axidraw conflicts = inkscape-eggbot source = https://cdn.evilmadscientist.com/dl/ad/public/395/AxiDraw_395_LinX86.zip + source = github-pr-18.patch sha256sums = d3d53e90dd92bf5e0e1a2042500996e1806bd933edcb839087dddcd6d31d783d + sha256sums = e6c68a3ad22362927dd0bec9da4b30a010606cf8ad110a7a77e29b8ec34eb9e7 pkgname = inkscape-axidraw-bin @@ -4,7 +4,7 @@ pkgname=inkscape-axidraw-bin pkgver=3.9.5 _zipname="AxiDraw_${pkgver//./}_LinX86" -pkgrel=1 +pkgrel=2 pkgdesc='Inkscape extension for Axidraw' provides=('inkscape-axidraw' 'inkscape-eggbot') conflicts=('inkscape-axidraw' 'inkscape-eggbot') @@ -14,11 +14,22 @@ license=('GPL2') arch=('x86_64') source=( "https://cdn.evilmadscientist.com/dl/ad/public/${pkgver//./}/${_zipname}.zip" + 'github-pr-18.patch' ) sha256sums=( 'd3d53e90dd92bf5e0e1a2042500996e1806bd933edcb839087dddcd6d31d783d' + 'e6c68a3ad22362927dd0bec9da4b30a010606cf8ad110a7a77e29b8ec34eb9e7' ) +prepare() { + cd "${srcdir}/${_zipname}" + + # Fix syntax warning dialog under Python 3.12 + # See also: + # https://github.com/evil-mad/ink_extensions/pull/18 + patch -p1 -d 'axidraw_deps' < ../github-pr-18.patch +} + package() { echo >&2 'Packaging the Inkscape extension' mkdir -p "${pkgdir}/usr/share/inkscape/extensions" diff --git a/github-pr-18.patch b/github-pr-18.patch new file mode 100644 index 000000000000..d4bc8ee67223 --- /dev/null +++ b/github-pr-18.patch @@ -0,0 +1,35 @@ +From 500e553d0459b0e4904e20520f9e01f8fba1d524 Mon Sep 17 00:00:00 2001 +From: Claudia Pellegrino <claui@users.noreply.github.com> +Date: Sun, 28 Apr 2024 23:30:51 +0200 +Subject: [PATCH] Use raw string to fix Python 3.12 syntax warning + +When running under Python v3.12, the `re.match` invocation in +`simpletransform.py` causes a syntax warning, because the regexp string +contains an escape sequence that Python tries to interpret as part of +the string literal: + +```bash +python -c 'import re; print(re.match("(translate|scale|rotate|skewX|skewY|matrix)\s*\(([^)]*)\)\s*,?", "translate(3.1416)"))' +<string>:1: SyntaxWarning: invalid escape sequence '\s' +<re.Match object; span=(0, 17), match='translate(3.1416)'> +``` + +The `\s` is really meant to be taken literally and to be passed to the +regexp engine as is. Use a raw string to achieve that. +--- + ink_extensions/simpletransform.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ink_extensions/simpletransform.py b/ink_extensions/simpletransform.py +index 9cb7651..e615fc1 100755 +--- a/ink_extensions/simpletransform.py ++++ b/ink_extensions/simpletransform.py +@@ -27,7 +27,7 @@ def parseTransform(transf,mat=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]): + if transf=="" or transf==None: + return(mat) + stransf = transf.strip() +- result=re.match("(translate|scale|rotate|skewX|skewY|matrix)\s*\(([^)]*)\)\s*,?",stransf) ++ result=re.match(r"(translate|scale|rotate|skewX|skewY|matrix)\s*\(([^)]*)\)\s*,?",stransf) + #-- translate -- + if result.group(1)=="translate": + args=result.group(2).replace(',',' ').split() |