From c3d8c6ac7e457bbde72ce54cd4caf4b9610e2d99 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 21 Nov 2018 11:59:37 +0100 Subject: gnu: emacs-pdf-tools: Use 'git-fetch'. * gnu/packages/emacs.scm (emacs-pdf-tools)[source]: Switch to GIT-FETCH. [arguments]: In 'emacs-patch-variables' phase, make files writable. --- gnu/packages/emacs.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gnu/packages/emacs.scm') diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index ce1add3915..c386b080e7 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -1593,15 +1593,15 @@ filters, new key bindings and faces. It can be enabled by (package (name "emacs-pdf-tools") (version "0.80") + (home-page "https://github.com/politza/pdf-tools") (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/politza/pdf-tools/archive/v" - version ".tar.gz")) - (file-name (string-append name "-" version ".tar.gz")) + (method git-fetch) + (uri (git-reference (url home-page) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 (base32 - "06imydn3a92vr57azpn1zhqc14kxyyslmyi9ldsyphan9b724gb6")))) + "1i4647vax5na73basc5dz4lh9kprir00fh8ps4i0l1y3ippnjs2s")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; there are no tests @@ -1626,6 +1626,8 @@ filters, new key bindings and faces. It can be enabled by (lambda _ (chdir "../lisp") #t)) (add-after 'enter-lisp-dir 'emacs-patch-variables (lambda* (#:key outputs #:allow-other-keys) + (for-each make-file-writable (find-files ".")) + ;; Set path to epdfinfo program. (emacs-substitute-variables "pdf-info.el" ("pdf-info-epdfinfo-program" @@ -1659,7 +1661,6 @@ filters, new key bindings and faces. It can be enabled by files. The key difference is that pages are not pre-rendered by e.g. ghostscript and stored in the file-system, but rather created on-demand and stored in memory.") - (home-page "https://github.com/politza/pdf-tools") (license license:gpl3+))) (define-public emacs-dash -- cgit v1.2.3 From e555bbfc48ebb4ca019d3648324b1900a891cda1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 21 Nov 2018 12:43:57 +0100 Subject: gnu: emacs-pdf-tools: Fix build with recent Poppler. * gnu/packages/patches/emacs-pdf-tools-poppler.patch: New file. * gnu/packages/emacs.scm (emacs-pdf-tools)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 3 +- gnu/packages/patches/emacs-pdf-tools-poppler.patch | 41 ++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/emacs-pdf-tools-poppler.patch (limited to 'gnu/packages/emacs.scm') diff --git a/gnu/local.mk b/gnu/local.mk index aeff3f8298..4b194d7b13 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -667,6 +667,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ %D%/packages/patches/emacs-highlight-stages-add-gexp.patch \ + %D%/packages/patches/emacs-pdf-tools-poppler.patch \ %D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \ %D%/packages/patches/emacs-source-date-epoch.patch \ %D%/packages/patches/emacs-realgud-fix-configure-ac.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index c386b080e7..dfcee56afe 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -1601,7 +1601,8 @@ filters, new key bindings and faces. It can be enabled by (file-name (git-file-name name version)) (sha256 (base32 - "1i4647vax5na73basc5dz4lh9kprir00fh8ps4i0l1y3ippnjs2s")))) + "1i4647vax5na73basc5dz4lh9kprir00fh8ps4i0l1y3ippnjs2s")) + (patches (search-patches "emacs-pdf-tools-poppler.patch")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; there are no tests diff --git a/gnu/packages/patches/emacs-pdf-tools-poppler.patch b/gnu/packages/patches/emacs-pdf-tools-poppler.patch new file mode 100644 index 0000000000..0477508fa9 --- /dev/null +++ b/gnu/packages/patches/emacs-pdf-tools-poppler.patch @@ -0,0 +1,41 @@ +Fix build issue with recent Poppler: + . + +This combines upstream commits +6cd76dec9aece2a8daa90f17ab77fbf773157a1d..50a5297b82e26cfd52f6c00645ddc1057099d6a7 +for this file. + +diff --git a/server/poppler-hack.cc b/server/poppler-hack.cc +index 0c62f73..427f9df 100644 +--- a/server/poppler-hack.cc ++++ b/server/poppler-hack.cc +@@ -51,7 +51,10 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; + double y2; + }; + +- char *_xpoppler_goo_string_to_utf8(GooString *s) ++ // This function does not modify its argument s, but for ++ // compatibility reasons (e.g. getLength in GooString.h before 2015) ++ // with older poppler code, it can't be declared as such. ++ char *_xpoppler_goo_string_to_utf8(/* const */ GooString *s) + { + char *result; + +@@ -85,7 +88,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; + // Set the rectangle of an annotation. It was first added in v0.26. + void xpoppler_annot_set_rectangle (PopplerAnnot *a, PopplerRectangle *rectangle) + { +- GooString *state = a->annot->getAppearState (); ++ GooString *state = (GooString*) a->annot->getAppearState (); + char *ustate = _xpoppler_goo_string_to_utf8 (state); + + a->annot->setRect (rectangle->x1, rectangle->y1, +@@ -105,7 +108,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; + g_return_val_if_fail (POPPLER_IS_ANNOT_MARKUP (poppler_annot), NULL); + + annot = static_cast(POPPLER_ANNOT (poppler_annot)->annot); +- text = annot->getDate (); ++ text = (GooString*) annot->getDate (); + + return text ? _xpoppler_goo_string_to_utf8 (text) : NULL; + } -- cgit v1.2.3