From 13c8e747e86e39c0a8c6ec7da8c812d9bbcb682b Mon Sep 17 00:00:00 2001 From: Jack Hill Date: Wed, 12 Feb 2020 15:33:43 -0500 Subject: gnu: containerd: Fix test failure with Go 1.13. * gnu/packages/docker.scm (containerd)[source]: Add patch. * gnu/packages/patches/containerd-test-with-go1.13.patch: New file. * gnu/local.mk (dist_patch_DATA): Add patch. --- gnu/local.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 9a316f6edb..1f7cad9d32 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -794,6 +794,7 @@ dist_patch_DATA = \ %D%/packages/patches/coda-use-system-libs.patch \ %D%/packages/patches/combinatorial-blas-awpm.patch \ %D%/packages/patches/combinatorial-blas-io-fix.patch \ + %D%/packages/patches/containerd-test-with-go1.13.patch \ %D%/packages/patches/cpufrequtils-fix-aclocal.patch \ %D%/packages/patches/crawl-upgrade-saves.patch \ %D%/packages/patches/crda-optional-gcrypt.patch \ -- cgit v1.2.3 From f5255ed3d3689c793b87939d30df7e2e3443b004 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 17 Feb 2020 04:55:47 +0100 Subject: gnu: upx: Update to 3.96. * gnu/packages/compression.scm (upx): Update to 3.96. [source]: Remove patch. [arguments]: Remove CHECK_WHITESPACE work-around. [properties]: Remove obsolete hidden CVE. * gnu/packages/patches/upx-fix-CVE-2017-15056.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/compression.scm | 15 +--- gnu/packages/patches/upx-fix-CVE-2017-15056.patch | 96 ----------------------- 3 files changed, 3 insertions(+), 109 deletions(-) delete mode 100644 gnu/packages/patches/upx-fix-CVE-2017-15056.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 1f7cad9d32..f2289518e5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1465,7 +1465,6 @@ dist_patch_DATA = \ %D%/packages/patches/ustr-fix-build-with-gcc-5.patch \ %D%/packages/patches/util-linux-tests.patch \ %D%/packages/patches/upower-builddir.patch \ - %D%/packages/patches/upx-fix-CVE-2017-15056.patch \ %D%/packages/patches/valgrind-enable-arm.patch \ %D%/packages/patches/vboot-utils-fix-format-load-address.patch \ %D%/packages/patches/vboot-utils-fix-tests-show-contents.patch \ diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index a65e320a9b..3f4b99bfcf 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -1903,15 +1903,14 @@ decompression is a little bit slower.") (define-public upx (package (name "upx") - (version "3.94") + (version "3.96") (source (origin (method url-fetch) (uri (string-append "https://github.com/upx/upx/releases/download/v" version "/upx-" version "-src.tar.xz")) (sha256 (base32 - "08anybdliqsbsl6x835iwzljahnm9i7v26icdjkcv33xmk6p5vw1")) - (patches (search-patches "upx-fix-CVE-2017-15056.patch")))) + "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) @@ -1920,10 +1919,7 @@ decompression is a little bit slower.") ("zlib" ,zlib))) (arguments `(#:make-flags - (list "all" - ;; CHECK_WHITESPACE does not seem to work. - ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/upx. - "CHECK_WHITESPACE=true") + (list "all") #:phases (modify-phases %standard-phases (delete 'configure) @@ -1945,11 +1941,6 @@ decompression is a little bit slower.") #t)) ))) (home-page "https://upx.github.io/") - ;; CVE-2017-16869 is about Mach-O files which is not of a big concern for Guix. - ;; See https://github.com/upx/upx/issues/146 and - ;; https://nvd.nist.gov/vuln/detail?vulnId=CVE-2017-16869. - ;; The issue will be fixed after version 3.94. - (properties `((lint-hidden-cve . ("CVE-2017-16869")))) (synopsis "Compression tool for executables") (description "The Ultimate Packer for eXecutables (UPX) is an executable file diff --git a/gnu/packages/patches/upx-fix-CVE-2017-15056.patch b/gnu/packages/patches/upx-fix-CVE-2017-15056.patch deleted file mode 100644 index 525980e73e..0000000000 --- a/gnu/packages/patches/upx-fix-CVE-2017-15056.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 3e0c2966dffb5dadb512a476ef4be3d0cc51c2be Mon Sep 17 00:00:00 2001 -From: Pierre Neidhardt -Date: Sat, 16 Jun 2018 16:35:00 +0200 -Subject: [PATCH] Protect against bad crafted input - -Also check for wrap-around when checking oversize involving e_shoff and e_shnum. - -raised by https://github.com/upx/upx/pull/190 - modified: p_lx_elf.cpp ---- - src/p_lx_elf.cpp | 30 ++++++++++++++++++++++++++++++ - 1 file changed, 30 insertions(+) - -diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp -index 822a7652..41e805ee 100644 ---- a/src/p_lx_elf.cpp -+++ b/src/p_lx_elf.cpp -@@ -235,8 +235,17 @@ PackLinuxElf32::PackLinuxElf32help1(InputFile *f) - sz_phdrs = 0; - return; - } -+ if (0==e_phnum) throwCantUnpack("0==e_phnum"); - e_phoff = get_te32(&ehdri.e_phoff); -+ unsigned const last_Phdr = e_phoff + e_phnum * sizeof(Elf32_Phdr); -+ if (last_Phdr < e_phoff || (unsigned long)file_size < last_Phdr) { -+ throwCantUnpack("bad e_phoff"); -+ } - e_shoff = get_te32(&ehdri.e_shoff); -+ unsigned const last_Shdr = e_shoff + e_shnum * sizeof(Elf32_Shdr); -+ if (last_Shdr < e_shoff || (unsigned long)file_size < last_Shdr) { -+ throwCantUnpack("bad e_shoff"); -+ } - sz_phdrs = e_phnum * e_phentsize; - - if (f && Elf32_Ehdr::ET_DYN!=e_type) { -@@ -599,8 +608,17 @@ PackLinuxElf64::PackLinuxElf64help1(InputFile *f) - sz_phdrs = 0; - return; - } -+ if (0==e_phnum) throwCantUnpack("0==e_phnum"); - e_phoff = get_te64(&ehdri.e_phoff); -+ upx_uint64_t const last_Phdr = e_phoff + e_phnum * sizeof(Elf64_Phdr); -+ if (last_Phdr < e_phoff || (unsigned long)file_size < last_Phdr) { -+ throwCantUnpack("bad e_phoff"); -+ } - e_shoff = get_te64(&ehdri.e_shoff); -+ upx_uint64_t const last_Shdr = e_shoff + e_shnum * sizeof(Elf64_Shdr); -+ if (last_Shdr < e_shoff || (unsigned long)file_size < last_Shdr) { -+ throwCantUnpack("bad e_shoff"); -+ } - sz_phdrs = e_phnum * e_phentsize; - - if (f && Elf64_Ehdr::ET_DYN!=e_type) { -@@ -3763,6 +3781,9 @@ void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft) - - void PackLinuxElf64::unpack(OutputFile *fo) - { -+ if (e_phoff != sizeof(Elf64_Ehdr)) {// Phdrs not contiguous with Ehdr -+ throwCantUnpack("bad e_phoff"); -+ } - unsigned const c_phnum = get_te16(&ehdri.e_phnum); - upx_uint64_t old_data_off = 0; - upx_uint64_t old_data_len = 0; -@@ -3828,6 +3849,9 @@ void PackLinuxElf64::unpack(OutputFile *fo) - unsigned total_out = 0; - unsigned c_adler = upx_adler32(NULL, 0); - unsigned u_adler = upx_adler32(NULL, 0); -+ if ((MAX_ELF_HDR - sizeof(Elf64_Ehdr))/sizeof(Elf64_Phdr) < u_phnum) { -+ throwCantUnpack("bad compressed e_phnum"); -+ } - - // Packed ET_EXE has no PT_DYNAMIC. - // Packed ET_DYN has original PT_DYNAMIC for info needed by rtld. -@@ -4383,6 +4407,9 @@ Elf64_Sym const *PackLinuxElf64::elf_lookup(char const *name) const - - void PackLinuxElf32::unpack(OutputFile *fo) - { -+ if (e_phoff != sizeof(Elf32_Ehdr)) {// Phdrs not contiguous with Ehdr -+ throwCantUnpack("bad e_phoff"); -+ } - unsigned const c_phnum = get_te16(&ehdri.e_phnum); - unsigned old_data_off = 0; - unsigned old_data_len = 0; -@@ -4449,6 +4476,9 @@ void PackLinuxElf32::unpack(OutputFile *fo) - unsigned total_out = 0; - unsigned c_adler = upx_adler32(NULL, 0); - unsigned u_adler = upx_adler32(NULL, 0); -+ if ((MAX_ELF_HDR - sizeof(Elf32_Ehdr))/sizeof(Elf32_Phdr) < u_phnum) { -+ throwCantUnpack("bad compressed e_phnum"); -+ } - - // Packed ET_EXE has no PT_DYNAMIC. - // Packed ET_DYN has original PT_DYNAMIC for info needed by rtld. --- -2.17.0 - -- cgit v1.2.3 From c080beb9c7d0e6b3d1405dd72e32cf8ef40815d5 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sat, 22 Feb 2020 00:09:52 +0100 Subject: gnu: choqok: Update to 1.7.0. * gnu/packages/kde-internet.scm (choqok): Update to 1.7.0. (inputs): Add purpose, qtnetworkauth. (source): Don't apply patch. * gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch: Remove (no longer needed). --- gnu/local.mk | 1 - gnu/packages/kde-internet.scm | 7 +- .../choqok-Fix-building-under-Qt-5.13.patch | 89 ---------------------- 3 files changed, 4 insertions(+), 93 deletions(-) delete mode 100644 gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index f2289518e5..c26ea40a90 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -774,7 +774,6 @@ dist_patch_DATA = \ %D%/packages/patches/ceph-disable-cpu-optimizations.patch \ %D%/packages/patches/ceph-volume-respect-PATH.patch \ %D%/packages/patches/chmlib-inttypes.patch \ - %D%/packages/patches/choqok-Fix-building-under-Qt-5.13.patch \ %D%/packages/patches/clamav-config-llvm-libs.patch \ %D%/packages/patches/clamav-system-tomsfastmath.patch \ %D%/packages/patches/clang-3.5-libc-search-path.patch \ diff --git a/gnu/packages/kde-internet.scm b/gnu/packages/kde-internet.scm index 0d5b9788b8..12aa9fe53a 100644 --- a/gnu/packages/kde-internet.scm +++ b/gnu/packages/kde-internet.scm @@ -51,7 +51,7 @@ (define-public choqok (package (name "choqok") - (version "1.6.0") + (version "1.7.0") (source (origin (method url-fetch) @@ -59,8 +59,7 @@ (version-major+minor version) "/src/choqok-" version ".tar.xz")) (sha256 - (base32 "03ri4y1wzyqlixnhczsls5gmy7jzzm67bb5gz8bav51ngc32fxca")) - (patches (search-patches "choqok-Fix-building-under-Qt-5.13.patch")))) + (base32 "0zm4nkpmvd181xlkis7ydzx54p3vn0zgpdzgh54f1hsjy6ahsq16")))) (build-system qt-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) @@ -86,9 +85,11 @@ ("kxmlgui" ,kxmlgui) ;; TODO: telepathy ("oxygen-icons" ,oxygen-icons) ; default icon set + ("purpose" ,purpose) ("qca" ,qca) ("qoauth" ,qoauth) ("qtbase" ,qtbase) + ("qtnetworkauth" ,qtnetworkauth) ("qtwebkit" ,qtwebkit) ("sonnet" ,sonnet))) (home-page "https://kde.org/applications/internet/org.kde.choqok") diff --git a/gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch b/gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch deleted file mode 100644 index 4250106a19..0000000000 --- a/gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch +++ /dev/null @@ -1,89 +0,0 @@ -Add QMap include to fix building under Qt 5.13 - -This combines several patches which all add the same missing include: -- e13ab06f65a4e8b6259bccda1401abb9c1c9fdca -- 546ede9ef712bb1b156a55ce30df81c3203dde61 -- 08fb06b63a78888e6703de6ac1a4fd6a0e2791eb -- bef6784596bf0b41287ebad81f138e1c8c2a6be2 - -Include is no longer added transitively. ---- - ---- a/plugins/betternotify/notify.h -+++ b/plugins/betternotify/notify.h -@@ -23,6 +23,7 @@ - #ifndef NOTIFY_H - #define NOTIFY_H - -+#include - #include - #include - #include ---- a/plugins/untiny/untiny.h -+++ b/plugins/untiny/untiny.h -@@ -27,6 +27,7 @@ - - #include "plugin.h" - -+#include - #include - #include - #include ---- a/plugins/uploaders/flickr/flickr.h -+++ b/plugins/uploaders/flickr/flickr.h -@@ -26,6 +26,8 @@ - - #include "uploader.h" - -+#include -+ - /** - @author Andrey Esin \ - */ -diff --git a/plugins/uploaders/imageshack/imageshack.h b/plugins/uploaders/imageshack/imageshack.h -index d9ddc88..63d0e3f 100644 ---- a/plugins/uploaders/imageshack/imageshack.h -+++ b/plugins/uploaders/imageshack/imageshack.h -@@ -26,6 +26,8 @@ - - #include "uploader.h" - -+#include -+ - /** - @author Mehrdad Momeny \ - */ ---- a/plugins/uploaders/mobypicture/mobypicture.h -+++ b/plugins/uploaders/mobypicture/mobypicture.h -@@ -26,6 +26,8 @@ - - #include "uploader.h" - -+#include -+ - class KJob; - - class Mobypicture : public Choqok::Uploader ---- a/plugins/uploaders/posterous/posterous.h -+++ b/plugins/uploaders/posterous/posterous.h -@@ -26,6 +26,8 @@ - - #include "uploader.h" - -+#include -+ - class KJob; - - class Posterous : public Choqok::Uploader ---- a/plugins/uploaders/twitgoo/twitgoo.h -+++ b/plugins/uploaders/twitgoo/twitgoo.h -@@ -26,6 +26,8 @@ - - #include "uploader.h" - -+#include -+ - class KJob; - - class Twitgoo : public Choqok::Uploader --- -- cgit v1.2.3 From f267420707142dc17f8e9f976f98447697823c85 Mon Sep 17 00:00:00 2001 From: raingloom Date: Wed, 19 Feb 2020 14:36:26 +0100 Subject: gnu: desmume: fix build on new GCC versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/emulation.scm (desmume): add patches * gnu/packages/patches/desmume-gcc6-fixes.patch: new file * gnu/packages/patches/desmume-gcc7-fixes.patch: new file * gnu/local.mk (dist_patch_DATA): register the above Note: desmume-gcc6-fixes.patch contains some CRLF line endings. Signed-off-by: Jakub Kądziołka --- gnu/local.mk | 2 + gnu/packages/emulators.scm | 4 +- gnu/packages/patches/desmume-gcc6-fixes.patch | 59 +++++++++++++++++++++++++++ gnu/packages/patches/desmume-gcc7-fixes.patch | 18 ++++++++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/desmume-gcc6-fixes.patch create mode 100644 gnu/packages/patches/desmume-gcc7-fixes.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index c26ea40a90..94b07c93b2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -809,6 +809,8 @@ dist_patch_DATA = \ %D%/packages/patches/debops-constants-for-external-program-names.patch \ %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ %D%/packages/patches/deja-dup-use-ref-keyword-for-iter.patch \ + %D%/packages/patches/desmume-gcc6-fixes.patch \ + %D%/packages/patches/desmume-gcc7-fixes.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ %D%/packages/patches/diffutils-gets-undeclared.patch \ %D%/packages/patches/dkimproxy-add-ipv6-support.patch \ diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index 92e50d1484..5e1ab6cb3f 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -102,7 +102,9 @@ version "/desmume-" version ".tar.gz")) (sha256 (base32 - "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs")))) + "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs")) + (patches (search-patches "desmume-gcc6-fixes.patch" + "desmume-gcc7-fixes.patch")))) (build-system gnu-build-system) (arguments ;; Enable support for WiFi and microphone. diff --git a/gnu/packages/patches/desmume-gcc6-fixes.patch b/gnu/packages/patches/desmume-gcc6-fixes.patch new file mode 100644 index 0000000000..6eb9576f64 --- /dev/null +++ b/gnu/packages/patches/desmume-gcc6-fixes.patch @@ -0,0 +1,59 @@ +From: zeromus +Origin: upstream, https://sourceforge.net/p/desmume/code/5514, https://sourceforge.net/p/desmume/code/5517, https://sourceforge.net/p/desmume/code/5430 +Subject: fix GCC6 issues +Bug: https://sourceforge.net/p/desmume/bugs/1570/ +Bug-Debian: http://bugs.debian.org/811691 + +Index: desmume/src/MMU_timing.h +=================================================================== +--- desmume/src/MMU_timing.h (revision 5513) ++++ desmume/src/MMU_timing.h (revision 5517) +@@ -155,8 +155,8 @@ + enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT }; + enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT }; + enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT }; +- enum { TAGMASK = (u32)(~0 << TAGSHIFT) }; +- enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) }; ++ enum { TAGMASK = (u32)(~0U << TAGSHIFT) }; ++ enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) }; + enum { WORDSIZE = sizeof(u32) }; + enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE }; + enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY }; +Index: desmume/src/ctrlssdl.cpp +=================================================================== +--- desmume/src/ctrlssdl.cpp (revision 5513) ++++ desmume/src/ctrlssdl.cpp (revision 5517) +@@ -200,7 +200,7 @@ + break; + case SDL_JOYAXISMOTION: + /* Dead zone of 50% */ +- if( (abs(event.jaxis.value) >> 14) != 0 ) ++ if( ((u32)abs(event.jaxis.value) >> 14) != 0 ) + { + key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1); + if (event.jaxis.value > 0) { +@@ -370,7 +370,7 @@ + Note: button constants have a 1bit offset. */ + case SDL_JOYAXISMOTION: + key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1); +- if( (abs(event->jaxis.value) >> 14) != 0 ) ++ if( ((u32)abs(event->jaxis.value) >> 14) != 0 ) + { + if (event->jaxis.value > 0) + key_code |= 1; +Index: desmume/src/wifi.cpp +=================================================================== +--- desmume/src/wifi.cpp (revision 5429) ++++ desmume/src/wifi.cpp (revision 5430) +@@ -320,9 +320,9 @@ + + #if (WIFI_LOGGING_LEVEL >= 1) + #if WIFI_LOG_USE_LOGC +- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: "__VA_ARGS__); ++ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: " __VA_ARGS__); + #else +- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: "__VA_ARGS__); ++ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: " __VA_ARGS__); + #endif + #else + #define WIFI_LOG(level, ...) {} diff --git a/gnu/packages/patches/desmume-gcc7-fixes.patch b/gnu/packages/patches/desmume-gcc7-fixes.patch new file mode 100644 index 0000000000..a4934ff6e6 --- /dev/null +++ b/gnu/packages/patches/desmume-gcc7-fixes.patch @@ -0,0 +1,18 @@ +From e1f7039f1b06add4fb75b2f8774000b8f05574af Mon Sep 17 00:00:00 2001 +From: rogerman +Date: Mon, 17 Aug 2015 21:15:04 +0000 +Subject: Fix bug with libfat string handling. + +diff --git a/src/utils/libfat/directory.cpp b/src/utils/libfat/directory.cpp +index 765d7ae5..b6d7f01f 100644 +--- a/src/utils/libfat/directory.cpp ++++ b/src/utils/libfat/directory.cpp +@@ -139,7 +139,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const char* src, size_t len + int bytes; + size_t count = 0; + +- while (count < len-1 && src != '\0') { ++ while (count < len-1 && *src != '\0') { + bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps); + if (bytes > 0) { + *dst = (ucs2_t)tempChar; -- cgit v1.2.3 From 233deb82f3b1c9b66b33b709426ab76bd274bb75 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 21 Feb 2020 17:07:39 +0100 Subject: gnu: clang@9: Fix search path handling. * gnu/packages/patches/clang-9.0-libc-search-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/llvm.scm (clang-9): Add #:patches. --- gnu/local.mk | 1 + gnu/packages/llvm.scm | 5 +- .../patches/clang-9.0-libc-search-path.patch | 83 ++++++++++++++++++++++ 3 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/clang-9.0-libc-search-path.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 94b07c93b2..412bcb0dd4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -781,6 +781,7 @@ dist_patch_DATA = \ %D%/packages/patches/clang-3.8-libc-search-path.patch \ %D%/packages/patches/clang-6.0-libc-search-path.patch \ %D%/packages/patches/clang-7.0-libc-search-path.patch \ + %D%/packages/patches/clang-9.0-libc-search-path.patch \ %D%/packages/patches/clang-runtime-asan-build-fixes.patch \ %D%/packages/patches/clang-runtime-esan-build-fixes.patch \ %D%/packages/patches/classpath-aarch64-support.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index a6f779e7f8..e7b196be86 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2016 Dennis Mungai ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus ;;; Copyright © 2017 Roel Janssen -;;; Copyright © 2018, 2019 Marius Bakke +;;; Copyright © 2018, 2019, 2020 Marius Bakke ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2018 Tim Gesthuizen @@ -479,7 +479,8 @@ with that of libgomp, the GNU Offloading and Multi Processing Library.") (define-public clang-9 (clang-from-llvm llvm-9 clang-runtime-9 - "0426ma80i41qsgzm1qdz81mjskck426diygxi2k5vji2gkpixa3v")) + "0426ma80i41qsgzm1qdz81mjskck426diygxi2k5vji2gkpixa3v" + #:patches '("clang-9.0-libc-search-path.patch"))) (define-public clang-toolchain-9 (make-clang-toolchain clang-9)) diff --git a/gnu/packages/patches/clang-9.0-libc-search-path.patch b/gnu/packages/patches/clang-9.0-libc-search-path.patch new file mode 100644 index 0000000000..be34344842 --- /dev/null +++ b/gnu/packages/patches/clang-9.0-libc-search-path.patch @@ -0,0 +1,83 @@ +Clang attempts to guess file names based on the OS and distro (yes!), +but unfortunately, that doesn't work for us. + +This patch makes it easy to insert libc's $libdir so that Clang passes the +correct absolute file name of crt1.o etc. to 'ld'. It also disables all +the distro-specific stuff and removes the hard-coded FHS directory names +to make sure Clang also works on non-GuixSD systems. + +diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp +--- a/lib/Driver/ToolChains/Linux.cpp ++++ b/lib/Driver/ToolChains/Linux.cpp +@@ -240,6 +240,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + .str()); + } + ++// Comment out the distro-specific tweaks so that they don't bite when ++// using Guix on a foreign distro. ++#if 0 + Distro Distro(D.getVFS()); + + if (Distro.IsAlpineLinux() || Triple.isAndroid()) { +@@ -306,6 +309,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + + if (IsAndroid || Distro.IsOpenSUSE()) + ExtraOpts.push_back("--enable-new-dtags"); ++#endif + + // The selection of paths to try here is designed to match the patterns which + // the GCC driver itself uses, as this is part of the GCC-compatible driver. +@@ -363,7 +367,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + // the cross. Note that GCC does include some of these directories in some + // configurations but this seems somewhere between questionable and simply + // a bug. +- if (StringRef(LibPath).startswith(SysRoot)) { ++ if (0) { + addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths); + addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths); + } +@@ -382,6 +386,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths); + addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths); + ++// This requires the commented distro tweaks above. ++#if 0 + if (IsAndroid) { + // Android sysroots contain a library directory for each supported OS + // version as well as some unversioned libraries in the usual multiarch +@@ -410,10 +416,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths); + addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths); + } ++#endif + + // Try walking via the GCC triple path in case of biarch or multiarch GCC + // installations with strange symlinks. + if (GCCInstallation.isValid()) { ++ ++// The following code would end up adding things like ++// "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path. ++#if 0 + addPathIfExists(D, + SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() + + "/../../" + OSLibDir, +@@ -426,6 +437,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + BiarchSibling.gccSuffix(), + Paths); + } ++#endif + + // See comments above on the multilib variant for details of why this is + // included even from outside the sysroot. +@@ -450,8 +462,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + if (StringRef(D.Dir).startswith(SysRoot)) + addPathIfExists(D, D.Dir + "/../lib", Paths); + +- addPathIfExists(D, SysRoot + "/lib", Paths); +- addPathIfExists(D, SysRoot + "/usr/lib", Paths); ++ // Add libc's lib/ directory to the search path, so that crt1.o, crti.o, ++ // and friends can be found. ++ addPathIfExists(D, "@GLIBC_LIBDIR@", Paths); + } + + ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const { -- cgit v1.2.3 From e2546bb472b6285a8856cacf686c5e0ce9bb62c5 Mon Sep 17 00:00:00 2001 From: John Soo Date: Fri, 21 Feb 2020 21:13:47 -0800 Subject: gnu: qtbase: Add variant that fixes file name handling in CMake macros. * gnu/packages/patches/qtbase-QTBUG-81715.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/qt.scm (qtbase-patched): New public variable. Signed-off-by: Marius Bakke --- gnu/local.mk | 1 + gnu/packages/patches/qtbase-QTBUG-81715.patch | 40 +++++++++++++++++++++++++++ gnu/packages/qt.scm | 13 +++++++++ 3 files changed, 54 insertions(+) create mode 100644 gnu/packages/patches/qtbase-QTBUG-81715.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 412bcb0dd4..b85c289c4e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1355,6 +1355,7 @@ dist_patch_DATA = \ %D%/packages/patches/qrcodegen-cpp-make-install.patch \ %D%/packages/patches/qt4-ldflags.patch \ %D%/packages/patches/qtbase-use-TZDIR.patch \ + %D%/packages/patches/qtbase-QTBUG-81715.patch \ %D%/packages/patches/qtscript-disable-tests.patch \ %D%/packages/patches/quagga-reproducible-build.patch \ %D%/packages/patches/quickswitch-fix-dmenu-check.patch \ diff --git a/gnu/packages/patches/qtbase-QTBUG-81715.patch b/gnu/packages/patches/qtbase-QTBUG-81715.patch new file mode 100644 index 0000000000..70b83b97d2 --- /dev/null +++ b/gnu/packages/patches/qtbase-QTBUG-81715.patch @@ -0,0 +1,40 @@ +From 8a3fde00bf53d99e9e4853e8ab97b0e1bcf74915 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Wed, 29 Jan 2020 11:06:35 +0100 +Subject: [PATCH] Fix qt5_make_output_file macro for paths containing dots + +Commit 89bd5a7e broke CMake projects that use dots in their build +paths, because the used regular expression matches the directory part +of the path as well. + +The regex wants to achieve the same as get_filename_component(... +NAME_WLE) which is available since CMake 3.14. Re-implement the +NAME_WLE functionality for older CMake versions by using multiple +get_filename_component calls. + +Fixes: QTBUG-81715 +Task-number: QTBUG-80295 +Change-Id: I2ef053300948f6e1b2c0c5eafac35105f193d4e6 +Reviewed-by: Alexandru Croitor +--- + +diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake +index 7735e51..b3da640 100644 +--- a/src/corelib/Qt5CoreMacros.cmake ++++ b/src/corelib/Qt5CoreMacros.cmake +@@ -59,7 +59,14 @@ + set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") + string(REPLACE ".." "__" _outfile ${_outfile}) + get_filename_component(outpath ${_outfile} PATH) +- string(REGEX REPLACE "\\.[^.]*$" "" _outfile ${_outfile}) ++ if(CMAKE_VERSION VERSION_LESS "3.14") ++ get_filename_component(_outfile_ext ${_outfile} EXT) ++ get_filename_component(_outfile_ext ${_outfile_ext} NAME_WE) ++ get_filename_component(_outfile ${_outfile} NAME_WE) ++ string(APPEND _outfile ${_outfile_ext}) ++ else() ++ get_filename_component(_outfile ${_outfile} NAME_WLE) ++ endif() + file(MAKE_DIRECTORY ${outpath}) + set(${outfile} ${outpath}/${prefix}${_outfile}.${ext}) + endmacro() diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 466c6ba358..7aa9d0f0f9 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -598,6 +598,19 @@ developers using C++ or QML, a CSS & JavaScript like language.") developers using C++ or QML, a CSS & JavaScript like language.") (license (list license:lgpl2.1 license:lgpl3)))) +;; This variant fixes a problem with the CMake macros shipped by qtbase. See +;; discussion at . +(define-public qtbase-patched + (let ((src (package-source qtbase))) + (hidden-package + (package + (inherit qtbase) + (source + (origin + (inherit src) + (patches + (append (search-patches "qtbase-QTBUG-81715.patch") + (origin-patches src))))))))) ;; qt used to refer to the monolithic Qt 5.x package (define-deprecated qt qtbase) -- cgit v1.2.3 From 25590118ad1a9e93b9f438c668bf1de020fd36d2 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 24 Feb 2020 22:46:03 +0100 Subject: gnu: Add ld wrapper variant that supports quotes in response files. * gnu/packages/ld-wrapper-next.in: New file. * gnu/local.mk (MISC_DISTRO_FILES): Adjust accordingly. * gnu/packages/chromium.scm (ld-wrapper-next): New variable. --- gnu/local.mk | 3 +- gnu/packages/chromium.scm | 15 +- gnu/packages/ld-wrapper-next.in | 305 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 321 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/ld-wrapper-next.in (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index b85c289c4e..857345cfad 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1515,4 +1515,5 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-tighten-default-umask.patch MISC_DISTRO_FILES = \ - %D%/packages/ld-wrapper.in + %D%/packages/ld-wrapper.in \ + %D%/packages/ld-wrapper-next.in diff --git a/gnu/packages/chromium.scm b/gnu/packages/chromium.scm index 49ad8de84c..06e259b985 100644 --- a/gnu/packages/chromium.scm +++ b/gnu/packages/chromium.scm @@ -70,7 +70,8 @@ #:use-module (gnu packages xml) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) - #:use-module (ice-9 match)) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1)) (define %preserved-third-party-files '("base/third_party/cityhash" ;Expat @@ -423,6 +424,18 @@ from forcing GEXP-PROMISE." `(cons "--enable-custom-modes" ,flags)))))) +;; Add a custom ld wrapper that supports quoted strings in response files. +;; To be merged with 'ld-wrapper' in a future rebuild cycle. +(define-public ld-wrapper-next + (let ((orig (car (assoc-ref (%final-inputs) "ld-wrapper")))) + (package + (inherit orig) + (name "ld-wrapper-next") + (inputs + `(("wrapper" ,(search-path %load-path + "gnu/packages/ld-wrapper-next.in")) + ,@(alist-delete "wrapper" (package-inputs orig))))))) + (define-public ungoogled-chromium (package (name "ungoogled-chromium") diff --git a/gnu/packages/ld-wrapper-next.in b/gnu/packages/ld-wrapper-next.in new file mode 100644 index 0000000000..5d5756f6a3 --- /dev/null +++ b/gnu/packages/ld-wrapper-next.in @@ -0,0 +1,305 @@ +#!@BASH@ +# -*- mode: scheme; coding: utf-8; -*- + +# XXX: We have to go through Bash because there's no command-line switch to +# augment %load-compiled-path, and because of the silly 127-byte limit for +# the shebang line in Linux. +# Use `load-compiled' because `load' (and `-l') doesn't otherwise load our +# .go file (see ). +# Unset 'GUILE_LOAD_COMPILED_PATH' to make sure we do not stumble upon +# incompatible .go files. See +# . + +unset GUILE_LOAD_COMPILED_PATH +main="(@ (gnu build-support ld-wrapper) ld-wrapper)" +exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@" +!# +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2020 Marius Bakke +;;; +;;; 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 (gnu build-support ld-wrapper) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:autoload (ice-9 rdelim) (read-delimited) + #:export (ld-wrapper)) + +;;; Commentary: +;;; +;;; This is a wrapper for the linker. Its purpose is to inspect the -L and +;;; -l switches passed to the linker, add corresponding -rpath arguments, and +;;; invoke the actual linker with this new set of arguments. +;;; +;;; The alternatives to this hack would be: +;;; +;;; 1. Using $LD_RUN_PATH. However, that would tend to include more than +;;; needed in the RPATH; for instance, given a package with `libfoo' as +;;; an input, all its binaries would have libfoo in their RPATH, +;;; regardless of whether they actually NEED it. +;;; +;;; 2. Use a GCC "lib" spec string such as `%{L*:-rpath %*}', which adds a +;;; `-rpath LIBDIR' argument for each occurrence of `-L LIBDIR'. +;;; However, this doesn't work when $LIBRARY_PATH is used, because the +;;; additional `-L' switches are not matched by the above rule, because +;;; the rule only matches explicit user-provided switches. See +;;; for details. +;;; +;;; As a bonus, this wrapper checks for "impurities"--i.e., references to +;;; libraries outside the store. +;;; +;;; Code: + +(define %real-ld + ;; Name of the linker that we wrap. + "@LD@") + +(define %store-directory + ;; File name of the store. + (or (getenv "NIX_STORE") "/gnu/store")) + +(define %temporary-directory + ;; Temporary directory. + (or (getenv "TMPDIR") "/tmp")) + +(define %build-directory + ;; Top build directory when run from a builder. + (getenv "NIX_BUILD_TOP")) + +(define %allow-impurities? + ;; Whether to allow references to libraries outside the store. + ;; Allow them by default for convenience. + (let ((value (getenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES"))) + (or (not value) + (let ((value (string-downcase value))) + (cond ((member value '("yes" "y" "t" "true" "1")) + #t) + ((member value '("no" "n" "f" "false" "0")) + #f) + (else + (format (current-error-port) + "ld-wrapper: ~s: invalid value for \ +'GUIX_LD_WRAPPER_ALLOW_IMPURITIES'~%" + value))))))) + +(define %debug? + ;; Whether to emit debugging output. + (getenv "GUIX_LD_WRAPPER_DEBUG")) + +(define %disable-rpath? + ;; Whether to disable automatic '-rpath' addition. + (getenv "GUIX_LD_WRAPPER_DISABLE_RPATH")) + +(define (readlink* file) + ;; Call 'readlink' until the result is not a symlink. + (define %max-symlink-depth 50) + + (let loop ((file file) + (depth 0)) + (define (absolute target) + (if (absolute-file-name? target) + target + (string-append (dirname file) "/" target))) + + (if (>= depth %max-symlink-depth) + file + (call-with-values + (lambda () + (catch 'system-error + (lambda () + (values #t (readlink file))) + (lambda args + (let ((errno (system-error-errno args))) + (if (or (= errno EINVAL) (= errno ENOENT)) + (values #f file) + (apply throw args)))))) + (lambda (success? target) + (if success? + (loop (absolute target) (+ depth 1)) + file)))))) + +(define (pure-file-name? file) + ;; Return #t when FILE is the name of a file either within the store + ;; (possibly via a symlink) or within the build directory. + (let ((file (readlink* file))) + (or (not (string-prefix? "/" file)) + (string-prefix? %store-directory file) + (string-prefix? %temporary-directory file) + (and %build-directory + (string-prefix? %build-directory file))))) + +(define (store-file-name? file) + ;; Return #t when FILE is a store file, possibly indirectly. + (string-prefix? %store-directory (readlink* file))) + +(define (shared-library? file) + ;; Return #t when FILE denotes a shared library. + (or (string-suffix? ".so" file) + (let ((index (string-contains file ".so."))) + ;; Since we cannot use regexps during bootstrap, roll our own. + (and index + (string-every (char-set-union (char-set #\.) char-set:digit) + (string-drop file (+ index 3))))))) + +(define (library-search-path args) + ;; Return the library search path as a list of directory names. The GNU ld + ;; manual notes that "[a]ll `-L' options apply to all `-l' options, + ;; regardless of the order in which the options appear", so we must compute + ;; the search path independently of the -l options. + (let loop ((args args) + (path '())) + (match args + (() + (reverse path)) + (("-L" directory . rest) + (loop rest (cons directory path))) + ((argument . rest) + (if (string-prefix? "-L" argument) ;augment the search path + (loop rest + (cons (string-drop argument 2) path)) + (loop rest path)))))) + +(define (library-files-linked args library-path) + ;; Return the absolute file names of shared libraries explicitly linked + ;; against via `-l' or with an absolute file name in ARGS, looking them up + ;; in LIBRARY-PATH. + (define files+args + (fold (lambda (argument result) + (match result + ((library-files ((and flag + (or "-dynamic-linker" "-plugin")) + . rest)) + ;; When passed '-dynamic-linker ld.so', ignore 'ld.so'; when + ;; passed '-plugin liblto_plugin.so', ignore + ;; 'liblto_plugin.so'. See . + (list library-files + (cons* argument flag rest))) + ((library-files previous-args) + (cond ((string-prefix? "-l" argument) ;add library + (let* ((lib (string-append "lib" + (string-drop argument 2) + ".so")) + (full (search-path library-path lib))) + (list (if full + (cons full library-files) + library-files) + (cons argument previous-args)))) + ((and (string-prefix? %store-directory argument) + (shared-library? argument)) ;add library + (list (cons argument library-files) + (cons argument previous-args))) + (else + (list library-files + (cons argument previous-args))))))) + (list '() '()) + args)) + + (match files+args + ((files arguments) + (reverse files)))) + +(define (rpath-arguments library-files) + ;; Return the `-rpath' argument list for each of LIBRARY-FILES, a list of + ;; absolute file names. + (fold-right (lambda (file args) + ;; Add '-rpath' if and only if FILE is in the store; we don't + ;; want to add '-rpath' for files under %BUILD-DIRECTORY or + ;; %TEMPORARY-DIRECTORY because that could leak to installed + ;; files. + (cond ((and (not %disable-rpath?) + (store-file-name? file)) + (cons* "-rpath" (dirname file) args)) + ((or %allow-impurities? + (pure-file-name? file)) + args) + (else + (begin + (format (current-error-port) + "ld-wrapper: error: attempt to use \ +library outside of ~a: ~s~%" + %store-directory file) + (exit 1))))) + '() + library-files)) + +(define (expand-arguments args) + ;; Expand ARGS such that "response file" arguments, such as "@args.txt", are + ;; expanded (info "(gcc) Overall Options"). + (define (response-file-arguments file) + (define (tokenize port) + ;; Return a list of all strings found in PORT. Quote characters are removed, + ;; but whitespaces within quoted strings are preserved. + (let loop ((words '())) + (let* ((word (read-delimited " '\"" port 'split)) + (token (car word)) + (delim (cdr word))) + (if (eof-object? delim) + (reverse words) + (case delim + ((#\") (loop (cons (read-delimited "\"" port) words))) + ((#\') (loop (cons (read-delimited "'" port) words))) + ((#\ ) (if (> 0 (string-length token)) + (loop (cons token words)) + (loop words))) + (else (loop words))))))) + + (when %debug? + (format (current-error-port) + "ld-wrapper: attempting to read arguments from '~a'~%" file)) + + (call-with-input-file file tokenize)) + + (define result + (fold-right (lambda (arg result) + (if (string-prefix? "@" arg) + (let ((file (string-drop arg 1))) + (append (catch 'system-error + (lambda () + (response-file-arguments file)) + (lambda args + ;; FILE doesn't exist or cannot be read so + ;; leave ARG as is. + (list arg))) + result)) + (cons arg result))) + '() + args)) + + ;; If there are "@" arguments in RESULT *and* we can expand them (they don't + ;; refer to nonexistent files), then recurse. + (if (equal? result args) + result + (expand-arguments result))) + +(define (ld-wrapper . args) + ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches. + (let* ((args (expand-arguments args)) + (path (library-search-path args)) + (libs (library-files-linked args path)) + (args (append args (rpath-arguments libs)))) + (when %debug? + (format (current-error-port) + "ld-wrapper: library search path: ~s~%" path) + (format (current-error-port) + "ld-wrapper: libraries linked: ~s~%" libs) + (format (current-error-port) + "ld-wrapper: invoking `~a' with ~s~%" + %real-ld args) + (force-output (current-error-port))) + (apply execl %real-ld (basename %real-ld) args))) + +;;; ld-wrapper.scm ends here -- cgit v1.2.3 From 15a6805751309452616999933492f1fb9da8bcec Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 2 Mar 2020 23:38:04 +0100 Subject: gnu: Add system test for CUPS. * gnu/tests/cups.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Adjust accordingly. --- gnu/local.mk | 1 + gnu/tests/cups.scm | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 gnu/tests/cups.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 857345cfad..359ed4bbbc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -622,6 +622,7 @@ GNU_SYSTEM_MODULES = \ %D%/tests.scm \ %D%/tests/audio.scm \ %D%/tests/base.scm \ + %D%/tests/cups.scm \ %D%/tests/databases.scm \ %D%/tests/desktop.scm \ %D%/tests/dict.scm \ diff --git a/gnu/tests/cups.scm b/gnu/tests/cups.scm new file mode 100644 index 0000000000..4e922e5023 --- /dev/null +++ b/gnu/tests/cups.scm @@ -0,0 +1,119 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Marius Bakke +;;; +;;; 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 (gnu tests cups) + #:use-module (gnu tests) + #:use-module (gnu system) + #:use-module (gnu system vm) + #:use-module (gnu services) + #:use-module (gnu services cups) + #:use-module (gnu services networking) + #:use-module (guix gexp) + #:use-module (guix store) + #:use-module (guix monads) + #:export (%test-cups)) + +;;; +;;; Test the Common Unix Printing System. +;;; + +(define* (run-cups-test os-configuration #:optional (cups-port 631)) + (define os + (marionette-operating-system os-configuration + #:imported-modules '((gnu services herd)))) + + (define forwarded-port 8080) + + (define vm + (virtual-machine + (operating-system os) + (port-forwardings `((,forwarded-port . ,cups-port))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (gnu build marionette) + (srfi srfi-11) (srfi srfi-64) + (web client) (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "cups") + + ;; Wait for the web interface to become ready. + (wait-for-tcp-port #$cups-port marionette) + + (test-equal "http-get default page" + 200 + (let-values + (((response text) + (http-get #$(simple-format + #f "http://localhost:~A/" forwarded-port) + #:decode-body? #t))) + (response-code response))) + + (test-equal "http-get admin page" + 200 + (let-values + (((response text) + (http-get #$(simple-format + #f "http://localhost:~A/admin" forwarded-port) + #:decode-body? #t))) + (response-code response))) + + (test-end) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "cups-test" test)) + +(define %cups-os + (simple-operating-system + (service dhcp-client-service-type) + (service cups-service-type + (cups-configuration + (web-interface? #t) + ;; Listen on all interfaces instead of just localhost so we + ;; can access the web interface "remotely". + (listen '("*:631" "/var/run/cups/cups.sock")) + ;; Add access controls for the Qemu-managed network. + (location-access-controls + (list (location-access-control + (path "/") + (access-controls '("Order allow,deny" + "Allow from 10.0.0.0/8"))) + (location-access-control + (path "/admin") + (access-controls '("Order allow,deny" + "Allow from 10.0.0.0/8"))) + (location-access-control + (path "/admin/conf") + (access-controls '("Order allow,deny" + "AuthType Basic" + "Require user @SYSTEM" + "Allow localhost"))))))))) + +(define %test-cups + (system-test + (name "cups") + (description "Test the CUPS print server") + (value (run-cups-test %cups-os)))) + -- cgit v1.2.3 From 790b66e34fd81cdda246361303072065e6339c97 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 4 Mar 2020 10:15:06 +0200 Subject: gnu: zziplib: Fix CVE-2018-16548. * gnu/packages/compression.scm (zziplib)[replacement]: New field. (zziplib/fixed): New private variable. * gnu/packages/patches/zziplib-CVE-2018-16548.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 3 +- gnu/packages/compression.scm | 8 ++++ gnu/packages/patches/zziplib-CVE-2018-16548.patch | 49 +++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/zziplib-CVE-2018-16548.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 359ed4bbbc..cbb7d2b2f0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1513,7 +1513,8 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-fix-pdf-floats.patch \ %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \ %D%/packages/patches/xsane-support-ipv6.patch \ - %D%/packages/patches/xsane-tighten-default-umask.patch + %D%/packages/patches/xsane-tighten-default-umask.patch \ + %D%/packages/patches/zziplib-CVE-2018-16548.patch MISC_DISTRO_FILES = \ %D%/packages/ld-wrapper.in \ diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index ee10bd03ce..6463b50735 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -1584,6 +1584,7 @@ recreates the stored directory structure by default.") (package (name "zziplib") (version "0.13.69") + (replacement zziplib/fixed) (home-page "https://github.com/gdraheim/zziplib") (source (origin (method git-fetch) @@ -1621,6 +1622,13 @@ recreates the stored directory structure by default.") ;; files carry the Zlib license; see "docs/copying.html" for details. (license (list license:lgpl2.0+ license:mpl1.1)))) +(define zziplib/fixed + (package + (inherit zziplib) + (source (origin + (inherit (package-source zziplib)) + (patches (search-patches "zziplib-CVE-2018-16548.patch")))))) + (define-public libzip (package (name "libzip") diff --git a/gnu/packages/patches/zziplib-CVE-2018-16548.patch b/gnu/packages/patches/zziplib-CVE-2018-16548.patch new file mode 100644 index 0000000000..a17c6a9768 --- /dev/null +++ b/gnu/packages/patches/zziplib-CVE-2018-16548.patch @@ -0,0 +1,49 @@ +The following 3 patches applied to 0.13.69 in this order, combined: +https://github.com/gdraheim/zziplib/commit/9411bde3e4a70a81ff3ffd256b71927b2d90dcbb.patch +https://github.com/gdraheim/zziplib/commit/d2e5d5c53212e54a97ad64b793a4389193fec687.patch +https://github.com/gdraheim/zziplib/commit/0e1dadb05c1473b9df2d7b8f298dab801778ef99.patch + +diff --git a/test/test.zip b/test/test.zip +index 2c992ea..952d475 100644 +Binary files a/test/test.zip and b/test/test.zip differ +diff --git a/zzip/zip.c b/zzip/zip.c +index 14e2e06..f97a40a 100644 +--- a/zzip/zip.c ++++ b/zzip/zip.c +@@ -472,9 +472,15 @@ __zzip_parse_root_directory(int fd, + } else + { + if (io->fd.seeks(fd, zz_rootseek + zz_offset, SEEK_SET) < 0) ++ { ++ free(hdr0); + return ZZIP_DIR_SEEK; ++ } + if (io->fd.read(fd, &dirent, sizeof(dirent)) < __sizeof(dirent)) ++ { ++ free(hdr0); + return ZZIP_DIR_READ; ++ } + d = &dirent; + } + +@@ -574,11 +580,18 @@ __zzip_parse_root_directory(int fd, + + if (hdr_return) + *hdr_return = hdr0; ++ else ++ { ++ /* If it is not assigned to *hdr_return, it will never be free()'d */ ++ free(hdr0); ++ } + } /* else zero (sane) entries */ ++ else ++ free(hdr0); + # ifndef ZZIP_ALLOW_MODULO_ENTRIES +- return (entries != zz_entries ? ZZIP_CORRUPTED : 0); ++ return (entries != zz_entries) ? ZZIP_CORRUPTED : 0; + # else +- return ((entries & (unsigned)0xFFFF) != zz_entries ? ZZIP_CORRUPTED : 0); ++ return ((entries & (unsigned)0xFFFF) != zz_entries) ? ZZIP_CORRUPTED : 0; + # endif + } + -- cgit v1.2.3 From c1a86b666f1a5ece3251bab0be4929167e84b410 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 4 Mar 2020 12:34:34 +0100 Subject: gnu: appstream-glib: Update to 0.7.17. * gnu/packages/patches/appstream-glib-2020.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/glib.scm (appstream-glib): Update to 0.7.17. [source](patches): Remove. --- gnu/local.mk | 1 - gnu/packages/glib.scm | 5 ++--- gnu/packages/patches/appstream-glib-2020.patch | 31 -------------------------- 3 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 gnu/packages/patches/appstream-glib-2020.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index cbb7d2b2f0..b62468c923 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -720,7 +720,6 @@ dist_patch_DATA = \ %D%/packages/patches/antiword-CVE-2014-8123.patch \ %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \ %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \ - %D%/packages/patches/appstream-glib-2020.patch \ %D%/packages/patches/apr-skip-getservbyname-test.patch \ %D%/packages/patches/arm-trusted-firmware-disable-hdcp.patch \ %D%/packages/patches/aspell-default-dict-dir.patch \ diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 03d6be596b..c98d8c18f5 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -898,16 +898,15 @@ programming language. It also contains the utility (define-public appstream-glib (package (name "appstream-glib") - (version "0.7.16") + (version "0.7.17") (source (origin (method url-fetch) (uri (string-append "https://people.freedesktop.org/~hughsient/" "appstream-glib/releases/" "appstream-glib-" version ".tar.xz")) - (patches (search-patches "appstream-glib-2020.patch")) (sha256 (base32 - "14jr1psx5kxywdprgbqn79w309yz8lrqlsq7288hfrf87gbr1wh4")))) + "0jg58m1p5xfrh8zkpqhhg00nqs727z5i1qy6sb0a3vyc98fyk9vw")))) (build-system meson-build-system) (native-inputs `(("gettext" ,gettext-minimal) diff --git a/gnu/packages/patches/appstream-glib-2020.patch b/gnu/packages/patches/appstream-glib-2020.patch deleted file mode 100644 index ab8a4bbdee..0000000000 --- a/gnu/packages/patches/appstream-glib-2020.patch +++ /dev/null @@ -1,31 +0,0 @@ -2020 is no longer the future. - -Taken from upstream: -https://github.com/hughsie/appstream-glib/commit/953c8e529d7291e60a95e580967ed79ce2c9ccf0 - -diff --git a/data/tests/broken.appdata.xml b/data/tests/broken.appdata.xml -index f7a5386e..cf80f5b4 100644 ---- a/data/tests/broken.appdata.xml -+++ b/data/tests/broken.appdata.xml -@@ -40,7 +40,7 @@ -

