summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Schwartz2021-05-03 06:47:52 -0400
committerEli Schwartz2021-05-03 06:47:52 -0400
commit1a3281828a13f97ea7e5047f313024c07dc81d1d (patch)
tree8d8b6ae42e1abe6db19661023276275786aff29e
parente4e174bfc85a4ec22e3fb9178514eda67c5dffd1 (diff)
downloadaur-1a3281828a13f97ea7e5047f313024c07dc81d1d.tar.gz
upgpkg: fanficfare-git 4.2.0.r0.g6d6f2737-1
Include the glue for fanficfare to run as a calibre plugin, now that: - calibre supports a system plugin directory - fanficfare plugin's import mechanism handles importing the fanficfare module from site-packages
-rw-r--r--.SRCINFO5
-rw-r--r--0001-makeplugin-do-not-bundle-system-dependencies.patch37
-rw-r--r--PKGBUILD30
3 files changed, 62 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bf877cab2168..00f54c4f6727 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = fanficfare-git
pkgdesc = A tool for downloading fanfiction to eBook formats
- pkgver = 4.0.2.r5.g158b4b75
+ pkgver = 4.2.0.r0.g6d6f2737
pkgrel = 1
url = https://github.com/JimmXinu/FanFicFare
arch = any
@@ -13,10 +13,13 @@ pkgbase = fanficfare-git
depends = python-html5lib
depends = python-html2text
depends = python-requests-file
+ optdepends = calibre: use FanFicFare as a calibre plugin
optdepends = python-pillow: support for converting/resizing story images and covers
provides = fanficfare
conflicts = fanficfare
source = git+https://github.com/JimmXinu/FanFicFare.git
+ source = 0001-makeplugin-do-not-bundle-system-dependencies.patch
sha256sums = SKIP
+ sha256sums = 6d172dcc98a8f6dcef2048272bfabd810ceeb5740969fbe406ebcd7b638e072c
pkgname = fanficfare-git
diff --git a/0001-makeplugin-do-not-bundle-system-dependencies.patch b/0001-makeplugin-do-not-bundle-system-dependencies.patch
new file mode 100644
index 000000000000..af1ef325178d
--- /dev/null
+++ b/0001-makeplugin-do-not-bundle-system-dependencies.patch
@@ -0,0 +1,37 @@
+From a483e39777470538e2e94cb5048b3dc370a35e83 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz@archlinux.org>
+Date: Sun, 18 Apr 2021 15:35:15 -0400
+Subject: [PATCH] makeplugin: do not bundle system dependencies
+
+---
+ makeplugin.py | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/makeplugin.py b/makeplugin.py
+index 6ee101fb..e6f7c20c 100644
+--- a/makeplugin.py
++++ b/makeplugin.py
+@@ -34,19 +34,9 @@ if __name__=="__main__":
+ files,
+ exclude=exclude)
+
+- os.chdir('../included_dependencies')
+- files=['bs4','chardet','html2text','soupsieve','backports',
+- 'cloudscraper','requests','requests_toolbelt',
+- 'requests_file.py','urllib3','certifi','idna','brotlidecpy']
+- ## Kept only for v2.85.1 support now.
+- createZipFile("../"+filename,"a",
+- files,
+- exclude=exclude)
+-
+ os.chdir('..')
+ # 'a' for append
+ files=['fanficfare']
+ createZipFile(filename,"a",
+ files,
+- exclude=exclude)
+-
++ exclude=exclude + ['*.py'])
+--
+2.31.1
+
diff --git a/PKGBUILD b/PKGBUILD
index a6d90fc6caa4..5a2ee67d1458 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
_pkgname=FanFicFare
pkgname=fanficfare-git
-pkgver=4.0.2.r5.g158b4b75
+pkgver=4.2.0.r0.g6d6f2737
pkgrel=1
pkgdesc="A tool for downloading fanfiction to eBook formats"
arch=('any')
@@ -14,29 +14,41 @@ _deps=('beautifulsoup4' 'brotli' 'chardet' 'cloudscraper' 'html5lib' 'html2text'
'requests-file')
depends=("${_deps[@]/#/python-}")
makedepends=('git')
-optdepends=('python-pillow: support for converting/resizing story images and covers')
+optdepends=('calibre: use FanFicFare as a calibre plugin'
+ 'python-pillow: support for converting/resizing story images and covers')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
-source=("git+${url}.git")
-sha256sums=('SKIP')
+source=("git+${url}.git"
+ "0001-makeplugin-do-not-bundle-system-dependencies.patch")
+sha256sums=('SKIP'
+ '6d172dcc98a8f6dcef2048272bfabd810ceeb5740969fbe406ebcd7b638e072c')
pkgver() {
cd "${srcdir}/${_pkgname}"
+
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
+prepare() {
+ cd "${srcdir}/${_pkgname}"
+
+ patch -p1 -i ../0001-makeplugin-do-not-bundle-system-dependencies.patch
+}
+
build() {
cd "${srcdir}/${_pkgname}"
+
python setup.py build
- if command -v calibre-customize > /dev/null; then
- msg2 "Creating and installing FanFicFare calibre plugin..."
- python makeplugin.py
- calibre-customize -a FanFicFare.zip || true
- fi
+ for i in calibre-plugin/translations/*.po; do
+ msgfmt -vv "$i" -o "${i%.po}.mo"
+ done
+ python makeplugin.py
}
package() {
cd "${srcdir}/${_pkgname}"
+
python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+ install -Dm644 FanFicFare.zip "${pkgdir}"/usr/share/calibre/system-plugins/FanFicFare.zip
}