Skip to content

Commit b989033

Browse files
JkktBkktDuncaen
authored andcommitted
libmpeg2: fix distfiles and symbols on i686
1 parent 0e6033f commit b989033

2 files changed

Lines changed: 63 additions & 3 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Rewrite the public symbol check to verify the shared libraries, to check for
2+
more things, and to avoid duplication; fixes make check on ARM
3+
4+
--- a/test/globals
5+
+++ b/test/globals
6+
@@ -1,4 +1,8 @@
7+
#!/bin/sh
8+
+# TODO
9+
+# - fix checking of .a libs; problem is that "nm -g --defined-only" lists
10+
+# internal symbols; this can be solved by using objdump, but it's probably
11+
+# good enough to just run the tests on the shared lib
12+
13+
if test x"$srcdir" != x""; then
14+
builddir="." # running from make check, but it does not define that
15+
@@ -14,22 +18,30 @@
16+
17+
error=0
18+
19+
-bad_globals=`nm -g --defined-only $builddir/../libmpeg2/*.o |\
20+
- awk '{if ($3) print $3}' | grep -v '^_\?mpeg2_'`
21+
-
22+
-if test x"$bad_globals" != x""; then
23+
- echo BAD GLOBAL SYMBOLS:
24+
- for s in $bad_globals; do echo $s; done
25+
+# check_bad_public_symbols <symbol prefix> <lib file> [<lib file>...]
26+
+#
27+
+# checks public symbols in shared libs:
28+
+# - allow prefix_anything
29+
+# - reject _prefixanything
30+
+# - allow _anything
31+
+# - reject anything else
32+
+#
33+
+# NB: skips missing files
34+
+check_bad_public_symbols() {
35+
+ symbols_prefix="$1"
36+
+ shift
37+
+ lib_files=`ls "$@" 2>/dev/null`
38+
+ [ -z "$lib_files" ] && return
39+
+ bad_globals=`nm -g --defined-only $lib_files |
40+
+ awk '{if ($3) print $3}' |
41+
+ sed -n "/^${symbols_prefix}_/ d; /^_${symbols_prefix}/ { p; d }; /^_/ d; p"`
42+
+ [ -z "$bad_globals" ] && return
43+
error=1
44+
-fi
45+
-
46+
-bad_globals=`nm -g --defined-only $builddir/../libmpeg2/convert/*.o |\
47+
- awk '{if ($3) print $3}' | grep -v '^_\?mpeg2convert_'`
48+
+ echo BAD GLOBAL SYMBOLS in $lib_files:
49+
+ echo "$bad_globals"
50+
+}
51+
52+
-if test x"$bad_globals" != x""; then
53+
- echo BAD GLOBAL SYMBOLS:
54+
- for s in $bad_globals; do echo $s; done
55+
- error=1
56+
-fi
57+
+check_bad_public_symbols mpeg2 $builddir/../libmpeg2/.libs/libmpeg2.so
58+
+check_bad_public_symbols mpeg2convert $builddir/../libmpeg2/convert/.libs/libmpeg2convert.so
59+
60+
exit $error

srcpkgs/libmpeg2/template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Template file for 'libmpeg2'
22
pkgname=libmpeg2
33
version=0.5.1
4-
revision=11
4+
revision=12
55
build_style=gnu-configure
66
configure_args="--enable-shared"
77
hostmakedepends="pkg-config"
88
makedepends="libXext-devel libXv-devel sdl12-compat-devel"
99
short_desc="Library for decoding MPEG-2 and MPEG-1 video streams"
1010
maintainer="Orphaned <orphan@voidlinux.org>"
11-
license="GPL-2"
11+
license="GPL-2.0-or-later"
1212
homepage="http://libmpeg2.sourceforge.net/"
13-
distfiles="http://libmpeg2.sourceforge.net/files/libmpeg2-${version}.tar.gz"
13+
distfiles="http://deb.debian.org/debian/pool/main/m/mpeg2dec/mpeg2dec_${version}.orig.tar.gz"
1414
checksum=dee22e893cb5fc2b2b6ebd60b88478ab8556cb3b93f9a0d7ce8f3b61851871d4
1515

1616
case "$XBPS_TARGET_MACHINE" in

0 commit comments

Comments
 (0)