Browse Source

initial package creation

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 2 years ago
commit
d124baa50a
  1. 84
      SOURCES/0001-Revert-Rework-detection-of-mupdf.patch
  2. 65
      SPECS/zathura-pdf-mupdf.spec

84
SOURCES/0001-Revert-Rework-detection-of-mupdf.patch

@ -0,0 +1,84 @@
From 10c8edffbf9b814bb95e74b04a6a1d7fb729b4b4 Mon Sep 17 00:00:00 2001
Message-Id: <10c8edffbf9b814bb95e74b04a6a1d7fb729b4b4.1644786121.git.mjg@fedoraproject.org>
From: Michael J Gruber <mjg@fedoraproject.org>
Date: Sun, 13 Feb 2022 22:00:59 +0100
Subject: [PATCH] Revert "Rework detection of mupdf"

This reverts commit 49a85efb915bfed933d251f6074b807d0e1ef385.

On Fedora, neither pkconfig nor cmake find mupdf the way meson looks for
it. Also, we don't mujs since mupdf builds against the in-tree copy.

Signed-off-by: Michael J Gruber <mjg@fedoraproject.org>
---
meson.build | 17 +++++------------
meson_options.txt | 6 ++++++
2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/meson.build b/meson.build
index c8c19dc..07abdf5 100644
--- a/meson.build
+++ b/meson.build
@@ -19,7 +19,7 @@ zathura = dependency('zathura', version: '>=0.3.9')
girara = dependency('girara-gtk3')
glib = dependency('glib-2.0')
cairo = dependency('cairo')
-mupdf = dependency('mupdf', required: false)
+mupdf = cc.find_library('mupdf')
mupdfthird = cc.find_library('mupdf-third')
build_dependencies = [
@@ -27,23 +27,17 @@ build_dependencies = [
girara,
glib,
cairo,
+ mupdf,
+ mupdfthird
]
-if not mupdf.found()
- # normal build of mupdf
- mupdf = cc.find_library('mupdf')
- build_dependencies += [mupdf, mupdfthird]
-else
- # build from Debian's libmupdf-dev
- build_dependencies += [mupdf, mupdfthird]
-
+if get_option('link-external')
libjpeg = dependency('libjpeg')
libjbig2dec = cc.find_library('jbig2dec')
libopenjp2 = dependency('libopenjp2')
gumbo = dependency('gumbo')
tesseract = dependency('tesseract')
leptonica = dependency('lept')
- mujs = dependency('mujs')
build_dependencies += [
libjpeg,
@@ -51,8 +45,7 @@ else
libopenjp2,
gumbo,
tesseract,
- leptonica,
- mujs
+ leptonica
]
endif
diff --git a/meson_options.txt b/meson_options.txt
index c8df610..db9d0c5 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,9 @@
+option('link-external',
+ type: 'boolean',
+ value: false,
+ description: 'Link external libraries required by mupdf.'
+)
+
option('plugindir',
type: 'string',
value: '',
--
2.35.1.306.ga00bde9711

65
SPECS/zathura-pdf-mupdf.spec

@ -0,0 +1,65 @@
%global jbig2dec_version 0.19

Name: zathura-pdf-mupdf
Version: 0.3.9
Release: 1%{?dist}
Summary: PDF support for zathura via mupdf
License: zlib
URL: https://pwmt.org/projects/%{name}/
Source0: %{url}/download/%{name}-%{version}.tar.xz
Patch1: 0001-Revert-Rework-detection-of-mupdf.patch
BuildRequires: binutils
BuildRequires: cairo-devel
BuildRequires: desktop-file-utils
BuildRequires: gcc
BuildRequires: git-core
BuildRequires: girara-devel
BuildRequires: glib2-devel
BuildRequires: libappstream-glib
BuildRequires: libjpeg-turbo-devel
BuildRequires: meson >= 0.43
BuildRequires: mupdf-static >= 1.20
BuildRequires: openjpeg2-devel
BuildRequires: zathura-devel >= 0.3.9
BuildRequires: gumbo-parser-devel
BuildRequires: leptonica-devel
BuildRequires: tesseract-devel
Requires: zathura >= 0.3.9
BuildRequires: jbig2dec-devel = %{jbig2dec_version}
BuildRequires: jbig2dec-libs = %{jbig2dec_version}
Requires: jbig2dec-libs = %{jbig2dec_version}
Conflicts: zathura-pdf-poppler < 0.2.9


%description
This plugin adds PDF support to zathura using the mupdf rendering engine.


%prep
%autosetup -S git -p1


%build
%meson -Dlink-external=true
%meson_build


%install
%meson_install
desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.metainfo.xml


%pre
[ -L %{_libdir}/zathura/pdf.so ] && rm -f %{_libdir}/zathura/pdf.so || :


%files
%license LICENSE
%doc AUTHORS
%{_libdir}/zathura/libpdf-mupdf.so
%{_datadir}/applications/org.pwmt.zathura-pdf-mupdf.desktop
%{_datadir}/metainfo/org.pwmt.zathura-pdf-mupdf.metainfo.xml


%changelog
Loading…
Cancel
Save