From 253f4457dd1ea0b2413611af67ed16a7abe01e55 Mon Sep 17 00:00:00 2001 From: idealist1508 Date: Fri, 10 May 2024 08:06:49 +0200 Subject: [PATCH 1/6] New package: python3-fabulous-0.4.0 --- srcpkgs/python3-fabulous/template | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 srcpkgs/python3-fabulous/template diff --git a/srcpkgs/python3-fabulous/template b/srcpkgs/python3-fabulous/template new file mode 100644 index 00000000000000..3965bfcbd4b733 --- /dev/null +++ b/srcpkgs/python3-fabulous/template @@ -0,0 +1,16 @@ +# Template file for 'python3-fabulous' +pkgname=python3-fabulous +version=0.4.0 +revision=1 +build_style=python3-module +hostmakedepends="python3-build python3-installer python3-setuptools_scm python3-wheel" +short_desc="Print images, colors, and stylish text to the terminal with Python" +maintainer="idealist1508 " +license="Apache-2.0" +homepage="https://github.com/jart/fabulous" +distfiles="https://github.com/jart/${pkgname/python3-/}/archive/refs/tags/$version.tar.gz" +checksum=867401a5fac139516b2d611e4800d1f7b63b81151c645ac5457d3b042c6ff406 + +do_check() { + true +} From 45dff05a2b2b3d79c070234cf6bfd7366f46a635 Mon Sep 17 00:00:00 2001 From: idealist1508 Date: Fri, 10 May 2024 08:10:14 +0200 Subject: [PATCH 2/6] New package: libinsane-1.0.10 --- srcpkgs/libinsane/template | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 srcpkgs/libinsane/template diff --git a/srcpkgs/libinsane/template b/srcpkgs/libinsane/template new file mode 100644 index 00000000000000..0a7258c73bf0f3 --- /dev/null +++ b/srcpkgs/libinsane/template @@ -0,0 +1,14 @@ +# Template file for 'libinsane' +pkgname=libinsane +version=1.0.10 +revision=1 +build_style=gnu-makefile +hostmakedepends="meson pkg-config gobject-introspection gtk-doc" +makedepends="sane-devel vala-devel glib-devel " +depends="sane" +short_desc="Crossplatform library to access scanners" +maintainer="idealist1508 " +license="LGPL-3.0-or-later" +homepage="https://gitlab.gnome.org/World/OpenPaperwork/libinsane" +distfiles="https://gitlab.gnome.org/World/OpenPaperwork/$pkgname/-/archive/$version/$pkgname-$version.tar.gz" +checksum=a9b8daaef03eb3bc4a8e638131e506ff3c2f99f715170da572e7f5ce7ba76467 From 993523d07b3b52fbb2bc4494d93ee9d631b0834c Mon Sep 17 00:00:00 2001 From: idealist1508 Date: Fri, 10 May 2024 08:28:42 +0200 Subject: [PATCH 3/6] New package: python3-pyocr-0.8.5 --- srcpkgs/python3-pyocr/template | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 srcpkgs/python3-pyocr/template diff --git a/srcpkgs/python3-pyocr/template b/srcpkgs/python3-pyocr/template new file mode 100644 index 00000000000000..c5abe15194c479 --- /dev/null +++ b/srcpkgs/python3-pyocr/template @@ -0,0 +1,21 @@ +# Template file for 'python3-pyocr' +pkgname=python3-pyocr +version=0.8.5 +revision=1 +build_style=python3-module +hostmakedepends="python3-build python3-installer python3-setuptools_scm python3-wheel" +depends="python3 tesseract-ocr" +short_desc="Python wrapper for Tesseract and Cuneiform" +maintainer="idealist1508 " +license="GPL-3.0-or-later" +homepage="https://gitlab.gnome.org/World/OpenPaperwork/pyocr" +distfiles="https://gitlab.gnome.org/World/OpenPaperwork/pyocr/-/archive/${version}/pyocr-${version}.tar.bz2" +checksum=ba9c63cfac7bb6e441590053954466b41768e6b87f1b279c2d62460cad8bb174 + +do_build() { + python -m build --wheel --no-isolation +} + +do_install() { + python -m installer --destdir="$DESTDIR" dist/*.whl +} From 7b901ae693102dac6968ba9ec4419795b0cf5470 Mon Sep 17 00:00:00 2001 From: idealist1508 Date: Fri, 10 May 2024 08:46:15 +0200 Subject: [PATCH 4/6] New package: libpillowfight-0.3.0 --- srcpkgs/libpillowfight/template | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 srcpkgs/libpillowfight/template diff --git a/srcpkgs/libpillowfight/template b/srcpkgs/libpillowfight/template new file mode 100644 index 00000000000000..8cb48afb447dd7 --- /dev/null +++ b/srcpkgs/libpillowfight/template @@ -0,0 +1,27 @@ +# Template file for 'libpillowfight' +pkgname=libpillowfight +version=0.3.0 +revision=1 +build_style=gnu-makefile +hostmakedepends="cmake python3 python3-wheel python3-nose" +makedepends="python3-setuptools_scm python3-devel" +case $XBPS_TARGET_MACHINE in + x86_64*) depends+=" python3-pillow-simd" ;; + *) depends+=" python3-Pillow" ;; +esac +checkdepends="flake8" +short_desc="Small library containing various image processing algorithms" +maintainer="idealist1508 " +license="GPL-2.0-only" +homepage="https://gitlab.gnome.org/World/OpenPaperwork/libpillowfight" +distfiles="https://gitlab.gnome.org/World/OpenPaperwork/libpillowfight/-/archive/${version}/libpillowfight-${version}.tar.bz2" +checksum=0f39a6b0099bf246e961e30ddb9d3c19e8f9460ee24fbfa5c463cda196209327 + +export CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr" +export PIP_ARGS="--root=/usr" + +pre_build() { + cat > src/pillowfight/_version.h <<- EOF || die + #define INTERNAL_PILLOWFIGHT_VERSION "$version" + EOF +} From cfcafbafd7294756231f54184e5d6c67ac6f11d8 Mon Sep 17 00:00:00 2001 From: idealist1508 Date: Fri, 10 May 2024 09:12:33 +0200 Subject: [PATCH 5/6] New package: python3-pillowfight-0.3.0 --- srcpkgs/python3-pillowfight/template | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 srcpkgs/python3-pillowfight/template diff --git a/srcpkgs/python3-pillowfight/template b/srcpkgs/python3-pillowfight/template new file mode 100644 index 00000000000000..e67ac266ae3adf --- /dev/null +++ b/srcpkgs/python3-pillowfight/template @@ -0,0 +1,25 @@ +# Template file for 'python3-pillowfight' +pkgname=python3-pillowfight +version=0.3.0 +revision=1 +build_style=python3-module +hostmakedepends="python3-nose" +makedepends="python3-devel" +case $XBPS_TARGET_MACHINE in + x86_64*) depends+=" python3-pillow-simd" ;; + *) depends+=" python3-Pillow" ;; +esac +checkdepends="python3-Pillow" +short_desc="Python bindings for libpillowfigh" +maintainer="idealist1508 " +license="GPL-3.0-or-later" +homepage="https://gitlab.gnome.org/World/OpenPaperwork/libpillowfight" +distfiles="https://gitlab.gnome.org/World/OpenPaperwork/libpillowfight/-/archive/${version}/libpillowfight-${version}.tar.bz2" +checksum=0f39a6b0099bf246e961e30ddb9d3c19e8f9460ee24fbfa5c463cda196209327 +python_version=3 + +pre_build() { + cat > src/pillowfight/_version.h <<- EOF || die + #define INTERNAL_PILLOWFIGHT_VERSION "$version" + EOF +} From 8c7683493f84afade5d1f0b130889bd0b0bc262f Mon Sep 17 00:00:00 2001 From: idealist1508 Date: Fri, 10 May 2024 09:14:47 +0200 Subject: [PATCH 6/6] New package: paperwork-2.2.2 --- .../paperwork/patches/Fix4Scipy1.13.0.patch | 55 +++++++++++++++++++ srcpkgs/paperwork/template | 44 +++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 srcpkgs/paperwork/patches/Fix4Scipy1.13.0.patch create mode 100644 srcpkgs/paperwork/template diff --git a/srcpkgs/paperwork/patches/Fix4Scipy1.13.0.patch b/srcpkgs/paperwork/patches/Fix4Scipy1.13.0.patch new file mode 100644 index 00000000000000..9add28626a23a7 --- /dev/null +++ b/srcpkgs/paperwork/patches/Fix4Scipy1.13.0.patch @@ -0,0 +1,55 @@ +From abcebfe9714644d4e259e53b10e0e9417b5b864f Mon Sep 17 00:00:00 2001 +From: Jerome Flesch +Date: Sun, 21 Apr 2024 13:31:03 +0200 +Subject: [PATCH] backend/guesswork/labels/sklearn: fix use of + scipy.sparse.hstack() + numpy.zeros() + +Closes #1111 +--- + .../paperwork_backend/guesswork/label/sklearn/__init__.py | 5 +++-- + paperwork-backend/src/paperwork_backend/model/fake.py | 6 ++++++ + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/paperwork-backend/src/paperwork_backend/guesswork/label/sklearn/__init__.py b/paperwork-backend/src/paperwork_backend/guesswork/label/sklearn/__init__.py +index b2af4350..8633211f 100644 +--- a/paperwork-backend/src/paperwork_backend/guesswork/label/sklearn/__init__.py ++++ b/paperwork-backend/src/paperwork_backend/guesswork/label/sklearn/__init__.py +@@ -191,7 +191,8 @@ class UpdatableVectorizer(object): + ) + if required_padding > 0: + doc_vector = numpy.hstack([ +- doc_vector, numpy.zeros((required_padding,)) ++ doc_vector, ++ numpy.zeros((required_padding,)) + ]) + if sum_features is None: + sum_features = doc_vector +@@ -339,7 +340,7 @@ class Corpus(object): + if required_padding > 0: + doc_vector = scipy.sparse.hstack([ + scipy.sparse.csr_matrix(doc_vector), +- numpy.zeros((required_padding,)) ++ numpy.zeros((1, required_padding)) + ]) + else: + doc_vector = scipy.sparse.csr_matrix(doc_vector) +diff --git a/paperwork-backend/src/paperwork_backend/model/fake.py b/paperwork-backend/src/paperwork_backend/model/fake.py +index 29beae97..f06fe18e 100644 +--- a/paperwork-backend/src/paperwork_backend/model/fake.py ++++ b/paperwork-backend/src/paperwork_backend/model/fake.py +@@ -125,6 +125,12 @@ class Plugin(openpaperwork_core.PluginBase): + if doc['url'] == doc_url: + out.update(doc['labels']) + ++ def doc_has_labels_by_url(self, doc_url): ++ for doc in self.docs: ++ if doc['url'] == doc_url: ++ return True if len(doc["labels"]) > 0 else None ++ return None ++ + def doc_add_label_by_url(self, doc_url, label, color=None): + if color is None: + all_labels = set() +-- +GitLab + diff --git a/srcpkgs/paperwork/template b/srcpkgs/paperwork/template new file mode 100644 index 00000000000000..f5df4a5b884183 --- /dev/null +++ b/srcpkgs/paperwork/template @@ -0,0 +1,44 @@ +# Template file for 'paperwork' +pkgname=paperwork +version=2.2.2 +revision=1 +short_desc="Personal document manager for scanned documents (and PDFs)" +maintainer="idealist1508 " +license="GPL-3.0-or-later" +homepage="https://www.openpaper.work/" +distfiles="https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/archive/${version}/paperwork-${version}.tar.bz2" +checksum=006b4f95d9c5665dbcd0cdbd851f7164f0abc5fbf91138157f3768d9cae3ff51 + +python_version=3 +hostmakedepends="gettext which python3-pillowfight python3-build python3-installer python3-setuptools_scm python3-wheel python3-distro python3-psutil python3-numpy python3-scipy python3-scikit-learn python3-pycountry python3-Whoosh python3-xdg python3-pyocr" +depends="libhandy1 poppler-glib python3-distro python3-rich python3-psutil python3-pillowfight python3-gobject python3-numpy python3-scipy python3-scikit-learn python3-distutils-extra python3-pycountry python3-Whoosh python3-xdg python3-fabulous python3-pyocr" + +case $XBPS_TARGET_MACHINE in + x86_64*) depends+=" python3-pillow-simd" ;; + *) depends+=" python3-Pillow" ;; +esac + +export SETUPTOOLS_SCM_PRETEND_VERSION=${version} + +do_build() { + make l10n_compile + + for dir in openpaperwork-{core,gtk} paperwork-{backend,shell,gtk}; do + pushd $dir + python -m build --wheel --no-isolation + popd + done +} + +do_install() { + for dir in openpaperwork-{core,gtk} paperwork-{backend,shell,gtk}; do + pushd $dir + python -m installer --destdir="$DESTDIR" dist/*.whl + popd + done + + PYTHONPATH="$DESTDIR"$(python -c 'import site; print(site.getsitepackages()[0])') \ + "$DESTDIR"/usr/bin/paperwork-gtk install \ + --icon_base_dir="$DESTDIR/usr/share/icons" \ + --data_base_dir="$DESTDIR/usr/share" +}