diff options
-rw-r--r-- | .SRCINFO | 35 | ||||
-rw-r--r-- | PKGBUILD | 118 |
2 files changed, 124 insertions, 29 deletions
@@ -1,18 +1,35 @@ pkgbase = svg2tikz-git - pkgdesc = set of tools for converting SVG graphics to TikZ/PGF code - pkgver = r216.7a9959c + pkgdesc = Set of tools for converting SVG graphics to TikZ/PGF code. + pkgver = 3.0.0+9.r473.20240112.307c86a pkgrel = 1 url = https://github.com/kjellmf/svg2tikz arch = any - license = GPL + license = GPL2 + checkdepends = python-pytest makedepends = git - depends = python-lxml - optdepends = inkscape: for using the inksape extension files - provides = inkscape-tikz + makedepends = python-build + makedepends = python-installer + makedepends = python-setuptools + makedepends = python-wheel + makedepends = python-poetry + makedepends = python-sphinx + makedepends = python-sphinx-argparse + makedepends = texlive-bin + depends = python>=3 + optdepends = inkscape: for using the inksape extension files. + optdepends = python-inkex + optdepends = python-lxml + optdepends = xclip + provides = inkscape-tikz=3.0.0+9.r473.20240112.307c86a + provides = svg2tikz=3.0.0+9.r473.20240112.307c86a + provides = svg2tikz-doc=3.0.0+9.r473.20240112.307c86a + provides = python-svg2tikz=3.0.0+9.r473.20240112.307c86a conflicts = inkscape-tikz + conflicts = svg2tikz + conflicts = svg2tikz-doc + conflicts = python-svg2tikz replaces = inkscape-tikz-hg - source = git+https://github.com/kjellmf/svg2tikz - md5sums = SKIP + source = svg2tikz::git+https://github.com/kjellmf/svg2tikz + sha256sums = SKIP pkgname = svg2tikz-git - @@ -1,37 +1,115 @@ -# Maintainer: Stefan Husmann <stefan-husmann@t-online.de> -# Contributor: max_meyer <dev@fedux.org> +# Maintainer: dreieck (https://aur.archlinux.org/account/dreieck) +# Contributor: quang (https://aur.archlinux.org/account/quang) +# Contributor: Samega7Cattac (https://aur.archlinux.org/account/Samega7Cattac) +# Contributor: max_meyer +# Contributor: Stefan Husmann pkgname=svg2tikz-git -pkgver=r216.7a9959c +_gitname="svg2tikz" +pkgver=3.0.0+9.r473.20240112.307c86a pkgrel=1 -pkgdesc="set of tools for converting SVG graphics to TikZ/PGF code" +pkgdesc="Set of tools for converting SVG graphics to TikZ/PGF code." arch=('any') url="https://github.com/kjellmf/svg2tikz" -license=('GPL') -depends=('python-lxml') -makedepends=('git') -provides=('inkscape-tikz') -conflicts=('inkscape-tikz') -replaces=('inkscape-tikz-hg') -optdepends=('inkscape: for using the inksape extension files') -source=("git+https://github.com/kjellmf/svg2tikz") -md5sums=('SKIP') -_gitname="svg2tikz" +license=('GPL2') +depends=( + 'python>=3' +) +optdepends=( + 'inkscape: for using the inksape extension files.' + 'python-inkex' + 'python-lxml' + 'xclip' +) +makedepends=( + 'git' + 'python-build' + 'python-installer' + 'python-setuptools' + 'python-wheel' + 'python-poetry' + 'python-sphinx' # For building the documentation. + 'python-sphinx-argparse' # For building the documentation. + 'texlive-bin' # For building the documentation. +) +checkdepends=( + 'python-pytest' +) +provides=( + "inkscape-tikz=${pkgver}" + "svg2tikz=${pkgver}" + "svg2tikz-doc=${pkgver}" + "python-svg2tikz=${pkgver}" +) +conflicts=( + 'inkscape-tikz' + 'svg2tikz' + 'svg2tikz-doc' + 'python-svg2tikz' +) +replaces=( + 'inkscape-tikz-hg' +) +source=( + "${_gitname}::git+https://github.com/kjellmf/${_gitname}" +) +sha256sums=( + 'SKIP' +) + +prepare() { + cd "$srcdir"/"$_gitname" + + git log > "${srcdir}/git.log" +} pkgver() { cd "$srcdir"/"$_gitname" - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + + _ver="$(git describe --tags | sed 's|^[vV]||' | sed 's|-[^-]*$||' | tr '-' '+')" + _rev="$(git rev-list --count HEAD)" + _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")" + _hash="$(git rev-parse --short HEAD)" + + if [ -z "${_ver}" ]; then + error "Version could not be determined." + return 1 + else + printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}" + fi } -prepare() { +build() { cd "$srcdir"/"$_gitname" - [[ -d build ]] || rm -rf build + + # Fix for https://github.com/xyz2tex/svg2tikz/issues/183 + sed -i -e '1s|#!/usr/bin/env python/|#!/usr/bin/env python|' 'svg2tikz/tikz_export.py' + + python -m build --wheel --no-isolation + + cd docs + make latex +} + +check() { + cd "$srcdir"/"$_gitname" + + python -m pytest } package() { cd "$srcdir/$_gitname" - python setup.py install --root="$pkgdir/" --optimize=1 + + python -m installer --destdir="$pkgdir" dist/*.whl _inkscape_ext="$pkgdir/usr/share/inkscape/extensions" - install -d "$_inkscape_ext" - cp ./svg2tikz/extensions/tikz_export* "$_inkscape_ext" + install -dvm755 "$_inkscape_ext" + cp -v ./svg2tikz/tikz_export* "$_inkscape_ext/" + + for _docfile in "${srcdir}/git.log" CHANGELOG.md README.md; do + install -Dvm644 "${_docfile}" "${pkgdir}/usr/share/doc/svg2tikz/$(basename "${_docfile}")" + done + cp -rv docs "${pkgdir}/usr/share/doc/svg2tikz/docs" + + install -Dvm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + ln -svr "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" "${pkgdir}/usr/share/doc/svg2tikz/LICENSE" } |