From 09b9702e9b6142f3fae6fbcc88bacc78f5a1c24d Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 11 Oct 2023 21:14:14 -0400 Subject: [PATCH] bookworm: patch for python3 compat --- srcpkgs/bookworm/patches/py3-scriptname.patch | 15 +++++++++++++++ srcpkgs/bookworm/template | 16 ++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/bookworm/patches/py3-scriptname.patch diff --git a/srcpkgs/bookworm/patches/py3-scriptname.patch b/srcpkgs/bookworm/patches/py3-scriptname.patch new file mode 100644 index 0000000000000..0b90c8836e1b2 --- /dev/null +++ b/srcpkgs/bookworm/patches/py3-scriptname.patch @@ -0,0 +1,15 @@ +fix script name for larger patch in distfiles, as there were some changes between +then and now that prevent the patch from applying + +--- a/src/constants.vala.in ++++ b/src/constants.vala.in +@@ -167,8 +167,7 @@ + public const string HTML_SCRIPT_RESOURCE_LOCATION = "resource:///" + + RESOURCE_PREFIX + BOOKWORM_HTML_SCRIPT; + +- public const string MOBIUNPACK_SCRIPT_LOCATION = INSTALL_MOBILIB_DIR + +- "/mobi_unpack.py"; ++ public const string MOBIUNPACK_SCRIPT_LOCATION = INSTALL_MOBILIB_DIR + "/kindleunpack.py"; + + //Set resource paths for images and icons + public const string PREV_PAGE_ICON_IMAGE_LOCATION = RESOURCE_PREFIX+"16-bookworm-go-previous.svg"; diff --git a/srcpkgs/bookworm/template b/srcpkgs/bookworm/template index 0205a6e624275..14e5fe4eb3602 100644 --- a/srcpkgs/bookworm/template +++ b/srcpkgs/bookworm/template @@ -1,7 +1,7 @@ # Template file for 'bookworm' pkgname=bookworm version=1.1.2 -revision=5 +revision=6 build_style=meson hostmakedepends="pkg-config glib-devel gettext vala" makedepends="gtk+3-devel libgee08-devel granite-devel @@ -12,9 +12,17 @@ short_desc="Simple, focused eBook reader" maintainer="Giuseppe Fierro " license="GPL-3.0-or-later" homepage="https://babluboy.github.io/bookworm" -distfiles="https://github.com/babluboy/${pkgname}/archive/${version}.tar.gz" -checksum=6d27e55697debfa08f7cc15805413b74c94c55111cdf2d333b306228eccad824 -python_version=2 # Should be set to python3 when updated to version > 1.1.2 +distfiles="https://github.com/babluboy/bookworm/archive/${version}.tar.gz + https://github.com/babluboy/bookworm/commit/c7c3643760caea4bd26b1d56ed033a52f6e34124.patch>python3.patch" +checksum="6d27e55697debfa08f7cc15805413b74c94c55111cdf2d333b306228eccad824 + ac3981fc515380a8a6d34707ca404a9b8ce16174a51520f1e9f41ee54b044e4b" +skip_extraction="python3.patch" +python_version=3 + +post_patch() { + patch -Np1 < <(sed 's,#! /usr/bin/python,#!usr/bin/env python,; /^diff --git .*\.pyc$/,/^diff --git/d; /^--- .*constants.vala.in$/q' \ + "${XBPS_SRCDISTDIR}/${pkgname}-${version}/python3.patch") +} post_install() { ln -s com.github.babluboy.bookworm ${DESTDIR}/usr/bin/bookworm