pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/multimedia/libmp4v2 libmp4v2: fix build more properly.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6e8371937ba3
branches:  trunk
changeset: 362154:6e8371937ba3
user:      maya <maya%pkgsrc.org@localhost>
date:      Sat May 06 18:12:00 2017 +0000

description:
libmp4v2: fix build more properly.

if 0 likely out of bounds write, we only have one scratch channel,
don't write to a second if asked to do stereo (thanks, GCC 4.5.3!)

convert lowercase min, max to uppercase - libstdc++6 doesn't approve
of it. mostly using sed, because there's too many occurences.

if we're not returning anything, use a void return type.

fix likely issue with signed char - 0251 may be truncated, but the
equivalent \xa9 won't be.

don't store a return value if we're not going to check it.

correct misleading indentation.

Remove -fpermissive too, as it caused jperkin issues. I could build
without removing -Werror, but I'll keep it since it's full of warnings.

XXX do we want a security advisory for this, if it can be triggered?

diffstat:

 multimedia/libmp4v2/Makefile                                                 |  15 +-
 multimedia/libmp4v2/distinfo                                                 |  20 ++-
 multimedia/libmp4v2/patches/patch-common_video_iso-mpeg4_include_basic.hpp   |  23 +++
 multimedia/libmp4v2/patches/patch-common_video_iso-mpeg4_src_type__basic.cpp |   6 +-
 multimedia/libmp4v2/patches/patch-lib_mp4_ctts.c                             |  15 ++
 multimedia/libmp4v2/patches/patch-lib_mp4_funcprotos.h                       |  17 ++
 multimedia/libmp4v2/patches/patch-lib_mp4_hinthnti.c                         |  43 +++++++
 multimedia/libmp4v2/patches/patch-lib_mp4_hintudta.c                         |  46 +++++++
 multimedia/libmp4v2/patches/patch-lib_mp4_hnti.c                             |  43 +++++++
 multimedia/libmp4v2/patches/patch-lib_mp4_rtp.c                              |  61 ++++++++++
 multimedia/libmp4v2/patches/patch-lib_mp4_sdp.c                              |  61 ++++++++++
 multimedia/libmp4v2/patches/patch-lib_mp4_tref.c                             |  49 ++++++++
 multimedia/libmp4v2/patches/patch-lib_mp4_udta.c                             |  15 ++
 multimedia/libmp4v2/patches/patch-lib_mp4v2_atom__standard.cpp               |  32 +++++
 multimedia/libmp4v2/patches/patch-lib_mp4v2_mp4atom.cpp                      |  26 ++++
 multimedia/libmp4v2/patches/patch-lib_rtp_net__udp.c                         |  17 ++
 multimedia/libmp4v2/patches/patch-player_lib_audio_faad_config.c             |  28 ++++
 multimedia/libmp4v2/patches/patch-player_lib_audio_faad_huffdec.c            |  16 ++
 multimedia/libmp4v2/patches/patch-player_lib_audio_faad_monopred.c           |  19 +++
 19 files changed, 543 insertions(+), 9 deletions(-)

diffs (truncated from 655 to 300 lines):

diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/Makefile
--- a/multimedia/libmp4v2/Makefile      Sat May 06 16:33:54 2017 +0000
+++ b/multimedia/libmp4v2/Makefile      Sat May 06 18:12:00 2017 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.16 2017/04/26 14:38:30 maya Exp $
+# $NetBSD: Makefile,v 1.17 2017/05/06 18:12:00 maya Exp $
 
 DISTNAME=              mpeg4ip-1.6.1
 PKGNAME=               libmp4v2-1.6.1
-PKGREVISION=           4
+PKGREVISION=           5
 CATEGORIES=            multimedia
 # distfile at sf is corrupt
 #MASTER_SITES=         ${MASTER_SITE_SOURCEFORGE:=mpeg4ip/}
@@ -27,9 +27,16 @@
 # to install mp4* tools
 BUILD_DIRS=            . lib/mp4v2/util
 
-# It's an unmaintained old library
+CFLAGS+=               -std=gnu89
 BUILDLINK_TRANSFORM+=  rm:-Werror
