From 257e3247910610fe24ae1b86f38e85552d53e48c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 23 Sep 2018 04:46:59 -0400 Subject: gnu: icecat: Unbundle graphite2 and harfbuzz. * gnu/packages/patches/icecat-use-system-graphite2+harfbuzz.patch: New file. * gnu/packages/patches/icecat-use-system-graphite2.patch, gnu/packages/patches/icecat-use-system-harfbuzz.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/gnuzilla.scm (icecat)[source]: Add new patch. Delete bundled graphite2 and harfbuzz in snippet. [inputs]: Add graphite2 and harfbuzz. [arguments]: Add --with-system-{graphite2,harfbuzz} to configure flags. --- .../icecat-use-system-graphite2+harfbuzz.patch | 226 +++++++++++++++++ .../patches/icecat-use-system-graphite2.patch | 248 ------------------ .../patches/icecat-use-system-harfbuzz.patch | 279 --------------------- 3 files changed, 226 insertions(+), 527 deletions(-) create mode 100644 gnu/packages/patches/icecat-use-system-graphite2+harfbuzz.patch delete mode 100644 gnu/packages/patches/icecat-use-system-graphite2.patch delete mode 100644 gnu/packages/patches/icecat-use-system-harfbuzz.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/icecat-use-system-graphite2+harfbuzz.patch b/gnu/packages/patches/icecat-use-system-graphite2+harfbuzz.patch new file mode 100644 index 0000000000..94c211b797 --- /dev/null +++ b/gnu/packages/patches/icecat-use-system-graphite2+harfbuzz.patch @@ -0,0 +1,226 @@ +Allow building against system-wide graphite2/harfbuzz. +See +Based on: + https://svnweb.freebsd.org/ports/head/www/firefox-esr/files/patch-bug847568?revision=472833&view=co +Modified for use with patch -p1, and to apply cleanly to GNU IceCat. + +--- icecat-60.2.0/config/system-headers.mozbuild ++++ icecat-60.2.0/config/system-headers.mozbuild +@@ -1311,6 +1311,19 @@ + 'pixman.h', + ] + ++if CONFIG['MOZ_SYSTEM_GRAPHITE2']: ++ system_headers += [ ++ 'graphite2/Font.h', ++ 'graphite2/Segment.h', ++ ] ++ ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ system_headers += [ ++ 'harfbuzz/hb-glib.h', ++ 'harfbuzz/hb-ot.h', ++ 'harfbuzz/hb.h', ++ ] ++ + if CONFIG['MOZ_SYSTEM_LIBVPX']: + system_headers += [ + 'vpx_mem/vpx_mem.h', +--- icecat-60.2.0/dom/base/moz.build ++++ icecat-60.2.0/dom/base/moz.build +@@ -474,6 +474,9 @@ + if CONFIG['MOZ_X11']: + CXXFLAGS += CONFIG['TK_CFLAGS'] + ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] ++ + GENERATED_FILES += [ + 'PropertyUseCounterMap.inc', + 'UseCounterList.h', +--- icecat-60.2.0/gfx/graphite2/moz-gr-update.sh ++++ icecat-60.2.0/gfx/graphite2/moz-gr-update.sh +@@ -1,6 +1,7 @@ + #!/bin/bash + + # Script used to update the Graphite2 library in the mozilla source tree ++# and bump version for --with-system-graphite2 + + # This script lives in gfx/graphite2, along with the library source, + # but must be run from the top level of the mozilla-central tree. +@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla + #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; + #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; + ++# chase version for --with-system-graphite2 ++perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \ ++ if /GR2_VERSION_REQUIRE/" old-configure.in ++ + # summarize what's been touched + echo Updated to $RELEASE. + echo Here is what changed in the gfx/graphite2 directory: + echo + +-hg stat gfx/graphite2 ++hg stat old-configure.in gfx/graphite2 + + echo + echo If gfx/graphite2/src/files.mk has changed, please make corresponding +--- icecat-60.2.0/gfx/moz.build ++++ icecat-60.2.0/gfx/moz.build +@@ -10,6 +10,12 @@ with Files('**'): + if CONFIG['MOZ_TREE_CAIRO']: + DIRS += ['cairo'] + ++if not CONFIG['MOZ_SYSTEM_GRAPHITE2']: ++ DIRS += ['graphite2/src' ] ++ ++if not CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ DIRS += ['harfbuzz/src'] ++ + DIRS += [ + '2d', + 'ycbcr', +@@ -18,8 +24,6 @@ DIRS += [ + 'qcms', + 'gl', + 'layers', +- 'graphite2/src', +- 'harfbuzz/src', + 'ots/src', + 'thebes', + 'ipc', +--- icecat-60.2.0/gfx/skia/generate_mozbuild.py ++++ icecat-60.2.0/gfx/skia/generate_mozbuild.py +@@ -148,6 +148,9 @@ + '-Wno-unused-private-field', + ] + ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] ++ + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'): + CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] + CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] +--- icecat-60.2.0/gfx/skia/moz.build ++++ icecat-60.2.0/gfx/skia/moz.build +@@ -822,6 +822,9 @@ + '-Wno-unused-private-field', + ] + ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] ++ + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'): + CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] + CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] +--- icecat-60.2.0/gfx/thebes/moz.build ++++ icecat-60.2.0/gfx/thebes/moz.build +@@ -272,7 +272,13 @@ + + LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] + +-DEFINES['GRAPHITE2_STATIC'] = True ++if CONFIG['MOZ_SYSTEM_GRAPHITE2']: ++ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] ++else: ++ DEFINES['GRAPHITE2_STATIC'] = True ++ ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + + if CONFIG['CC_TYPE'] == 'clang': + # Suppress warnings from Skia header files. +--- icecat-60.2.0/intl/unicharutil/util/moz.build ++++ icecat-60.2.0/intl/unicharutil/util/moz.build +@@ -25,4 +25,7 @@ UNIFIED_SOURCES += [ + 'nsUnicodeProperties.cpp', + ] + ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] ++ + FINAL_LIBRARY = 'xul' +--- icecat-60.2.0/netwerk/dns/moz.build ++++ icecat-60.2.0/netwerk/dns/moz.build +@@ -76,3 +76,6 @@ + + if CONFIG['CC_TYPE'] in ('clang', 'gcc'): + CXXFLAGS += ['-Wno-error=shadow'] ++ ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] +--- icecat-60.2.0/old-configure.in ++++ icecat-60.2.0/old-configure.in +@@ -3995,6 +3995,27 @@ + AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR) + + dnl ======================================================== ++dnl Check for graphite2 ++dnl ======================================================== ++if test -n "$MOZ_SYSTEM_GRAPHITE2"; then ++ dnl graphite2.pc has bogus version, check manually ++ _SAVE_CFLAGS=$CFLAGS ++ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" ++ AC_TRY_COMPILE([ #include ++ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ ++ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ ++ * 100 + GR2_VERSION_BUGFIX >= \ ++ (major) * 10000 + (minor) * 100 + (bugfix) ) ++ ], [ ++ #if !GR2_VERSION_REQUIRE(1,3,10) ++ #error "Insufficient graphite2 version." ++ #endif ++ ], [], ++ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) ++ CFLAGS=$_SAVE_CFLAGS ++fi ++ ++dnl ======================================================== + dnl Check for pixman and cairo + dnl ======================================================== + +--- icecat-60.2.0/toolkit/library/moz.build ++++ icecat-60.2.0/toolkit/library/moz.build +@@ -235,6 +235,12 @@ + if CONFIG['MOZ_SYSTEM_PNG']: + OS_LIBS += CONFIG['MOZ_PNG_LIBS'] + ++if CONFIG['MOZ_SYSTEM_GRAPHITE2']: ++ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] ++ ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] ++ + if CONFIG['MOZ_SYSTEM_HUNSPELL']: + OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] + +--- icecat-60.2.0/toolkit/moz.configure ++++ icecat-60.2.0/toolkit/moz.configure +@@ -1051,6 +1051,26 @@ + add_old_configure_assignment('FT2_CFLAGS', + ft2_info.cflags) + ++# Graphite2 ++# ============================================================== ++option('--with-system-graphite2', ++ help="Use system graphite2 (located with pkgconfig)") ++ ++system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2', ++ when='--with-system-graphite2') ++ ++set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True)) ++ ++# HarfBuzz ++# ============================================================== ++option('--with-system-harfbuzz', ++ help="Use system harfbuzz (located with pkgconfig)") ++ ++system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.7.4', ++ when='--with-system-harfbuzz') ++ ++set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) ++ + # Mortar + # ============================================================== + option('--enable-mortar', help='Enable mortar extension') diff --git a/gnu/packages/patches/icecat-use-system-graphite2.patch b/gnu/packages/patches/icecat-use-system-graphite2.patch deleted file mode 100644 index 188fba2bc9..0000000000 --- a/gnu/packages/patches/icecat-use-system-graphite2.patch +++ /dev/null @@ -1,248 +0,0 @@ -Copied from -See - -diff --git a/config/Makefile.in b/config/Makefile.in ---- a/config/Makefile.in -+++ b/config/Makefile.in -@@ -36,16 +36,17 @@ ifdef WRAP_SYSTEM_INCLUDES - export-preqs = \ - $(call mkdir_deps,system_wrappers) \ - $(NULL) - - export:: $(export-preqs) - $(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \ - -DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \ - -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \ -+ -DMOZ_SYSTEM_GRAPHITE2=$(MOZ_SYSTEM_GRAPHITE2) \ - -DMOZ_SYSTEM_HARFBUZZ=$(MOZ_SYSTEM_HARFBUZZ) \ - -DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \ - -DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \ - -DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \ - -DMOZ_SYSTEM_PNG=$(MOZ_SYSTEM_PNG) \ - -DMOZ_SYSTEM_JPEG=$(MOZ_SYSTEM_JPEG) \ - -DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \ - -DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \ -diff --git a/config/system-headers b/config/system-headers ---- a/config/system-headers -+++ b/config/system-headers -@@ -1260,16 +1260,20 @@ zlib.h - #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION - libsn/sn.h - libsn/sn-common.h - libsn/sn-launchee.h - libsn/sn-launcher.h - libsn/sn-monitor.h - libsn/sn-util.h - #endif -+#if MOZ_SYSTEM_GRAPHITE2==1 -+graphite2/Font.h -+graphite2/Segment.h -+#endif - #if MOZ_SYSTEM_HARFBUZZ==1 - harfbuzz/hb-glib.h - harfbuzz/hb-ot.h - harfbuzz/hb.h - #endif - #if MOZ_SYSTEM_HUNSPELL==1 - hunspell.hxx - #endif -diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh ---- a/gfx/graphite2/moz-gr-update.sh -+++ b/gfx/graphite2/moz-gr-update.sh -@@ -1,11 +1,12 @@ - #!/bin/bash - - # Script used to update the Graphite2 library in the mozilla source tree -+# and bump version for --with-system-graphite2 - - # This script lives in gfx/graphite2, along with the library source, - # but must be run from the top level of the mozilla-central tree. - - # Run as - # - # ./gfx/graphite2/moz-gr-update.sh RELEASE - # -@@ -32,22 +33,26 @@ echo "This directory contains the Graphi - echo "$TARBALL" >> gfx/graphite2/README.mozilla - echo "" - echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla - - # fix up includes because of bug 721839 (cstdio) and bug 803066 (Windows.h) - #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; - #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; - -+# chase version for --with-system-graphite2 -+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \ -+ if /GR2_VERSION_REQUIRE/" old-configure.in -+ - # summarize what's been touched - echo Updated to $RELEASE. - echo Here is what changed in the gfx/graphite2 directory: - echo - --hg stat gfx/graphite2 -+hg stat old-configure.in gfx/graphite2 - - echo - echo If gfx/graphite2/src/files.mk has changed, please make corresponding - echo changes to gfx/graphite2/src/moz.build - echo - - echo - echo Now use hg commands to create a patch for the mozilla tree. -diff --git a/gfx/moz.build b/gfx/moz.build ---- a/gfx/moz.build -+++ b/gfx/moz.build -@@ -2,28 +2,30 @@ - # vim: set filetype=python: - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - - if CONFIG['MOZ_TREE_CAIRO']: - DIRS += ['cairo'] - -+if not CONFIG['MOZ_SYSTEM_GRAPHITE2']: -+ DIRS += ['graphite2/src' ] -+ - if not CONFIG['MOZ_SYSTEM_HARFBUZZ']: - DIRS += ['harfbuzz/src'] - - DIRS += [ - '2d', - 'ycbcr', - 'angle', - 'src', - 'qcms', - 'gl', - 'layers', -- 'graphite2/src', - 'ots/src', - 'thebes', - 'ipc', - 'vr', - 'config', - ] - - if CONFIG['MOZ_ENABLE_SKIA']: -diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build ---- a/gfx/thebes/moz.build -+++ b/gfx/thebes/moz.build -@@ -261,16 +261,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('and - CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] - - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): - CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS'] - - LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] - LOCAL_INCLUDES += ['/media/libyuv/include'] - --DEFINES['GRAPHITE2_STATIC'] = True -+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: -+ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] -+else: -+ DEFINES['GRAPHITE2_STATIC'] = True - - if CONFIG['MOZ_SYSTEM_HARFBUZZ']: - CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] - - if CONFIG['CLANG_CXX']: - # Suppress warnings from Skia header files. - SOURCES['gfxPlatform.cpp'].flags += ['-Wno-implicit-fallthrough'] -diff --git a/moz.configure b/moz.configure ---- a/moz.configure -+++ b/moz.configure -@@ -260,16 +260,28 @@ def extra_programs(target): - - check_prog('DSYMUTIL', delayed_getattr(extra_programs, 'DSYMUTIL'), - allow_missing=True) - check_prog('GENISOIMAGE', delayed_getattr(extra_programs, 'GENISOIMAGE'), - allow_missing=True) - check_prog('RPMBUILD', delayed_getattr(extra_programs, 'RPMBUILD'), - allow_missing=True) - -+option('--with-system-graphite2', -+ help="Use system graphite2 (located with pkgconfig)") -+ -+@depends('--with-system-graphite2', compile_environment) -+def check_for_graphite2(value, compile_env): -+ return value and compile_env -+ -+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2', -+ check_for_graphite2) -+ -+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True)) -+ - option('--with-system-harfbuzz', - help="Use system harfbuzz (located with pkgconfig)") - - @depends('--with-system-harfbuzz', compile_environment) - def check_for_harfbuzz(value, compile_env): - return value and compile_env - - system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.3.3', -diff --git a/old-configure.in b/old-configure.in ---- a/old-configure.in -+++ b/old-configure.in -@@ -5060,16 +5060,37 @@ if test "$USE_FC_FREETYPE"; then - CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS" - MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], , - [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include ]) - CPPFLAGS="$_SAVE_CPPFLAGS" - fi - fi - - dnl ======================================================== -+dnl Check for graphite2 -+dnl ======================================================== -+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then -+ dnl graphite2.pc has bogus version, check manually -+ _SAVE_CFLAGS=$CFLAGS -+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" -+ AC_TRY_COMPILE([ #include -+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ -+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ -+ * 100 + GR2_VERSION_BUGFIX >= \ -+ (major) * 10000 + (minor) * 100 + (bugfix) ) -+ ], [ -+ #if !GR2_VERSION_REQUIRE(1,3,8) -+ #error "Insufficient graphite2 version." -+ #endif -+ ], [], -+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) -+ CFLAGS=$_SAVE_CFLAGS -+fi -+ -+dnl ======================================================== - dnl Check for pixman and cairo - dnl ======================================================== - - MOZ_TREE_CAIRO=1 - MOZ_ARG_ENABLE_BOOL(system-cairo, - [ --enable-system-cairo Use system cairo (located with pkgconfig)], - MOZ_TREE_CAIRO=, - MOZ_TREE_CAIRO=1 ) -diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build ---- a/toolkit/library/moz.build -+++ b/toolkit/library/moz.build -@@ -221,16 +221,19 @@ if CONFIG['SERVO_TARGET_DIR']: - OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo'] - - if CONFIG['MOZ_SYSTEM_JPEG']: - OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] - - if CONFIG['MOZ_SYSTEM_PNG']: - OS_LIBS += CONFIG['MOZ_PNG_LIBS'] - -+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: -+ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] -+ - if CONFIG['MOZ_SYSTEM_HARFBUZZ']: - OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] - - if CONFIG['MOZ_SYSTEM_HUNSPELL']: - OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] - - if CONFIG['MOZ_SYSTEM_LIBEVENT']: - OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] - diff --git a/gnu/packages/patches/icecat-use-system-harfbuzz.patch b/gnu/packages/patches/icecat-use-system-harfbuzz.patch deleted file mode 100644 index 083d404c13..0000000000 --- a/gnu/packages/patches/icecat-use-system-harfbuzz.patch +++ /dev/null @@ -1,279 +0,0 @@ -Copied from -See - -diff --git a/config/Makefile.in b/config/Makefile.in ---- a/config/Makefile.in -+++ b/config/Makefile.in -@@ -36,16 +36,17 @@ ifdef WRAP_SYSTEM_INCLUDES - export-preqs = \ - $(call mkdir_deps,system_wrappers) \ - $(NULL) - - export:: $(export-preqs) - $(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \ - -DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \ - -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \ -+ -DMOZ_SYSTEM_HARFBUZZ=$(MOZ_SYSTEM_HARFBUZZ) \ - -DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \ - -DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \ - -DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \ - -DMOZ_SYSTEM_PNG=$(MOZ_SYSTEM_PNG) \ - -DMOZ_SYSTEM_JPEG=$(MOZ_SYSTEM_JPEG) \ - -DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \ - -DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \ - -DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \ -diff --git a/config/system-headers b/config/system-headers ---- a/config/system-headers -+++ b/config/system-headers -@@ -1260,16 +1260,21 @@ zlib.h - #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION - libsn/sn.h - libsn/sn-common.h - libsn/sn-launchee.h - libsn/sn-launcher.h - libsn/sn-monitor.h - libsn/sn-util.h - #endif -+#if MOZ_SYSTEM_HARFBUZZ==1 -+harfbuzz/hb-glib.h -+harfbuzz/hb-ot.h -+harfbuzz/hb.h -+#endif - #if MOZ_SYSTEM_HUNSPELL==1 - hunspell.hxx - #endif - #if MOZ_SYSTEM_BZ2==1 - bzlib.h - #endif - #ifdef MOZ_ENABLE_GIO - gio/gio.h -diff --git a/dom/base/moz.build b/dom/base/moz.build ---- a/dom/base/moz.build -+++ b/dom/base/moz.build -@@ -474,16 +474,19 @@ for var in ('MOZ_B2G_RIL'): - DEFINES[var] = True - - if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: - DEFINES['HAVE_SIDEBAR'] = True - - if CONFIG['MOZ_X11']: - CXXFLAGS += CONFIG['TK_CFLAGS'] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - GENERATED_FILES += [ - 'PropertyUseCounterMap.inc', - 'UseCounterList.h', - ] - - countermap = GENERATED_FILES['PropertyUseCounterMap.inc'] - countermap.script = 'gen-usecounters.py:property_map' - countermap.inputs = ['UseCounters.conf'] -diff --git a/gfx/harfbuzz/README-mozilla b/gfx/harfbuzz/README-mozilla ---- a/gfx/harfbuzz/README-mozilla -+++ b/gfx/harfbuzz/README-mozilla -@@ -14,8 +14,13 @@ this file when updating harfbuzz, and ch - - The normal approach to updating harfbuzz, therefore, is to pull the latest HB - source into a scratch directory and do a local build; then copy the original - sources AND the generated header mentioned above from the build directory into - the mozilla tree. - - If the collection of source files changes, manual updates to moz.build may be - needed, as we don't use the upstream makefiles. -+ -+The in-tree copy may be omitted during build by --with-system-harfbuzz. -+Make sure to keep pkg-config version check within old-configure.in in sync -+with checkout version or increment latest tag by one if it's not based -+on upstream release. -diff --git a/gfx/moz.build b/gfx/moz.build ---- a/gfx/moz.build -+++ b/gfx/moz.build -@@ -2,26 +2,28 @@ - # vim: set filetype=python: - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - - if CONFIG['MOZ_TREE_CAIRO']: - DIRS += ['cairo'] - -+if not CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ DIRS += ['harfbuzz/src'] -+ - DIRS += [ - '2d', - 'ycbcr', - 'angle', - 'src', - 'qcms', - 'gl', - 'layers', - 'graphite2/src', -- 'harfbuzz/src', - 'ots/src', - 'thebes', - 'ipc', - 'vr', - 'config', - ] - - if CONFIG['MOZ_ENABLE_SKIA']: -diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py ---- a/gfx/skia/generate_mozbuild.py -+++ b/gfx/skia/generate_mozbuild.py -@@ -138,16 +138,19 @@ if CONFIG['GNU_CXX'] and not CONFIG['CLA - if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']: - CXXFLAGS += [ - '-Wno-implicit-fallthrough', - '-Wno-inconsistent-missing-override', - '-Wno-macro-redefined', - '-Wno-unused-private-field', - ] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android'): - CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] - CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] - - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): - CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS'] - """ - -diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build ---- a/gfx/skia/moz.build -+++ b/gfx/skia/moz.build -@@ -748,14 +748,17 @@ if CONFIG['GNU_CXX'] and not CONFIG['CLA - if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']: - CXXFLAGS += [ - '-Wno-implicit-fallthrough', - '-Wno-inconsistent-missing-override', - '-Wno-macro-redefined', - '-Wno-unused-private-field', - ] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android'): - CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] - CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] - - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): - CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS'] -diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build ---- a/gfx/thebes/moz.build -+++ b/gfx/thebes/moz.build -@@ -263,11 +263,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('and - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): - CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS'] - - LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] - LOCAL_INCLUDES += ['/media/libyuv/include'] - - DEFINES['GRAPHITE2_STATIC'] = True - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - if CONFIG['CLANG_CXX']: - # Suppress warnings from Skia header files. - SOURCES['gfxPlatform.cpp'].flags += ['-Wno-implicit-fallthrough'] -diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build ---- a/intl/unicharutil/util/moz.build -+++ b/intl/unicharutil/util/moz.build -@@ -37,9 +37,12 @@ if CONFIG['_MSC_VER']: - DEFINES['_USE_ANSI_CPP'] = True - # Don't include directives about which CRT to use - CFLAGS += ['-Zl'] - CXXFLAGS += ['-Zl'] - - if CONFIG['ENABLE_INTL_API']: - USE_LIBS += ['icu'] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - DIST_INSTALL = True -diff --git a/moz.configure b/moz.configure ---- a/moz.configure -+++ b/moz.configure -@@ -260,16 +260,28 @@ def extra_programs(target): - - check_prog('DSYMUTIL', delayed_getattr(extra_programs, 'DSYMUTIL'), - allow_missing=True) - check_prog('GENISOIMAGE', delayed_getattr(extra_programs, 'GENISOIMAGE'), - allow_missing=True) - check_prog('RPMBUILD', delayed_getattr(extra_programs, 'RPMBUILD'), - allow_missing=True) - -+option('--with-system-harfbuzz', -+ help="Use system harfbuzz (located with pkgconfig)") -+ -+@depends('--with-system-harfbuzz', compile_environment) -+def check_for_harfbuzz(value, compile_env): -+ return value and compile_env -+ -+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.3.3', -+ check_for_harfbuzz) -+ -+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) -+ - option('--enable-system-hunspell', - help="Use system hunspell (located with pkgconfig)") - - @depends('--enable-system-hunspell', compile_environment) - def check_for_hunspell(value, compile_env): - return value and compile_env - - system_hunspell = pkg_check_modules('MOZ_HUNSPELL', 'hunspell', -diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build ---- a/netwerk/dns/moz.build -+++ b/netwerk/dns/moz.build -@@ -61,16 +61,19 @@ etld_data = GENERATED_FILES['etld_data.i - etld_data.script = 'prepare_tlds.py' - etld_data.inputs = ['effective_tld_names.dat'] - - # need to include etld_data.inc - LOCAL_INCLUDES += [ - '/netwerk/base', - ] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - if CONFIG['ENABLE_INTL_API']: - DEFINES['IDNA2008'] = True - USE_LIBS += ['icu'] - else: - UNIFIED_SOURCES += [ - 'nameprep.c', - ] - -diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build ---- a/toolkit/library/moz.build -+++ b/toolkit/library/moz.build -@@ -221,16 +221,19 @@ if CONFIG['SERVO_TARGET_DIR']: - OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo'] - - if CONFIG['MOZ_SYSTEM_JPEG']: - OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] - - if CONFIG['MOZ_SYSTEM_PNG']: - OS_LIBS += CONFIG['MOZ_PNG_LIBS'] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] -+ - if CONFIG['MOZ_SYSTEM_HUNSPELL']: - OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] - - if CONFIG['MOZ_SYSTEM_LIBEVENT']: - OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] - - if CONFIG['MOZ_SYSTEM_LIBVPX']: - OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS'] - -- cgit v1.2.3 From 94e96f7f68c3b9053fdb5dee5b0ab614163aaa08 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 24 Sep 2018 00:10:37 -0400 Subject: gnu: icecat: Unbundle libevent, libogg, and libvorbis. * gnu/packages/patches/icecat-use-system-media-libs.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/patches/icecat-avoid-bundled-libraries.patch: Add another hunk to enable removal of libevent. * gnu/packages/gnuzilla.scm (icecat)[source]: Add patch. In the snippet, add libevent, libogg, libvorbis, and libtremor to the list of bundled libraries to remove. Add a comment regarding theora. Remove comments regarding unbundling cairo, which is no longer supported. [inputs]: Add libevent, libogg, and libvorbis. [arguments]: Add --with-system-{libevent,ogg,vorbis} to configure flags. Add custom bootstrap phase. Add comments. --- gnu/local.mk | 1 + gnu/packages/gnuzilla.scm | 39 ++- .../patches/icecat-avoid-bundled-libraries.patch | 14 + .../patches/icecat-use-system-media-libs.patch | 381 +++++++++++++++++++++ 4 files changed, 423 insertions(+), 12 deletions(-) create mode 100644 gnu/packages/patches/icecat-use-system-media-libs.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 35e78e7816..244c79d221 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -812,6 +812,7 @@ dist_patch_DATA = \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ %D%/packages/patches/icecat-CVE-2018-12383.patch \ %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ + %D%/packages/patches/icecat-use-system-media-libs.patch \ %D%/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch \ %D%/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch \ %D%/packages/patches/id3lib-CVE-2007-4460.patch \ diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index ad83444e3c..6834d82426 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -36,6 +36,7 @@ #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system cargo) + #:use-module (gnu packages audio) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages databases) @@ -62,6 +63,7 @@ #:use-module (gnu packages rust) #:use-module (gnu packages icu4c) #:use-module (gnu packages video) + #:use-module (gnu packages xiph) #:use-module (gnu packages xdisorg) #:use-module (gnu packages readline)) @@ -497,6 +499,7 @@ security standards.") (list (search-patch "icecat-avoid-bundled-libraries.patch") (search-patch "icecat-use-system-graphite2+harfbuzz.patch") + (search-patch "icecat-use-system-media-libs.patch") (mozilla-patch "icecat-CVE-2018-12385.patch" "80a4a7ef2813" "1vgcbimpnfjqj934v0cryq1g13xac3wfmd4jyhcb5s60x8xyssf5") (search-patch "icecat-CVE-2018-12383.patch") (mozilla-patch "icecat-bug-1489744.patch" "6546ee839d30" "11mhvj77r789b428bfxqq5wdx8yr7lbrdjzr8qjj6fw197pldn51"))) @@ -516,24 +519,29 @@ security standards.") ;; FIXME: A script from the bundled nspr is used. ;;"nsprpub" ;; - ;; TODO: Use system media libraries. Waiting for: + ;; TODO: Use more system media libraries. See: ;; - ;; * libogg - ;; * libtheora - ;; * libvorbis - ;; * libtremor (not yet in guix) + ;; * libtheora: esr60 wants v1.2, not yet released. + ;; * soundtouch: avoiding the bundled library would + ;; result in some loss of functionality. There's + ;; also an issue with exception handling + ;; configuration. It seems that this is needed in + ;; some moz.build: + ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1 ;; * libopus ;; * speex - ;; * soundtouch (not yet in guix) ;; "modules/freetype2" "modules/zlib" "modules/libbz2" - ;; UNBUNDLE-ME "ipc/chromium/src/third_party/libevent" + "ipc/chromium/src/third_party/libevent" "media/libjpeg" "media/libvpx" + "media/libogg" + "media/libvorbis" + ;; "media/libtheora" ; wants theora-1.2, not yet released + "media/libtremor" "security/nss" - ;; UNBUNDLE-ME "gfx/cairo" "gfx/harfbuzz" "gfx/graphite2" "js/src/ctypes/libffi" @@ -549,7 +557,6 @@ security standards.") (inputs `(("alsa-lib" ,alsa-lib) ("bzip2" ,bzip2) - ;; UNBUNDLE-ME ("cairo" ,cairo) ("cups" ,cups) ("dbus-glib" ,dbus-glib) ("gdk-pixbuf" ,gdk-pixbuf) @@ -564,8 +571,11 @@ security standards.") ("libcanberra" ,libcanberra) ("libgnome" ,libgnome) ("libjpeg-turbo" ,libjpeg-turbo) + ("libogg" ,libogg) + ;; ("libtheora" ,libtheora) ; wants theora-1.2, not yet released + ("libvorbis" ,libvorbis) ("libxft" ,libxft) - ;; UNBUNDLE-ME ("libevent" ,libevent-2.0) + ("libevent" ,libevent) ("libxinerama" ,libxinerama) ("libxscrnsaver" ,libxscrnsaver) ("libxcomposite" ,libxcomposite) @@ -637,7 +647,10 @@ security standards.") "--with-system-zlib" "--with-system-bz2" "--with-system-jpeg" ; must be libjpeg-turbo - ;; UNBUNDLE-ME "--with-system-libevent" + "--with-system-libevent" + "--with-system-ogg" + "--with-system-vorbis" + ;; "--with-system-theora" ; wants theora-1.2, not yet released "--with-system-libvpx" "--with-system-icu" "--with-system-nspr" @@ -645,7 +658,6 @@ security standards.") "--with-system-harfbuzz" "--with-system-graphite2" "--enable-system-pixman" - ;; UNBUNDLE-ME "--enable-system-cairo" "--enable-system-ffi" "--enable-system-hunspell" "--enable-system-sqlite" @@ -695,6 +707,9 @@ security standards.") 'avcodec', 'avutil', 'pulse' ]\n\n" all))) #t)) + (replace 'bootstrap + (lambda _ + (invoke "sh" "-c" "autoconf old-configure.in > old-configure"))) (add-after 'patch-source-shebangs 'patch-cargo-checksums (lambda _ (use-modules (guix build cargo-build-system)) diff --git a/gnu/packages/patches/icecat-avoid-bundled-libraries.patch b/gnu/packages/patches/icecat-avoid-bundled-libraries.patch index b5e9fb887e..33203b1a33 100644 --- a/gnu/packages/patches/icecat-avoid-bundled-libraries.patch +++ b/gnu/packages/patches/icecat-avoid-bundled-libraries.patch @@ -33,3 +33,17 @@ Fixes needed when avoiding bundled libraries. '/dom/base', '/dom/storage', '/ipc/glue', +--- icecat-60.2.0/media/webrtc/trunk/webrtc/base/rtc_task_queue_gn/moz.build.orig 2018-09-13 17:40:54.000000000 -0400 ++++ icecat-60.2.0/media/webrtc/trunk/webrtc/base/rtc_task_queue_gn/moz.build 2018-09-23 21:33:12.319975105 -0400 +@@ -130,11 +130,6 @@ + DEFINES["WEBRTC_POSIX"] = True + DEFINES["_FILE_OFFSET_BITS"] = "64" + +- LOCAL_INCLUDES += [ +- "/ipc/chromium/src/third_party/libevent/include/", +- "/ipc/chromium/src/third_party/libevent/linux/" +- ] +- + UNIFIED_SOURCES += [ + "/media/webrtc/trunk/webrtc/base/task_queue_libevent.cc", + "/media/webrtc/trunk/webrtc/base/task_queue_posix.cc" diff --git a/gnu/packages/patches/icecat-use-system-media-libs.patch b/gnu/packages/patches/icecat-use-system-media-libs.patch new file mode 100644 index 0000000000..648585a6f0 --- /dev/null +++ b/gnu/packages/patches/icecat-use-system-media-libs.patch @@ -0,0 +1,381 @@ +Support building with system media libraries. +See + +Based on: + https://svnweb.freebsd.org/ports/head/www/firefox-esr/files/patch-z-bug517422?revision=472833&view=markup + +Changes to files within the bundled libraries are omitted, since those files +are removed from Guix sources. Modified for use with patch -p1, and to apply +cleanly to GNU IceCat. + +--- icecat-60.2.0/build/moz.configure/old.configure ++++ icecat-60.2.0/build/moz.configure/old.configure +@@ -273,7 +273,12 @@ + '--with-system-libvpx', + '--with-system-nspr', + '--with-system-nss', ++ '--with-system-ogg', + '--with-system-png', ++ '--with-system-soundtouch', ++ '--with-system-theora', ++ '--with-system-tremor', ++ '--with-system-vorbis', + '--with-system-zlib', + '--with-thumb', + '--with-thumb-interwork', +--- icecat-60.2.0/config/external/moz.build ++++ icecat-60.2.0/config/external/moz.build +@@ -23,12 +23,21 @@ + + external_dirs += ['modules/xz-embedded'] + +-if CONFIG['MOZ_VORBIS']: ++if not CONFIG['MOZ_SYSTEM_OGG']: ++ external_dirs += ['media/libogg'] ++ ++if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_SYSTEM_VORBIS']: + external_dirs += ['media/libvorbis'] + +-if CONFIG['MOZ_TREMOR']: ++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_SYSTEM_TREMOR']: + external_dirs += ['media/libtremor'] + ++if not CONFIG['MOZ_SYSTEM_THEORA']: ++ external_dirs += ['media/libtheora'] ++ ++if not CONFIG['MOZ_SYSTEM_SOUNDTOUCH']: ++ external_dirs += ['media/libsoundtouch'] ++ + if CONFIG['MOZ_WEBM_ENCODER']: + external_dirs += ['media/libmkv'] + +@@ -51,11 +60,8 @@ + 'media/kiss_fft', + 'media/libcubeb', + 'media/libnestegg', +- 'media/libogg', + 'media/libopus', +- 'media/libtheora', + 'media/libspeex_resampler', +- 'media/libsoundtouch', + 'media/mp4parse-rust', + 'media/psshparser' + ] +--- icecat-60.2.0/config/system-headers.mozbuild ++++ icecat-60.2.0/config/system-headers.mozbuild +@@ -1324,6 +1324,28 @@ + 'harfbuzz/hb.h', + ] + ++if CONFIG['MOZ_SYSTEM_OGG']: ++ system_headers += [ ++ 'ogg/ogg.h', ++ 'ogg/os_types.h', ++ ] ++ ++if CONFIG['MOZ_SYSTEM_THEORA']: ++ system_headers += [ ++ 'theora/theoradec.h', ++ ] ++ ++if CONFIG['MOZ_SYSTEM_VORBIS']: ++ system_headers += [ ++ 'vorbis/codec.h', ++ 'vorbis/vorbisenc.h', ++ ] ++ ++if CONFIG['MOZ_SYSTEM_TREMOR']: ++ system_headers += [ ++ 'tremor/ivorbiscodec.h', ++ ] ++ + if CONFIG['MOZ_SYSTEM_LIBVPX']: + system_headers += [ + 'vpx_mem/vpx_mem.h', +--- icecat-60.2.0/dom/media/AudioStream.cpp ++++ icecat-60.2.0/dom/media/AudioStream.cpp +@@ -121,7 +121,9 @@ + : mMonitor("AudioStream") + , mChannels(0) + , mOutChannels(0) ++#ifndef MOZ_SYSTEM_SOUNDTOUCH + , mTimeStretcher(nullptr) ++#endif + , mDumpFile(nullptr) + , mState(INITIALIZED) + , mDataSource(aSource) +@@ -142,9 +144,11 @@ + if (mDumpFile) { + fclose(mDumpFile); + } ++#ifndef MOZ_SYSTEM_SOUNDTOUCH + if (mTimeStretcher) { + soundtouch::destroySoundTouchObj(mTimeStretcher); + } ++#endif + #if defined(XP_WIN) + if (XRE_IsContentProcess()) { + audio::AudioNotificationReceiver::Unregister(this); +@@ -168,7 +172,11 @@ + { + mMonitor.AssertCurrentThreadOwns(); + if (!mTimeStretcher) { ++#ifdef MOZ_SYSTEM_SOUNDTOUCH ++ mTimeStretcher = new soundtouch::SoundTouch(); ++#else + mTimeStretcher = soundtouch::createSoundTouchObj(); ++#endif + mTimeStretcher->setSampleRate(mAudioClock.GetInputRate()); + mTimeStretcher->setChannels(mOutChannels); + mTimeStretcher->setPitch(1.0); +--- icecat-60.2.0/dom/media/AudioStream.h ++++ icecat-60.2.0/dom/media/AudioStream.h +@@ -15,7 +15,11 @@ + #include "mozilla/TimeStamp.h" + #include "mozilla/UniquePtr.h" + #include "CubebUtils.h" ++#ifdef MOZ_SYSTEM_SOUNDTOUCH ++#include "soundtouch/SoundTouch.h" ++#else + #include "soundtouch/SoundTouchFactory.h" ++#endif + + #if defined(XP_WIN) + #include "mozilla/audio/AudioNotificationReceiver.h" +@@ -297,7 +301,11 @@ + uint32_t mChannels; + uint32_t mOutChannels; + AudioClock mAudioClock; ++#ifdef MOZ_SYSTEM_SOUNDTOUCH ++ nsAutoPtr mTimeStretcher; ++#else + soundtouch::SoundTouch* mTimeStretcher; ++#endif + + // Output file for dumping audio + FILE* mDumpFile; +--- icecat-60.2.0/dom/media/moz.build ++++ icecat-60.2.0/dom/media/moz.build +@@ -327,6 +327,21 @@ + + DEFINES['MOZILLA_INTERNAL_API'] = True + ++if CONFIG['MOZ_SYSTEM_OGG']: ++ CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS'] ++ ++if CONFIG['MOZ_SYSTEM_THEORA']: ++ CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS'] ++ ++if CONFIG['MOZ_SYSTEM_VORBIS']: ++ CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS'] ++ ++if CONFIG['MOZ_SYSTEM_TREMOR']: ++ CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS'] ++ ++if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']: ++ CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS'] ++ + if CONFIG['MOZ_ANDROID_HLS_SUPPORT']: + DEFINES['MOZ_ANDROID_HLS_SUPPORT'] = True + +--- icecat-60.2.0/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp ++++ icecat-60.2.0/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp +@@ -15,9 +15,13 @@ + #include + #endif + ++#ifdef MOZ_SYSTEM_SOUNDTOUCH ++#include "nsXPCOMPrivate.h" // for XUL_DLL ++#else + // We use a known symbol located in lgpllibs to determine its location. + // soundtouch happens to be always included in lgpllibs + #include "soundtouch/SoundTouch.h" ++#endif + + namespace mozilla { + +@@ -64,6 +68,12 @@ + + sLinkStatus = LinkStatus_FAILED; + ++#ifdef MOZ_SYSTEM_SOUNDTOUCH ++ // We retrieve the path of the XUL library as this is where mozavcodec and ++ // mozavutil libs are located. ++ char* path = ++ PR_GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init); ++#else + // We retrieve the path of the lgpllibs library as this is where mozavcodec + // and mozavutil libs are located. + PathString lgpllibsname = GetLibraryName(nullptr, "lgpllibs"); +@@ -73,6 +83,7 @@ + PathString path = + GetLibraryFilePathname(lgpllibsname.get(), + (PRFuncPtr)&soundtouch::SoundTouch::getVersionId); ++#endif + if (path.IsEmpty()) { + return false; + } +--- icecat-60.2.0/old-configure.in ++++ icecat-60.2.0/old-configure.in +@@ -2451,6 +2451,111 @@ + fi + fi # COMPILE_ENVIRONMENT + ++dnl ======================================================== ++dnl Check for libogg ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-ogg, ++[ --with-system-ogg Use system libogg (located with pkgconfig)], ++MOZ_SYSTEM_OGG=1, ++MOZ_SYSTEM_OGG=) ++ ++if test -n "$MOZ_SYSTEM_OGG"; then ++ PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.3.3) ++ ++ _SAVE_LIBS=$LIBS ++ LIBS="$LIBS $MOZ_OGG_LIBS" ++ AC_CHECK_FUNC(ogg_set_mem_functions, [], ++ [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)]) ++ LIBS=$_SAVE_LIBS ++fi ++ ++AC_SUBST(MOZ_SYSTEM_OGG) ++ ++dnl ======================================================== ++dnl Check for libvorbis ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-vorbis, ++[ --with-system-vorbis Use system libvorbis (located with pkgconfig)], ++MOZ_SYSTEM_VORBIS=1, ++MOZ_SYSTEM_VORBIS=) ++ ++if test -n "$MOZ_SYSTEM_VORBIS"; then ++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.6) ++fi ++ ++AC_SUBST(MOZ_SYSTEM_VORBIS) ++ ++dnl ======================================================== ++dnl Check for integer-only libvorbis aka tremor ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-tremor, ++[ --with-system-tremor Use system libtremor (located with pkgconfig)], ++MOZ_SYSTEM_TREMOR=1, ++MOZ_SYSTEM_TREMOR=) ++ ++if test -n "$MOZ_SYSTEM_TREMOR"; then ++ PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1) ++fi ++ ++AC_SUBST(MOZ_SYSTEM_TREMOR) ++ ++dnl ======================================================== ++dnl Check for libtheora ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-theora, ++[ --with-system-theora Use system libtheora (located with pkgconfig)], ++MOZ_SYSTEM_THEORA=1, ++MOZ_SYSTEM_THEORA=) ++ ++if test -n "$MOZ_SYSTEM_THEORA"; then ++ PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2) ++fi ++ ++AC_SUBST(MOZ_SYSTEM_THEORA) ++ ++dnl ======================================================== ++dnl Check for libSoundTouch ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-soundtouch, ++[ --with-system-soundtouch Use system libSoundTouch (located with pkgconfig)], ++MOZ_SYSTEM_SOUNDTOUCH=1, ++MOZ_SYSTEM_SOUNDTOUCH=) ++ ++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then ++ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.9.0) ++ ++ AC_LANG_SAVE ++ AC_LANG_CPLUSPLUS ++ _SAVE_CXXFLAGS=$CXXFLAGS ++ CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" ++ AC_CACHE_CHECK(for soundtouch sample type, ++ ac_cv_soundtouch_sample_type, ++ [AC_TRY_COMPILE([#include ++ #ifndef SOUNDTOUCH_INTEGER_SAMPLES ++ #error soundtouch expects float samples ++ #endif], ++ [], ++ [ac_cv_soundtouch_sample_type=short], ++ [ac_cv_soundtouch_sample_type=float])]) ++ CXXFLAGS=$_SAVE_CXXFLAGS ++ AC_LANG_RESTORE ++ ++ if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ ++ -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then ++ AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) ++ fi ++fi ++ ++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then ++ AC_DEFINE(MOZ_SYSTEM_SOUNDTOUCH) ++fi ++AC_SUBST(MOZ_SYSTEM_SOUNDTOUCH) ++ + dnl system libvpx Support + dnl ======================================================== + MOZ_ARG_WITH_BOOL(system-libvpx, +--- icecat-60.2.0/toolkit/library/moz.build ++++ icecat-60.2.0/toolkit/library/moz.build +@@ -244,6 +244,21 @@ + if CONFIG['MOZ_SYSTEM_HUNSPELL']: + OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] + ++if CONFIG['MOZ_SYSTEM_OGG']: ++ OS_LIBS += CONFIG['MOZ_OGG_LIBS'] ++ ++if CONFIG['MOZ_SYSTEM_THEORA']: ++ OS_LIBS += CONFIG['MOZ_THEORA_LIBS'] ++ ++if CONFIG['MOZ_SYSTEM_VORBIS']: ++ OS_LIBS += CONFIG['MOZ_VORBIS_LIBS'] ++ ++if CONFIG['MOZ_SYSTEM_TREMOR']: ++ OS_LIBS += CONFIG['MOZ_TREMOR_LIBS'] ++ ++if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']: ++ OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS'] ++ + if CONFIG['MOZ_SYSTEM_LIBEVENT']: + OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] + +--- icecat-60.2.0/xpcom/build/XPCOMInit.cpp ++++ icecat-60.2.0/xpcom/build/XPCOMInit.cpp +@@ -138,7 +138,9 @@ + + #include "mozilla/ipc/GeckoChildProcessHost.h" + ++#ifndef MOZ_OGG_NO_MEM_REPORTING + #include "ogg/ogg.h" ++#endif + #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) + #if defined(HAVE_STDINT_H) + // mozilla-config.h defines HAVE_STDINT_H, and then it's defined *again* in +@@ -639,11 +641,13 @@ + // this oddness. + mozilla::SetICUMemoryFunctions(); + ++#ifndef MOZ_OGG_NO_MEM_REPORTING + // Do the same for libogg. + ogg_set_mem_functions(OggReporter::CountingMalloc, + OggReporter::CountingCalloc, + OggReporter::CountingRealloc, + OggReporter::CountingFree); ++#endif + + #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) + // And for VPX. -- cgit v1.2.3 From 082d9383d1475b772f104f1a6b363e4c80d91cf9 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 29 Aug 2018 00:06:20 -0400 Subject: gnu: ghc-haddock-library: Update to 1.5.0.1. * gnu/packages/patches/ghc-haddock-library-unbundle.patch: New file. * gnu/packages/haskell.scm (ghc-haddock-library): Update to 1.5.0.1. [source]: Add the patch; add a snippet to remove the bundled library. [arguments]: Add a phase to relax test suite dependency constraints and another to add a missing directory required for tests. [native-inputs]: Add ghc-base-compat, ghc-optparse-applicative, and ghc-tree-diff. --- gnu/packages/haskell.scm | 35 +++++++-- .../patches/ghc-haddock-library-unbundle.patch | 86 ++++++++++++++++++++++ 2 files changed, 115 insertions(+), 6 deletions(-) create mode 100644 gnu/packages/patches/ghc-haddock-library-unbundle.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 5f9c2a4b6e..0e061a6b40 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -935,7 +935,7 @@ compute the difference between arbitrary abstract datatypes (ADTs) using (define-public ghc-haddock-library (package (name "ghc-haddock-library") - (version "1.4.3") + (version "1.5.0.1") (source (origin (method url-fetch) @@ -945,14 +945,37 @@ compute the difference between arbitrary abstract datatypes (ADTs) using ".tar.gz")) (sha256 (base32 - "0ns4bpf6whmcfl0cm2gx2c73if416x4q3ac4l4qm8w84h0zpcr7p")))) + "1cmbg8l5xrwpliclwy3l057raypjqy0hsg1h1743ahaj8gq10b7z")) + (patches (search-patches + "ghc-haddock-library-unbundle.patch")) + (modules '((guix build utils))) + (snippet '(begin + (delete-file-recursively "vendor") + #t)))) (build-system haskell-build-system) - (inputs - `(("ghc-base-compat" ,ghc-base-compat))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'relax-test-suite-dependencies + (lambda _ + (substitute* "haddock-library.cabal" + (("base-compat\\s*\\^>= 0\\.9\\.3") "base-compat") + (("hspec\\s*\\^>= 2\\.4\\.4") "hspec")))) + ;; The release tarball does not contain the "fixtures/examples" + ;; directory, which is required for testing. In the upstream + ;; repository, the directory exists and is populated. Here, we + ;; create an empty directory to placate the tests. + (add-before 'check 'add-examples-directory + (lambda _ + (mkdir "fixtures/examples") + #t))))) (native-inputs - `(("hspec-discover" ,hspec-discover) + `(("ghc-base-compat" ,ghc-base-compat) ("ghc-hspec" ,ghc-hspec) - ("ghc-quickcheck" ,ghc-quickcheck))) + ("ghc-optparse-applicative" ,ghc-optparse-applicative) + ("ghc-quickcheck" ,ghc-quickcheck) + ("ghc-tree-diff" ,ghc-tree-diff) + ("hspec-discover" ,hspec-discover))) (home-page "https://www.haskell.org/haddock/") (synopsis "Library exposing some functionality of Haddock") (description diff --git a/gnu/packages/patches/ghc-haddock-library-unbundle.patch b/gnu/packages/patches/ghc-haddock-library-unbundle.patch new file mode 100644 index 0000000000..0e8b548956 --- /dev/null +++ b/gnu/packages/patches/ghc-haddock-library-unbundle.patch @@ -0,0 +1,86 @@ +This patch (inspired by Debian) allows ghc-haddock-library to use our +ghc-attoparsec package instead of using a bundled version. + +--- a/haddock-library.cabal 2018-09-01 01:22:18.676855884 -0400 ++++ b/haddock-library.cabal 2018-09-01 01:25:10.501150260 -0400 +@@ -10,7 +10,6 @@ + itself, see the ‘haddock’ package. + license: BSD3 + license-files: LICENSE +- vendor/attoparsec-0.13.1.0/LICENSE + maintainer: Alex Biehl , Simon Hengel , Mateusz Kowalczyk + homepage: http://www.haskell.org/haddock/ + bug-reports: https://github.com/haskell/haddock/issues +@@ -28,7 +27,6 @@ + , containers >= 0.4.2.1 && < 0.6 + , transformers >= 0.3.0 && < 0.6 + +- -- internal sub-lib + build-depends: attoparsec + + hs-source-dirs: src +@@ -49,42 +47,6 @@ + if impl(ghc >= 8.0) + ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances + +-library attoparsec +- default-language: Haskell2010 +- +- build-depends: +- base >= 4.5 && < 4.12 +- , bytestring >= 0.9.2.1 && < 0.11 +- , deepseq >= 1.3 && < 1.5 +- +- hs-source-dirs: vendor/attoparsec-0.13.1.0 +- +- -- NB: haddock-library needs only small part of lib:attoparsec +- -- internally, so we only bundle that subset here +- exposed-modules: +- Data.Attoparsec.ByteString +- Data.Attoparsec.ByteString.Char8 +- Data.Attoparsec.Combinator +- +- other-modules: +- Data.Attoparsec +- Data.Attoparsec.ByteString.Buffer +- Data.Attoparsec.ByteString.FastSet +- Data.Attoparsec.ByteString.Internal +- Data.Attoparsec.Internal +- Data.Attoparsec.Internal.Fhthagn +- Data.Attoparsec.Internal.Types +- Data.Attoparsec.Number +- +- ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 +- +- ghc-options: -Wall +- if impl(ghc >= 8.0) +- ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances +- else +- build-depends: semigroups ^>= 0.18.3, fail ^>= 4.9.0.0 +- +- + test-suite spec + type: exitcode-stdio-1.0 + default-language: Haskell2010 +@@ -115,11 +77,10 @@ + , hspec ^>= 2.4.4 + , QuickCheck ^>= 2.11 + +- -- internal sub-lib + build-depends: attoparsec + + -- Versions for the dependencies below are transitively pinned by +- -- dependency on haddock-library:lib:attoparsec ++ -- dependency on attoparsec + build-depends: + base + , bytestring +@@ -146,7 +107,7 @@ + haddock-library + + -- Versions for the dependencies below are transitively pinned by +- -- dependency on haddock-library:lib:attoparsec ++ -- dependency on attoparsec + build-depends: + base + -- cgit v1.2.3 From 68faa20e2d4511b43062f8279cc407aee735b275 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Tue, 2 Oct 2018 13:53:13 -0500 Subject: quilt: Upgrade to 0.65. * gnu/packages/patches/quilt-test-fix-regex.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/patchutils.scm (quilt)[version]: Upgrade to 0.65. [source]: Use patch. [arguments]: Adjust 'patch-tests' phase for new tests. Re-enable "mail" test. --- gnu/local.mk | 1 + gnu/packages/patches/quilt-test-fix-regex.patch | 41 +++++++++++++++++++++++++ gnu/packages/patchutils.scm | 19 +++++++++--- 3 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/quilt-test-fix-regex.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 244c79d221..b2fda4ac69 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1101,6 +1101,7 @@ dist_patch_DATA = \ %D%/packages/patches/qtscript-disable-tests.patch \ %D%/packages/patches/quagga-reproducible-build.patch \ %D%/packages/patches/quickswitch-fix-dmenu-check.patch \ + %D%/packages/patches/quilt-test-fix-regex.patch \ %D%/packages/patches/qtwebkit-pbutils-include.patch \ %D%/packages/patches/rapicorn-isnan.patch \ %D%/packages/patches/raptor2-heap-overflow.patch \ diff --git a/gnu/packages/patches/quilt-test-fix-regex.patch b/gnu/packages/patches/quilt-test-fix-regex.patch new file mode 100644 index 0000000000..2e249ac55b --- /dev/null +++ b/gnu/packages/patches/quilt-test-fix-regex.patch @@ -0,0 +1,41 @@ +From 5193b137b5a9034ce79946edd40760df2f63a82a Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 25 Apr 2017 15:17:53 +0200 +Subject: test: Escape curly braces in regex + +Curly braces in perl regex are supposed to be escaped, recent +versions of perl complain when they aren't: + +Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE (\w+)}/ at ./run line 114. +Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE \?}/ at ./run line 290. + +Signed-off-by: Jean Delvare +--- + test/run | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/run b/test/run +index 942014e..03afc7a 100755 +--- a/test/run ++++ b/test/run +@@ -112,7 +112,7 @@ sub flush_output() + sub substitute_vars($) + { + my ($line) = @_; +- $line =~ s[%{(\w+)}][defined $ENV{$1} ? $ENV{$1} : ""]eg; ++ $line =~ s[%\{(\w+)\}][defined $ENV{$1} ? $ENV{$1} : ""]eg; + return $line; + } + +@@ -288,7 +288,7 @@ while (defined(my $line = )) { + # Parse the next command + if ($line =~ s/^\s*\$ ?//) { + # Substitute %{?} with the last command's status +- $line =~ s[%{\?}][$last_status]eg; ++ $line =~ s[%\{\?\}][$last_status]eg; + + chomp($prog = substitute_vars($line)); + $prog_line = $lineno; +-- +cgit v1.0-41-gc330 + diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index a68e369912..0cf111ac47 100644 --- a/gnu/packages/patchutils.scm +++ b/gnu/packages/patchutils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Eric Bavier +;;; Copyright © 2014, 2018 Eric Bavier ;;; Copyright © 2015, 2018 Leo Famulari ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; @@ -92,7 +92,7 @@ listing the files modified by a patch.") (define-public quilt (package (name "quilt") - (version "0.61") + (version "0.65") (source (origin (method url-fetch) @@ -100,7 +100,8 @@ listing the files modified by a patch.") name "-" version ".tar.gz")) (sha256 (base32 - "1hwz58djkq9cv46sjwxbp2v5m8yjr41kd0nm1zm1xm6418khmv0y")))) + "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn")) + (patches (search-patches "quilt-test-fix-regex.patch")))) (build-system gnu-build-system) (inputs `(("perl" ,perl) ("less" ,less) @@ -116,8 +117,16 @@ listing the files modified by a patch.") '("test/run" "test/edit.test") (("/bin/sh") (which "sh"))) - ;; TODO: Run the mail tests once the mail feature can be supported. - (delete-file "test/mail.test") + (substitute* "test/create-delete.test" + ;; We'd rather use quilt's compat/getopt than declare a + ;; dependency on util-linux, but this test fails because of + ;; compat/getopt's handling of "---" in this test, so remove it + ;; for now. + ((" ---") "")) + (substitute* '("test/empty-files.test" "test/faildiff.test") + ;; compat/getopt seems not to handle splitting of short opts + ;; from its arguments. + (("-pab") "-p ab")) #t)) (add-after 'install 'wrap-program ;; quilt's configure checks for the absolute path to the utilities it -- cgit v1.2.3 From 43eb42ef017aa4752503fb2913781bb446716c1e Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Wed, 3 Oct 2018 10:23:51 -0500 Subject: quilt: Remove test workarounds. * gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch, gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/patchutils.scm (quilt)[source]: Use them. [arguments]: Remove workarounds in 'patch-tests' phase. --- gnu/local.mk | 2 + ...pat-getopt-fix-option-with-nondigit-param.patch | 45 +++++++++++++++++ .../quilt-compat-getopt-fix-second-separator.patch | 58 ++++++++++++++++++++++ gnu/packages/patchutils.scm | 14 ++---- 4 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch create mode 100644 gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index b2fda4ac69..61e5913a01 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1102,6 +1102,8 @@ dist_patch_DATA = \ %D%/packages/patches/quagga-reproducible-build.patch \ %D%/packages/patches/quickswitch-fix-dmenu-check.patch \ %D%/packages/patches/quilt-test-fix-regex.patch \ + %D%/packages/patches/quilt-compat-getopt-fix-second-separator.patch \ + %D%/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch \ %D%/packages/patches/qtwebkit-pbutils-include.patch \ %D%/packages/patches/rapicorn-isnan.patch \ %D%/packages/patches/raptor2-heap-overflow.patch \ diff --git a/gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch b/gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch new file mode 100644 index 0000000000..6bbec67e75 --- /dev/null +++ b/gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch @@ -0,0 +1,45 @@ +From: Jean Delvare +Subject: compat/getopt: Allow non-digit parameter embedded in short option + +The compatibility getopt script allows only digit parameters to be +embedded in short options. Util-linux's getopt implementation does +not have such a restriction and allows any parameter to be embedded +in short options. As a consequence, using the compatibility getopt +script would choke for example on "-pab", which is a legal option +of the "quilt refresh" command. + +Remove the limitation on digits so that the compatibility getopt +script allows what util-linux allows. This fixes the second half +of bug #54772: +https://savannah.nongnu.org/bugs/index.php?54772 + +As a side note, this feature of the compatibility script was broken +anyway, as it would output the digits in reverse order. + +Signed-off-by: Jean Delvare +--- + compat/getopt.in | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +--- quilt.orig/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200 ++++ quilt/compat/getopt.in 2018-10-03 16:12:17.624841732 +0200 +@@ -108,15 +108,10 @@ foreach my $word (@words) { + if (scalar(@letters) == 0) { + $need_param = $letter; + } else { +- # short options can have numerical args +- # embedded in the short option list: -UO +- die "unexpected character after option $letter" +- if ($letters[$#letters] !~ /[0-9]/); +- my @digits; +- while (scalar(@letters) && ($letters[$#letters] =~ /[0-9]/)) { +- push @digits, pop @letters; +- } +- push @options, quote_word(join('', reverse @digits)); ++ # short options can have args ++ # embedded in the short option list ++ push @options, quote_word(join('', reverse @letters)); ++ @letters = (); + } + } + } diff --git a/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch b/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch new file mode 100644 index 0000000000..cde2c8d41c --- /dev/null +++ b/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch @@ -0,0 +1,58 @@ +From: Jean Delvare +Subject: compat/getopt: Handle a second separator + +getopt can be passed 2 '--' separators. The first one tells that +getopt options are over and target program options start. The second +one tells that the target program's options are over and following +arguments should be treated as non-options even if they look like +options. + +This second separator was not handled, causing the compatibility +getopt script to treat the following arguments as options, eventually +failing one way or another. + +Properly detect and handle the second separator. This fixes the first +half of bug #54772: +https://savannah.nongnu.org/bugs/index.php?54772 + +Signed-off-by: Jean Delvare +--- + compat/getopt.in | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +--- quilt.orig/compat/getopt.in 2018-10-03 15:23:21.147620172 +0200 ++++ quilt/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200 +@@ -8,12 +8,12 @@ + + use strict; + +-my $opts; ++my $opts = ''; + my @words; + my $found_sep = 0; + + foreach my $arg (@ARGV) { +- if ($arg eq '--') { ++ if (!$found_sep && $arg eq '--') { + $found_sep = 1; + } + else { +@@ -62,10 +62,17 @@ sub quote_word + return "'$word'"; + } + ++# there can be a second separator, to inhibit processing following arguments ++# as options ++$found_sep = 0; + foreach my $word (@words) { ++ if ($word eq '--') { ++ $found_sep = 1; ++ next; ++ } + + # allow '-' to be an option value +- if (!$need_param && $word !~ /^-./) { ++ if ($found_sep || (!$need_param && $word !~ /^-./)) { + push @barewords, quote_word($word); + next; + } diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index da20ae1c3f..688e62cdc8 100644 --- a/gnu/packages/patchutils.scm +++ b/gnu/packages/patchutils.scm @@ -103,7 +103,9 @@ listing the files modified by a patch.") (sha256 (base32 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn")) - (patches (search-patches "quilt-test-fix-regex.patch")))) + (patches (search-patches "quilt-test-fix-regex.patch" + "quilt-compat-getopt-fix-second-separator.patch" + "quilt-compat-getopt-fix-option-with-nondigit-param.patch")))) (build-system gnu-build-system) (native-inputs `(("gettext" ,gnu-gettext))) @@ -122,16 +124,6 @@ listing the files modified by a patch.") '("test/run" "test/edit.test") (("/bin/sh") (which "sh"))) - (substitute* "test/create-delete.test" - ;; We'd rather use quilt's compat/getopt than declare a - ;; dependency on util-linux, but this test fails because of - ;; compat/getopt's handling of "---" in this test, so remove it - ;; for now. - ((" ---") "")) - (substitute* '("test/empty-files.test" "test/faildiff.test") - ;; compat/getopt seems not to handle splitting of short opts - ;; from its arguments. - (("-pab") "-p ab")) #t)) (add-after 'install 'wrap-program ;; quilt's configure checks for the absolute path to the utilities it -- cgit v1.2.3