From patchwork Tue Jan 8 00:32:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kei Kebreau X-Patchwork-Id: 701 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D1CD816A32; Tue, 8 Jan 2019 00:33:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6155516A30 for ; Tue, 8 Jan 2019 00:33:10 +0000 (GMT) Received: from localhost ([127.0.0.1]:51398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggfKP-0000NP-G4 for patchwork@mira.cbaines.net; Mon, 07 Jan 2019 19:33:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggfKJ-0000MM-D0 for guix-patches@gnu.org; Mon, 07 Jan 2019 19:33:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggfKI-0002kn-DN for guix-patches@gnu.org; Mon, 07 Jan 2019 19:33:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggfKI-0002kC-9U for guix-patches@gnu.org; Mon, 07 Jan 2019 19:33:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggfKI-0003sQ-5J for guix-patches@gnu.org; Mon, 07 Jan 2019 19:33:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34013] [PATCH 1/2] gnu: libjxr: Build and install shared library. Resent-From: Kei Kebreau Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Jan 2019 00:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34013 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34013@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154690753914853 (code B ref -1); Tue, 08 Jan 2019 00:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jan 2019 00:32:19 +0000 Received: from localhost ([127.0.0.1]:49084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggfJb-0003rV-7Y for submit@debbugs.gnu.org; Mon, 07 Jan 2019 19:32:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggfJY-0003rH-Cz for submit@debbugs.gnu.org; Mon, 07 Jan 2019 19:32:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:34104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggfJS-0001Cn-W9 for submit@debbugs.gnu.org; Mon, 07 Jan 2019 19:32:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggfJR-0008Ny-Pg for guix-patches@gnu.org; Mon, 07 Jan 2019 19:32:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggfJQ-00017S-Ov for guix-patches@gnu.org; Mon, 07 Jan 2019 19:32:09 -0500 Received: from mout01.posteo.de ([185.67.36.65]:44160) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggfJQ-00013h-3R for guix-patches@gnu.org; Mon, 07 Jan 2019 19:32:08 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id DA8E716005E for ; Tue, 8 Jan 2019 01:32:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1546907525; bh=NRM67l8LkA0hZteArBVgJkw4vqDQXpIfD8eo9KWJNqE=; h=From:To:Cc:Subject:Date:From; b=VDPVG2s4SrKWK7NEaQ9BYeb3gsaJuHM+9Z0h5NW2GB9Rn3XVVd9aBJ+OYSc6vcuJ7 X7C6t5TG6y3PYlqSEgsNPq1xjtHk9aFmZVP0cxR+4dl40PxAvCaYQJuennzipVT874 lmn7wf+RTvdEmHuMLI3MmmeD/UAz5D8VYetQH7b4+HxQZoEE0HBOLas9J9FrPK9hLJ hMCuBSuJpxSPUyH7sxs/ZQL2nBlSzi4cFS7H3wzMxsGEy9J4Lu7UdvGnH3yOTixT70 QOQlpAf+wnQzb4gk1z+Xoy6IqrQWh6umkEVxGXQeXtJ13Dr6AnHpmpmKBPM6vIgydl p8q5SLGEZUloA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 43YY9d12vMz6tm6; Tue, 8 Jan 2019 01:32:04 +0100 (CET) From: Kei Kebreau Date: Mon, 7 Jan 2019 19:32:02 -0500 Message-Id: <20190108003202.20331-1-kkebreau@posteo.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kei Kebreau Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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.")