summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2022-09-25 14:43:27 +0000
committerhe <he@pkgsrc.org>2022-09-25 14:43:27 +0000
commita810eb5c11663ce10eb4d2b8c9b269fca29b7564 (patch)
tree9d558299e0c397f79c1213a1d99b13731e02200a
parentef683411cf174be011d7da8e83bb6386e94b403e (diff)
downloadpkgsrc-a810eb5c11663ce10eb4d2b8c9b269fca29b7564.tar.gz
multimedia/libmpeg2: fix build on NetBSD/macppc.
This re-orders the two tests for altivec to first try with <altivec.h> included, and the second without. The configure script is hand-patched, corresponding to configure.ac; I could not generate a working configure script...
-rw-r--r--multimedia/libmpeg2/distinfo5
-rw-r--r--multimedia/libmpeg2/patches/patch-aa49
-rw-r--r--multimedia/libmpeg2/patches/patch-configure.ac34
3 files changed, 85 insertions, 3 deletions
diff --git a/multimedia/libmpeg2/distinfo b/multimedia/libmpeg2/distinfo
index 7295348d660..fec332322bd 100644
--- a/multimedia/libmpeg2/distinfo
+++ b/multimedia/libmpeg2/distinfo
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.15 2021/10/26 11:01:09 nia Exp $
+$NetBSD: distinfo,v 1.16 2022/09/25 14:43:27 he Exp $
BLAKE2s (libmpeg2-0.5.1.tar.gz) = 052e01bcc751539f594f48d9b370fc2dc0ca0bda86e94c041eb2e1ef2270d3d4
SHA512 (libmpeg2-0.5.1.tar.gz) = 3648a2b3d7e2056d5adb328acd2fb983a1fa9a05ccb6f9388cc686c819445421811f42e8439418a0491a13080977f074a0d8bf8fa6bc101ff245ddea65a46fbc
Size (libmpeg2-0.5.1.tar.gz) = 524776 bytes
-SHA1 (patch-aa) = 6e6d47232ba20a307ac3a378b09fb08b50f80445
+SHA1 (patch-aa) = 925383d3e5eab74ba2b37d9def5a270ad0def3fc
SHA1 (patch-ab) = e732e35208eb62101f54bbf4a7800a3c4cf9adf0
+SHA1 (patch-configure.ac) = 05620d548994cf8e1125a816c545a9b12c5c2cd8
diff --git a/multimedia/libmpeg2/patches/patch-aa b/multimedia/libmpeg2/patches/patch-aa
index a5993210dca..8747d9afe3a 100644
--- a/multimedia/libmpeg2/patches/patch-aa
+++ b/multimedia/libmpeg2/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.6 2008/08/07 18:23:18 drochner Exp $
+$NetBSD: patch-aa,v 1.7 2022/09/25 14:43:27 he Exp $
--- configure.orig 2008-07-18 16:41:54.000000000 +0200
+++ configure
@@ -11,3 +11,50 @@ $NetBSD: patch-aa,v 1.6 2008/08/07 18:23:18 drochner Exp $
{ echo "$as_me:$LINENO: checking if $CC supports $TRY_CFLAGS flags" >&5
echo $ECHO_N "checking if $CC supports $TRY_CFLAGS flags... $ECHO_C" >&6; }
SAVE_CFLAGS="$CFLAGS"
+@@ -4981,6 +4981,7 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+
++#include <altivec.h>
+ int
+ main ()
+ {
+@@ -5007,8 +5008,12 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+- have_altivec=yes; { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_ALTIVEC_H
++_ACEOF
++
++ have_altivec=yes; { echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6; }
+ else
+ echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+@@ -5019,7 +5024,6 @@ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-#include <altivec.h>
+ int
+ main ()
+ {
+@@ -5045,13 +5049,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define HAVE_ALTIVEC_H
+-_ACEOF
+-
+- have_altivec=yes; { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
++ have_altivec=yes; { echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6; }
+ else
+ echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
diff --git a/multimedia/libmpeg2/patches/patch-configure.ac b/multimedia/libmpeg2/patches/patch-configure.ac
new file mode 100644
index 00000000000..c374800bc98
--- /dev/null
+++ b/multimedia/libmpeg2/patches/patch-configure.ac
@@ -0,0 +1,34 @@
+$NetBSD: patch-configure.ac,v 1.1 2022/09/25 14:43:27 he Exp $
+
+--- configure.ac.orig 2008-07-18 14:30:17.000000000 +0000
++++ configure.ac
+@@ -41,7 +41,7 @@ elif test x"$GCC" = x"yes"; then
+ changequote(<<,>>)
+ TRY_CFLAGS=`echo "$OPT_CFLAGS $CFLAGS"|sed "s/-O[0-9]*//g"`
+ changequote([,])
+- TRY_CFLAGS="$TRY_CFLAGS -O3"
++ TRY_CFLAGS="$TRY_CFLAGS $CFLAGS"
+ AC_TRY_CFLAGS([$TRY_CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"])
+
+ AC_ARG_ENABLE([debug],
+@@ -78,15 +78,15 @@ elif test x"$GCC" = x"yes"; then
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="$OPT_CFLAGS $TRY_CFLAGS $CFLAGS"
+ AC_MSG_CHECKING([if <altivec.h> is needed])
+- AC_TRY_COMPILE([],
+- [typedef vector int t;
+- vec_ld(0, (unsigned char *)0);],
+- [have_altivec=yes; AC_MSG_RESULT(no)],
+- [AC_TRY_COMPILE([#include <altivec.h>],
++ [AC_TRY_COMPILE([#include <altivec.h>],
+ [typedef vector int t; vec_ld(0, (unsigned char *)0);],
+ [AC_DEFINE([HAVE_ALTIVEC_H],,
+ [Define to 1 if you have the <altivec.h> header.])
+ have_altivec=yes; AC_MSG_RESULT(yes)],
++ AC_TRY_COMPILE([],
++ [typedef vector int t;
++ vec_ld(0, (unsigned char *)0);],
++ [have_altivec=yes; AC_MSG_RESULT(no)],
+ [AC_MSG_RESULT(unsupported)])])
+ CFLAGS="$save_CFLAGS"])
+ if test "$have_altivec" = "yes"; then