From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: Re: [PATCH] gnu: Add libjxr. Date: Sun, 30 Oct 2016 11:31:12 -0400 Message-ID: <87ins94zwf.fsf@openmailbox.org> References: <87eg39qvjh.fsf@openmailbox.org> <20161021235859.GA9570@jasmine> <87a8dwrdf5.fsf@openmailbox.org> <20161023212929.GB6318@jasmine> <87bmy4bni6.fsf@gnu.org> <87mvhn4va2.fsf@openmailbox.org> <87a8dmvpge.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0s5B-0007dz-QQ for guix-devel@gnu.org; Sun, 30 Oct 2016 11:31:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0s58-00087P-24 for guix-devel@gnu.org; Sun, 30 Oct 2016 11:31:37 -0400 Received: from smtp8.openmailbox.org ([62.4.1.42]:47371) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0s57-000874-MM for guix-devel@gnu.org; Sun, 30 Oct 2016 11:31:33 -0400 In-Reply-To: <87a8dmvpge.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 29 Oct 2016 23:02:25 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Kei Kebreau skribis: > >> ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> >>> Leo Famulari skribis: >>> >>>> On Sat, Oct 22, 2016 at 04:33:18AM -0400, Kei Kebreau wrote: >>> >>> [...] >>> >>>>> >> diff --git a/gnu/packages/patches/libjxr-use-cmake.patch >>>>> >> b/gnu/packages/patches/libjxr-use-cmake.patch >>>>> >> new file mode 100644 >>>>> >> index 0000000..cb5919e >>>>> >> --- /dev/null >>>>> >> +++ b/gnu/packages/patches/libjxr-use-cmake.patch >>>>> >> @@ -0,0 +1,143 @@ >>>>> >> +Description: Prefer a cmake based build system >>>>> >> +Author: Mathieu Malaterre >>>>> >> +Forwarded: https://jxrlib.codeplex.com/discussions/440294 >>>>> > >>>>> > Why doesn't upstream's build system work? >>>>>=20 >>>>> Upstream's build system simply doesn't have configuration or >>>>> installation targets in the provided Makefile. Using the cmake patch >>>>> makes the definition cleaner at the cost of relying on outside work >>>>> [1]. If this is not acceptable, I can see about writing manual >>>>> replacement phases to the best of my ability. >>>>>=20 >>>>> [1]: https://jxrlib.codeplex.com/discussions/440294 >>>> >>>> Hm, not an ideal situation. >>>> >>>> If Debian is using this patch, we should link to it's source on Debian= 's >>>> site instead of this message board. I don't know enough about CMake to >>>> judge the patch but I'd be more comfortable if Debian was using it. >>>> >>>> What do others think? >>> >>> Regarding the choice between writing our own installation phase in >>> Scheme and using this CMake thing instead, I think we should choose the >>> most concise approach (in terms of lines of code). >>> >>> If the winner here is the CMake patch, then indeed, we should take the >>> patch from Debian rather than from a message board (and include >>> provenance information in the patch, as you wrote.) >>> >>> That said, I suspect an =E2=80=98install=E2=80=99 phase in Scheme would= be more concise >>> than this new CMakeLists.txt (134 lines). >>> >>> Kei: WDYT? >>> >> >> I have been working on writing our own installation phase, and it looks >> like it will be more concise. > > Cool, thanks! > >> However, the patches need to be in DOS format to apply. The patch >> doesn't seem to carry these line returns, which leads me to believe >> that a standard git configuration won't accept them. Is there way >> around this? > > But that=E2=80=99s unrelated to removing the CMakeLists.txt patch and add= ing > your own install phase, right? :-) > > From the description I=E2=80=99m not sure exactly what the problem is, but > perhaps the =E2=80=98--binary=E2=80=99 option of =E2=80=98patch=E2=80=99 = can help? You can specify it > in =E2=80=98patch-flags=E2=80=99: > > https://www.gnu.org/software/guix/manual/html_node/origin-Reference.html > > Ludo=E2=80=99. I ended up using the '--binary' flag, but the libjxr patches still need to be converted to DOS format to function properly. The current procedure to get this patch running is: $ git am 0001-gnu-Add-libjxr.patch [whitespace complaints] $ sed -i -e 's/\r*$/\r/' gnu/packages/patches/libjxr-fix-* $ ./pre-inst-env guix build libjxr The DOS formatting issue also keeps me from using 'substitute*' to patch the Makefile to build both a shared and static version of the library. The current package only builds a static version. Everything seems to link properly for now, but I don't know if that will be required in the future. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-libjxr.patch Content-Transfer-Encoding: quoted-printable From=20316a4f7a676bf6b8cc7a8f8795b74fa0ebab3e36 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Sun, 30 Oct 2016 11:05:30 -0400 Subject: [PATCH] gnu: Add libjxr. * gnu/packages/images.scm (libjxr): New variable. * gnu/packages/patches/libjxr-fix-function-signature.patch: New file. * gnu/packages/patches/libjxr-fix-typos.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patches. =2D-- gnu/local.mk | 2 + gnu/packages/image.scm | 54 ++++++++++++++++++= ++++ .../patches/libjxr-fix-function-signature.patch | 16 +++++++ gnu/packages/patches/libjxr-fix-typos.patch | 29 ++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 gnu/packages/patches/libjxr-fix-function-signature.patch create mode 100644 gnu/packages/patches/libjxr-fix-typos.patch diff --git a/gnu/local.mk b/gnu/local.mk index a64b7ec..db9d436 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -639,6 +639,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/libdrm-symbol-check.patch \ %D%/packages/patches/libevent-dns-tests.patch \ %D%/packages/patches/libextractor-ffmpeg-3.patch \ + %D%/packages/patches/libjxr-fix-function-signature.patch \ + %D%/packages/patches/libjxr-fix-typos.patch \ %D%/packages/patches/liboop-mips64-deplibs-fix.patch \ %D%/packages/patches/libotr-test-auth-fix.patch \ %D%/packages/patches/liblxqt-include.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 873a7f2..b4d0765 100644 =2D-- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -11,6 +11,7 @@ ;;; Copyright =C2=A9 2016 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2016 Eric Bavier ;;; Copyright =C2=A9 2016 Arun Isaac +;;; Copyright =C2=A9 2016 Kei Kebreau ;;; ;;; This file is part of GNU Guix. ;;; @@ -129,6 +130,59 @@ image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa fi= le formats.") (sha256 (base32 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0= ")))))) =20 +(define-public libjxr + (package + (name "libjxr") + (version "1.1") + (source (origin + (method url-fetch) + (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrl= ib_" + version ".orig.tar.gz")) + (sha256 + (base32 + "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67")) + (patch-flags '("-p1" "--binary")) + (patches (search-patches "libjxr-fix-function-signature.patc= h" + "libjxr-fix-typos.patch")))) + (build-system gnu-build-system) + (arguments '(#:make-flags '("CC=3Dgcc") + #:tests? #f ; no check target + #:phases + (modify-phases %standard-phases + (delete 'configure) ; no configure script + (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))))) + (synopsis "Implementation of the JPEG XR standard") + (description "JPEG XR is an approved ISO/IEC International standard (i= ts +official designation is ISO/IEC 29199-2). This library is an implementatio= n of that standard.") + (license + (license:non-copyleft + "file://Makefile" + "See the header of the Makefile in the distribution.")) + (home-page "https://jxrlib.codeplex.com/"))) + (define-public jpegoptim (package (name "jpegoptim") diff --git a/gnu/packages/patches/libjxr-fix-function-signature.patch b/gnu= /packages/patches/libjxr-fix-function-signature.patch new file mode 100644 index 0000000..32f5f64 =2D-- /dev/null +++ b/gnu/packages/patches/libjxr-fix-function-signature.patch @@ -0,0 +1,16 @@ +Description: Fix function signature=0D +Author: Mathieu Malaterre =0D +Origin: upstream, https://jxrlib.codeplex.com/SourceControl/changeset/04cf= 339385b8196f98025b43a366a0790deac994=0D +Bug-Debian: http://bugs.debian.org/748590=0D +=0D +--- jxrlib-1.1.orig/image/decode/JXRTranscode.c=0D ++++ jxrlib-1.1/image/decode/JXRTranscode.c=0D +@@ -47,7 +47,7 @@ EXTERN_C Void FreeCodingContextDec(CWMIm=0D + EXTERN_C Int StrEncInit(CWMImageStrCodec *);=0D + EXTERN_C Void StrIOEncTerm(CWMImageStrCodec *);=0D + EXTERN_C Void FreeCodingContextEnc(CWMImageStrCodec *);=0D +-EXTERN_C Void encodeMB(CWMImageStrCodec *, Int, Int);=0D ++EXTERN_C Int encodeMB(CWMImageStrCodec *, Int, Int);=0D + EXTERN_C Int writeIndexTableNull(CWMImageStrCodec *);=0D + EXTERN_C Void writePacketHeader(BitIOInfo *, U8, U8);=0D + =0D diff --git a/gnu/packages/patches/libjxr-fix-typos.patch b/gnu/packages/pat= ches/libjxr-fix-typos.patch new file mode 100644 index 0000000..819db34 =2D-- /dev/null +++ b/gnu/packages/patches/libjxr-fix-typos.patch @@ -0,0 +1,29 @@ +Description: Fix typos and remove some warnings=0D +Author: Mathieu Malaterre =0D +=0D +Index: jxrlib-1.1/jxrencoderdecoder/JxrEncApp.c=0D +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D +--- jxrlib-1.1.orig/jxrencoderdecoder/JxrEncApp.c=0D ++++ jxrlib-1.1/jxrencoderdecoder/JxrEncApp.c=0D +@@ -578,7 +578,7 @@ main(int argc, char* argv[])=0D + =0D + //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION));=0D +- Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, &pEncoder));=0D ++ Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, (void**)&pEnco= der));=0D + =0D + //----------------------------------------------------------------=0D + Call(PKCreateTestFactory(&pTestFactory, WMP_SDK_VERSION));=0D +Index: jxrlib-1.1/jxrgluelib/JXRMeta.h=0D +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D +--- jxrlib-1.1.orig/jxrgluelib/JXRMeta.h=0D ++++ jxrlib-1.1/jxrgluelib/JXRMeta.h=0D +@@ -34,7 +34,7 @@=0D + =0D + #ifndef UNREFERENCED_PARAMETER=0D + #define UNREFERENCED_PARAMETER(P) { (P) =3D (P); }=0D +-#endif UNREFERENCED_PARAMETER=0D ++#endif /*UNREFERENCED_PARAMETER*/=0D + =0D + //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + // Container=0D =2D-=20 2.10.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYFhJAAAoJEOal7jwZRnoN9UgQAKk0MpbA9t9frykcMrogk3pD cn9VnbAOd9X0I57kEMoHZgkhoj9Ac1mk0hct96+5R4McyXzQRshSzoCsuKzM8R7F uh5wmV0NUm6hA21doA+Rrng7xg9wCzBDK26A8MGbEFJS4tTCn8fPXfFyvUlYptwo aj84hQ9oeqS3FE+5zrcUFasMV3YmqNxxbcdIOJFSo7nSmsjOngEGCdNR0TRtFVQy kBGEv55bFtlp7nkNvHbAK59oS6OknWMyelWzD2WUPheBRa8HsS779NyVtOf3Ysmg V0FxBebjjCBI1yxiQGQpmCS00DIZ7Bjl809huXQcsRx+KcLzTSWpdWjZunCKJEX/ RSIRwY6zVPOU5RDFKmy1jPx9Uqi+mLBj1P+3QCTPMN3VDJ4NgOKAw4+3cBM/opjN yPElOtKoHgokkeWLCJITlDYr4DkUtXAhdiND4dKjEynzOCrK3v0sc2uoL52o1qEt bWFPedR0is8nEYeOF0Kfxe8Ds9LURXEaVAEH6LE3MOxIdGrR7RTcz5upJ5vcZ1b4 ouNJFGhcL4xeHHMmEoRnb2aPHhi2ccisee6MILEUNB/UJubTZVpJ4oktTJ99oqsc meJwUn5/XoZZKhjV0uXOtpDv3ujwYxxCgghcEX/i/pDC4lEVqqupvQwkXc5SG82Z BN+/VTe00RvoKrAKAP5d =6qEc -----END PGP SIGNATURE----- --==-=-=--