Skip to content

Commit

Permalink
upgpkg: fanficfare-git 4.2.0.r0.g6d6f2737-1
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eli-schwartz committed May 3, 2021
1 parent aa925e3 commit e08b856
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
5 changes: 4 additions & 1 deletion fanficfare-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From a483e39777470538e2e94cb5048b3dc370a35e83 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <[email protected]>
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

30 changes: 21 additions & 9 deletions fanficfare-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
}

0 comments on commit e08b856

Please sign in to comment.