From 257e3247910610fe24ae1b86f38e85552d53e48c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 23 Sep 2018 04:46:59 -0400 Subject: [PATCH 001/440] 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. --- gnu/local.mk | 3 +- gnu/packages/gnuzilla.scm | 19 +- ...icecat-use-system-graphite2+harfbuzz.patch | 226 ++++++++++++++ .../patches/icecat-use-system-graphite2.patch | 248 ---------------- .../patches/icecat-use-system-harfbuzz.patch | 279 ------------------ 5 files changed, 236 insertions(+), 539 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 diff --git a/gnu/local.mk b/gnu/local.mk index fe2b573dd5..35e78e7816 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -811,8 +811,7 @@ dist_patch_DATA = \ %D%/packages/patches/hydra-disable-darcs-test.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ %D%/packages/patches/icecat-CVE-2018-12383.patch \ - %D%/packages/patches/icecat-use-system-graphite2.patch \ - %D%/packages/patches/icecat-use-system-harfbuzz.patch \ + %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.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 653cee93d5..ad83444e3c 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -495,9 +495,8 @@ security standards.") "0lqx7g79x15941rhjr3qsfwsny6vzc7d7abdmvjy6jjbqkqlc1zl")) (patches (list - (search-patch "icecat-avoid-bundled-libraries.patch") - ;; FIXME (search-patch "icecat-use-system-harfbuzz.patch") - ;; FIXME (search-patch "icecat-use-system-graphite2.patch") + (search-patch "icecat-avoid-bundled-libraries.patch") + (search-patch "icecat-use-system-graphite2+harfbuzz.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"))) @@ -535,8 +534,8 @@ security standards.") "media/libvpx" "security/nss" ;; UNBUNDLE-ME "gfx/cairo" - ;; UNBUNDLE-ME "gfx/harfbuzz" - ;; UNBUNDLE-ME "gfx/graphite2" + "gfx/harfbuzz" + "gfx/graphite2" "js/src/ctypes/libffi" "db/sqlite3")) ;; Delete .pyc files, typically present in icecat source tarballs @@ -557,10 +556,10 @@ security standards.") ("glib" ,glib) ("gtk+" ,gtk+) ("gtk+-2" ,gtk+-2) - ;; UNBUNDLE-ME ("graphite2" ,graphite2) + ("graphite2" ,graphite2) ("pango" ,pango) ("freetype" ,freetype) - ;; UNBUNDLE-ME ("harfbuzz" ,harfbuzz) + ("harfbuzz" ,harfbuzz) ("hunspell" ,hunspell) ("libcanberra" ,libcanberra) ("libgnome" ,libgnome) @@ -643,8 +642,8 @@ security standards.") "--with-system-icu" "--with-system-nspr" "--with-system-nss" - ;; UNBUNDLE-ME "--with-system-harfbuzz" - ;; UNBUNDLE-ME "--with-system-graphite2" + "--with-system-harfbuzz" + "--with-system-graphite2" "--enable-system-pixman" ;; UNBUNDLE-ME "--enable-system-cairo" "--enable-system-ffi" @@ -697,7 +696,7 @@ security standards.") all))) #t)) (add-after 'patch-source-shebangs 'patch-cargo-checksums - (lambda* _ + (lambda _ (use-modules (guix build cargo-build-system)) (let ((null-file "/dev/null") (null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) 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'] - From 94e96f7f68c3b9053fdb5dee5b0ab614163aaa08 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 24 Sep 2018 00:10:37 -0400 Subject: [PATCH 002/440] 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 +- .../icecat-avoid-bundled-libraries.patch | 14 + .../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 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. From 6d328879378fac95240005233331f596fb5c68ed Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 25 Sep 2018 17:13:59 -0400 Subject: [PATCH 003/440] gnu: icecat: Rebundle NSPR and NSS [security fix]. Works around . * gnu/packages/gnuzilla.scm (icecat)[source]: In snippet, don't remove NSS. [inputs]: Remove 'nspr' and 'nss'. [arguments]: Remove --with-system-{nspr,nss} from configure flags. --- gnu/packages/gnuzilla.scm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 6834d82426..ea3b61c231 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -519,6 +519,13 @@ security standards.") ;; FIXME: A script from the bundled nspr is used. ;;"nsprpub" ;; + ;; FIXME: With the update to IceCat 60, using system NSS + ;; broke certificate validation. See + ;; . For now, we use + ;; the bundled NSPR and NSS. TODO: Investigate, + ;; and try to unbundle these libraries again. + ;; UNBUNDLE-ME! "security/nss" + ;; ;; TODO: Use more system media libraries. See: ;; ;; * libtheora: esr60 wants v1.2, not yet released. @@ -541,7 +548,6 @@ security standards.") "media/libvorbis" ;; "media/libtheora" ; wants theora-1.2, not yet released "media/libtremor" - "security/nss" "gfx/harfbuzz" "gfx/graphite2" "js/src/ctypes/libffi" @@ -588,8 +594,10 @@ security standards.") ("pulseaudio" ,pulseaudio) ("mesa" ,mesa) ("mit-krb5" ,mit-krb5) - ("nspr" ,nspr) - ("nss" ,nss) + ;; See + ;; and related comments in the 'snippet' above. + ;; UNBUNDLE-ME! ("nspr" ,nspr) + ;; UNBUNDLE-ME! ("nss" ,nss) ("sqlite" ,sqlite) ("startup-notification" ,startup-notification) ("unzip" ,unzip) @@ -653,8 +661,12 @@ security standards.") ;; "--with-system-theora" ; wants theora-1.2, not yet released "--with-system-libvpx" "--with-system-icu" - "--with-system-nspr" - "--with-system-nss" + + ;; See + ;; and related comments in the 'snippet' above. + ;; UNBUNDLE-ME! "--with-system-nspr" + ;; UNBUNDLE-ME! "--with-system-nss" + "--with-system-harfbuzz" "--with-system-graphite2" "--enable-system-pixman" From fe73352e8073ea0a0e6f6b5591f24395671998ab Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 25 Sep 2018 19:31:50 -0400 Subject: [PATCH 004/440] gnu: linux-libre: Enable SHPC PCI Hotplug driver, now built-in only. Fixes . * gnu/packages/aux-files/linux-libre/4.18-x86_64.conf, gnu/packages/aux-files/linux-libre/4.18-i686.conf: Add CONFIG_HOTPLUG_PCI_SHPC=y, plus updates made by 'make oldconfig'. --- gnu/packages/aux-files/linux-libre/4.18-i686.conf | 6 ++++-- gnu/packages/aux-files/linux-libre/4.18-x86_64.conf | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gnu/packages/aux-files/linux-libre/4.18-i686.conf b/gnu/packages/aux-files/linux-libre/4.18-i686.conf index 606616b9fa..859b8b10b6 100644 --- a/gnu/packages/aux-files/linux-libre/4.18-i686.conf +++ b/gnu/packages/aux-files/linux-libre/4.18-i686.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 4.18.0-gnu Kernel Configuration +# Linux/x86 4.18.9-gnu Kernel Configuration # # @@ -255,6 +255,7 @@ CONFIG_PROFILING=y CONFIG_TRACEPOINTS=y CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y +CONFIG_HOTPLUG_SMT=y CONFIG_OPROFILE=m # CONFIG_OPROFILE_EVENT_MULTIPLEX is not set CONFIG_HAVE_OPROFILE=y @@ -294,6 +295,7 @@ CONFIG_HAVE_PERF_REGS=y CONFIG_HAVE_PERF_USER_STACK_DUMP=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_RCU_TABLE_FREE=y +CONFIG_HAVE_RCU_TABLE_INVALIDATE=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_CMPXCHG_LOCAL=y @@ -853,7 +855,7 @@ CONFIG_HOTPLUG_PCI_ACPI_IBM=m CONFIG_HOTPLUG_PCI_CPCI=y CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m -# CONFIG_HOTPLUG_PCI_SHPC is not set +CONFIG_HOTPLUG_PCI_SHPC=y # # PCI controller drivers diff --git a/gnu/packages/aux-files/linux-libre/4.18-x86_64.conf b/gnu/packages/aux-files/linux-libre/4.18-x86_64.conf index 81fd822756..2a66c483d6 100644 --- a/gnu/packages/aux-files/linux-libre/4.18-x86_64.conf +++ b/gnu/packages/aux-files/linux-libre/4.18-x86_64.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 4.18.0-gnu Kernel Configuration +# Linux/x86 4.18.9-gnu Kernel Configuration # # @@ -265,6 +265,7 @@ CONFIG_PROFILING=y CONFIG_TRACEPOINTS=y CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y +CONFIG_HOTPLUG_SMT=y CONFIG_OPROFILE=m # CONFIG_OPROFILE_EVENT_MULTIPLEX is not set CONFIG_HAVE_OPROFILE=y @@ -304,6 +305,7 @@ CONFIG_HAVE_PERF_REGS=y CONFIG_HAVE_PERF_USER_STACK_DUMP=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_RCU_TABLE_FREE=y +CONFIG_HAVE_RCU_TABLE_INVALIDATE=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_CMPXCHG_LOCAL=y @@ -869,7 +871,7 @@ CONFIG_HOTPLUG_PCI_ACPI_IBM=m CONFIG_HOTPLUG_PCI_CPCI=y CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m -# CONFIG_HOTPLUG_PCI_SHPC is not set +CONFIG_HOTPLUG_PCI_SHPC=y # # PCI controller drivers From 06619128274c0f7e3ebfefab03db337e886fec51 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 25 Sep 2018 17:57:59 +0200 Subject: [PATCH 005/440] Fix URL in emacs-magit and emacs-groovy-modes. * gnu/packages/emacs.scm (emacs-magit)[source]: Fix URL. * gnu/packages/emacs.scm (emacs-groovy-modes)[source]: Fix URL. --- gnu/packages/emacs.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index f29040c372..c541c51483 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -458,7 +458,7 @@ on stdout instead of using a socket as the Emacsclient does.") (method url-fetch) (uri (string-append "https://github.com/magit/magit/releases/download/" - version "/" name "-" version ".tar.gz")) + version "/magit-" version ".tar.gz")) (sha256 (base32 "1ygaah3dd3nxpyd17297xgvdcgr7pgzzwlmpnmchki0kiwgg3sbc")))) @@ -8019,7 +8019,7 @@ supports multiple backends such as @code{vlc}, @code{mpg123}, (source (origin (method url-fetch) (uri (string-append - "https://github.com/Groovy-Emacs-Modes/" name + "https://github.com/Groovy-Emacs-Modes/groovy-emacs-modes" "/archive/" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz")) (sha256 From 9bd85a785f47d039b027de854b78b9ded0892e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 26 Sep 2018 15:42:15 +0200 Subject: [PATCH 006/440] gnu: shepherd: Update to 0.5.0. * gnu/packages/admin.scm (shepherd): Update to 0.5.0. --- gnu/packages/admin.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 8f504cafef..ded7ce3b97 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -173,14 +173,14 @@ and provides a \"top-like\" mode (monitoring).") (define-public shepherd (package (name "shepherd") - (version "0.4.0") + (version "0.5.0") (source (origin (method url-fetch) (uri (string-append "https://alpha.gnu.org/gnu/shepherd/shepherd-" version ".tar.gz")) (sha256 (base32 - "1lgmsbxn8i8xdasxzkdp2cml75n128pplw6icvmspl6s0n9xmw8n")))) + "1wmciqml9yplnx1s4ynn00giqyk06rbrcsgvpjj2df47sawk2jp8")))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--localstatedir=/var"))) From 4245ddcbc9f935804c17c97872b90ec1050c2d75 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Sun, 26 Aug 2018 21:54:14 +1000 Subject: [PATCH 007/440] guix system: Load all services on reconfigure, not just stopped ones. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This uses the 'replacement' service slot introduced in the Shepherd version 0.5.0. * gnu/services/shepherd.scm (shepherd-service-upgrade): Return a list of services that need to be restarted to complete their upgrade. * guix/scripts/system.scm (call-with-service-upgrade-info): Rename an internal variable to reflect the change to shepherd-service-upgrade. (upgrade-shepherd-services): Call 'load-services/safe' instead of 'load-services'. Print a message about services that need to be manually restarted. * gnu/services/herd.scm (load-services/safe): New procedure. * doc/guix.texi (Invoking guix system): Document the new behaviour. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 8 ++++---- gnu/services/herd.scm | 20 ++++++++++++++++++++ gnu/services/shepherd.scm | 23 ++++++++--------------- guix/scripts/system.scm | 25 ++++++++++++++++--------- 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 6b4b06f46d..e1046eb512 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -33,7 +33,7 @@ Copyright @copyright{} 2016 Alex ter Weele@* Copyright @copyright{} 2017, 2018 Clément Lassieur@* Copyright @copyright{} 2017 Mathieu Othacehe@* Copyright @copyright{} 2017 Federico Beffa@* -Copyright @copyright{} 2017 Carlo Zancanaro@* +Copyright @copyright{} 2017, 2018 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017 Christopher Allan Webber@* @@ -21920,9 +21920,9 @@ systems already running GuixSD.}. This effects all the configuration specified in @var{file}: user accounts, system services, global package list, setuid programs, etc. The command starts system services specified in @var{file} that are not -currently running; if a service is currently running, it does not -attempt to upgrade it since this would not be possible without stopping it -first. +currently running; if a service is currently running this command will +arrange for it to be upgraded the next time it is stopped (eg. by +@code{herd stop X} or @code{herd restart X}). This command creates a new generation whose number is one greater than the current generation (as reported by @command{guix system diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm index 8c96b70731..8ff817759d 100644 --- a/gnu/services/herd.scm +++ b/gnu/services/herd.scm @@ -50,6 +50,7 @@ unload-services unload-service load-services + load-services/safe start-service stop-service)) @@ -232,6 +233,25 @@ returns a shepherd object." `(primitive-load ,file)) files)))) +(define (load-services/safe files) + "This is like 'load-services', but make sure only the subset of FILES that +can be safely reloaded is actually reloaded. + +This is done to accommodate the Shepherd < 0.15.0 where services lacked the +'replacement' slot, and where 'register-services' would throw an exception +when passed a service with an already-registered name." + (eval-there `(let* ((services (map primitive-load ',files)) + (slots (map slot-definition-name + (class-slots ))) + (can-replace? (memq 'replacement slots))) + (define (registered? service) + (not (null? (lookup-services (canonical-name service))))) + + (apply register-services + (if can-replace? + services + (remove registered? services)))))) + (define (start-service name) (with-shepherd-action name ('start) result result)) diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 4cd2249841..4c7e72049f 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2018 Ludovic Courtès ;;; Copyright © 2017 Clément Lassieur +;;; Copyright © 2018 Carlo Zancanaro ;;; ;;; This file is part of GNU Guix. ;;; @@ -329,7 +330,7 @@ symbols provided/required by a service." (define (shepherd-service-upgrade live target) "Return two values: the subset of LIVE (a list of ) that needs to be unloaded, and the subset of TARGET (a list of ) that -needs to be loaded." +need to be restarted to complete their upgrade." (define (essential? service) (memq (first (live-service-provision service)) '(root shepherd))) @@ -346,12 +347,6 @@ needs to be loaded." (and=> (lookup-live (shepherd-service-canonical-name service)) live-service-running)) - (define (stopped service) - (match (lookup-live (shepherd-service-canonical-name service)) - (#f #f) - (service (and (not (live-service-running service)) - service)))) - (define live-service-dependents (shepherd-service-back-edges live #:provision live-service-provision @@ -362,16 +357,14 @@ needs to be loaded." (#f (every obsolete? (live-service-dependents service))) (_ #f))) - (define to-load - ;; Only load services that are either new or currently stopped. - (remove running? target)) + (define to-restart + ;; Restart services that are currently running. + (filter running? target)) (define to-unload - ;; Unload services that are (1) no longer required, or (2) are in TO-LOAD. - (remove essential? - (append (filter obsolete? live) - (filter-map stopped to-load)))) + ;; Unload services that are no longer required. + (remove essential? (filter obsolete? live))) - (values to-unload to-load)) + (values to-unload to-restart)) ;;; shepherd.scm ends here diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 69bd05b516..1e7620f147 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -310,9 +310,9 @@ names of services to load (upgrade), and the list of names of services to unload." (match (current-services) ((services ...) - (let-values (((to-unload to-load) + (let-values (((to-unload to-restart) (shepherd-service-upgrade services new-services))) - (mproc to-load + (mproc to-restart (map (compose first live-service-provision) to-unload)))) (#f @@ -335,25 +335,32 @@ bring the system down." ;; Arrange to simply emit a warning if the service upgrade fails. (with-shepherd-error-handling (call-with-service-upgrade-info new-services - (lambda (to-load to-unload) + (lambda (to-restart to-unload) (for-each (lambda (unload) (info (G_ "unloading service '~a'...~%") unload) (unload-service unload)) to-unload) (with-monad %store-monad - (munless (null? to-load) - (let ((to-load-names (map shepherd-service-canonical-name to-load)) - (to-start (filter shepherd-service-auto-start? to-load))) - (info (G_ "loading new services:~{ ~a~}...~%") to-load-names) + (munless (null? new-services) + (let ((new-service-names (map shepherd-service-canonical-name new-services)) + (to-restart-names (map shepherd-service-canonical-name to-restart)) + (to-start (filter shepherd-service-auto-start? new-services))) + (info (G_ "loading new services:~{ ~a~}...~%") new-service-names) + (unless (null? to-restart-names) + ;; Listing TO-RESTART-NAMES in the message below wouldn't help + ;; because many essential services cannot be meaningfully + ;; restarted. See . + (format #t (G_ "To complete the upgrade, run 'herd restart SERVICE' to stop, +upgrade, and restart each service that was not automatically restarted.\n"))) (mlet %store-monad ((files (mapm %store-monad (compose lower-object shepherd-service-file) - to-load))) + new-services))) ;; Here we assume that FILES are exactly those that were computed ;; as part of the derivation that built OS, which is normally the ;; case. - (load-services (map derivation->output-path files)) + (load-services/safe (map derivation->output-path files)) (for-each start-service (map shepherd-service-canonical-name to-start)) From 2a5f2b1f7550db701172a338e98179e1cac55a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 26 Sep 2018 16:35:37 +0200 Subject: [PATCH 008/440] gnu: Remove incorrect Emacs package deprecations. This is a followup to 5c8031ff7382ec9079040d08ae5a05b4dd2352b7. An upgrade would wrongfully report things like: guix package: package 'emacs-typo' has been superseded by 'emacs-typo' guix package: package 'emacs-org-tree-slide' has been superseded by 'emacs-org-tree-slide' guix package: package 'emacs-emms' has been superseded by 'emacs-emms' * gnu/packages/emacs.scm (flycheck, emms, typo, org-tree-slide) (butler): Remove. (emacs-emms-mode-line-cycle)[propagated-inputs]: Use EMACS-EMMS instead of EMMS. --- gnu/packages/emacs.scm | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index c541c51483..9dc11c59fc 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -782,9 +782,6 @@ different tools. It highlights errors and warnings inline in the buffer, and provides an optional IDE-like error list.") (license license:gpl3+))) ;+GFDLv1.3+ for the manual -(define-public flycheck - (deprecated-package "flycheck" emacs-flycheck)) - ;;; ;;; Web browsing. @@ -1066,9 +1063,6 @@ light user interface.") (home-page "https://www.gnu.org/software/emms/") (license license:gpl3+))) -(define-public emms - (deprecated-package "emacs-emms" emacs-emms)) - (define-public emacs-emms-player-mpv ;; A new mpv backend is included in Emms from 5.0. (deprecated-package "emacs-emms-player-mpv" emacs-emms)) @@ -1088,7 +1082,7 @@ light user interface.") "0ifszi930pnaxk1x8pcydmvnp06868gc7nfx14q17zbajbx735k6")))) (build-system emacs-build-system) (propagated-inputs - `(("emms" ,emms))) + `(("emms" ,emacs-emms))) (home-page "https://github.com/momomo5717/emms-mode-line-cycle") (synopsis "Display the EMMS mode line as a ticker") (description @@ -2722,9 +2716,6 @@ view the build status of those servers' build jobs, and possibly to trigger build jobs.") (license license:gpl3+))) -(define-public butler - (deprecated-package "emacs-butler" emacs-butler)) - (define-public emacs-company (package (name "emacs-company") @@ -2874,9 +2865,6 @@ automatically inserts a Unicode opening or closing quotation mark, depending on context.") (license license:gpl3+))) -(define-public typo - (deprecated-package "emacs-typo" emacs-typo)) - (define-public emacs-scheme-complete (let ((commit "9b5cf224bf2a5994bc6d5b152ff487517f1a9bb5")) (package @@ -8061,9 +8049,6 @@ navigation with the grails mode.") @kbd{C-<} to jump to the next and previous slide.") (license license:gpl3+)))) -(define-public org-tree-slide - (deprecated-package "emacs-org-tree-slide" emacs-org-tree-slide)) - (define-public emacs-scratch-el (let ((commit "2cdf2b841ce7a0987093f65b0cc431947549f897") (revision "1")) From 6f03b08089167ec863361352ab200830bffeb0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 26 Sep 2018 22:30:16 +0200 Subject: [PATCH 009/440] services: dhcp-client: Use 'read-pid-file'. * gnu/services/networking.scm (dhcp-client-service-type)[start]: Use 'read-pid-file' instead of the custom and possibly infinite loop. --- gnu/services/networking.scm | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index bd1d5a2706..3fdb2bb9f7 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2016, 2018 Efraim Flashner ;;; Copyright © 2016 John Darrington @@ -191,19 +191,7 @@ fe80::1%lo0 apps.facebook.com\n") (cons* #$dhclient "-nw" "-pf" #$pid-file ifaces)))) (and (zero? (cdr (waitpid pid))) - (let loop () - (catch 'system-error - (lambda () - (call-with-input-file #$pid-file read)) - (lambda args - ;; 'dhclient' returned before PID-FILE was created, - ;; so try again. - (let ((errno (system-error-errno args))) - (if (= ENOENT errno) - (begin - (sleep 1) - (loop)) - (apply throw args)))))))))) + (read-pid-file #$pid-file))))) (stop #~(make-kill-destructor)))))) (define* (dhcp-client-service #:key (dhcp isc-dhcp)) From a56c4eb8f43ae5555985d8a84308d150c0763c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 26 Sep 2018 22:52:38 +0200 Subject: [PATCH 010/440] services: shepherd: Add workaround for 0.5.0 in containers. * gnu/services/shepherd.scm (%containerized-shepherd-service): New service. * gnu/system.scm (essential-services): Use it when CONTAINER? is true. --- gnu/services/shepherd.scm | 16 ++++++++++++++++ gnu/system.scm | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 4c7e72049f..49d08cc30f 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -59,6 +59,7 @@ %default-modules shepherd-service-file + %containerized-shepherd-service shepherd-service-lookup-procedure shepherd-service-back-edges @@ -327,6 +328,21 @@ symbols provided/required by a service." (lambda (service) (vhash-foldq* cons '() service edges))) +(define %containerized-shepherd-service + ;; XXX: This service works around a bug in the Shepherd 0.5.0: shepherd + ;; calls reboot(2) (via 'disable-reboot-on-ctrl-alt-del') when it starts, + ;; but in a container that fails with EINVAL. This was fixed in Shepherd + ;; commit 92e806bac1abaeeaf5d60f0ab50d1ae85ba6a62f. + (simple-service 'containerized-shepherd + shepherd-root-service-type + (list (shepherd-service + (provision '(containerized-shepherd)) + (start #~(lambda () + (set! (@@ (shepherd) + disable-reboot-on-ctrl-alt-del) + (const #t)) + #t)))))) + (define (shepherd-service-upgrade live target) "Return two values: the subset of LIVE (a list of ) that needs to be unloaded, and the subset of TARGET (a list of ) that diff --git a/gnu/system.scm b/gnu/system.scm index e4a57475a9..99bc09873d 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -501,7 +501,7 @@ a container or that of a \"bare metal\" system." ;; Add the firmware service, unless we are building for a ;; container. (if container? - '() + (list %containerized-shepherd-service) (list %linux-bare-metal-service (service firmware-service-type (operating-system-firmware os)))))))) From 23784f0c3342a0fab5bf2a1c15c300b9f0856872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 26 Sep 2018 22:58:23 +0200 Subject: [PATCH 011/440] services: udev: Don't attempt to read "modules.devname" from a container. Fixes . Reported by Julien Lepiller . * gnu/services/base.scm (udev-shepherd-service)[start]: Check whether DIRECTORY exists and skip 'make-static-device-nodes' call if it doesn't. --- gnu/services/base.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 5ba2c6b86d..9dfabd9807 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1881,7 +1881,12 @@ item of @var{packages}." (string-append linux-module-directory "/" kernel-release)) (old-umask (umask #o022))) - (make-static-device-nodes directory) + ;; If we're in a container, DIRECTORY might not exist, + ;; for instance because the host runs a different + ;; kernel. In that case, skip it; we'll just miss a few + ;; nodes like /dev/fuse. + (when (file-exists? directory) + (make-static-device-nodes directory)) (umask old-umask)) (let ((pid (fork+exec-command (list udevd)))) From 09b7300c01a8e7100467c6caae9b2c8d8e673971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 26 Sep 2018 23:01:33 +0200 Subject: [PATCH 012/440] services: virtual-terminal: Write to "default_utf8" only if necessary. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a bug in containers whereby 'virtual-terminal' would always fail to start because writing to /sys/…/default_utf8 would fail with EROFS. * gnu/services/base.scm (virtual-terminal-service-type): Read from "default_utf8" before attempting to write to it. --- gnu/services/base.scm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 9dfabd9807..47c7d8bb27 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -685,17 +685,20 @@ to add @var{device} to the kernel's entropy pool. The service will fail if (shepherd-service-type 'virtual-terminal (lambda (utf8?) - (shepherd-service - (documentation "Set virtual terminals in UTF-8 module.") - (provision '(virtual-terminal)) - (requirement '(root-file-system)) - (start #~(lambda _ - (call-with-output-file - "/sys/module/vt/parameters/default_utf8" - (lambda (port) - (display 1 port))) - #t)) - (stop #~(const #f)))) + (let ((knob "/sys/module/vt/parameters/default_utf8")) + (shepherd-service + (documentation "Set virtual terminals in UTF-8 module.") + (provision '(virtual-terminal)) + (requirement '(root-file-system)) + (start #~(lambda _ + ;; In containers /sys is read-only so don't insist on + ;; writing to this file. + (unless (= 1 (call-with-input-file #$knob read)) + (call-with-output-file #$knob + (lambda (port) + (display 1 port)))) + #t)) + (stop #~(const #f))))) #t)) ;default to UTF-8 (define console-keymap-service-type From e15ede6e28cfaf5fe951faf88d7c1e3213a476a4 Mon Sep 17 00:00:00 2001 From: Timo Eisenmann Date: Wed, 26 Sep 2018 17:01:33 +0200 Subject: [PATCH 013/440] gnu: enlightenment: Fix initial locale and keyboard selection. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/enlightenment.scm (enlightenment)[arguments]: In 'set-system-actions', set absolute file name to 'locale' and 'xorg.lst'. Signed-off-by: Ludovic Courtès --- gnu/packages/enlightenment.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gnu/packages/enlightenment.scm b/gnu/packages/enlightenment.scm index 45dc1dbbeb..c7812e8874 100644 --- a/gnu/packages/enlightenment.scm +++ b/gnu/packages/enlightenment.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner ;;; Copyright © 2017 Nils Gillmann ;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; Copyright © 2018 Timo Eisenmann ;;; ;;; This file is part of GNU Guix. ;;; @@ -268,13 +269,19 @@ Libraries with some extra bells and whistles.") (add-before 'configure 'set-system-actions (lambda* (#:key inputs #:allow-other-keys) (let ((xkeyboard (assoc-ref inputs "xkeyboard-config")) - (utils (assoc-ref inputs "util-linux"))) + (utils (assoc-ref inputs "util-linux")) + (libc (assoc-ref inputs "libc"))) ;; We need to patch the path to 'base.lst' to be able ;; to switch the keyboard layout in E. - (substitute* "src/modules/xkbswitch/e_mod_parse.c" + (substitute* (list "src/modules/xkbswitch/e_mod_parse.c" + "src/modules/wizard/page_011.c") (("/usr/share/X11/xkb/rules/xorg.lst") (string-append xkeyboard "/share/X11/xkb/rules/base.lst"))) + (substitute* (list "src/bin/e_intl.c" + "src/modules/conf_intl/e_int_config_intl.c" + "src/modules/wizard/page_010.c") + (("locale -a") (string-append libc "/bin/locale -a"))) (substitute* "src/modules/everything/evry_plug_apps.c" (("/usr/bin/") "")) (substitute* "configure" From a9994b273585914a273f5c50bf2d39af1f657fd0 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 25 Sep 2018 20:58:07 +0200 Subject: [PATCH 014/440] gnu: perl-crypt-openssl-rsa: Update to 0.31. * gnu/packages/tls.scm (perl-crypt-openssl-rsa): Update to 0.31. --- gnu/packages/tls.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 0cdb02b0aa..bdb63c0dbf 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -681,7 +681,7 @@ servers or clients for more complicated applications.") (define-public perl-crypt-openssl-rsa (package (name "perl-crypt-openssl-rsa") - (version "0.30") + (version "0.31") (source (origin (method url-fetch) @@ -691,7 +691,7 @@ servers or clients for more complicated applications.") ".tar.gz")) (sha256 (base32 - "1b19kaaw4wda8dy6kjiwqa2prpbs2dqcyjyj9zdh5wbs74qkbq93")))) + "0djl5i6kibl7862b6ih29q8dhg5zpwzq77q9j8hp6xngshx40ws1")))) (build-system perl-build-system) (native-inputs `(("perl-crypt-openssl-guess" ,perl-crypt-openssl-guess))) From 6f52db245564b5732577e4e40e0f3127d37fcaf0 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 25 Sep 2018 23:27:44 +0200 Subject: [PATCH 015/440] gnu: perl-catalyst-runtime: Update to 5.90119. * gnu/packages/web.scm (perl-catalyst-runtime): Update to 5.90119. --- gnu/packages/web.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 26c2e9128a..2251daabf7 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -1862,15 +1862,15 @@ MIME type directly to the browser, without being processed through Catalyst.") (define-public perl-catalyst-runtime (package (name "perl-catalyst-runtime") - (version "5.90118") + (version "5.90119") (source (origin (method url-fetch) - (uri (string-append "mirror://cpan/authors/id/H/HA/HAARG/" + (uri (string-append "mirror://cpan/authors/id/E/ET/ETHER/" "Catalyst-Runtime-" version ".tar.gz")) (sha256 (base32 - "0cws3szx3vvh0372qdx8fypgv6qphcc3v81rbq30sl1ghby7ksd3")))) + "1iw7x9rqk3sz2hm1bw01blz5vwm7zlljdf4xj3r8vz54f1yggzqr")))) (build-system perl-build-system) (native-inputs `(("perl-test-fatal" ,perl-test-fatal))) From af44f05af78e3187589c2c628c3d3436df7ceed0 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 24 Sep 2018 12:38:47 +0200 Subject: [PATCH 016/440] gnu: perl-net-dns: Update to 1.18. * gnu/packages/networking.scm (perl-net-dns): Update to 1.18. --- gnu/packages/networking.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index 4800c2496b..0d6de040e5 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -902,7 +902,7 @@ private (reserved).") (define-public perl-net-dns (package (name "perl-net-dns") - (version "1.17") + (version "1.18") (source (origin (method url-fetch) @@ -914,7 +914,7 @@ private (reserved).") version ".tar.gz"))) (sha256 (base32 - "1q62w9rf2w8kjzqagzr0rdn20ybl8gj3l6cdq4k8fw0sxa7zsycs")))) + "1lx902cbvlfl63bqfdrnyavmfwbjvrfdnwgdc1dgs1wpzja19kjj")))) (build-system perl-build-system) (inputs `(("perl-digest-hmac" ,perl-digest-hmac))) From 3d190d6a219d03dc94c8d33614766df0fed1473f Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 27 Sep 2018 03:47:24 +0200 Subject: [PATCH 017/440] gnu: dico: Update to 2.7. * gnu/packages/dico.scm (dico): Update to 2.7. [arguments]: Work around dodgy test in 'check' phase. --- gnu/packages/dico.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gnu/packages/dico.scm b/gnu/packages/dico.scm index a85987d9b1..d96dbb86d9 100644 --- a/gnu/packages/dico.scm +++ b/gnu/packages/dico.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2018 Ludovic Courtès ;;; Copyright © 2016, 2018 Efraim Flashner +;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,14 +38,14 @@ (define-public dico (package (name "dico") - (version "2.6") + (version "2.7") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/dico/dico-" version ".tar.xz")) (sha256 (base32 - "0zmi041gv5nd5fmyzgdrgrsy2pvjaq9p8dvvhxwi842hiyng5b7i")))) + "0dg4aacnmlf3ljssd7dwh8z5644xzq8k1501mbsx8nz8p8a9mbsq")))) (build-system gnu-build-system) (arguments '(#:configure-flags (list (string-append "--with-guile-site-dir=" %output @@ -57,7 +58,11 @@ ;; infrastructure. Gag it. (setenv "GUILE_AUTO_COMPILE" "0") (setenv "GUILE_WARN_DEPRECATED" "no") - #t))))) + #t)) + (replace 'check + (lambda _ + ;; Test '71: append + dooffs + env' fails if $V is not 2. + (invoke "make" "check" "V=2")))))) (inputs `(("m4" ,m4) ;used at run time ("pcre" ,pcre) From b733dbc0fb5bd1648f1fdce6471f048886e69e73 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 25 Sep 2018 10:15:37 +0200 Subject: [PATCH 018/440] gnu: python-setproctitle: Use INVOKE. * gnu/packages/python.scm (python-setproctitle)[arguments]: Substitute INVOKE for SYSTEM*. --- gnu/packages/python.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 5c6c79da88..4703d95a2d 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -10482,7 +10482,7 @@ theme for the Sphinx documentation system. It's the default theme of Sphinx.") (setenv "CC" "gcc") ;; No need to extend PYTHONPATH to find the built package, since ;; the Makefile will build anyway - (zero? (system* "make" "check"))))))) + (invoke "make" "check")))))) (native-inputs `(("procps" ,procps))) ; required for tests (home-page From 428d2ca2ecc57780fb4be90ca6009ea1d00eeade Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 24 Sep 2018 20:33:00 +0200 Subject: [PATCH 019/440] gnu: youtube-dl: Update to 2018.09.18. * gnu/packages/video.scm (youtube-dl): Update to 2018.09.18. --- gnu/packages/video.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 448773e0d9..54ffef86de 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -1271,7 +1271,7 @@ access to mpv's powerful playback capabilities.") (define-public youtube-dl (package (name "youtube-dl") - (version "2018.09.08") + (version "2018.09.18") (source (origin (method url-fetch) (uri (string-append "https://yt-dl.org/downloads/" @@ -1279,7 +1279,7 @@ access to mpv's powerful playback capabilities.") version ".tar.gz")) (sha256 (base32 - "0vwc4faqdddrb3nm4fzmkr60n5rc2zwyy8jwrrjad60kcp8isf05")))) + "0mlsdmddmyy3xaqy366k48xds14g17l81al3kglndjkbrrji63sb")))) (build-system python-build-system) (arguments ;; The problem here is that the directory for the man page and completion From c4a3ea38850e97cdc12252440c7fa9cdefd5790f Mon Sep 17 00:00:00 2001 From: Rutger Helling Date: Thu, 27 Sep 2018 09:50:01 +0200 Subject: [PATCH 020/440] gnu: mame: Update to 0.202. * gnu/packages/emulators.scm (mame): Update to 0.202. --- gnu/packages/emulators.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index 782bff5b18..443137f141 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -1184,7 +1184,7 @@ play them on systems for which they were never designed!") (define-public mame (package (name "mame") - (version "0.201") + (version "0.202") (source (origin (method git-fetch) @@ -1194,7 +1194,7 @@ play them on systems for which they were never designed!") (file-name (git-file-name name version)) (sha256 (base32 - "00whiig4ld3d4fkl34q48vlf28ygvvp5g7fp0rb5n31ymhl4kajk")) + "1v9gm124p65nbj678gfkcvwphp9qc15ky2p12ca6g3rllma94di5")) (modules '((guix build utils))) (snippet ;; Remove bundled libraries. From e07cb04d40eaea8aa792e2375f7f127ef54a79f3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 27 Sep 2018 05:51:20 -0400 Subject: [PATCH 021/440] gnu: linux-libre@4.4: Update to 4.4.158. * gnu/packages/linux.scm (linux-libre-4.4): Update to 4.4.158. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 170c77374d..95a5234c76 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -452,8 +452,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.4 - (make-linux-libre "4.4.157" - "00bnfqwkr0jfdabmwx5qk5bqxn5vwnnzwqbm5rfg7lggii74kk54" + (make-linux-libre "4.4.158" + "1l3blfaw50a8l9bp735vzsmk1naq4l40qidza10dwkkrd2ip3n41" %intel-compatible-systems #:configuration-file kernel-config)) From 202190ec392d3284b0dae753b356cb74f4962682 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 27 Sep 2018 05:52:00 -0400 Subject: [PATCH 022/440] gnu: linux-libre@4.9: Update to 4.9.129. * gnu/packages/linux.scm (linux-libre-4.9): Update to 4.9.129. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 95a5234c76..b3ccaef89f 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -446,8 +446,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.9 - (make-linux-libre "4.9.128" - "0lww23xcyyg0dwzrap5x9d700gy3lbxln55n6sqqkm7m89dkqwha" + (make-linux-libre "4.9.129" + "0y7p1xgbpn4nmr5pmqb58shr54lvryr5rxwm9m66knwzj332f3rh" %intel-compatible-systems #:configuration-file kernel-config)) From e0b6085a7f69a8b2a8ff4fe90d8ef28f9ef50769 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 27 Sep 2018 05:52:52 -0400 Subject: [PATCH 023/440] gnu: linux-libre@4.14: Update to 4.14.72. * gnu/packages/linux.scm (%linux-libre-4.14-version): Update to 4.14.72. (%linux-libre-4.14-hash): Update hash. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index b3ccaef89f..93005e16da 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -436,8 +436,8 @@ It has been modified to remove all non-free binary blobs.") #:patches %linux-libre-4.18-patches #:configuration-file kernel-config)) -(define %linux-libre-4.14-version "4.14.71") -(define %linux-libre-4.14-hash "1akvykaccy7ikl8v04grwxvgs4z2rrs7drf2s85ysqwq79mdh3gq") +(define %linux-libre-4.14-version "4.14.72") +(define %linux-libre-4.14-hash "1ngz5p8mvga45y1n6hbw6niy0ji5mfl4vc3bxlckjg42dcp5qf64") (define-public linux-libre-4.14 (make-linux-libre %linux-libre-4.14-version From 1d1e4f8f9c46b13ed2c4a61bc4c5f25c6748649b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 27 Sep 2018 05:53:46 -0400 Subject: [PATCH 024/440] gnu: linux-libre: Update to 4.18.10. * gnu/packages/linux.scm (%linux-libre-version): Update to 4.18.10. (%linux-libre-hash): Update hash. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 93005e16da..2503676396 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -405,8 +405,8 @@ It has been modified to remove all non-free binary blobs.") ;; supports qemu "virt" machine and possibly a large number of ARM boards. ;; See : https://wiki.debian.org/DebianKernel/ARMMP. -(define %linux-libre-version "4.18.9") -(define %linux-libre-hash "0wwmhnfvcsdlqhzwwwyz1x5a3ldjky6l0xir1pi6pysr0lak402x") +(define %linux-libre-version "4.18.10") +(define %linux-libre-hash "1znc6kh3j8plmxail6hn2ss0r0fvbcp50s3xv5gxys7jc7k42znj") (define %linux-libre-4.18-patches (list %boot-logo-patch From de1158d53fd106103214e79f8523a91b9cfa89d7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 27 Sep 2018 19:55:49 +0200 Subject: [PATCH 025/440] gnu: eolie: Update to 0.9.38. * gnu/packages/gnome.scm (eolie): Update to 0.9.38. --- gnu/packages/gnome.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 1e8522c500..de938e4b14 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -4090,15 +4090,15 @@ work and the interface is well tested.") (define-public eolie (package (name "eolie") - (version "0.9.37") + (version "0.9.38") (source (origin (method url-fetch) (uri (string-append "https://gitlab.gnome.org/World/eolie/" - "uploads/4341cb428b7a45670308ee3fb3fa07dd/" + "uploads/9814c06a1bc83ea09c3da8719a9ed11b/" "eolie-" version ".tar.xz")) (sha256 (base32 - "126m0nwwy3lqv7z8aj9hiwangih03b1nlkg3xja9p7wbf7zcvp2n")))) + "10vrh91rapgfmqwc6jkcybpmlvn4q0y8bnklw3rddzigf9kvqsff")))) (build-system meson-build-system) (arguments `(#:glib-or-gtk? #t From ea1a3601999887a0762a942460317145f3f53b30 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 27 Sep 2018 20:02:55 +0200 Subject: [PATCH 026/440] gnu: emacs-ert-runner: Do not use package name in directory. * gnu/packages/emacs.scm (emacs-ert-runner)[arguments]: Use the upstream name instead of the Guix package name in the "install-executable" phase. This is a follow-up to commit 5c8031ff7382ec9079040d08ae5a05b4dd2352b7. --- gnu/packages/emacs.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 9dc11c59fc..8da5add886 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -6982,8 +6982,8 @@ Emacs.") (substitute* "bin/ert-runner" (("ERT_RUNNER=\"\\$\\(dirname \\$\\(dirname \\$0\\)\\)") (string-append "ERT_RUNNER=\"" out - "/share/emacs/site-lisp/guix.d/" - ,name "-" ,version))) + "/share/emacs/site-lisp/guix.d/ert-runner-" + ,version))) (install-file "bin/ert-runner" (string-append out "/bin")) (wrap-program (string-append out "/bin/ert-runner") (list "EMACSLOADPATH" ":" 'prefix From 363d7d6608d599776f78525e50a920b1d641805b Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 27 Sep 2018 21:52:07 +0200 Subject: [PATCH 027/440] gnu: yoshimi: Update to 1.5.9. * gnu/packages/music.scm (yoshimi): Update to 1.5.9. --- gnu/packages/music.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index e563062018..2d834d8c1f 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -1996,7 +1996,7 @@ capabilities, custom envelopes, effects, etc.") (define-public yoshimi (package (name "yoshimi") - (version "1.5.8.2") + (version "1.5.9") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/yoshimi/" @@ -2004,7 +2004,7 @@ capabilities, custom envelopes, effects, etc.") "/yoshimi-" version ".tar.bz2")) (sha256 (base32 - "1kg7d6mnzdwzsqhrf7pmrf1hzgfpbpm5lv8xkaz32wiv391qrnxc")))) + "1nqwxwq6814m860zrh33r85vdyi2bgkvjg5372h3ngcdmxnb7wr0")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; there are no tests From fe65b559a671390ed5034d2d0b2c58c276e5abff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 25 Sep 2018 10:30:21 +0200 Subject: [PATCH 028/440] progress: Add 'display-download-progress'. * guix/progress.scm (display-download-progress): New procedure. (progress-reporter/file)[render]: Rewrite in terms of 'display-download-progress'. --- guix/progress.scm | 72 +++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/guix/progress.scm b/guix/progress.scm index 53aea1c56d..d4ebb32991 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -39,6 +39,7 @@ progress-reporter/file progress-reporter/bar + display-download-progress byte-count->string current-terminal-columns @@ -183,6 +184,42 @@ width of the bar is BAR-WIDTH." move the cursor to the beginning of the line." (display "\r\x1b[K" port)) +(define* (display-download-progress file size + #:key + start-time (transferred 0) + (log-port (current-error-port))) + "Write the progress report to LOG-PORT. Use START-TIME (a SRFI-19 time +object) and TRANSFERRED (a total number of bytes) to determine the +throughput." + (define elapsed + (duration->seconds + (time-difference (current-time time-monotonic) start-time))) + (if (number? size) + (let* ((% (* 100.0 (/ transferred size))) + (throughput (/ transferred elapsed)) + (left (format #f " ~a ~a" file + (byte-count->string size))) + (right (format #f "~a/s ~a ~a~6,1f%" + (byte-count->string throughput) + (seconds->string elapsed) + (progress-bar %) %))) + (erase-current-line log-port) + (display (string-pad-middle left right + (current-terminal-columns)) + log-port) + (force-output log-port)) + (let* ((throughput (/ transferred elapsed)) + (left (format #f " ~a" file)) + (right (format #f "~a/s ~a | ~a transferred" + (byte-count->string throughput) + (seconds->string elapsed) + (byte-count->string transferred)))) + (erase-current-line log-port) + (display (string-pad-middle left right + (current-terminal-columns)) + log-port) + (force-output log-port)))) + (define* (progress-reporter/file file size #:optional (log-port (current-output-port)) #:key (abbreviation basename)) @@ -192,37 +229,10 @@ ABBREVIATION used to shorten FILE for display." (let ((start-time (current-time time-monotonic)) (transferred 0)) (define (render) - "Write the progress report to LOG-PORT." - (define elapsed - (duration->seconds - (time-difference (current-time time-monotonic) start-time))) - (if (number? size) - (let* ((% (* 100.0 (/ transferred size))) - (throughput (/ transferred elapsed)) - (left (format #f " ~a ~a" - (abbreviation file) - (byte-count->string size))) - (right (format #f "~a/s ~a ~a~6,1f%" - (byte-count->string throughput) - (seconds->string elapsed) - (progress-bar %) %))) - (erase-current-line log-port) - (display (string-pad-middle left right - (current-terminal-columns)) - log-port) - (force-output log-port)) - (let* ((throughput (/ transferred elapsed)) - (left (format #f " ~a" - (abbreviation file))) - (right (format #f "~a/s ~a | ~a transferred" - (byte-count->string throughput) - (seconds->string elapsed) - (byte-count->string transferred)))) - (erase-current-line log-port) - (display (string-pad-middle left right - (current-terminal-columns)) - log-port) - (force-output log-port)))) + (display-download-progress (abbreviation file) size + #:start-time start-time + #:transferred transferred + #:log-port log-port)) (progress-reporter (start render) From dc0f74e5fc26977a3ee6c4f2aa74a141f4359982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 18 Jan 2017 23:21:29 +0100 Subject: [PATCH 029/440] Add (guix status) and use it for pretty colored output. * guix/progress.scm (progress-reporter/trace): New procedure. (%progress-interval): New variable. (progress-reporter/file): Use it. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:print-extended-build-trace?. (%default-options): Add 'print-extended-build-trace?'. (guix-build): Parameterize CURRENT-TERMINAL-COLUMNS. Use 'build-status-updater'. * guix/scripts/environment.scm (%default-options): Add 'print-extended-build-trace?'. (guix-environment): Wrap body in 'with-status-report'. * guix/scripts/pack.scm (%default-options): Add 'print-build-trace?' and 'print-extended-build-trace?'. (guix-pack): Wrap body in 'with-status-report'. * guix/scripts/package.scm (%default-options, guix-package): Likewise. * guix/scripts/system.scm (%default-options, guix-system): Likewise. * guix/scripts/pull.scm (%default-options, guix-pull): Likewise. * guix/scripts/substitute.scm (progress-report-port): Don't call STOP when TOTAL is zero. (process-substitution): Add #:print-build-trace? and honor it. (guix-substitute)[print-build-trace?]: New variable. Pass #:print-build-trace? to 'process-substitution'. * guix/status.scm: New file. * guix/store.scm (set-build-options): Add #:print-extended-build-trace?; pass it into PAIRS. (%protocol-version): Bump. (protocol-version, nix-server-version): New procedures. (current-store-protocol-version): New variable. (with-store, build-things): Parameterize it. * guix/ui.scm (build-output-port): Remove. (colorize-string): Export. * po/guix/POTFILES.in: Add guix/status.scm. * tests/status.scm: New file. * Makefile.am (SCM_TESTS): Add it. * nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x162. * nix/libstore/build.cc (DerivationGoal::registerOutputs) (SubstitutionGoal::finished): Print a "@ hash-mismatch" trace before throwing. --- .dir-locals.el | 1 + Makefile.am | 2 + guix/progress.scm | 38 ++- guix/scripts/build.scm | 13 +- guix/scripts/environment.scm | 110 +++---- guix/scripts/pack.scm | 140 ++++----- guix/scripts/package.scm | 25 +- guix/scripts/perform-download.scm | 1 + guix/scripts/pull.scm | 64 ++-- guix/scripts/substitute.scm | 42 ++- guix/scripts/system.scm | 11 +- guix/status.scm | 493 ++++++++++++++++++++++++++++++ guix/store.scm | 53 +++- guix/ui.scm | 122 +------- nix/libstore/build.cc | 27 +- nix/libstore/worker-protocol.hh | 2 +- po/guix/POTFILES.in | 1 + tests/status.scm | 115 +++++++ 18 files changed, 934 insertions(+), 326 deletions(-) create mode 100644 guix/status.scm create mode 100644 tests/status.scm diff --git a/.dir-locals.el b/.dir-locals.el index eb99a5bcc1..793117c0ae 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -59,6 +59,7 @@ (eval . (put 'emacs-substitute-variables 'scheme-indent-function 1)) (eval . (put 'with-derivation-narinfo 'scheme-indent-function 1)) (eval . (put 'with-derivation-substitute 'scheme-indent-function 2)) + (eval . (put 'with-status-report 'scheme-indent-function 1)) (eval . (put 'mlambda 'scheme-indent-function 1)) (eval . (put 'mlambdaq 'scheme-indent-function 1)) diff --git a/Makefile.am b/Makefile.am index 5c8639d665..7fd29b90a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -131,6 +131,7 @@ MODULES = \ guix/svn-download.scm \ guix/i18n.scm \ guix/ui.scm \ + guix/status.scm \ guix/build/android-ndk-build-system.scm \ guix/build/ant-build-system.scm \ guix/build/download.scm \ @@ -340,6 +341,7 @@ SCM_TESTS = \ tests/glob.scm \ tests/grafts.scm \ tests/ui.scm \ + tests/status.scm \ tests/records.scm \ tests/upstream.scm \ tests/combinators.scm \ diff --git a/guix/progress.scm b/guix/progress.scm index d4ebb32991..3b9ff408cd 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Sou Bunnbu ;;; Copyright © 2015 Steve Sprang -;;; Copyright © 2017 Ludovic Courtès +;;; Copyright © 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,8 +38,11 @@ progress-reporter/silent progress-reporter/file progress-reporter/bar + progress-reporter/trace display-download-progress + erase-current-line + progress-bar byte-count->string current-terminal-columns @@ -220,6 +223,10 @@ throughput." log-port) (force-output log-port)))) +(define %progress-interval + ;; Default interval between subsequent outputs for rate-limited displays. + (make-time time-monotonic 200000000 0)) + (define* (progress-reporter/file file size #:optional (log-port (current-output-port)) #:key (abbreviation basename)) @@ -238,8 +245,7 @@ ABBREVIATION used to shorten FILE for display." (start render) ;; Report the progress every 300ms or longer. (report - (let ((rate-limited-render - (rate-limited render (make-time time-monotonic 300000000 0)))) + (let ((rate-limited-render (rate-limited render %progress-interval))) (lambda (value) (set! transferred value) (rate-limited-render)))) @@ -279,6 +285,32 @@ tasks is performed. Write PREFIX at the beginning of the line." (newline port)) (force-output port))))) +(define* (progress-reporter/trace file url size + #:optional (log-port (current-output-port))) + "Like 'progress-reporter/file', but instead of returning human-readable +progress reports, write \"build trace\" lines to be processed elsewhere." + (define (report-progress transferred) + (define message + (format #f "@ download-progress ~a ~a ~a ~a~%" + file url (or size "-") transferred)) + + (display message log-port) ;should be atomic + (flush-output-port log-port)) + + (progress-reporter + (start (lambda () + (display (format #f "@ download-started ~a ~a ~a~%" + file url (or size "-")) + log-port))) + (report (rate-limited report-progress %progress-interval)) + (stop (lambda () + (report-progress size) + (display (format #f "@ download-succeeded ~a ~a ~a~%" + file url + (or (and=> (stat file #f) stat:size) + size)) + log-port))))) + ;; TODO: replace '(@ (guix build utils) dump-port))'. (define* (dump-port* in out #:key (buffer-size 16384) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 9d38610633..5a6ba62bc3 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -45,6 +45,9 @@ #:use-module (srfi srfi-37) #:autoload (gnu packages) (specification->package %package-module-path) #:autoload (guix download) (download-to-store) + #:use-module (guix status) + #:use-module ((guix progress) #:select (current-terminal-columns)) + #:use-module ((guix build syscalls) #:select (terminal-columns)) #:export (%standard-build-options set-build-options-from-command-line set-build-options-from-command-line* @@ -390,6 +393,8 @@ options handled by 'set-build-options-from-command-line', and listed in #:max-silent-time (assoc-ref opts 'max-silent-time) #:timeout (assoc-ref opts 'timeout) #:print-build-trace (assoc-ref opts 'print-build-trace?) + #:print-extended-build-trace? + (assoc-ref opts 'print-extended-build-trace?) #:verbosity (assoc-ref opts 'verbosity))) (define set-build-options-from-command-line* @@ -499,6 +504,7 @@ options handled by 'set-build-options-from-command-line', and listed in (substitutes? . #t) (build-hook? . #t) (print-build-trace? . #t) + (print-extended-build-trace? . #t) (verbosity . 0))) (define (show-help) @@ -733,11 +739,12 @@ needed." ;; Set the build options before we do anything else. (set-build-options-from-command-line store opts) - (parameterize ((current-build-output-port + (parameterize ((current-terminal-columns (terminal-columns)) + (current-build-output-port (if quiet? (%make-void-port "w") - (build-output-port #:verbose? #t - #:port (duplicate-port (current-error-port) "w"))))) + (build-event-output-port + (build-status-updater print-build-event))))) (let* ((mode (assoc-ref opts 'build-mode)) (drv (options->derivations store opts)) (urls (map (cut string-append <> "/log") diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 1c04800e42..9fc7edcd36 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -21,6 +21,7 @@ (define-module (guix scripts environment) #:use-module (guix ui) #:use-module (guix store) + #:use-module (guix status) #:use-module (guix grafts) #:use-module (guix derivations) #:use-module (guix packages) @@ -173,6 +174,8 @@ COMMAND or an interactive shell in that environment.\n")) (substitutes? . #t) (build-hook? . #t) (graft? . #t) + (print-build-trace? . #t) + (print-extended-build-trace? . #t) (verbosity . 0))) (define (tag-package-arg opts arg) @@ -661,59 +664,60 @@ message if any test fails." (leave (G_ "'--user' cannot be used without '--container'~%"))) (with-store store - (set-build-options-from-command-line store opts) + (with-status-report print-build-event + (set-build-options-from-command-line store opts) - ;; Use the bootstrap Guile when requested. - (parameterize ((%graft? (assoc-ref opts 'graft?)) - (%guile-for-build - (package-derivation - store - (if bootstrap? - %bootstrap-guile - (canonical-package guile-2.2))))) - (run-with-store store - ;; Containers need a Bourne shell at /bin/sh. - (mlet* %store-monad ((bash (environment-bash container? - bootstrap? - system)) - (prof-drv (manifest->derivation - manifest system bootstrap?)) - (profile -> (derivation->output-path prof-drv)) - (gc-root -> (assoc-ref opts 'gc-root))) + ;; Use the bootstrap Guile when requested. + (parameterize ((%graft? (assoc-ref opts 'graft?)) + (%guile-for-build + (package-derivation + store + (if bootstrap? + %bootstrap-guile + (canonical-package guile-2.2))))) + (run-with-store store + ;; Containers need a Bourne shell at /bin/sh. + (mlet* %store-monad ((bash (environment-bash container? + bootstrap? + system)) + (prof-drv (manifest->derivation + manifest system bootstrap?)) + (profile -> (derivation->output-path prof-drv)) + (gc-root -> (assoc-ref opts 'gc-root))) - ;; First build the inputs. This is necessary even for - ;; --search-paths. Additionally, we might need to build bash for - ;; a container. - (mbegin %store-monad - (build-environment (if (derivation? bash) - (list prof-drv bash) - (list prof-drv)) - opts) - (mwhen gc-root - (register-gc-root profile gc-root)) + ;; First build the inputs. This is necessary even for + ;; --search-paths. Additionally, we might need to build bash for + ;; a container. + (mbegin %store-monad + (build-environment (if (derivation? bash) + (list prof-drv bash) + (list prof-drv)) + opts) + (mwhen gc-root + (register-gc-root profile gc-root)) - (cond - ((assoc-ref opts 'dry-run?) - (return #t)) - ((assoc-ref opts 'search-paths) - (show-search-paths profile manifest #:pure? pure?) - (return #t)) - (container? - (let ((bash-binary - (if bootstrap? - bash - (string-append (derivation->output-path bash) - "/bin/sh")))) - (launch-environment/container #:command command - #:bash bash-binary - #:user user - #:user-mappings mappings - #:profile profile - #:manifest manifest - #:link-profile? link-prof? - #:network? network?))) - (else - (return - (exit/status - (launch-environment/fork command profile manifest - #:pure? pure?))))))))))))) + (cond + ((assoc-ref opts 'dry-run?) + (return #t)) + ((assoc-ref opts 'search-paths) + (show-search-paths profile manifest #:pure? pure?) + (return #t)) + (container? + (let ((bash-binary + (if bootstrap? + bash + (string-append (derivation->output-path bash) + "/bin/sh")))) + (launch-environment/container #:command command + #:bash bash-binary + #:user user + #:user-mappings mappings + #:profile profile + #:manifest manifest + #:link-profile? link-prof? + #:network? network?))) + (else + (return + (exit/status + (launch-environment/fork command profile manifest + #:pure? pure?)))))))))))))) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 1916f3b9d7..163f5b1dc1 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -25,6 +25,7 @@ #:use-module (guix gexp) #:use-module (guix utils) #:use-module (guix store) + #:use-module (guix status) #:use-module (guix grafts) #:use-module (guix monads) #:use-module (guix modules) @@ -538,6 +539,8 @@ please email '~a'~%") (substitutes? . #t) (build-hook? . #t) (graft? . #t) + (print-build-trace? . #t) + (print-extended-build-trace? . #t) (verbosity . 0) (symlinks . ()) (compressor . ,(first %compressors)))) @@ -684,72 +687,73 @@ Create a bundle of PACKAGE.\n")) (with-error-handling (with-store store - ;; Set the build options before we do anything else. - (set-build-options-from-command-line store opts) + (with-status-report print-build-event + ;; Set the build options before we do anything else. + (set-build-options-from-command-line store opts) - (parameterize ((%graft? (assoc-ref opts 'graft?)) - (%guile-for-build (package-derivation - store - (if (assoc-ref opts 'bootstrap?) - %bootstrap-guile - (canonical-package guile-2.2)) - (assoc-ref opts 'system) - #:graft? (assoc-ref opts 'graft?)))) - (let* ((dry-run? (assoc-ref opts 'dry-run?)) - (relocatable? (assoc-ref opts 'relocatable?)) - (manifest (let ((manifest (manifest-from-args store opts))) - ;; Note: We cannot honor '--bootstrap' here because - ;; 'glibc-bootstrap' lacks 'libc.a'. - (if relocatable? - (map-manifest-entries wrapped-package manifest) - manifest))) - (pack-format (assoc-ref opts 'format)) - (name (string-append (symbol->string pack-format) - "-pack")) - (target (assoc-ref opts 'target)) - (bootstrap? (assoc-ref opts 'bootstrap?)) - (compressor (if bootstrap? - bootstrap-xz - (assoc-ref opts 'compressor))) - (archiver (if (equal? pack-format 'squashfs) - squashfs-tools-next - (if bootstrap? - %bootstrap-coreutils&co - tar))) - (symlinks (assoc-ref opts 'symlinks)) - (build-image (match (assq-ref %formats pack-format) - ((? procedure? proc) proc) - (#f - (leave (G_ "~a: unknown pack format~%") - pack-format)))) - (localstatedir? (assoc-ref opts 'localstatedir?))) - (run-with-store store - (mlet* %store-monad ((profile (profile-derivation - manifest - #:relative-symlinks? relocatable? - #:hooks (if bootstrap? - '() - %default-profile-hooks) - #:locales? (not bootstrap?) - #:target target)) - (drv (build-image name profile - #:target - target - #:compressor - compressor - #:symlinks - symlinks - #:localstatedir? - localstatedir? - #:archiver - archiver))) - (mbegin %store-monad - (show-what-to-build* (list drv) - #:use-substitutes? - (assoc-ref opts 'substitutes?) - #:dry-run? dry-run?) - (munless dry-run? - (built-derivations (list drv)) - (return (format #t "~a~%" - (derivation->output-path drv)))))) - #:system (assoc-ref opts 'system))))))) + (parameterize ((%graft? (assoc-ref opts 'graft?)) + (%guile-for-build (package-derivation + store + (if (assoc-ref opts 'bootstrap?) + %bootstrap-guile + (canonical-package guile-2.2)) + (assoc-ref opts 'system) + #:graft? (assoc-ref opts 'graft?)))) + (let* ((dry-run? (assoc-ref opts 'dry-run?)) + (relocatable? (assoc-ref opts 'relocatable?)) + (manifest (let ((manifest (manifest-from-args store opts))) + ;; Note: We cannot honor '--bootstrap' here because + ;; 'glibc-bootstrap' lacks 'libc.a'. + (if relocatable? + (map-manifest-entries wrapped-package manifest) + manifest))) + (pack-format (assoc-ref opts 'format)) + (name (string-append (symbol->string pack-format) + "-pack")) + (target (assoc-ref opts 'target)) + (bootstrap? (assoc-ref opts 'bootstrap?)) + (compressor (if bootstrap? + bootstrap-xz + (assoc-ref opts 'compressor))) + (archiver (if (equal? pack-format 'squashfs) + squashfs-tools-next + (if bootstrap? + %bootstrap-coreutils&co + tar))) + (symlinks (assoc-ref opts 'symlinks)) + (build-image (match (assq-ref %formats pack-format) + ((? procedure? proc) proc) + (#f + (leave (G_ "~a: unknown pack format~%") + pack-format)))) + (localstatedir? (assoc-ref opts 'localstatedir?))) + (run-with-store store + (mlet* %store-monad ((profile (profile-derivation + manifest + #:relative-symlinks? relocatable? + #:hooks (if bootstrap? + '() + %default-profile-hooks) + #:locales? (not bootstrap?) + #:target target)) + (drv (build-image name profile + #:target + target + #:compressor + compressor + #:symlinks + symlinks + #:localstatedir? + localstatedir? + #:archiver + archiver))) + (mbegin %store-monad + (show-what-to-build* (list drv) + #:use-substitutes? + (assoc-ref opts 'substitutes?) + #:dry-run? dry-run?) + (munless dry-run? + (built-derivations (list drv)) + (return (format #t "~a~%" + (derivation->output-path drv)))))) + #:system (assoc-ref opts 'system)))))))) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index c3ed2ac935..93a77915fe 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -24,6 +24,7 @@ (define-module (guix scripts package) #:use-module (guix ui) + #:use-module (guix status) #:use-module (guix store) #:use-module (guix grafts) #:use-module (guix derivations) @@ -330,7 +331,8 @@ ENTRIES, a list of manifest entries, in the context of PROFILE." (graft? . #t) (substitutes? . #t) (build-hook? . #t) - (print-build-trace? . #t))) + (print-build-trace? . #t) + (print-extended-build-trace? . #t))) (define (show-help) (display (G_ "Usage: guix package [OPTION]... @@ -941,15 +943,12 @@ processed, #f otherwise." (or (process-query opts) (parameterize ((%store (open-connection)) (%graft? (assoc-ref opts 'graft?))) - (set-build-options-from-command-line (%store) opts) - - (parameterize ((%guile-for-build - (package-derivation - (%store) - (if (assoc-ref opts 'bootstrap?) - %bootstrap-guile - (canonical-package guile-2.2)))) - (current-build-output-port - (build-output-port #:verbose? verbose? - #:port (duplicate-port (current-error-port) "w")))) - (process-actions (%store) opts)))))) + (with-status-report print-build-event/quiet + (set-build-options-from-command-line (%store) opts) + (parameterize ((%guile-for-build + (package-derivation + (%store) + (if (assoc-ref opts 'bootstrap?) + %bootstrap-guile + (canonical-package guile-2.2))))) + (process-actions (%store) opts))))))) diff --git a/guix/scripts/perform-download.scm b/guix/scripts/perform-download.scm index 18e2fc92f2..9f6ecc00d2 100644 --- a/guix/scripts/perform-download.scm +++ b/guix/scripts/perform-download.scm @@ -48,6 +48,7 @@ OUTPUT. Note: Unless OUTPUT is #f, we don't read the value of 'out' in DRV since the actual output is different from that when we're doing a 'bmCheck' or 'bmRepair' build." + ;; TODO: Use 'trace-progress-proc' when possible. (derivation-let drv ((url "url") (output* "out") (executable "executable") diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 39aebb18e2..803f7cf142 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -20,6 +20,7 @@ (define-module (guix scripts pull) #:use-module (guix ui) #:use-module (guix utils) + #:use-module (guix status) #:use-module (guix scripts) #:use-module (guix store) #:use-module (guix config) @@ -61,6 +62,8 @@ `((system . ,(%current-system)) (substitutes? . #t) (build-hook? . #t) + (print-build-trace? . #t) + (print-extended-build-trace? . #t) (graft? . #t) (verbosity . 0))) @@ -447,36 +450,37 @@ Use '~/.config/guix/channels.scm' instead.")) #t) ;XXX: not very useful (else (with-store store - (parameterize ((%graft? (assoc-ref opts 'graft?)) - (%repository-cache-directory cache)) - (set-build-options-from-command-line store opts) - (honor-x509-certificates store) + (with-status-report print-build-event + (parameterize ((%graft? (assoc-ref opts 'graft?)) + (%repository-cache-directory cache)) + (set-build-options-from-command-line store opts) + (honor-x509-certificates store) - (let ((instances (latest-channel-instances store channels))) - (format (current-error-port) - (N_ "Building from this channel:~%" - "Building from these channels:~%" - (length instances))) - (for-each (lambda (instance) - (let ((channel - (channel-instance-channel instance))) - (format (current-error-port) - " ~10a~a\t~a~%" - (channel-name channel) - (channel-url channel) - (string-take - (channel-instance-commit instance) - 7)))) - instances) - (parameterize ((%guile-for-build - (package-derivation - store - (if (assoc-ref opts 'bootstrap?) - %bootstrap-guile - (canonical-package guile-2.2))))) - (run-with-store store - (build-and-install instances profile - #:verbose? - (assoc-ref opts 'verbose?))))))))))))) + (let ((instances (latest-channel-instances store channels))) + (format (current-error-port) + (N_ "Building from this channel:~%" + "Building from these channels:~%" + (length instances))) + (for-each (lambda (instance) + (let ((channel + (channel-instance-channel instance))) + (format (current-error-port) + " ~10a~a\t~a~%" + (channel-name channel) + (channel-url channel) + (string-take + (channel-instance-commit instance) + 7)))) + instances) + (parameterize ((%guile-for-build + (package-derivation + store + (if (assoc-ref opts 'bootstrap?) + %bootstrap-guile + (canonical-package guile-2.2))))) + (run-with-store store + (build-and-install instances profile + #:verbose? + (assoc-ref opts 'verbose?)))))))))))))) ;;; pull.scm ends here diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 50c6a22064..eb82224016 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -837,7 +837,16 @@ REPORTER, which should be a object." (make-custom-binary-input-port "progress-port-proc" read! #f #f (lambda () - (stop) + ;; XXX: Kludge! When used through + ;; 'decompressed-port', this port ends + ;; up being closed twice: once in a + ;; child process early on, and at the + ;; end in the parent process. Ignore + ;; the early close so we don't output + ;; a spurious "download-succeeded" + ;; trace. + (unless (zero? total) + (stop)) (close-port port))))))) (define-syntax with-networking @@ -930,7 +939,7 @@ authorized substitutes." (error "unknown `--query' command" wtf)))) (define* (process-substitution store-item destination - #:key cache-urls acl) + #:key cache-urls acl print-build-trace?) "Substitute STORE-ITEM (a store file name) from CACHE-URLS, and write it to DESTINATION as a nar file. Verify the substitute against ACL." (let* ((narinfo (lookup-narinfo cache-urls store-item @@ -943,8 +952,10 @@ DESTINATION as a nar file. Verify the substitute against ACL." ;; Tell the daemon what the expected hash of the Nar itself is. (format #t "~a~%" (narinfo-hash narinfo)) - (format (current-error-port) - (G_ "Downloading ~a...~%") (uri->string uri)) + (unless print-build-trace? + (format (current-error-port) + (G_ "Downloading ~a...~%") (uri->string uri))) + (let*-values (((raw download-size) ;; Note that Hydra currently generates Nars on the fly ;; and doesn't specify a Content-Length, so @@ -955,10 +966,15 @@ DESTINATION as a nar file. Verify the substitute against ACL." (dl-size (or download-size (and (equal? comp "none") (narinfo-size narinfo)))) - (reporter (progress-reporter/file - (uri->string uri) dl-size - (current-error-port) - #:abbreviation nar-uri-abbreviation))) + (reporter (if print-build-trace? + (progress-reporter/trace + destination + (uri->string uri) dl-size + (current-error-port)) + (progress-reporter/file + (uri->string uri) dl-size + (current-error-port) + #:abbreviation nar-uri-abbreviation)))) (progress-report-port reporter raw))) ((input pids) ;; NOTE: This 'progress' port of current process will be @@ -1058,6 +1074,13 @@ default value." (define (guix-substitute . args) "Implement the build daemon's substituter protocol." + (define print-build-trace? + (match (or (find-daemon-option "untrusted-print-extended-build-trace") + (find-daemon-option "print-extended-build-trace")) + (#f #f) + ((= string->number number) (> number 0)) + (_ #f))) + (mkdir-p %narinfo-cache-directory) (maybe-remove-expired-cache-entries %narinfo-cache-directory cached-narinfo-files @@ -1111,7 +1134,8 @@ default value." (parameterize ((current-terminal-columns (client-terminal-columns))) (process-substitution store-path destination #:cache-urls (substitute-urls) - #:acl (current-acl)))) + #:acl (current-acl) + #:print-build-trace? print-build-trace?))) ((or ("-V") ("--version")) (show-version-and-exit "guix substitute")) (("--help") diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 1e7620f147..f9d6b9e5b6 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -23,6 +23,7 @@ (define-module (guix scripts system) #:use-module (guix config) #:use-module (guix ui) + #:use-module (guix status) #:use-module (guix store) #:autoload (guix store database) (register-path) #:use-module (guix grafts) @@ -1079,6 +1080,8 @@ Some ACTIONS support additional ARGS.\n")) `((system . ,(%current-system)) (substitutes? . #t) (build-hook? . #t) + (print-build-trace? . #t) + (print-extended-build-trace? . #t) (graft? . #t) (verbosity . 0) (file-system-type . "ext4") @@ -1253,9 +1256,11 @@ argument list and OPTS is the option alist." parse-sub-command)) (args (option-arguments opts)) (command (assoc-ref opts 'action))) - (parameterize ((%graft? (assoc-ref opts 'graft?)) - (current-terminal-columns (terminal-columns))) - (process-command command args opts))))) + (parameterize ((%graft? (assoc-ref opts 'graft?))) + (with-status-report (if (memq command '(init reconfigure)) + print-build-event/quiet + print-build-event) + (process-command command args opts)))))) ;;; Local Variables: ;;; eval: (put 'call-with-service-upgrade-info 'scheme-indent-function 1) diff --git a/guix/status.scm b/guix/status.scm new file mode 100644 index 0000000000..94d4748af5 --- /dev/null +++ b/guix/status.scm @@ -0,0 +1,493 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017, 2018 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix status) + #:use-module (guix records) + #:use-module (guix i18n) + #:use-module ((guix ui) #:select (colorize-string)) + #:use-module (guix progress) + #:autoload (guix build syscalls) (terminal-columns) + #:use-module ((guix build download) + #:select (nar-uri-abbreviation)) + #:use-module ((guix store) + #:select (current-build-output-port + current-store-protocol-version + log-file)) + #:use-module (guix derivations) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-19) + #:use-module (srfi srfi-26) + #:use-module (ice-9 regex) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:use-module (ice-9 binary-ports) + #:use-module (rnrs bytevectors) + #:use-module ((system foreign) + #:select (bytevector->pointer pointer->bytevector)) + #:export (build-event-output-port + compute-status + + build-status + build-status? + build-status-building + build-status-downloading + build-status-builds-completed + build-status-downloads-completed + + download? + download + download-item + download-uri + download-size + download-start + download-end + download-transferred + + build-status-updater + print-build-event + print-build-event/quiet + print-build-status + + with-status-report)) + +;;; Commentary: +;;; +;;; This module provides facilities to track the status of ongoing builds and +;;; downloads in a given session, as well as tools to report about the current +;;; status to user interfaces. It does so by analyzing the output of +;;; 'current-build-output-port'. The build status is maintained in a +;;; record. +;;; +;;; Code: + + +;;; +;;; Build status tracking. +;;; + +;; Builds and substitutions performed by the daemon. +(define-record-type* build-status make-build-status + build-status? + (building build-status-building ;list of drv + (default '())) + (downloading build-status-downloading ;list of + (default '())) + (builds-completed build-status-builds-completed ;list of drv + (default '())) + (downloads-completed build-status-downloads-completed ;list of store items + (default '()))) + +;; On-going or completed downloads. Downloads can be stem from substitutes +;; and from "builtin:download" fixed-output derivations. +(define-record-type + (%download item uri size start end transferred) + download? + (item download-item) ;store item + (uri download-uri) ;string | #f + (size download-size) ;integer | #f + (start download-start) ;