aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libmpeg2-global-symbol-test.patch
blob: f6eb3c6bd7126ad3f0787f8d32bd8573e31dbda6 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Rewrite the public symbol check to verify the shared libraries, to check for
more things, and to avoid duplication; fixes make check on ARM

Taken from Debian:
https://salsa.debian.org/multimedia-team/mpeg2dec/blob/master/debian/patches/61_global-symbol-test.patch

--- mpeg2dec.orig/test/globals
+++ mpeg2dec/test/globals
@@ -1,4 +1,8 @@
 #!/bin/sh
+# TODO
+# - fix checking of .a libs; problem is that "nm -g --defined-only" lists
+#   internal symbols; this can be solved by using objdump, but it's probably
+#   good enough to just run the tests on the shared lib
 
 if test x"$srcdir" != x""; then
     builddir="."	# running from make check, but it does not define that
@@ -14,22 +18,30 @@ builddir=`cd $builddir;pwd`
 
 error=0
 
-bad_globals=`nm -g --defined-only $builddir/../libmpeg2/*.o |\
-    awk '{if ($3) print $3}' | grep -v '^_\?mpeg2_'`
-
-if test x"$bad_globals" != x""; then
-    echo BAD GLOBAL SYMBOLS:
-    for s in $bad_globals; do echo $s; done
+# check_bad_public_symbols <symbol prefix> <lib file> [<lib file>...]
+#
+# checks public symbols in shared libs:
+# - allow prefix_anything
+# - reject _prefixanything
+# - allow _anything
+# - reject anything else
+#
+# NB: skips missing files
+check_bad_public_symbols() {
+    symbols_prefix="$1"
+    shift
+    lib_files=`ls "$@" 2>/dev/null`
+    [ -z "$lib_files" ] && return
+    bad_globals=`nm -g --defined-only $lib_files |
+        awk '{if ($3) print $3}' |
+        sed -n "/^${symbols_prefix}_/ d; /^_${symbols_prefix}/ { p; d }; /^_/ d; p"`
+    [ -z "$bad_globals" ] && return
     error=1
-fi
-
-bad_globals=`nm -g --defined-only $builddir/../libmpeg2/convert/*.o |\
-    awk '{if ($3) print $3}' | grep -v '^_\?mpeg2convert_'`
+    echo BAD GLOBAL SYMBOLS in $lib_files:
+    echo "$bad_globals"
+}
 
-if test x"$bad_globals" != x""; then
-    echo BAD GLOBAL SYMBOLS:
-    for s in $bad_globals; do echo $s; done
-    error=1
-fi
+check_bad_public_symbols mpeg2 $builddir/../libmpeg2/.libs/libmpeg2.so
+check_bad_public_symbols mpeg2convert $builddir/../libmpeg2/convert/.libs/libmpeg2convert.so
 
 exit $error
: Use 'append' and 'list' instead of 'cons*'.Ludovic Courtès * gnu/installer/services.scm (system-services->configuration): Use 'append' and 'list' instead of 'cons*'. 2019-04-08installer: Generate 'set-xorg-configuration' snippet.Ludovic Courtès * gnu/installer/services.scm (system-services->configuration): Add 'set-xorg-configuration' service. * gnu/installer/steps.scm (format-configuration): Add 'xorg' service module. 2019-04-08installer: Xfce service uses the 'service' form.Ludovic Courtès * gnu/installer/services.scm (%system-services): Adjust Xfce snippet to use the 'service' form. 2019-04-07installer: Internationalize service "names".Ludovic Courtès * gnu/installer/services.scm (%system-services): Mark networking service names with 'G_'. * gnu/installer/newt/services.scm (run-networking-cbt-page): Pass 'system-service-name' through 'G_'. 2019-04-07installer: Offer NM, Connman, and DHCP to non-desktop installs.Ludovic Courtès * gnu/installer/services.scm (%system-services): Add NetworkManager, Connman, and the DHCP client. * gnu/installer/newt/services.scm (run-networking-cbt-page): Add 'network-management?' parameter and honor it. (run-services-page): Adjust call accordingly. 2019-04-07installer: Add dialog to select networking services.Ludovic Courtès * gnu/installer/newt/services.scm (run-networking-cbt-page): New procedure. (run-services-page): Call it. * gnu/installer/services.scm (%system-services): Add OpenSSH and Tor. (networking-system-service?): New procedure. * gnu/installer/steps.scm (format-configuration): Add 'networking' and 'ssh' to the service modules. 2019-04-07installer: Generalize desktop environments to system services.Ludovic Courtès * gnu/installer/services.scm (<desktop-environment>): Rename to... (<system-service>): ... this. Add a 'type' field. (%desktop-environments): Rename to... (%system-services): ... this. (desktop-system-service?): New procedure. (desktop-environments->configuration): Rename to... (system-services->configuration): ... this. Determine the base list of services based on whether SERVICES contains at least one "desktop" service. * gnu/installer/newt/services.scm (run-desktop-environments-cbt-page): Adjust accordingly. * gnu/installer.scm (installer-steps): Likewise. 2019-03-27services: Deprecate 'xfce-desktop-service'.Ludovic Courtès * gnu/services/desktop.scm (xfce-desktop-service-type)[default-value] [description]: New fields. (xfce-desktop-service): Deprecate. * gnu/system/examples/desktop.tmpl: Use the (service …) form. * gnu/installer/services.scm (%desktop-environments): Add TODO comment. * doc/guix.texi (Desktop Services): Adjust accordingly, and fix spelling of "Xfce" throughout. 2019-03-27services: Deprecate 'gnome-desktop-service'.Ludovic Courtès * gnu/services/desktop.scm (gnome-desktop-service-type)[default-value]: New field. (gnome-desktop-service): Deprecate. * gnu/installer/services.scm (%desktop-environments): Use the (service …) form for GNOME. * gnu/system/examples/desktop.tmpl: Likewise. * doc/guix.texi (Desktop Services): Adjust accordingly. 2019-03-27installer: Use the (service …) form for MATE.Ludovic Courtès * gnu/installer/services.scm (%desktop-environments): Use 'mate-desktop-service-type' for MATE. 2019-01-17installer: Add services page.Mathieu Othacehe Add a page to select services, for now only desktop environments choice is available. * gnu/installer.scm (steps): Add services step. * gnu/installer/newt.scm (newt-installer): Add services-page field. * gnu/installer/newt/services.scm: New file. * gnu/installer/record.scm (installer): Add services-page field. * gnu/installer/services.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add new files. * po/guix/POTFILES.in: Add new files.