Sun Dec 3 03:57:31 2017 UTC ()
libcaca: assume & handle newly POSIX style endian.h (decision in 2011)
Provide fallback definition that acts the same as the old code that existed.

Add test target.

Fixes build failure reported by John D Baker in pkgsrc-users


(maya)
diff -r1.35 -r1.36 pkgsrc/graphics/libcaca/Makefile
diff -r1.8 -r1.9 pkgsrc/graphics/libcaca/distinfo
diff -r0 -r1.1 pkgsrc/graphics/libcaca/patches/patch-caca_dither.c
diff -r0 -r1.1 pkgsrc/graphics/libcaca/patches/patch-examples_font.c

cvs diff -r1.35 -r1.36 pkgsrc/graphics/libcaca/Makefile (expand / switch to unified diff)

--- pkgsrc/graphics/libcaca/Makefile 2016/02/25 13:37:47 1.35
+++ pkgsrc/graphics/libcaca/Makefile 2017/12/03 03:57:31 1.36
@@ -1,26 +1,27 @@ @@ -1,26 +1,27 @@
1# $NetBSD: Makefile,v 1.35 2016/02/25 13:37:47 jperkin Exp $ 1# $NetBSD: Makefile,v 1.36 2017/12/03 03:57:31 maya Exp $
2 2
3DISTNAME= libcaca-0.99.beta18 3DISTNAME= libcaca-0.99.beta18
4PKGNAME= ${DISTNAME:S/beta//} 4PKGNAME= ${DISTNAME:S/beta//}
5PKGREVISION= 2 5PKGREVISION= 2
6CATEGORIES= graphics 6CATEGORIES= graphics
7MASTER_SITES= http://caca.zoy.org/files/libcaca/ 7MASTER_SITES= http://caca.zoy.org/files/libcaca/
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= http://caca.zoy.org/ 10HOMEPAGE= http://caca.zoy.org/
11COMMENT= Graphics library that outputs text instead of pixels, in colour 11COMMENT= Graphics library that outputs text instead of pixels, in colour
12# LICENSE= wtfpl 12# LICENSE= wtfpl
13 13
 14TEST_TARGET= check
14USE_LIBTOOL= yes 15USE_LIBTOOL= yes
15USE_LANGUAGES= c c++ 16USE_LANGUAGES= c c++
16USE_TOOLS+= pkg-config 17USE_TOOLS+= pkg-config
17USE_PKGLOCALEDIR= yes 18USE_PKGLOCALEDIR= yes
18GNU_CONFIGURE= yes 19GNU_CONFIGURE= yes
19PKGCONFIG_OVERRIDE+= caca/caca.pc.in 20PKGCONFIG_OVERRIDE+= caca/caca.pc.in
20 21
21CHECK_FILES_SKIP+= ${PREFIX}/lib/libcucul.* 22CHECK_FILES_SKIP+= ${PREFIX}/lib/libcucul.*
22 23
23CONFIG_GUESS_OVERRIDE+= .auto/config.guess 24CONFIG_GUESS_OVERRIDE+= .auto/config.guess
24CONFIG_SUB_OVERRIDE+= .auto/config.sub 25CONFIG_SUB_OVERRIDE+= .auto/config.sub
25 26
26.include "options.mk" 27.include "options.mk"

cvs diff -r1.8 -r1.9 pkgsrc/graphics/libcaca/distinfo (expand / switch to unified diff)

--- pkgsrc/graphics/libcaca/distinfo 2015/11/03 21:34:07 1.8
+++ pkgsrc/graphics/libcaca/distinfo 2017/12/03 03:57:31 1.9
@@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
1$NetBSD: distinfo,v 1.8 2015/11/03 21:34:07 agc Exp $ 1$NetBSD: distinfo,v 1.9 2017/12/03 03:57:31 maya Exp $
2 2
3SHA1 (libcaca-0.99.beta18.tar.gz) = 0cbf8075c01d59b53c3cdfec7df9818696a41128 3SHA1 (libcaca-0.99.beta18.tar.gz) = 0cbf8075c01d59b53c3cdfec7df9818696a41128
4RMD160 (libcaca-0.99.beta18.tar.gz) = e7fe45bce798926789e48662038f1eb3ad2bece1 4RMD160 (libcaca-0.99.beta18.tar.gz) = e7fe45bce798926789e48662038f1eb3ad2bece1
5SHA512 (libcaca-0.99.beta18.tar.gz) = b2a8264ec36b74a01ff415a1fd7cb1806c76e28795b73607d4f8fa5ed5cc776b215f2817f45f06c672688f010622ee5c5e2f9dc4d0c43417dedbff545d575ca5 5SHA512 (libcaca-0.99.beta18.tar.gz) = b2a8264ec36b74a01ff415a1fd7cb1806c76e28795b73607d4f8fa5ed5cc776b215f2817f45f06c672688f010622ee5c5e2f9dc4d0c43417dedbff545d575ca5
6Size (libcaca-0.99.beta18.tar.gz) = 1168552 bytes 6Size (libcaca-0.99.beta18.tar.gz) = 1168552 bytes
7SHA1 (patch-caca_caca.h) = 758527c49aa6f27eb82fa645bd80e8a87f4f4b96 7SHA1 (patch-caca_caca.h) = 758527c49aa6f27eb82fa645bd80e8a87f4f4b96
 8SHA1 (patch-caca_dither.c) = d2285e75eaec09840c38c2c54ce5e942d0a2e820
 9SHA1 (patch-examples_font.c) = cc3e32a41c941e2c11a380e4e811ac4ba8b14f1d

File Added: pkgsrc/graphics/libcaca/patches/patch-caca_dither.c
$NetBSD: patch-caca_dither.c,v 1.1 2017/12/03 03:57:31 maya Exp $

Assume POSIX style endian.h (POSIX introduced this in 2011)
Provide fallback definitions for the older code that has existed before.

--- caca/dither.c.orig	2010-02-15 23:45:36.000000000 +0000
+++ caca/dither.c
@@ -19,6 +19,12 @@
 #if !defined(__KERNEL__)
 #   if defined(HAVE_ENDIAN_H)
 #       include <endian.h>
+#       ifndef BYTE_ORDER
+#           define BYTE_ORDER __BYTE_ORDER
+#       endif
+#       ifndef BIG_ENDIAN
+#           define BIG_ENDIAN __BIG_ENDIAN
+#       endif
 #   endif
 #   include <stdio.h>
 #   include <stdlib.h>
@@ -1324,7 +1330,7 @@ static void get_rgba_default(caca_dither
         case 3:
         {
 #if defined(HAVE_ENDIAN_H)
-            if(__BYTE_ORDER == __BIG_ENDIAN)
+            if(BYTE_ORDER == BIG_ENDIAN)
 #else
             /* This is compile-time optimised with at least -O1 or -Os */
             uint32_t const tmp = 0x12345678;

File Added: pkgsrc/graphics/libcaca/patches/patch-examples_font.c
$NetBSD: patch-examples_font.c,v 1.1 2017/12/03 03:57:31 maya Exp $

Assume POSIX style endian.h (POSIX introduced this in 2011)
Provide fallback definitions for the older code that has existed before.

--- examples/font.c.orig	2010-02-15 23:40:44.000000000 +0000
+++ examples/font.c
@@ -15,8 +15,13 @@
 #if !defined(__KERNEL__)
 #   if defined(HAVE_ENDIAN_H)
 #      include <endian.h>
+#       ifndef BYTE_ORDER
+#           define BYTE_ORDER __BYTE_ORDER
+#       endif
+#       ifndef BIG_ENDIAN
+#           define BIG_ENDIAN __BIG_ENDIAN
+#       endif
 #   endif
-
 #   include <stdio.h>
 #   include <stdlib.h>
 #   include <string.h>
@@ -79,7 +84,7 @@ int main(int argc, char *argv[])
 
     {
 #if defined(HAVE_ENDIAN_H)
-        if(__BYTE_ORDER == __BIG_ENDIAN)
+        if(BYTE_ORDER == BIG_ENDIAN)
 #else
         /* This is compile-time optimised with at least -O1 or -Os */
         uint32_t const tmp = 0x12345678;