This is a duplicate release on the same day!

- - -- -+ - -

This is a release in the future!

-
-diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c -index c1103ace..f50e4e41 100644 ---- a/libappstream-glib/as-app-validate.c -+++ b/libappstream-glib/as-app-validate.c -@@ -864,7 +864,7 @@ as_app_validate_release (AsApp *app, - AS_PROBLEM_KIND_ATTRIBUTE_MISSING, - " has no timestamp"); - } -- if (timestamp > 20120101 && timestamp < 20251231) { -+ if (timestamp > 20120101 && timestamp < 20351231) { - ai_app_validate_add (helper, - AS_PROBLEM_KIND_ATTRIBUTE_INVALID, - " timestamp should be a UNIX time"); -- cgit v1.2.3 From 0a7aa6922b8ad121bfcf023346f9f9bb97099504 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 4 Mar 2020 12:36:51 +0100 Subject: gnu: libgit2: Update to 0.99.0. * gnu/packages/patches/libgit2-avoid-python.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/version-control.scm (libgit2): Update to 0.99.0. [source](patches): Remove 'libgit2-avoid-python.patch'. [source](snippet): Preserve bundled copy of http-parser. [arguments]: Remove "-DUSE_SHA1DC" from #:configure-flags, which is no longer optional and enabled by default. Add "-DUSE_NTLMCLIENT=OFF" and "-DREGEX_BACKEND=pcre2". Add phase 'fix-pcre2-reference'. [inputs]: Remove HTTP-PARSER. [propagated-inputs]: Add PCRE2. [native-inputs]: Remove GUILE-2.2. Add PYTHON. --- gnu/local.mk | 1 - gnu/packages/patches/libgit2-avoid-python.patch | 322 ------------------------ gnu/packages/version-control.scm | 44 ++-- 3 files changed, 30 insertions(+), 337 deletions(-) delete mode 100644 gnu/packages/patches/libgit2-avoid-python.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index b62468c923..71a39b73a1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1096,7 +1096,6 @@ dist_patch_DATA = \ %D%/packages/patches/libexif-CVE-2018-20030.patch \ %D%/packages/patches/libextractor-exiv2.patch \ %D%/packages/patches/libgeotiff-adapt-test-script-for-proj-6.2.patch \ - %D%/packages/patches/libgit2-avoid-python.patch \ %D%/packages/patches/libgit2-mtime-0.patch \ %D%/packages/patches/libgnome-encoding.patch \ %D%/packages/patches/libgnomeui-utf8.patch \ diff --git a/gnu/packages/patches/libgit2-avoid-python.patch b/gnu/packages/patches/libgit2-avoid-python.patch deleted file mode 100644 index b2e5141563..0000000000 --- a/gnu/packages/patches/libgit2-avoid-python.patch +++ /dev/null @@ -1,322 +0,0 @@ -This provides a Guile reimplementation of clar's "generate.py". -It makes it possible for us to remove Python from libgit2's build-time -dependencies. -libgit2 is used in order to fetch a lot of sources for guix packages. -Both Python2 and Python3 builds acted up in the past. -Hence this patch which makes the number of libgit2 dependencies very -small. -The reimplementation tries to keep as close as possible to the original -in both structure and runtime effect. Some things are thus overly -convoluted just to make them the same as in the original. - -Both implementations basically do: - -grep -r 'test_.*__.*' . > clar.suite - -It is important that the directory traversal order of the original and -the reimplementation stay the same. - -diff -ruN orig/libgit2-0.27.7/tests/CMakeLists.txt libgit2-0.27.7/tests/CMakeLists.txt ---- orig/libgit2-0.27.7/tests/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 -+++ libgit2-0.27.7/tests/CMakeLists.txt 2019-03-04 11:13:06.640118979 +0100 -@@ -1,10 +1,3 @@ --FIND_PACKAGE(PythonInterp) -- --IF(NOT PYTHONINTERP_FOUND) -- MESSAGE(FATAL_ERROR "Could not find a python interpeter, which is needed to build the tests. " -- "Make sure python is available, or pass -DBUILD_CLAR=OFF to skip building the tests") --ENDIF() -- - SET(CLAR_FIXTURES "${CMAKE_CURRENT_SOURCE_DIR}/resources/") - SET(CLAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}") - ADD_DEFINITIONS(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\") -@@ -21,7 +14,7 @@ - - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clar.suite -- COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress -xperf . -+ COMMAND guile generate.scm -o "${CMAKE_CURRENT_BINARY_DIR}" -f -x online -x stress -x perf . - DEPENDS ${SRC_TEST} - WORKING_DIRECTORY ${CLAR_PATH} - ) -diff -ruN orig/libgit2-0.27.7/tests/generate.scm libgit2-0.27.7/tests/generate.scm ---- orig/libgit2-0.27.7/tests/generate.scm 1970-01-01 01:00:00.000000000 +0100 -+++ libgit2-0.27.7/tests/generate.scm 2019-03-04 12:18:00.688040975 +0100 -@@ -0,0 +1,277 @@ -+;; -*- geiser-scheme-implementation: guile -*- -+ -+;;; Implementation: Danny Milosavljevic -+;;; Based on: Implementation in Python by Vicent Marti. -+;;; License: ISC, like the original generate.py in clar. -+ -+(use-modules (ice-9 ftw)) -+(use-modules (ice-9 regex)) -+(use-modules (ice-9 getopt-long)) -+(use-modules (ice-9 rdelim)) -+(use-modules (ice-9 match)) -+(use-modules (ice-9 textual-ports)) -+(use-modules (srfi srfi-1)) -+ -+(define (render-callback cb) -+ (if cb -+ (string-append " { \"" (assoc-ref cb "short-name") "\", &" -+ (assoc-ref cb "symbol") " }") -+ " { NULL, NULL }")) -+ -+(define (replace needle replacement haystack) -+ "Replace all occurences of NEEDLE in HAYSTACK by REPLACEMENT. -+NEEDLE is a regular expression." -+ (regexp-substitute/global #f needle haystack 'pre replacement 'post)) -+ -+(define (skip-comments* text) -+ (call-with-input-string -+ text -+ (lambda (port) -+ (let loop ((result '()) -+ (section #f)) -+ (define (consume-char) -+ (cons (read-char port) result)) -+ (define (skip-char) -+ (read-char port) -+ result) -+ (match section -+ (#f -+ (match (peek-char port) -+ (#\/ (loop (consume-char) 'almost-in-block-comment)) -+ (#\" (loop (consume-char) 'in-string-literal)) -+ (#\' (loop (consume-char) 'in-character-literal)) -+ ((? eof-object?) result) -+ (_ (loop (consume-char) section)))) -+ ('almost-in-block-comment -+ (match (peek-char port) -+ (#\* (loop (consume-char) 'in-block-comment)) -+ (#\/ (loop (consume-char) 'in-line-comment)) -+ ((? eof-object?) result) -+ (_ (loop (consume-char) #f)))) -+ ('in-line-comment -+ (match (peek-char port) -+ (#\newline (loop (consume-char) #f)) -+ ((? eof-object?) result) -+ (_ (loop (skip-char) section)))) -+ ('in-block-comment -+ (match (peek-char port) -+ (#\* (loop (skip-char) 'almost-out-of-block-comment)) -+ ((? eof-object?) result) -+ (_ (loop (skip-char) section)))) -+ ('almost-out-of-block-comment -+ (match (peek-char port) -+ (#\/ (loop (cons (read-char port) (cons #\* result)) #f)) -+ (#\* (loop (skip-char) 'almost-out-of-block-comment)) -+ ((? eof-object?) result) -+ (_ (loop (skip-char) 'in-block-comment)))) -+ ('in-string-literal -+ (match (peek-char port) -+ (#\\ (loop (consume-char) 'in-string-literal-escape)) -+ (#\" (loop (consume-char) #f)) -+ ((? eof-object?) result) -+ (_ (loop (consume-char) section)))) -+ ('in-string-literal-escape -+ (match (peek-char port) -+ ((? eof-object?) result) -+ (_ (loop (consume-char) 'in-string-literal)))) -+ ('in-character-literal -+ (match (peek-char port) -+ (#\\ (loop (consume-char) 'in-character-literal-escape)) -+ (#\' (loop (consume-char) #f)) -+ ((? eof-object?) result) -+ (_ (loop (consume-char) section)))) -+ ('in-character-literal-escape -+ (match (peek-char port) -+ ((? eof-object?) result) -+ (_ (loop (consume-char) 'in-character-literal))))))))) -+ -+(define (skip-comments text) -+ (list->string (reverse (skip-comments* text)))) -+ -+(define (maybe-only items) -+ (match items -+ ((a) a) -+ (_ #f))) -+ -+(define (Module name path excludes) -+ (let* ((clean-name (replace "_" "::" name)) -+ (enabled (not (any (lambda (exclude) -+ (string-prefix? exclude clean-name)) -+ excludes)))) -+ (define (parse contents) -+ (define (cons-match match prev) -+ (cons -+ `(("declaration" . ,(match:substring match 1)) -+ ("symbol" . ,(match:substring match 2)) -+ ("short-name" . ,(match:substring match 3))) -+ prev)) -+ (let* ((contents (skip-comments contents)) -+ (entries (fold-matches (make-regexp -+ (string-append "^(void\\s+(test_" -+ name -+ "__(\\w+))\\s*\\(\\s*void\\s*\\))\\s*\\{") -+ regexp/newline) -+ contents -+ '() -+ cons-match)) -+ (entries (reverse entries)) -+ (callbacks (filter (lambda (entry) -+ (match (assoc-ref entry "short-name") -+ ("initialize" #f) -+ ("cleanup" #f) -+ (_ #t))) -+ entries))) -+ (if (> (length callbacks) 0) -+ `(("name" . ,name) -+ ("enabled" . ,(if enabled "1" "0")) -+ ("clean-name" . ,clean-name) -+ ("initialize" . ,(maybe-only (filter-map (lambda (entry) -+ (match (assoc-ref entry "short-name") -+ ("initialize" entry) -+ (_ #f))) -+ entries))) -+ ("cleanup" . ,(maybe-only (filter-map (lambda (entry) -+ (match (assoc-ref entry "short-name") -+ ("cleanup" entry) -+ (_ #f))) -+ entries))) -+ ("callbacks" . ,callbacks)) -+ #f))) -+ -+ (define (refresh path) -+ (and (file-exists? path) -+ (parse (call-with-input-file path get-string-all)))) -+ (refresh path))) -+ -+(define (generate-TestSuite path output excludes) -+ (define (load) -+ (define enter? (const #t)) -+ (define (leaf file stat result) -+ (let* ((module-root (string-drop (dirname file) -+ (string-length path))) -+ (module-root (filter-map (match-lambda -+ ("" #f) -+ (a a)) -+ (string-split module-root #\/)))) -+ (define (make-module path) -+ (let* ((name (string-join (append module-root (list (string-drop-right (basename path) (string-length ".c")))) "_")) -+ (name (replace "-" "_" name))) -+ (Module name path excludes))) -+ (if (string-suffix? ".c" file) -+ (let ((module (make-module file))) -+ (if module -+ (cons module result) -+ result)) -+ result))) -+ (define (down dir stat result) -+ result) -+ (define (up file state result) -+ result) -+ (define skip (const #f)) -+ (file-system-fold enter? leaf down up skip error '() path)) -+ -+ (define (CallbacksTemplate module) -+ (string-append "static const struct clar_func _clar_cb_" -+ (assoc-ref module "name") "[] = {\n" -+ (string-join (map render-callback -+ (assoc-ref module "callbacks")) -+ ",\n") -+ "\n};\n")) -+ -+ (define (DeclarationTemplate module) -+ (string-append (string-join (map (lambda (cb) -+ (string-append "extern " -+ (assoc-ref cb "declaration") -+ ";")) -+ (assoc-ref module "callbacks")) -+ "\n") -+ "\n" -+ (if (assoc-ref module "initialize") -+ (string-append "extern " (assoc-ref (assoc-ref module "initialize") "declaration") ";\n") -+ "") -+ (if (assoc-ref module "cleanup") -+ (string-append "extern " (assoc-ref (assoc-ref module "cleanup") "declaration") ";\n") -+ ""))) -+ -+ (define (InfoTemplate module) -+ (string-append " -+ { -+ \"" (assoc-ref module "clean-name") "\", -+ " (render-callback (assoc-ref module "initialize")) ", -+ " (render-callback (assoc-ref module "cleanup")) ", -+ _clar_cb_" (assoc-ref module "name") ", " -+ (number->string (length (assoc-ref module "callbacks"))) -+ ", " (assoc-ref module "enabled") " -+ }")) -+ -+ (define (Write data) -+ (define (name< module-a module-b) -+ (stringstring (suite-count))) -+ (callback-count-str (number->string (callback-count)))) -+ (display-x "static const size_t _clar_suite_count = ") -+ (display-x suite-count-str) -+ (display-x ";\n") -+ -+ (display-x "static const size_t _clar_callback_count = ") -+ (display-x callback-count-str) -+ (display-x ";\n") -+ -+ (display (string-append "Written `clar.suite` (" -+ callback-count-str -+ " tests in " -+ suite-count-str -+ " suites)")) -+ (newline)) -+ #t) -+ -+ (call-with-output-file (string-append output "/clar.suite") Write)) -+ -+;;; main -+ -+(define (main) -+ (define option-spec -+ '((force (single-char #\f) (value #f)) -+ (exclude (single-char #\x) (value #t)) -+ (output (single-char #\o) (value #t)) -+ (help (single-char #\h) (value #f)))) -+ -+ (define options (getopt-long (command-line) option-spec #:stop-at-first-non-option #t)) -+ (define args (reverse (option-ref options '() '()))) -+ (when (> (length args) 1) -+ (display "More than one path given\n") -+ (exit 1)) -+ -+ (if (< (length args) 1) -+ (set! args '("."))) -+ -+ (let* ((path (car args)) -+ (output (option-ref options 'output path)) -+ (excluded (filter-map (match-lambda -+ (('exclude . value) value) -+ (_ #f)) -+ options))) -+ (generate-TestSuite path output excluded))) -+ -+(main) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index a8cb4cc347..514dfe7ab7 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -15,7 +15,7 @@ ;;; Copyright © 2017 Vasile Dumitrascu ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2017 André -;;; Copyright © 2017, 2018 Marius Bakke +;;; Copyright © 2017, 2018, 2020 Marius Bakke ;;; Copyright © 2017 Stefan Reichör ;;; Copyright © 2017 Oleg Pykhalov ;;; Copyright © 2018 Sou Bunnbu @@ -534,7 +534,7 @@ everything from small to very large projects with speed and efficiency.") (define-public libgit2 (package (name "libgit2") - (version "0.28.4") + (version "0.99.0") (source (origin (method git-fetch) (uri (git-reference @@ -543,21 +543,37 @@ everything from small to very large projects with speed and efficiency.") (file-name (git-file-name name version)) (sha256 (base32 - "171b25aym4q88bidc4c76y4l6jmdwifm3q9zjqsll0wjhlkycfy1")) - (patches (search-patches "libgit2-avoid-python.patch" - "libgit2-mtime-0.patch")) + "0qxzv49ip378g1n7hrbifb9c6pys2kj1hnxcafmbb94gj3pgd9kg")) + (patches (search-patches "libgit2-mtime-0.patch")) - ;; Remove bundled software. + ;; Remove bundled software. Keep "http-parser" because it + ;; contains patches that are not available in the system version. (snippet '(begin - (delete-file-recursively "deps") + (with-directory-excursion "deps" + (for-each (lambda (dir) + (delete-file-recursively dir)) + (lset-difference equal? + (scandir ".") + '("." ".." "http-parser")))) #t)) - (modules '((guix build utils))))) + (modules '((guix build utils) + (srfi srfi-1) + (ice-9 ftw))))) (build-system cmake-build-system) (outputs '("out" "debug")) (arguments - `(#:configure-flags '("-DUSE_SHA1DC=ON") ; SHA-1 collision detection + `(#:configure-flags '("-DUSE_NTLMCLIENT=OFF" ;TODO: package this + "-DREGEX_BACKEND=pcre2") #:phases (modify-phases %standard-phases + (add-after 'unpack 'fix-pcre2-reference + (lambda _ + ;; Use PCRE2 with 8-bit character support, as there is no "libpcre2.pc". + ;; See . + (substitute* "src/CMakeLists.txt" + (("\"libpcre2\"") + "\"libpcre2-8\"")) + #t)) (add-after 'unpack 'fix-hardcoded-paths (lambda _ (substitute* "tests/repo/init.c" @@ -574,14 +590,14 @@ everything from small to very large projects with speed and efficiency.") (replace 'check (lambda _ (invoke "./libgit2_clar" "-v" "-Q")))))) (inputs - `(("libssh2" ,libssh2) - ("http-parser" ,http-parser))) + `(("libssh2" ,libssh2))) (native-inputs - `(("guile" ,guile-2.2) - ("pkg-config" ,pkg-config))) + `(("pkg-config" ,pkg-config) + ("python" ,python))) (propagated-inputs - ;; These two libraries are in 'Requires.private' in libgit2.pc. + ;; These libraries are in 'Requires.private' in libgit2.pc. `(("openssl" ,openssl) + ("pcre2" ,pcre2) ("zlib" ,zlib))) (home-page "https://libgit2.github.com/") (synopsis "Library providing Git core methods") -- cgit v1.2.3 From c2d7e800e6788277bc56f31d5836f9d507dc1506 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 4 Mar 2020 13:07:14 +0100 Subject: gnu: ceph: Update to 14.2.8. * gnu/packages/patches/ceph-boost-compat.patch, gnu/packages/patches/ceph-volume-respect-PATH.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/storage.scm (ceph): Update to 14.2.8. [source](patches): Remove obsolete. --- gnu/local.mk | 2 - gnu/packages/patches/ceph-boost-compat.patch | 81 ---------------------- .../patches/ceph-volume-respect-PATH.patch | 22 ------ gnu/packages/storage.scm | 8 +-- 4 files changed, 3 insertions(+), 110 deletions(-) delete mode 100644 gnu/packages/patches/ceph-boost-compat.patch delete mode 100644 gnu/packages/patches/ceph-volume-respect-PATH.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 71a39b73a1..5ea93238ae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -770,9 +770,7 @@ dist_patch_DATA = \ %D%/packages/patches/catdoc-CVE-2017-11110.patch \ %D%/packages/patches/cdparanoia-fpic.patch \ %D%/packages/patches/cdrtools-3.01-mkisofs-isoinfo.patch \ - %D%/packages/patches/ceph-boost-compat.patch \ %D%/packages/patches/ceph-disable-cpu-optimizations.patch \ - %D%/packages/patches/ceph-volume-respect-PATH.patch \ %D%/packages/patches/chmlib-inttypes.patch \ %D%/packages/patches/clamav-config-llvm-libs.patch \ %D%/packages/patches/clamav-system-tomsfastmath.patch \ diff --git a/gnu/packages/patches/ceph-boost-compat.patch b/gnu/packages/patches/ceph-boost-compat.patch deleted file mode 100644 index b3df659d6b..0000000000 --- a/gnu/packages/patches/ceph-boost-compat.patch +++ /dev/null @@ -1,81 +0,0 @@ -Fix compatibility with Boost 1.70. - -Adapted for 14.2.5 from these upstream commits: -https://github.com/ceph/ceph/commit/064f142746ae97f54865069cdacf5aae2b1b14f6 -https://github.com/ceph/ceph/commit/f1651b8c509d60787d10c4115e29fecfd2da237c - -diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc ---- a/src/rgw/rgw_asio_frontend.cc -+++ b/src/rgw/rgw_asio_frontend.cc -@@ -83,7 +83,8 @@ - using SharedMutex = ceph::async::SharedMutex; - - template --void handle_connection(RGWProcessEnv& env, Stream& stream, -+void handle_connection(boost::asio::io_context& context, -+ RGWProcessEnv& env, Stream& stream, - parse_buffer& buffer, bool is_ssl, - SharedMutex& pause_mutex, - rgw::dmclock::Scheduler *scheduler, -@@ -160,7 +161,7 @@ - rgw::io::add_conlen_controlling( - &real_client)))); - RGWRestfulIO client(cct, &real_client_io); -- auto y = optional_yield{socket.get_io_context(), yield}; -+ auto y = optional_yield{context, yield}; - process_request(env.store, env.rest, &req, env.uri_prefix, - *env.auth_registry, &client, env.olog, y, scheduler); - } -@@ -604,7 +605,7 @@ - return; - } - buffer->consume(bytes); -- handle_connection(env, stream, *buffer, true, pause_mutex, -+ handle_connection(context, env, stream, *buffer, true, pause_mutex, - scheduler.get(), ec, yield); - if (!ec) { - // ssl shutdown (ignoring errors) -@@ -622,7 +623,7 @@ - auto c = connections.add(conn); - auto buffer = std::make_unique(); - boost::system::error_code ec; -- handle_connection(env, s, *buffer, false, pause_mutex, -+ handle_connection(context, env, s, *buffer, false, pause_mutex, - scheduler.get(), ec, yield); - s.shutdown(tcp::socket::shutdown_both, ec); - }); -diff --git a/src/rgw/rgw_dmclock_async_scheduler.h b/src/rgw/rgw_dmclock_async_scheduler.h ---- a/src/rgw/rgw_dmclock_async_scheduler.h -+++ b/src/rgw/rgw_dmclock_async_scheduler.h -@@ -82,7 +82,12 @@ class AsyncScheduler : public md_config_obs_t, public Scheduler { - using Completion = async::Completion>; - - using Clock = ceph::coarse_real_clock; -+#if BOOST_VERSION < 107000 - using Timer = boost::asio::basic_waitable_timer; -+#else -+ using Timer = boost::asio::basic_waitable_timer, executor_type>; -+#endif - Timer timer; //< timer for the next scheduled request - - CephContext *const cct; -diff --git a/src/rgw/rgw_reshard.h b/src/rgw/rgw_reshard.h ---- a/src/rgw/rgw_reshard.h -+++ b/src/rgw/rgw_reshard.h -@@ -183,7 +183,14 @@ class RGWReshardWait { - ceph::condition_variable cond; - - struct Waiter : boost::intrusive::list_base_hook<> { -- boost::asio::basic_waitable_timer timer; -+#if BOOST_VERSION < 107000 -+ using Timer = boost::asio::basic_waitable_timer; -+#else -+ using Executor = boost::asio::io_context::executor_type; -+ using Timer = boost::asio::basic_waitable_timer, Executor>; -+#endif -+ Timer timer; - explicit Waiter(boost::asio::io_context& ioc) : timer(ioc) {} - }; - boost::intrusive::list waiters; diff --git a/gnu/packages/patches/ceph-volume-respect-PATH.patch b/gnu/packages/patches/ceph-volume-respect-PATH.patch deleted file mode 100644 index 08a9a15ddd..0000000000 --- a/gnu/packages/patches/ceph-volume-respect-PATH.patch +++ /dev/null @@ -1,22 +0,0 @@ -Look for required tools in $PATH instead of just a handful locations. - -diff --git a/src/ceph-volume/ceph_volume/util/system.py b/src/ceph-volume/ceph_volume/util/system.py -index b637f023a4..14516e1c65 100644 ---- a/src/ceph-volume/ceph_volume/util/system.py -+++ b/src/ceph-volume/ceph_volume/util/system.py -@@ -33,14 +33,7 @@ def generate_uuid(): - - def which(executable): - """find the location of an executable""" -- locations = ( -- '/usr/local/bin', -- '/bin', -- '/usr/bin', -- '/usr/local/sbin', -- '/usr/sbin', -- '/sbin', -- ) -+ locations = os.getenv('PATH').split(':') - - for location in locations: - executable_path = os.path.join(location, executable) diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm index 1691939d7f..376a801fe2 100644 --- a/gnu/packages/storage.scm +++ b/gnu/packages/storage.scm @@ -53,18 +53,16 @@ (define-public ceph (package (name "ceph") - (version "14.2.7") + (version "14.2.8") (source (origin (method url-fetch) (uri (string-append "https://download.ceph.com/tarballs/ceph-" version ".tar.gz")) (sha256 (base32 - "0qiqhm6hvz299q54k3i4crnb5dhpq6xnn2yqih9pxn9van0dq1ln")) + "0p7pjycqhxqg1mmix8ykx3xqq01d560p54iiidxps0rcvwfkyyki")) (patches - (search-patches "ceph-boost-compat.patch" - "ceph-volume-respect-PATH.patch" - "ceph-disable-cpu-optimizations.patch")) + (search-patches "ceph-disable-cpu-optimizations.patch")) (modules '((guix build utils))) (snippet '(begin -- cgit v1.2.3