emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#34013: closed ([PATCH 1/2] gnu: libjxr: Build and


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#34013: closed ([PATCH 1/2] gnu: libjxr: Build and install shared library.)
Date: Wed, 25 Sep 2019 15:49:03 +0000

Your message dated Wed, 25 Sep 2019 17:48:39 +0200
with message-id <address@hidden>
and subject line Re: [bug#34013] [PATCH 2/2] gnu: freeimage: Update to 3.18.0.
has caused the debbugs.gnu.org bug report #34013,
regarding [PATCH 1/2] gnu: libjxr: Build and install shared library.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
34013: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34013
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH 1/2] gnu: libjxr: Build and install shared library. Date: Mon, 7 Jan 2019 19:32:02 -0500
* gnu/packages/image.scm (libjxr)[arguments]: Add -fPIC to CFLAGS for shared
library support.  Add 'build-shared-library' phase and modify 'install' phase
to install the shared libraries.
---
 gnu/packages/image.scm | 90 ++++++++++++++++++++++++++++--------------
 1 file changed, 60 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 8771eb8ae..e78ef5618 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -370,36 +370,66 @@ lossless JPEG manipulations such as rotation, scaling or 
cropping:
               (patches (search-patches "libjxr-fix-function-signature.patch"
                                        "libjxr-fix-typos.patch"))))
     (build-system gnu-build-system)
-    (arguments '(#:make-flags '("CC=gcc")
-                 #:tests? #f ; no check target
-                 #:phases
-                 (modify-phases %standard-phases
-                   (delete 'configure) ; no configure script
-                   ;; The upstream makefile does not include an install phase.
-                   (replace 'install
-                     (lambda* (#:key outputs #:allow-other-keys)
-                       (let* ((out (assoc-ref outputs "out"))
-                              (bin (string-append out "/bin"))
-                              (lib (string-append out "/lib"))
-                              (include (string-append out "/include/jxrlib")))
-                         (for-each (lambda (file)
-                                     (install-file file include)
-                                     (delete-file file))
-                                   (append
-                                    '("jxrgluelib/JXRGlue.h"
-                                      "jxrgluelib/JXRMeta.h"
-                                      "jxrtestlib/JXRTest.h"
-                                      "image/sys/windowsmediaphoto.h")
-                                    (find-files "common/include" "\\.h$")))
-                         (for-each (lambda (file)
-                                     (install-file file lib)
-                                     (delete-file file))
-                                   (find-files "." "\\.a$"))
-                         (for-each (lambda (file)
-                                     (install-file file bin)
-                                     (delete-file file))
-                                   '("JxrDecApp" "JxrEncApp")))
-                       #t)))))
+    (arguments
+     '(#:make-flags
+       (list "CC=gcc"
+             ;; A substitute* procedure call would be enough to add the -fPIC
+             ;; flag if there was no file decoding error.
+             ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
+             ;; terminators" according to the file(1) utility.
+             (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
+                            "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
+       #:tests? #f ; no check target
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure) ; no configure script
+         (add-after 'build 'build-shared-library
+           (lambda _
+             ;; The Makefile uses optimization level 1, so the same
+             ;; level is used here for consistency.
+             (invoke "gcc" "-shared" "-fPIC" "-O"
+                     ;; Common files.
+                     "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
+                     "strTransform.o" "perfTimerANSI.o"
+                     ;; Decoding files.
+                     "decode.o" "postprocess.o" "segdec.o" "strdec.o"
+                     "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
+                     ;; Encoding files.
+                     "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
+                     "strPredQuantEnc.o"
+                     "-o" "libjpegxr.so")
+             (invoke "gcc" "-shared" "-fPIC" "-O"
+                     ;; Glue files.
+                     "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
+                     ;; Test files.
+                     "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
+                     "JXRTestTif.o" "JXRTestYUV.o"
+                     "-o" "libjxrglue.so")))
+         ;; The upstream makefile does not include an install phase.
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (lib (string-append out "/lib"))
+                    (include (string-append out "/include/jxrlib")))
+               (for-each (lambda (file)
+                           (install-file file include)
+                           (delete-file file))
+                         (append
+                          '("jxrgluelib/JXRGlue.h"
+                            "jxrgluelib/JXRMeta.h"
+                            "jxrtestlib/JXRTest.h"
+                            "image/sys/windowsmediaphoto.h")
+                          (find-files "common/include" "\\.h$")))
+               (for-each (lambda (file)
+                           (install-file file lib)
+                           (delete-file file))
+                         (find-files "." "\\.(a|so)$"))
+               (for-each (lambda (file)
+                           (install-file file bin)
+                           (delete-file file))
+                         '("JxrDecApp" "JxrEncApp")))
+             #t)))))
     (synopsis "Implementation of the JPEG XR standard")
     (description "JPEG XR is an approved ISO/IEC International standard (its
 official designation is ISO/IEC 29199-2). This library is an implementation of 
that standard.")
-- 
2.20.1




--- End Message ---
--- Begin Message --- Subject: Re: [bug#34013] [PATCH 2/2] gnu: freeimage: Update to 3.18.0. Date: Wed, 25 Sep 2019 17:48:39 +0200 User-agent: Notmuch/0.29.1 (https://notmuchmail.org) Emacs/26.2 (x86_64-pc-linux-gnu)
Kei Kebreau <address@hidden> writes:

> * gnu/packages/image.scm (freeimage): Update to 3.18.0.
> [source]: Modify snippet to remove the bundled libjxr. Remove obsolete
> patches.
> [arguments]: Add libjxr include directory to #:make-flags.
> [inputs]: Add libjxr and substitute libjpeg-turbo for libjpeg.
> * gnu/packages/patches/freeimage-CVE-2015-0852.patch,
> gnu/packages/patches/freeimage-CVE-2016-5684.patch,
> gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch: Delete files.
> * gnu/local.mk (dist_patch_DATA): Unregister patches.
> * gnu/packages/patches/freeimage-unbundle.patch: Update patch.

Pushed in 8dc3c2a7d5, thanks!  I had to manually modify the unbundling
patch to make it apply.  Hope I did not mess anything up :-)

As an added bonus, all freeimage dependents are now working again \o/

Attachment: signature.asc
Description: PGP signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]