Package Details: pdftxt 0.7-2

Git Clone URL: https://aur.archlinux.org/pdftxt.git (read-only, click to copy)
Package Base: pdftxt
Description: A simple wrapper around mupdf library to extract text from pdf files.
Upstream URL: http://litcave.rudi.ir
Licenses: custom:BSD
Submitter: Sara
Maintainer: aksr
Last Packager: aksr
Votes: 5
Popularity: 0.000001
First Submitted: 2012-07-10 19:53
Last Updated: 2020-03-22 07:35

Latest Comments

aksr commented on 2020-03-22 07:36

Fixed (thank you ChrisMorgan).

ChrisMorgan commented on 2020-02-29 14:56

Failing to build again. Here’s a formatted patch that fixes it (paste it into foo.patch and run git am foo.patch to take the commit verbatim):

From b1eb0f558b6730182b1c8cdac1ee5556750fa22d Mon Sep 17 00:00:00 2001
From: Chris Morgan <me@chrismorgan.info>
Date: Sun, 1 Mar 2020 01:52:39 +1100
Subject: [PATCH] Patch Makefile to link against current mupdf

My attempt to build this package failed:

    ==> Starting build()...
    cc -c -Wall -O2 -I./include pdftxt.c
    cc -o pdftxt pdftxt.o -lopenjp2 -lharfbuzz -lfreetype -lz -ljpeg -ljbig2dec -lmupdf -lmupdfthird -lm
    /usr/sbin/ld: cannot find -lmupdfthird
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:10: pdftxt] Error 1

I found /usr/lib/libmupdf-third.a, so I guess a hyphen was added
somewhere along the way? After this Makefile patch, it builds and runs.
---
 .SRCINFO       |  8 +++++---
 Makefile.patch | 10 ++++++++++
 PKGBUILD       |  7 ++++++-
 3 files changed, 21 insertions(+), 4 deletions(-)
 create mode 100644 Makefile.patch

diff --git a/.SRCINFO b/.SRCINFO
index bc75c40..f250ce3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Sat Mar 24 09:03:28 UTC 2018
 pkgbase = pdftxt
    pkgdesc = A simple wrapper around mupdf library to extract text from pdf files.
    pkgver = 0.7
-   pkgrel = 1
+   pkgrel = 2
    url = http://litcave.rudi.ir
    install = pdftxt.install
    arch = i686
@@ -12,15 +10,19 @@ pkgbase = pdftxt
    depends = mupdf
    depends = libmupdf
    source = http://litcave.rudi.ir/pdftxt-0.7.tar.gz
+   source = Makefile.patch
    source = mupdfgrep
    source = LICENSE
    md5sums = 226fa17bc1044207db1d40ebd3c769f5
+   md5sums = 37204a8aaac1e14cdcd82915db3088c7
    md5sums = 95ccf38e8ab9ae076b9ad45d27ab0899
    md5sums = ec67f29a7dec10f86ef31515ed657a91
    sha1sums = 8e1f9a4fefbd85d942a76a2ed020de9059a14fb4
+   sha1sums = 3c1ba417ab95de269c28e97107e1ac9f925d1800
    sha1sums = 30b7ed6cef089d9777c90108138c91526ff60d8d
    sha1sums = 76a535243054e1fdd9caaa46a1571cd381d74353
    sha256sums = 01361355c4bfe4a51d2bfec27ac52592ce99a706097666631028f7ba67e432e8
+   sha256sums = eca9d3c683c0ee95cb7b24ec3958204d944e645a5aa519509e5ac1d23f94591b
    sha256sums = f4ec1ef6838f9e8e77d5710c108dceec1fb4b256bc548615e1670b90d9e53eec
    sha256sums = 0ea8d51c57a3a59ca57428b6fe9b47fdb1fde281fc1b095c9832872e85b09a72