-CFLAGS+=               -Wno-return-type
+BUILDLINK_TRANSFORM+=  rm:-fpermissive
+
+# lowercase min,max cannot be used as macros, conflicts with libstdc++6
+SUBST_CLASSES+=                minmax
+SUBST_STAGE.minmax=    post-patch
+SUBST_FILES.minmax=    common/video/iso-mpeg4/src/*
+SUBST_SED.minmax=      -e 's,min *(,MIN(,g' -e 's,max *(,MAX(,g'
+SUBST_MESSAGE.minmax=  replace lowercase min,max with uppercase
 
 pre-configure:
        ${TOUCH} ${WRKSRC}/bootstrapped
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/distinfo
--- a/multimedia/libmp4v2/distinfo      Sat May 06 16:33:54 2017 +0000
+++ b/multimedia/libmp4v2/distinfo      Sat May 06 18:12:00 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.14 2017/04/26 14:38:30 maya Exp $
+$NetBSD: distinfo,v 1.15 2017/05/06 18:12:00 maya Exp $
 
 SHA1 (mpeg4ip-1.6.1.tar.gz) = 2af97fc0da6a5c0bcb7b433c6715967487b80e38
 RMD160 (mpeg4ip-1.6.1.tar.gz) = ee8375d9581cccbbf685f730bb36f3866eaf12f7
@@ -25,5 +25,21 @@
 SHA1 (patch-at) = ce3dfb958e5a5c46e01b8514b412277be01e40d4
 SHA1 (patch-au) = f3eee9942c4f5ad716634edfa9535c8c9fda73ba
 SHA1 (patch-av) = 3b25351b26124c9a546c09d55900fe8df3224f6d
-SHA1 (patch-common_video_iso-mpeg4_src_type__basic.cpp) = 0a83438ab4666a0284879b7fe994a58ba945de47
+SHA1 (patch-common_video_iso-mpeg4_include_basic.hpp) = 457aa492ef05abf0af8a17fea202ae18c28f1cc3
+SHA1 (patch-common_video_iso-mpeg4_src_type__basic.cpp) = 01f8b446af8cd7f012d2837bdbb13d13e4e6ac93
 SHA1 (patch-doc_mp4v2_MP4.3) = e799c63f63cdb1d360077b6f1410a081c1a49c5a
+SHA1 (patch-lib_mp4_ctts.c) = c4d9b1df5b5940e4a0fbed37c0b52d330db9b310
+SHA1 (patch-lib_mp4_funcprotos.h) = 4a6ae557af14ca352bf8b712e52f91243a5f2ed4
+SHA1 (patch-lib_mp4_hinthnti.c) = bbb4f2f7e0b3401668f756252b91109f47382cbf
+SHA1 (patch-lib_mp4_hintudta.c) = d567138632559d1dd9311a2868ebc29416be918b
+SHA1 (patch-lib_mp4_hnti.c) = 21b1abf140368a8ff48b656e5b7c1297e95ac1c9
+SHA1 (patch-lib_mp4_rtp.c) = 903209c21444a788583be1fa27393c909fbbf65c
+SHA1 (patch-lib_mp4_sdp.c) = 9c9e18d84d151ca632c25c9aa52685d476e6435f
+SHA1 (patch-lib_mp4_tref.c) = c67a0a7b6fb5079736ef8f5e5aaa3628badecfdd
+SHA1 (patch-lib_mp4_udta.c) = af025f404668d1bc02861620b79d6a56fbe18295
+SHA1 (patch-lib_mp4v2_atom__standard.cpp) = 27a2bac270ac4a1fd5169d89d312690a4dcb58ab
+SHA1 (patch-lib_mp4v2_mp4atom.cpp) = ad0a1006293d8bea250de695919d8cdc59a7a4fa
+SHA1 (patch-lib_rtp_net__udp.c) = 3250d0ebcc0899ec4521eb20bc83f6e8a8bce3c9
+SHA1 (patch-player_lib_audio_faad_config.c) = 6448e02ed9f95fc94bca986958ac61c0bf0ec752
+SHA1 (patch-player_lib_audio_faad_huffdec.c) = 1106e902c3fe95cb76009613ae6641339580adac
+SHA1 (patch-player_lib_audio_faad_monopred.c) = 0833f17e10f91b69c63c896c15e98471c62f3025
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-common_video_iso-mpeg4_include_basic.hpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmp4v2/patches/patch-common_video_iso-mpeg4_include_basic.hpp        Sat May 06 18:12:00 2017 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-common_video_iso-mpeg4_include_basic.hpp,v 1.1 2017/05/06 18:12:00 maya Exp $
+
+libstdc++6 disapproves of lowercase min,max macros
+use uppercase.
+
+--- common/video/iso-mpeg4/include/basic.hpp.orig      2005-05-09 21:29:45.000000000 +0000
++++ common/video/iso-mpeg4/include/basic.hpp
+@@ -89,11 +89,11 @@ Revision History:
+ #define transpPixel CPixel(0,0,0,0)
+ #define opaquePixel CPixel(255,255,255,255)
+ 
+-#ifndef max
+-#define max(a,b) (((a) > (b)) ? (a) : (b))
++#ifndef MAX
++#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+ #endif
+-#ifndef min
+-#define min(a, b)  (((a) < (b)) ? (a) : (b))
++#ifndef MIN
++#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+ #endif
+ #define signOf(x) (((x) > 0) ? 1 : 0)
+ #define invSignOf(x) ((x) > 0 ? 0 : 1)                                        // see p.22/H.263
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-common_video_iso-mpeg4_src_type__basic.cpp
--- a/multimedia/libmp4v2/patches/patch-common_video_iso-mpeg4_src_type__basic.cpp      Sat May 06 16:33:54 2017 +0000
+++ b/multimedia/libmp4v2/patches/patch-common_video_iso-mpeg4_src_type__basic.cpp      Sat May 06 18:12:00 2017 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-common_video_iso-mpeg4_src_type__basic.cpp,v 1.1 2017/04/26 14:38:31 maya Exp $
+$NetBSD: patch-common_video_iso-mpeg4_src_type__basic.cpp,v 1.2 2017/05/06 18:12:00 maya Exp $
 
-Make GCC 4.5 happier about the prototype
+Make GCC 4.5.3 happier - it type errors on this declaration
 
---- common/video/iso-mpeg4/src/type_basic.cpp.orig     2006-08-07 18:26:58.000000000 +0000
+--- common/video/iso-mpeg4/src/type_basic.cpp.orig     2017-05-06 17:53:07.101492438 +0000
 +++ common/video/iso-mpeg4/src/type_basic.cpp
 @@ -317,7 +317,7 @@ Void CMotionVector::computeMV ()
        iHalfY = m_vctTrueHalfPel.y - iMVY * 2;
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-lib_mp4_ctts.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmp4v2/patches/patch-lib_mp4_ctts.c  Sat May 06 18:12:00 2017 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_mp4_ctts.c,v 1.1 2017/05/06 18:12:00 maya Exp $
+
+Fix return type. we're not returning anything.
+
+--- lib/mp4/ctts.c.orig        2001-08-01 00:34:00.000000000 +0000
++++ lib/mp4/ctts.c
+@@ -88,7 +88,7 @@ int quicktime_read_ctts(quicktime_t *fil
+       }
+ }
+ 
+-int quicktime_write_ctts(quicktime_t *file, quicktime_ctts_t *ctts)
++void quicktime_write_ctts(quicktime_t *file, quicktime_ctts_t *ctts)
+ {
+       int i;
+       quicktime_atom_t atom;
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-lib_mp4_funcprotos.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmp4v2/patches/patch-lib_mp4_funcprotos.h    Sat May 06 18:12:00 2017 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_mp4_funcprotos.h,v 1.1 2017/05/06 18:12:00 maya Exp $
+
+Match new return types.
+
+--- lib/mp4/funcprotos.h.orig  2001-08-01 00:34:00.000000000 +0000
++++ lib/mp4/funcprotos.h
+@@ -67,8 +67,8 @@ int quicktime_trak_init(quicktime_trak_t
+ int quicktime_trak_init_video(quicktime_t *file, quicktime_trak_t *trak, int frame_w, int frame_h, float frame_rate, int time_scale, char *compressor);
+ int quicktime_trak_init_audio(quicktime_t *file, quicktime_trak_t *trak, int channels, int sample_rate, int bits, int sample_size, int time_scale, int sample_duration, char *compressor);
+ int quicktime_trak_init_hint(quicktime_t *file, quicktime_trak_t *trak, quicktime_trak_t *refTrak, int maxPktSize, int time_scale, int sample_duration);
+-int quicktime_tref_init(quicktime_tref_t *tref);
+-int quicktime_tref_init_hint(quicktime_tref_t *tref, quicktime_trak_t *refTrak);
++void quicktime_tref_init(quicktime_tref_t *tref);
++void quicktime_tref_init_hint(quicktime_tref_t *tref, quicktime_trak_t *refTrak);
+ int quicktime_udta_init(quicktime_udta_t *udta);
+ int quicktime_mvhd_init(quicktime_mvhd_t *mvhd);
+ int quicktime_moov_init(quicktime_moov_t *moov);
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-lib_mp4_hinthnti.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmp4v2/patches/patch-lib_mp4_hinthnti.c      Sat May 06 18:12:00 2017 +0000
@@ -0,0 +1,43 @@
+$NetBSD: patch-lib_mp4_hinthnti.c,v 1.1 2017/05/06 18:12:00 maya Exp $
+
+Fix return type. we're not returning anything.
+
+--- lib/mp4/hinthnti.c.orig    2001-08-01 00:34:00.000000000 +0000
++++ lib/mp4/hinthnti.c
+@@ -22,23 +22,23 @@
+ #include "quicktime.h"
+ 
+ 
+-int quicktime_hint_hnti_init(quicktime_hint_hnti_t *hnti)
++void quicktime_hint_hnti_init(quicktime_hint_hnti_t *hnti)
+ {
+       quicktime_sdp_init(&(hnti->sdp));
+ }
+ 
+-int quicktime_hint_hnti_delete(quicktime_hint_hnti_t *hnti)
++void quicktime_hint_hnti_delete(quicktime_hint_hnti_t *hnti)
+ {
+       quicktime_sdp_delete(&(hnti->sdp));
+ }
+ 
+-int quicktime_hint_hnti_dump(quicktime_hint_hnti_t *hnti)
++void quicktime_hint_hnti_dump(quicktime_hint_hnti_t *hnti)
+ {
+       printf("   hnti\n");
+       quicktime_sdp_dump(&hnti->sdp);
+ }
+ 
+-int quicktime_read_hint_hnti(quicktime_t *file, quicktime_hint_hnti_t *hnti, quicktime_atom_t *parent_atom)
++void quicktime_read_hint_hnti(quicktime_t *file, quicktime_hint_hnti_t *hnti, quicktime_atom_t *parent_atom)
+ {
+       quicktime_atom_t leaf_atom;
+ 
+@@ -53,7 +53,7 @@ int quicktime_read_hint_hnti(quicktime_t
+       } while (quicktime_position(file) < parent_atom->end);
+ }
+ 
+-int quicktime_write_hint_hnti(quicktime_t *file, quicktime_hint_hnti_t *hnti)
++void quicktime_write_hint_hnti(quicktime_t *file, quicktime_hint_hnti_t *hnti)
+ {
+       quicktime_atom_t atom;
+ 
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-lib_mp4_hintudta.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmp4v2/patches/patch-lib_mp4_hintudta.c      Sat May 06 18:12:00 2017 +0000
@@ -0,0 +1,46 @@
+$NetBSD: patch-lib_mp4_hintudta.c,v 1.1 2017/05/06 18:12:00 maya Exp $
+
+Fix return type. we're not returning anything.
+
+--- lib/mp4/hintudta.c.orig    2001-08-01 00:34:00.000000000 +0000
++++ lib/mp4/hintudta.c
+@@ -22,26 +22,26 @@
+ #include "quicktime.h"
+ 
+ 
+-int quicktime_hint_udta_init(quicktime_hint_udta_t *hint_udta)
++void quicktime_hint_udta_init(quicktime_hint_udta_t *hint_udta)
+ {
+       quicktime_hinf_init(&(hint_udta->hinf));
+       quicktime_hint_hnti_init(&(hint_udta->hnti));
+ }
+ 
+-int quicktime_hint_udta_delete(quicktime_hint_udta_t *hint_udta)
++void quicktime_hint_udta_delete(quicktime_hint_udta_t *hint_udta)
+ {
+       quicktime_hinf_delete(&(hint_udta->hinf));
+       quicktime_hint_hnti_delete(&(hint_udta->hnti));
+ }
+ 
+-int quicktime_hint_udta_dump(quicktime_hint_udta_t *hint_udta)
++void quicktime_hint_udta_dump(quicktime_hint_udta_t *hint_udta)
+ {
+       printf("  udta\n");
+       quicktime_hinf_dump(&hint_udta->hinf);
+       quicktime_hint_hnti_dump(&hint_udta->hnti);
+ }
+ 
+-int quicktime_read_hint_udta(quicktime_t *file, quicktime_hint_udta_t *hint_udta, quicktime_atom_t *parent_atom)
++void quicktime_read_hint_udta(quicktime_t *file, quicktime_hint_udta_t *hint_udta, quicktime_atom_t *parent_atom)
+ {
+       quicktime_atom_t leaf_atom;
+ 
+@@ -66,7 +66,7 @@ int quicktime_read_hint_udta(quicktime_t
+       } while (quicktime_position(file) < parent_atom->end);
+ }
+ 
+-int quicktime_write_hint_udta(quicktime_t *file, quicktime_hint_udta_t *hint_udta)
++void quicktime_write_hint_udta(quicktime_t *file, quicktime_hint_udta_t *hint_udta)
+ {
+       quicktime_atom_t atom;
+ 
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-lib_mp4_hnti.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmp4v2/patches/patch-lib_mp4_hnti.c  Sat May 06 18:12:00 2017 +0000
@@ -0,0 +1,43 @@
+$NetBSD: patch-lib_mp4_hnti.c,v 1.1 2017/05/06 18:12:00 maya Exp $
+
+Fix return type. we're not returning anything.
+
+--- lib/mp4/hnti.c.orig        2001-08-30 16:23:13.000000000 +0000
++++ lib/mp4/hnti.c
+@@ -22,23 +22,23 @@
+ #include "quicktime.h"
+ 
+ 
+-int quicktime_hnti_init(quicktime_hnti_t *hnti)
++void quicktime_hnti_init(quicktime_hnti_t *hnti)
+ {
+       quicktime_rtp_init(&(hnti->rtp));
+ }
+ 
+-int quicktime_hnti_delete(quicktime_hnti_t *hnti)
++void quicktime_hnti_delete(quicktime_hnti_t *hnti)
+ {
+       quicktime_rtp_delete(&(hnti->rtp));
+ }
+ 
+-int quicktime_hnti_dump(quicktime_hnti_t *hnti)
++void quicktime_hnti_dump(quicktime_hnti_t *hnti)
+ {
+       printf("   hnti\n");
+       quicktime_rtp_dump(&hnti->rtp);
+ }
+ 
+-int quicktime_read_hnti(quicktime_t *file, quicktime_hnti_t *hnti, quicktime_atom_t *parent_atom)
++void quicktime_read_hnti(quicktime_t *file, quicktime_hnti_t *hnti, quicktime_atom_t *parent_atom)
+ {
+       quicktime_atom_t leaf_atom;
+ 
+@@ -53,7 +53,7 @@ int quicktime_read_hnti(quicktime_t *fil
+       } while (quicktime_position(file) < parent_atom->end);
+ }
+ 
+-int quicktime_write_hnti(quicktime_t *file, quicktime_hnti_t *hnti)
++void quicktime_write_hnti(quicktime_t *file, quicktime_hnti_t *hnti)
+ {
+       quicktime_atom_t atom;
+ 
diff -r d5ad03b0bab6 -r 6e8371937ba3 multimedia/libmp4v2/patches/patch-lib_mp4_rtp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/libmp4v2/patches/patch-lib_mp4_rtp.c   Sat May 06 18:12:00 2017 +0000
@@ -0,0 +1,61 @@
+$NetBSD: patch-lib_mp4_rtp.c,v 1.1 2017/05/06 18:12:00 maya Exp $
+
+Fix return type. we're not returning anything.
+
+--- lib/mp4/rtp.c.orig 2001-08-30 16:23:13.000000000 +0000



Home | Main Index | Thread Index | Old Index