David Runge pushed to branch main at Arch Linux / Packaging / Packages / mupdf
Commits:
12684402 by David Runge at 2024-01-26T11:10:36+01:00
upgpkg: 1.23.9-2
Rebuild to add C++ language bindings.
Add a patch to have full RELRO in libmupdfcpp.so by using our LDFLAGS.
The C++ language bindings are required for python-pymupdf to build and test.
- - - - -
3 changed files:
- .SRCINFO
- PKGBUILD
- + mupdf-1.23.9-cpp_full_relro.patch
Changes:
=====================================
.SRCINFO
=====================================
@@ -1,10 +1,11 @@
pkgbase = mupdf
pkgdesc = Lightweight PDF and XPS viewer
pkgver = 1.23.9
- pkgrel = 1
+ pkgrel = 2
url = https://mupdf.com/
arch = x86_64
license = AGPL-3.0-or-later
+ makedepends = clang
makedepends = curl
makedepends = desktop-file-utils
makedepends = freeglut
@@ -20,15 +21,18 @@ pkgbase = mupdf
makedepends = mesa-libgl
makedepends = openjpeg2
makedepends = openssl
+ makedepends = python
makedepends = tesseract
makedepends = zlib
options = staticlibs
source = https://mupdf.com/downloads/archive/mupdf-1.23.9-source.tar.gz
source = mupdf.desktop
source = mupdf.xpm
+ source = mupdf-1.23.9-cpp_full_relro.patch
sha256sums =
d4a5d66801d85f97d76da978b155f66a5659d1131070c0400f076883f604e297
sha256sums =
ccff66979249bd4ab4ba8918660f194eb90eb0ae231b16e36a6cecdcf471883f
sha256sums =
a435f44425f5432c074dee745d8fbaeb879038ec1f1ec64f037c74662f09aca8
+ sha256sums =
152222c0bc066404d9e38be7abbba20748b0a4bbc9cb30403d19e3b176ab257f
pkgname = libmupdf
pkgdesc = Library for Lightweight PDF and XPS viewer
=====================================
PKGBUILD
=====================================
@@ -9,12 +9,13 @@
pkgbase=mupdf
pkgname=(libmupdf mupdf mupdf-gl mupdf-tools)
pkgver=1.23.9
-pkgrel=1
+pkgrel=2
pkgdesc='Lightweight PDF and XPS viewer'
arch=('x86_64')
url='https://mupdf.com/'
license=('AGPL-3.0-or-later')
makedepends=(
+ 'clang'
'curl'
'desktop-file-utils'
'freeglut'
@@ -32,6 +33,7 @@ makedepends=(
# 'mujs' # is hardcoded and needs a patch to debundle
'openjpeg2'
'openssl'
+ 'python'
'tesseract'
'zlib'
)
@@ -40,14 +42,19 @@ source=(
"https://mupdf.com/downloads/archive/$pkgbase-${pkgver/_/}-source.tar.gz"
$pkgbase.desktop
$pkgbase.xpm
+ $pkgbase-1.23.9-cpp_full_relro.patch
)
sha256sums=('d4a5d66801d85f97d76da978b155f66a5659d1131070c0400f076883f604e297'
'ccff66979249bd4ab4ba8918660f194eb90eb0ae231b16e36a6cecdcf471883f'
- 'a435f44425f5432c074dee745d8fbaeb879038ec1f1ec64f037c74662f09aca8')
+ 'a435f44425f5432c074dee745d8fbaeb879038ec1f1ec64f037c74662f09aca8'
+ '152222c0bc066404d9e38be7abbba20748b0a4bbc9cb30403d19e3b176ab257f')
prepare() {
cd $pkgbase-${pkgver/_/}-source
+ # use our LDFLAGS when building the C++ bindings to have full RELRO
+ patch -Np1 -i ../$pkgbase-1.23.9-cpp_full_relro.patch
+
# remove bundled packages, we want our system libraries
rm -rf
thirdparty/{curl,freeglut,freetype,gumbo-parser,harfbuzz,jbig2dec,leptonica,libjpeg,openjpeg,tesseract,zlib}
@@ -73,6 +80,8 @@ prepare() {
build() {
cd $pkgbase-${pkgver/_/}-source
make shared=yes build=release libs apps
+ # build C++ bindings:
https://mupdf.readthedocs.io/en/latest/language-bindings.html#building-the-c-bindings
+ python scripts/mupdfwrap.py -b m01
}
package_libmupdf() {
@@ -100,6 +109,10 @@ package_libmupdf() {
# work around find-libdeps bug:
https://gitlab.archlinux.org/archlinux/devtools/-/issues/102
chmod +x "$pkgdir/usr/lib/$pkgname.so"
+
+ # install shared object and headers for C++
+ install -vDm 644 platform/c++/include/$pkgbase/*.h -t
"$pkgdir/usr/include/$pkgbase/"
+ install -vDm 755 build/shared-release/libmupdfcpp.so -t "$pkgdir/usr/lib/"
}
package_mupdf() {
=====================================
mupdf-1.23.9-cpp_full_relro.patch
=====================================
@@ -0,0 +1,11 @@
+diff -ruN a/scripts/wrap/__main__.py b/scripts/wrap/__main__.py
+--- a/scripts/wrap/__main__.py 2024-01-10 16:00:05.000000000 +0100
++++ b/scripts/wrap/__main__.py 2024-01-26 10:53:09.531262564 +0100
+@@ -1633,6 +1633,7 @@
+ -I {include2}
+ {cpp_files_text}
+ {link_l_flags(libmupdf)}
++ {os.environ.get("LDFLAGS") or ""}
+ ''').strip().replace( '\n', ' \\\n')
+ )
+ jlib.build(
View it on GitLab:
https://gitlab.archlinux.org/archlinux/packaging/packages/mupdf/-/commit/126844021933d836bb3def58001dbe8d27b790f1
--
View it on GitLab:
https://gitlab.archlinux.org/archlinux/packaging/packages/mupdf/-/commit/126844021933d836bb3def58001dbe8d27b790f1
You're receiving this email because of your account on gitlab.archlinux.org.