diff --git a/Makefile.patch b/Makefile.patch
new file mode 100644
index 0000000..e73b0ec
--- /dev/null
+++ b/Makefile.patch
@@ -0,0 +1,10 @@
+--- Makefile
++++ Makefile
+@@ -7,6 +7,6 @@
+ %.o: %.c
+   $(CC) -c $(CFLAGS) $<
+ pdftxt: pdftxt.o
+-  $(CC) -o $@ $^ $(LDFLAGS) -lmupdf -lmupdfthird -lm
++  $(CC) -o $@ $^ $(LDFLAGS) -lmupdf -lmupdf-third -lm
+ clean:
+   rm -f *.o pdftxt
diff --git a/PKGBUILD b/PKGBUILD
index 5f663b8..e6136e1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
 # Maintainer: aksr <aksr at t-com dot me>
 pkgname=pdftxt
 pkgver=0.7
-pkgrel=1
+pkgrel=2
 epoch=
 pkgdesc="A simple wrapper around mupdf library to extract text from pdf files."
 arch=('i686' 'x86_64')
@@ -21,17 +21,21 @@ options=()
 install=pdftxt.install
 changelog=
 source=("http://litcave.rudi.ir/${pkgname}-${pkgver}.tar.gz"
+        'Makefile.patch'
         'mupdfgrep'
         'LICENSE')
 noextract=()
 options=()
 md5sums=('226fa17bc1044207db1d40ebd3c769f5'
+         '37204a8aaac1e14cdcd82915db3088c7'
          '95ccf38e8ab9ae076b9ad45d27ab0899'
          'ec67f29a7dec10f86ef31515ed657a91')
 sha1sums=('8e1f9a4fefbd85d942a76a2ed020de9059a14fb4'
+          '3c1ba417ab95de269c28e97107e1ac9f925d1800'
           '30b7ed6cef089d9777c90108138c91526ff60d8d'
           '76a535243054e1fdd9caaa46a1571cd381d74353')
 sha256sums=('01361355c4bfe4a51d2bfec27ac52592ce99a706097666631028f7ba67e432e8'
+            'eca9d3c683c0ee95cb7b24ec3958204d944e645a5aa519509e5ac1d23f94591b'
             'f4ec1ef6838f9e8e77d5710c108dceec1fb4b256bc548615e1670b90d9e53eec'
             '0ea8d51c57a3a59ca57428b6fe9b47fdb1fde281fc1b095c9832872e85b09a72')

@@ -42,6 +46,7 @@ prepare() {

 build() {
   cd "$srcdir/$pkgname-$pkgver"
+  patch -Ni "$srcdir/Makefile.patch"
   make LDFLAGS="-lopenjp2 -lharfbuzz -lfreetype -lz -ljpeg -ljbig2dec"
 }

-- 
2.25.1

TrialnError commented on 2018-02-02 00:01

Maybe this should be removed from aurweb? Upstream didn't do something in a while and it cannot be compiled against mupdf 1.12

TrialnError commented on 2016-09-29 10:33

Still needs a look at the depends line.
Without libmupdf installed this will fail to compile

dreieck commented on 2016-09-24 11:29

Fails to build:

== %< ==

cc -c -Wall -O2 -I./include pdftxt.c
pdftxt.c:15:26: error: unknown type name ‘fz_text_page’
static void extract_page(fz_text_page *pg, int pnum)
^~~~~~~~~~~~
pdftxt.c: In function ‘extract’:
pdftxt.c:47:2: error: unknown type name ‘fz_text_sheet’
fz_text_sheet *sheet;
^~~~~~~~~~~~~
pdftxt.c:48:2: error: unknown type name ‘fz_text_page’
fz_text_page *text;
^~~~~~~~~~~~

== >% ==

TrialnError commented on 2016-09-10 21:58

Since the package got split, the depends aren't satisfied with mupdf.
The Header files needed for compilation got moved to the libmupdf package.
Dunno if those deps can be swapped or if the mupdf is still necessary.

Edit: Oh, and some comments on the PKGBUILD itself.
Empty variables should be deleted, and one array with checksums is more than enough.

Edit2: Patching is necessary.
It fails on unknown datatype fz_text_page and fz_text_sheet