diff mbox

[v4,3/5] package/gutenprint: Un-deprecate and bump version to 5.2.10

Message ID CALdGskKj_MrtZCWdYHZ7XKgaHHuffV1qabrfncXpjzkBdRC=ng@mail.gmail.com
State Superseded
Headers show

Commit Message

Olivier Schonken Jan. 24, 2016, 1:50 p.m. UTC
Hi Thomas, All

Attached is a patch that worked for fixing the build issue you had with
Gutenprint.  Seems they have a bit of issues with code quality
control/review upstream.
For the print-olympus.c file the way in which they checked the endianess
differed from the rest of the project, and the also had a variable in
genppd.c that was dependant on a HAVE_ZLIB define, but not encased in an
#ifdef block.

If the changes are in order I will resubmit using the usual methods.

Regards

Olivier Schonken

On 22 January 2016 at 01:15, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear Olivier Schonken,
>
> On Thu, 21 Jan 2016 00:17:45 +0200, Olivier Schonken wrote:
> > Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
> > ---
> >  package/gutenprint/Config.in       | 2 --
> >  package/gutenprint/gutenprint.hash | 2 +-
> >  package/gutenprint/gutenprint.mk   | 2 +-
> >  3 files changed, 2 insertions(+), 4 deletions(-)
>
> This one doesn't build here:
>
> print-olympus.c: In function ‘dyesub_do_print’:
> print-olympus.c:4909:2: error: #error "Unable to determine endianness,
> aborting compilation!"
>  #error "Unable to determine endianness, aborting compilation!"
>
> Here is the defconfig to reproduce:
>
> BR2_arm=y
> BR2_cortex_a9=y
> BR2_ARM_ENABLE_VFP=y
> BR2_COMPILER_PARANOID_UNSAFE_PATH=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="
> http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2015.11-rc1-71-g90d1299.tar.bz2
> "
> BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_3=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_CUPS=y
> BR2_PACKAGE_GUTENPRINT=y
> BR2_PACKAGE_HPLIP=y
> # BR2_TARGET_ROOTFS_TAR is not set
>
> It's late, I'm heading off to bed, so I haven't investigated at all. It
> might be trivial.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>

Comments

Arnout Vandecappelle Jan. 24, 2016, 2:26 p.m. UTC | #1
On 24-01-16 14:50, Olivier Schonken wrote:
> Hi Thomas, All
> 
> Attached is a patch that worked for fixing the build issue you had with
> Gutenprint.  Seems they have a bit of issues with code quality control/review
> upstream.
> For the print-olympus.c file the way in which they checked the endianess
> differed from the rest of the project, and the also had a variable in genppd.c
> that was dependant on a HAVE_ZLIB define, but not encased in an #ifdef block.
> 
> If the changes are in order I will resubmit using the usual methods.
> 

 A few small comments:

 It should be two separate patches, because they do two unrelated things.

 The patch commit log for the endianness fix could be improved a little, e.g.

print-olympus.c: fix endianness detection

The __LITTLE_ENDIAN__ and __BIG_ENDIAN__ macros are not a reliable way to detect
endianness. Instead, rely on __BYTE_ORDER like we do in the rest of the code.


 There's a redundant newline in the patch description.

 And finally, don't forget to send these patches upstream.

 Thanks,
 Arnout
diff mbox

Patch

From 2c5735204ce68b917c66d082e39023eebf12d2e3 Mon Sep 17 00:00:00 2001
From: Olivier Schonken <olivier.schonken@gmail.com>
Date: Sun, 24 Jan 2016 15:40:01 +0200
Subject: [PATCH] Gutenprint build fix

use_compression variable in genppd.c dependant on HAVE_LIBZ define.
Changed byte order #if-#elif to same format as rest of project


Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
---
 src/cups/genppd.c        | 2 ++
 src/main/print-olympus.c | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/cups/genppd.c b/src/cups/genppd.c
index 7b55c13..469c2cb 100644
--- a/src/cups/genppd.c
+++ b/src/cups/genppd.c
@@ -564,9 +564,11 @@  main(int  argc,			    /* I - Number of command-line arguments */
       break;
     }
   }
+#ifdef HAVE_LIBZ
   if (use_compression)
     gpext = ".gz";
   else
+#endif
     gpext = "";
   if (optind < argc) {
     int n, numargs;
diff --git a/src/main/print-olympus.c b/src/main/print-olympus.c
index 42c4897..8b2aa80 100644
--- a/src/main/print-olympus.c
+++ b/src/main/print-olympus.c
@@ -4901,9 +4901,9 @@  dyesub_do_print(stp_vars_t *v, stp_image_t *image)
   }
 
   if (pv.bytes_per_ink_channel > 1) {
-#if defined(__LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+#if (__BYTE_ORDER == __LITTLE_ENDIAN)
     pv.byteswap = dyesub_feature(caps, DYESUB_FEATURE_BIGENDIAN);
-#elif defined (__BIG_ENDIAN) || defined(__BIG_ENDIAN__)
+#elif (__BYTE_ORDER == __BIG_ENDIAN)
     pv.byteswap = !dyesub_feature(caps, DYESUB_FEATURE_BIGENDIAN);
 #else
 #error "Unable to determine endianness, aborting compilation!"
-- 
1.9.1