pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/libcaca libcaca: assume & handle newly POSIX ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7af15952b946
branches:  trunk
changeset: 372318:7af15952b946
user:      maya <maya%pkgsrc.org@localhost>
date:      Sun Dec 03 03:57:31 2017 +0000

description:
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

diffstat:

 graphics/libcaca/Makefile                      |   3 +-
 graphics/libcaca/distinfo                      |   4 ++-
 graphics/libcaca/patches/patch-caca_dither.c   |  29 ++++++++++++++++++++++++
 graphics/libcaca/patches/patch-examples_font.c |  31 ++++++++++++++++++++++++++
 4 files changed, 65 insertions(+), 2 deletions(-)

diffs (99 lines):

diff -r 3d1ec4a37cee -r 7af15952b946 graphics/libcaca/Makefile
--- a/graphics/libcaca/Makefile Sun Dec 03 00:37:58 2017 +0000
+++ b/graphics/libcaca/Makefile Sun Dec 03 03:57:31 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2016/02/25 13:37:47 jperkin Exp $
+# $NetBSD: Makefile,v 1.36 2017/12/03 03:57:31 maya Exp $
 
 DISTNAME=      libcaca-0.99.beta18
 PKGNAME=       ${DISTNAME:S/beta//}
@@ -11,6 +11,7 @@
 COMMENT=       Graphics library that outputs text instead of pixels, in colour
 # LICENSE=     wtfpl
 
+TEST_TARGET=           check
 USE_LIBTOOL=           yes
 USE_LANGUAGES=         c c++
 USE_TOOLS+=            pkg-config
diff -r 3d1ec4a37cee -r 7af15952b946 graphics/libcaca/distinfo
--- a/graphics/libcaca/distinfo Sun Dec 03 00:37:58 2017 +0000
+++ b/graphics/libcaca/distinfo Sun Dec 03 03:57:31 2017 +0000
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.8 2015/11/03 21:34:07 agc Exp $
+$NetBSD: distinfo,v 1.9 2017/12/03 03:57:31 maya Exp $
 
 SHA1 (libcaca-0.99.beta18.tar.gz) = 0cbf8075c01d59b53c3cdfec7df9818696a41128
 RMD160 (libcaca-0.99.beta18.tar.gz) = e7fe45bce798926789e48662038f1eb3ad2bece1
 SHA512 (libcaca-0.99.beta18.tar.gz) = b2a8264ec36b74a01ff415a1fd7cb1806c76e28795b73607d4f8fa5ed5cc776b215f2817f45f06c672688f010622ee5c5e2f9dc4d0c43417dedbff545d575ca5
 Size (libcaca-0.99.beta18.tar.gz) = 1168552 bytes
 SHA1 (patch-caca_caca.h) = 758527c49aa6f27eb82fa645bd80e8a87f4f4b96
+SHA1 (patch-caca_dither.c) = d2285e75eaec09840c38c2c54ce5e942d0a2e820
+SHA1 (patch-examples_font.c) = cc3e32a41c941e2c11a380e4e811ac4ba8b14f1d
diff -r 3d1ec4a37cee -r 7af15952b946 graphics/libcaca/patches/patch-caca_dither.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/libcaca/patches/patch-caca_dither.c      Sun Dec 03 03:57:31 2017 +0000
@@ -0,0 +1,29 @@
+$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;
diff -r 3d1ec4a37cee -r 7af15952b946 graphics/libcaca/patches/patch-examples_font.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/libcaca/patches/patch-examples_font.c    Sun Dec 03 03:57:31 2017 +0000
@@ -0,0 +1,31 @@
+$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;



Home | Main Index | Thread Index | Old Index