From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: [PATCH] gnu: Add libjxr. Date: Fri, 21 Oct 2016 16:47:14 -0400 Message-ID: <87eg39qvjh.fsf@openmailbox.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]:44639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxgiy-0003Ho-9G for guix-devel@gnu.org; Fri, 21 Oct 2016 16:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxgiu-0007vx-6R for guix-devel@gnu.org; Fri, 21 Oct 2016 16:47:32 -0400 Received: from smtp28.openmailbox.org ([62.4.1.62]:38423 helo=smtp13.openmailbox.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bxgit-0007vh-RH for guix-devel@gnu.org; Fri, 21 Oct 2016 16:47:28 -0400 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: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain This is a patch I think we need before fixing up freeimage. Thoughts? --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-libjxr.patch Content-Transfer-Encoding: quoted-printable From=20ac9a3c00c9b9a8232fa7cde26b2ecc46b94f809c Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 21 Oct 2016 16:39:50 -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/packages/patches/libjxr-use-cmake.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patches. =2D-- gnu/local.mk | 3 + gnu/packages/image.scm | 26 ++++ .../patches/libjxr-fix-function-signature.patch | 16 +++ gnu/packages/patches/libjxr-fix-typos.patch | 60 +++++++++ gnu/packages/patches/libjxr-use-cmake.patch | 143 +++++++++++++++++= ++++ 5 files changed, 248 insertions(+) create mode 100644 gnu/packages/patches/libjxr-fix-function-signature.patch create mode 100644 gnu/packages/patches/libjxr-fix-typos.patch create mode 100644 gnu/packages/patches/libjxr-use-cmake.patch diff --git a/gnu/local.mk b/gnu/local.mk index c6cd586..911af78 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -633,6 +633,9 @@ 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/libjxr-use-cmake.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 4b064bb..b1b40b3 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,31 @@ 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")) + (patches (search-patches "libjxr-fix-function-signature.patc= h" + "libjxr-use-cmake.patch" + "libjxr-fix-typos.patch")))) + (build-system cmake-build-system) + (arguments '(#:tests? #f)) ; no check target + (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..9efc339 =2D-- /dev/null +++ b/gnu/packages/patches/libjxr-fix-function-signature.patch @@ -0,0 +1,16 @@ +Description: Fix function signature +Author: Mathieu Malaterre +Origin: upstream, https://jxrlib.codeplex.com/SourceControl/changeset/04cf= 339385b8196f98025b43a366a0790deac994 +Bug-Debian: http://bugs.debian.org/748590 + +--- jxrlib-1.1.orig/image/decode/JXRTranscode.c ++++ jxrlib-1.1/image/decode/JXRTranscode.c +@@ -47,7 +47,7 @@ EXTERN_C Void FreeCodingContextDec(CWMIm + 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..3c051dd =2D-- /dev/null +++ b/gnu/packages/patches/libjxr-fix-typos.patch @@ -0,0 +1,60 @@ +Description: Fix typos and remove some warnings +Author: Mathieu Malaterre + +Index: jxrlib-1.1/CMakeLists.txt +=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 +--- jxrlib-1.1.orig/CMakeLists.txt ++++ jxrlib-1.1/CMakeLists.txt +@@ -91,7 +91,7 @@ add_library(jxrglue ${OBJ_GLUE} ${OBJ_TE + set_property(TARGET jxrglue + PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_EN= DIAN} + ) +-set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") ++#set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") + set_property(TARGET jxrglue PROPERTY COMPILE_FLAGS -w) + # VERSION/SOVERSION + set_property(TARGET jxrglue PROPERTY VERSION 1.1) +@@ -104,14 +104,15 @@ install(TARGETS jxrglue + #if(HAVE_STRLCPY_BSD) + # target_link_libraries(jxrglue ${BSD_LIBRARY}) + #endif() +-target_link_libraries(jxrglue jpegxr m) ++#target_link_libraries(jxrglue m) ++target_link_libraries(jxrglue PRIVATE jpegxr m) + # Enc app files + set(ENCAPP JxrEncApp) + add_executable(${ENCAPP} ${DIR_EXEC}/${ENCAPP}.c) + set_property(TARGET ${ENCAPP} + PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_EN= DIAN} + ) +-set_property(TARGET ${ENCAPP} PROPERTY COMPILE_FLAGS -w) ++#set_property(TARGET ${ENCAPP} PROPERTY COMPILE_FLAGS -w) + target_link_libraries(${ENCAPP} jxrglue) # jpegxr) + install(TARGETS ${ENCAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR}) + # Dec app files +Index: jxrlib-1.1/jxrencoderdecoder/JxrEncApp.c +=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 +--- jxrlib-1.1.orig/jxrencoderdecoder/JxrEncApp.c ++++ jxrlib-1.1/jxrencoderdecoder/JxrEncApp.c +@@ -578,7 +578,7 @@ main(int argc, char* argv[]) + =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 +=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 +--- jxrlib-1.1.orig/jxrgluelib/JXRMeta.h ++++ jxrlib-1.1/jxrgluelib/JXRMeta.h +@@ -34,7 +34,7 @@ + =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 diff --git a/gnu/packages/patches/libjxr-use-cmake.patch b/gnu/packages/pat= ches/libjxr-use-cmake.patch new file mode 100644 index 0000000..cb5919e =2D-- /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 + +Index: jxrlib-1.1/CMakeLists.txt +=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 +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ jxrlib-1.1/CMakeLists.txt 2014-03-26 17:05:04.429637801 +0100 +@@ -0,0 +1,134 @@ ++# Copyright Mathieu Malaterre ++# BSD (Same as jxrlib) ++cmake_minimum_required(VERSION 2.8) ++project(jxrlib C) ++ ++# Need shared libs for ABI ++set(BUILD_SHARED_LIBS ON) ++ ++# helper macro to preserve original Makefile convention ++macro(JXR_MAKE_OBJ SET_NAME) ++ foreach(src ${SRC_${SET_NAME}}) ++ list(APPEND OBJ_${SET_NAME} ${DIR_${SET_NAME}}/${src}) ++ endforeach() ++endmacro() ++ ++include(TestBigEndian) ++test_big_endian(ISBIGENDIAN) ++if(ISBIGENDIAN) ++ set(DEF_ENDIAN _BIG__ENDIAN_) ++endif() ++ ++set(DIR_SYS image/sys) ++set(DIR_DEC image/decode) ++set(DIR_ENC image/encode) ++ ++set(DIR_GLUE jxrgluelib) ++set(DIR_TEST jxrtestlib) ++set(DIR_EXEC jxrencoderdecoder) ++ ++if(NOT JXRLIB_INSTALL_BIN_DIR) ++ set(JXRLIB_INSTALL_BIN_DIR "bin") ++endif() ++ ++if(NOT JXRLIB_INSTALL_LIB_DIR) ++ set(JXRLIB_INSTALL_LIB_DIR "lib") ++endif() ++ ++if(NOT JXRLIB_INSTALL_INCLUDE_DIR) ++ set(JXRLIB_INSTALL_INCLUDE_DIR "include/jxrlib") ++endif() ++ ++include_directories( ++ common/include ++ ${DIR_SYS} ++ ${DIR_GLUE} ++ ${DIR_TEST} ++) ++ ++# where is strlcpy ? ++include(CheckSymbolExists) ++check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY) ++#set(CMAKE_REQUIRED_LIBRARIES bsd) ++#CHECK_SYMBOL_EXISTS(strlcpy "string.h" HAVE_STRLCPY4) ++# on linux, strlcpy is in -lbsd: ++#if(NOT HAVE_STRLCPY) ++# include(CheckLibraryExists) ++# find_library(BSD_LIBRARY bsd) ++# check_library_exists(bsd "strlcpy" ${BSD_LIBRARY} HAVE_STRLCPY_BSD) ++#endif() ++ ++# JPEG-XR ++set(SRC_SYS adapthuff.c image.c strcodec.c strPredQuant.c strTransform.c = perfTimerANSI.c) ++JXR_MAKE_OBJ(SYS) ++set(SRC_DEC decode.c postprocess.c segdec.c strdec.c strInvTransform.c st= rPredQuantDec.c JXRTranscode.c) ++JXR_MAKE_OBJ(DEC) ++set(SRC_ENC encode.c segenc.c strenc.c strFwdTransform.c strPredQuantEnc.= c) ++JXR_MAKE_OBJ(ENC) ++ ++add_library(jpegxr ${OBJ_ENC} ${OBJ_DEC} ${OBJ_SYS}) ++set_property(TARGET jpegxr ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_EN= DIAN} ++) ++set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "") ++set_property(TARGET jpegxr PROPERTY COMPILE_FLAGS -w) ++# VERSION/SOVERSION ++set_property(TARGET jpegxr PROPERTY VERSION 1.1) ++set_property(TARGET jpegxr PROPERTY SOVERSION 0) ++install(TARGETS jpegxr ++ EXPORT JXRLibTargets ++ RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} COMPONENT Libraries ++) ++ ++#=C2=A0JXR-GLUE ++set(SRC_GLUE JXRGlue.c JXRMeta.c JXRGluePFC.c JXRGlueJxr.c) ++JXR_MAKE_OBJ(GLUE) ++set(SRC_TEST JXRTest.c JXRTestBmp.c JXRTestHdr.c JXRTestPnm.c JXRTestTif.= c JXRTestYUV.c) ++JXR_MAKE_OBJ(TEST) ++ ++add_library(jxrglue ${OBJ_GLUE} ${OBJ_TEST}) ++set_property(TARGET jxrglue ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_EN= DIAN} ++) ++set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") ++set_property(TARGET jxrglue PROPERTY COMPILE_FLAGS -w) ++# VERSION/SOVERSION ++set_property(TARGET jxrglue PROPERTY VERSION 1.1) ++set_property(TARGET jxrglue PROPERTY SOVERSION 0) ++install(TARGETS jxrglue ++ EXPORT JXRLibTargets ++ RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} COMPONENT Libraries ++) ++#if(HAVE_STRLCPY_BSD) ++# target_link_libraries(jxrglue ${BSD_LIBRARY}) ++#endif() ++target_link_libraries(jxrglue jpegxr m) ++# Enc app files ++set(ENCAPP JxrEncApp) ++add_executable(${ENCAPP} ${DIR_EXEC}/${ENCAPP}.c) ++set_property(TARGET ${ENCAPP} ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_EN= DIAN} ++) ++set_property(TARGET ${ENCAPP} PROPERTY COMPILE_FLAGS -w) ++target_link_libraries(${ENCAPP} jxrglue) # jpegxr) ++install(TARGETS ${ENCAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR}) ++# Dec app files ++set(DECAPP JxrDecApp) ++add_executable(${DECAPP} ${DIR_EXEC}/${DECAPP}.c) ++set_property(TARGET ${DECAPP} ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_EN= DIAN} ++) ++set_property(TARGET ${DECAPP} PROPERTY COMPILE_FLAGS -w) ++target_link_libraries(${DECAPP} jxrglue) # jpegxr) ++install(TARGETS ${DECAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR}) ++ ++# install rules ++install(FILES jxrgluelib/JXRGlue.h jxrgluelib/JXRMeta.h jxrtestlib/JXRTes= t.h ++ image/sys/windowsmediaphoto.h ++ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} COMPONENT Headers ++) ++install(DIRECTORY common/include/ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DI= R} ++ FILES_MATCHING PATTERN "*.h" ++) =2D-=20 2.10.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYCn7SAAoJEOal7jwZRnoNki0P/Amllr+rxHgYSklrkacQmgZv S+ZEBzcGpkMs0Ds47cMSFAMZ+gnDfkVspeiVr+K/KHJE1Jhsa/om662bNh38WOmo hd9vCeU0kGgpxqv69KBCYtLr/BTLp2IpLqItX64REGqH/repuE5+A0bFl+d7U2dO kf3+mqwlaB6mIlVgrUy2nXogP7Zolo9qMUE5GrYCHg7/YDSdXVlKxxTlWMoXY0Jg kizU22AcV9+VEam09gjXUo1gubqg2W7ijcdkIcC947hh+/TsnrvmfginMNfxbVvx 8bPUuGrLh86oltRSytr2otwOw1Vw5EhYAX7R6cGpJlNH8DgJPb8yveBiBH/F8ZGU /ngQc4/riehT8/CoW3CglWD8x5arzLPCyr9+jOHtxbjECQSj63hLv59FOo9D0ByG rJSmrNbqA2Z7/zq93ADP7iZ/Eq+VKpVwMLaBybNMZDYQJQztrr0BIuRy9xdzzZ6K ysEEvZyVRGle1rJC7VEn6tquo3h3wyZ9H/S3QBUP4M9pGe/HxmcO6aGuQRHcujjV 7dxlxbVdCcz77SZXGy3R/CzwtsoCedle9ibLwuzZ2ZixCSQnQxV6m0qo6i59mVQn AYSfeau2+cwncxKKT+RHElFa9zWq5EgsYp2197HUs5uRGU8+OGNXH1P7Y6qbedWF pAzaOiBw0L6xfovaZ7Sb =7z0S -----END PGP SIGNATURE----- --==-=-=--