From d29d04c9e64c2421ed84022e0c140ead40e5fb58 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Tue, 29 Oct 2019 16:14:14 +0100 Subject: gnu: Add udiskie. * gnu/packages/freedesktop.scm (udiskie): New variable. * gnu/packages/patches/udiskie-no-appindicator.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- 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 41c5a92a0a..96b570a759 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1386,6 +1386,7 @@ dist_patch_DATA = \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %D%/packages/patches/txr-shell.patch \ %D%/packages/patches/u-boot-fix-mkimage-header-verification.patch \ + %D%/packages/patches/udiskie-no-appindicator.patch \ %D%/packages/patches/unzip-CVE-2014-8139.patch \ %D%/packages/patches/unzip-CVE-2014-8140.patch \ %D%/packages/patches/unzip-CVE-2014-8141.patch \ -- cgit v1.2.3 From 520b18e6fa8415b9b8fc07611c3c885035739633 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 2 Nov 2019 21:10:40 +0100 Subject: gnu: vlc: Fix build. * gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch: New file. * gnu/local.mk (dist_patch_DATA): Reference new file. * gnu/packages/video.scm (vlc): Apply patch. --- gnu/local.mk | 1 + .../patches/vlc-fix-test_libvlc_slaves.patch | 35 +++++++++++++++++++++ gnu/packages/video.scm | 36 +++++++++++++--------- 3 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 96b570a759..5fa97c7673 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1412,6 +1412,7 @@ dist_patch_DATA = \ %D%/packages/patches/vinagre-newer-freerdp.patch \ %D%/packages/patches/vinagre-newer-rdp-parameters.patch \ %D%/packages/patches/virglrenderer-CVE-2017-6386.patch \ + %D%/packages/patches/vlc-fix-test_libvlc_slaves.patch \ %D%/packages/patches/vorbis-tools-CVE-2014-9638+CVE-2014-9639.patch \ %D%/packages/patches/vorbis-tools-CVE-2014-9640.patch \ %D%/packages/patches/vorbis-tools-CVE-2015-6749.patch \ diff --git a/gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch b/gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch new file mode 100644 index 0000000000..9bc6d35f18 --- /dev/null +++ b/gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch @@ -0,0 +1,35 @@ +From 4186c94104ee528abd6860611b49515f3e6ec644 Mon Sep 17 00:00:00 2001 +From: Thomas Guillem +Date: Fri, 18 Oct 2019 10:34:07 +0200 +Subject: [PATCH] input/item: sort before attaching slaves + +The order of readdir() is completely filesystem dependent. + +Slaves should be attached using the same order across multiple OSses/access +modules. + +This fixes the test_libvlc_slaves on some system when the entry order from +readdir() is different. + +This patch need to be backported to VLC 3.0. +--- + src/input/item.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/input/item.c b/src/input/item.c +index e8db39ca28..fbd74cc95f 100644 +--- a/src/input/item.c ++++ b/src/input/item.c +@@ -1809,8 +1809,8 @@ void vlc_readdir_helper_finish(struct vlc_readdir_helper *p_rdh, bool b_success) + { + if (b_success) + { +- rdh_attach_slaves(p_rdh, p_rdh->p_node); + rdh_sort(p_rdh->p_node); ++ rdh_attach_slaves(p_rdh, p_rdh->p_node); + } + free(p_rdh->psz_ignored_exts); + +-- +2.20.1 + diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 7e62ab69ef..b5f81e2cb3 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -1088,20 +1088,26 @@ videoformats depend on the configuration flags of ffmpeg.") (name "vlc") (version "3.0.8") (source (origin - (method url-fetch) - (uri (string-append - "https://download.videolan.org/pub/videolan/vlc/" - (car (string-split version #\-)) - "/vlc-" version ".tar.xz")) - (sha256 - (base32 - "1xmxjpyzdhabchwncz6lvx3kzvl7fz9c42bkv3nbj68albs9w570")))) + (method url-fetch) + (uri (string-append + "https://download.videolan.org/pub/videolan/vlc/" + (car (string-split version #\-)) + "/vlc-" version ".tar.xz")) + (sha256 + (base32 + "1xmxjpyzdhabchwncz6lvx3kzvl7fz9c42bkv3nbj68albs9w570")) + (patches + (search-patches + ;; TODO: The test "libvlc_slaves" fails. Applied upstream as + ;; . + ;; Try removing it in 3.0.9. + "vlc-fix-test_libvlc_slaves.patch")))) (build-system gnu-build-system) (native-inputs `(("flex" ,flex) ("bison" ,bison) ("gettext" ,gettext-minimal) - ("git" ,git) ; needed for a test + ("git" ,git) ; needed for a test ("pkg-config" ,pkg-config))) ;; FIXME: Add optional inputs once available. (inputs @@ -1182,7 +1188,7 @@ videoformats depend on the configuration flags of ffmpeg.") `("BUILDCC=gcc" ,(string-append "LDFLAGS=-Wl,-rpath -Wl," (assoc-ref %build-inputs "ffmpeg") - "/lib")) ;needed for the tests + "/lib")) ;needed for the tests #:phases (modify-phases %standard-phases @@ -1233,11 +1239,11 @@ videoformats depend on the configuration flags of ffmpeg.") (invoke cachegen plugindir)))) (add-after 'install 'wrap-executable (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (plugin-path (getenv "QT_PLUGIN_PATH"))) - (wrap-program (string-append out "/bin/vlc") - `("QT_PLUGIN_PATH" ":" prefix (,plugin-path)))) - #t))))) + (let ((out (assoc-ref outputs "out")) + (plugin-path (getenv "QT_PLUGIN_PATH"))) + (wrap-program (string-append out "/bin/vlc") + `("QT_PLUGIN_PATH" ":" prefix (,plugin-path)))) + #t))))) (home-page "https://www.videolan.org/") (synopsis "Audio and video framework") (description "VLC is a cross-platform multimedia player and framework -- cgit v1.2.3 From a349835edb8e7e702089f6295e043c94caec6b11 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sun, 3 Nov 2019 13:25:39 +0300 Subject: gnu: docker: Adjust tests for changes in go. * gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch: New file. * gnu/local.mk (dist_patch_DATA): Use this. * gnu/packages/docker.scm (docker): Use this. --- gnu/local.mk | 1 + gnu/packages/docker.scm | 3 +- .../docker-adjust-tests-for-changes-in-go.patch | 67 ++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 5fa97c7673..8eca810337 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -781,6 +781,7 @@ dist_patch_DATA = \ %D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch \ %D%/packages/patches/doc++-include-directives.patch \ %D%/packages/patches/doc++-segfault-fix.patch \ + %D%/packages/patches/docker-adjust-tests-for-changes-in-go.patch \ %D%/packages/patches/docker-engine-test-noinstall.patch \ %D%/packages/patches/docker-fix-tests.patch \ %D%/packages/patches/docker-use-fewer-modprobes.patch \ diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm index 69325449a1..70d2062448 100644 --- a/gnu/packages/docker.scm +++ b/gnu/packages/docker.scm @@ -317,7 +317,8 @@ built-in registry server of Docker.") (patches (search-patches "docker-engine-test-noinstall.patch" "docker-fix-tests.patch" - "docker-use-fewer-modprobes.patch")))) + "docker-use-fewer-modprobes.patch" + "docker-adjust-tests-for-changes-in-go.patch")))) (build-system gnu-build-system) (arguments `(#:modules diff --git a/gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch b/gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch new file mode 100644 index 0000000000..82d92cd4de --- /dev/null +++ b/gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch @@ -0,0 +1,67 @@ +From 4983ef7c1693ad6dfbe4e3809b12541241d7ff56 Mon Sep 17 00:00:00 2001 +From: Sebastiaan van Stijn +Date: Wed, 14 Aug 2019 02:51:08 +0200 +Subject: [PATCH] Adjust tests for changes in Go 1.12.8 / 1.11.13 + +``` +00:38:11 === Failed +00:38:11 === FAIL: opts TestParseDockerDaemonHost (0.00s) +00:38:11 hosts_test.go:87: tcp tcp:a.b.c.d address expected error "Invalid bind address format: tcp:a.b.c.d" return, got "parse tcp://tcp:a.b.c.d: invalid port \":a.b.c.d\" after host" and addr +00:38:11 hosts_test.go:87: tcp tcp:a.b.c.d/path address expected error "Invalid bind address format: tcp:a.b.c.d/path" return, got "parse tcp://tcp:a.b.c.d/path: invalid port \":a.b.c.d\" after host" and addr +00:38:11 +00:38:11 === FAIL: opts TestParseTCP (0.00s) +00:38:11 hosts_test.go:129: tcp tcp:a.b.c.d address expected error Invalid bind address format: tcp:a.b.c.d return, got parse tcp://tcp:a.b.c.d: invalid port ":a.b.c.d" after host and addr +00:38:11 hosts_test.go:129: tcp tcp:a.b.c.d/path address expected error Invalid bind address format: tcp:a.b.c.d/path return, got parse tcp://tcp:a.b.c.d/path: invalid port ":a.b.c.d" after host and addr +``` + +Signed-off-by: Sebastiaan van Stijn +Upstream-commit: 683766613a8c1dca8f95b19ddb7e083bb3aef266 +Component: engine +--- + opts/hosts_test.go | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/opts/hosts_test.go b/opts/hosts_test.go +index 8c54ec0f4b..7a0a943adf 100644 +--- a/opts/hosts_test.go ++++ b/opts/hosts_test.go +@@ -53,8 +53,8 @@ func TestParseHost(t *testing.T) { + func TestParseDockerDaemonHost(t *testing.T) { + invalids := map[string]string{ + +- "tcp:a.b.c.d": "Invalid bind address format: tcp:a.b.c.d", +- "tcp:a.b.c.d/path": "Invalid bind address format: tcp:a.b.c.d/path", ++ "tcp:a.b.c.d": "", ++ "tcp:a.b.c.d/path": "", + "udp://127.0.0.1": "Invalid bind address format: udp://127.0.0.1", + "udp://127.0.0.1:2375": "Invalid bind address format: udp://127.0.0.1:2375", + "tcp://unix:///run/docker.sock": "Invalid proto, expected tcp: unix:///run/docker.sock", +@@ -83,7 +83,7 @@ func TestParseDockerDaemonHost(t *testing.T) { + "localhost:5555/path": "tcp://localhost:5555/path", + } + for invalidAddr, expectedError := range invalids { +- if addr, err := parseDaemonHost(invalidAddr); err == nil || err.Error() != expectedError { ++ if addr, err := parseDaemonHost(invalidAddr); err == nil || expectedError != "" && err.Error() != expectedError { + t.Errorf("tcp %v address expected error %q return, got %q and addr %v", invalidAddr, expectedError, err, addr) + } + } +@@ -99,8 +99,8 @@ func TestParseTCP(t *testing.T) { + defaultHTTPHost = "tcp://127.0.0.1:2376" + ) + invalids := map[string]string{ +- "tcp:a.b.c.d": "Invalid bind address format: tcp:a.b.c.d", +- "tcp:a.b.c.d/path": "Invalid bind address format: tcp:a.b.c.d/path", ++ "tcp:a.b.c.d": "", ++ "tcp:a.b.c.d/path": "", + "udp://127.0.0.1": "Invalid proto, expected tcp: udp://127.0.0.1", + "udp://127.0.0.1:2375": "Invalid proto, expected tcp: udp://127.0.0.1:2375", + } +@@ -125,7 +125,7 @@ func TestParseTCP(t *testing.T) { + "localhost:5555/path": "tcp://localhost:5555/path", + } + for invalidAddr, expectedError := range invalids { +- if addr, err := ParseTCPAddr(invalidAddr, defaultHTTPHost); err == nil || err.Error() != expectedError { ++ if addr, err := ParseTCPAddr(invalidAddr, defaultHTTPHost); err == nil || expectedError != "" && err.Error() != expectedError { + t.Errorf("tcp %v address expected error %v return, got %s and addr %v", invalidAddr, expectedError, err, addr) + } + } -- cgit v1.2.3 From 8f5ac03e2162b93648c255d10ebef1c2037c296e Mon Sep 17 00:00:00 2001 From: Jonathan Brielmaier Date: Tue, 5 Nov 2019 13:13:02 +0100 Subject: gnu: Add missing patch to locale.mk. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch was introduced in commit 2be878d8e54057980121e4c659ca48317b79970e. * gnu/local.mk (dist_patch_DATA): Add "python-pep8-stdlib-tokenize-compat.patch". Signed-off-by: Gábor Boskovits --- gnu/local.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 8eca810337..468bf02ca0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -22,6 +22,7 @@ # Copyright © 2018 Maxim Cournoyer # Copyright © 2019 Guillaume Le Vaillant # Copyright © 2019 John Soo +# Copyright © 2019 Jonathan Brielmaier # # This file is part of GNU Guix. # @@ -1270,6 +1271,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-configobj-setuptools.patch \ %D%/packages/patches/python-faker-fix-build-32bit.patch \ %D%/packages/patches/python-keras-integration-test.patch \ + %D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \ %D%/packages/patches/python-pyfakefs-remove-bad-test.patch \ %D%/packages/patches/python-flint-includes.patch \ %D%/packages/patches/python-libxml2-utf8.patch \ -- cgit v1.2.3 From aa1f0896fb15a0bdcc5474839c8afdbb2520d603 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Arruga Vivas Date: Sat, 2 Nov 2019 00:31:44 +0100 Subject: gnu: libvirt: Update to 5.8.0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/local.mk (dist_patch_DATA): Add new patch file. * gnu/packages/patches/libvirt-create-machine-cgroup.patch: New patch, submitted to upstream for upstream bug 1760233. * gnu/packages/virtualization.scm (libvirt): Update version to 5.8.0. Include patch. Avoid execution of failing tests qemuxml2argvtest and qemuhotplugtest. Replace python by python-wrapper to avoid warnings on patch-shebangs phase. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + .../patches/libvirt-create-machine-cgroup.patch | 48 ++++++++++++++++++++++ gnu/packages/virtualization.scm | 10 +++-- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/libvirt-create-machine-cgroup.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 468bf02ca0..ec3974a8aa 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1005,6 +1005,7 @@ dist_patch_DATA = \ %D%/packages/patches/java-xerces-xjavac_taskdef.patch \ %D%/packages/patches/jbig2dec-ignore-testtest.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ + %D%/packages/patches/libvirt-create-machine-cgroup.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ %D%/packages/patches/kiki-level-selection-crash.patch \ diff --git a/gnu/packages/patches/libvirt-create-machine-cgroup.patch b/gnu/packages/patches/libvirt-create-machine-cgroup.patch new file mode 100644 index 0000000000..585ac237e1 --- /dev/null +++ b/gnu/packages/patches/libvirt-create-machine-cgroup.patch @@ -0,0 +1,48 @@ +From 9ca0b2955edea162b255b428e493cd8ffac52167 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= + +Date: Fri, 1 Nov 2019 17:29:00 +0100 +Subject: [PATCH] vircgroup: Ensure /machine group is associated with its + parent. + +Call first virCgroupNew on the parent group virCgroupNewPartition if +it is available on before the creation of the child group. This +ensures that the creation of a first level group on the unified +architecture, as the check at virCgroupV2ParseControllersFile as the +parent file is there. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1760233 +--- + src/util/vircgroup.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c +index b46f20abfd..33c61f2d45 100644 +--- a/src/util/vircgroup.c ++++ b/src/util/vircgroup.c +@@ -855,9 +855,6 @@ virCgroupNewPartition(const char *path, + if (virCgroupSetPartitionSuffix(path, &newPath) < 0) + goto cleanup; + +- if (virCgroupNew(-1, newPath, NULL, controllers, group) < 0) +- goto cleanup; +- + if (STRNEQ(newPath, "/")) { + char *tmp; + parentPath = g_strdup(newPath); +@@ -868,7 +865,12 @@ virCgroupNewPartition(const char *path, + + if (virCgroupNew(-1, parentPath, NULL, controllers, &parent) < 0) + goto cleanup; ++ } + ++ if (virCgroupNew(-1, newPath, parent, controllers, group) < 0) ++ goto cleanup; ++ ++ if (parent) { + if (virCgroupMakeGroup(parent, *group, create, VIR_CGROUP_NONE) < 0) + goto cleanup; + } +-- +2.23.0 + diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index c2f46985f0..7266f6606d 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -400,14 +400,16 @@ manage system or application containers.") (define-public libvirt (package (name "libvirt") - (version "5.6.0") + (version "5.8.0") (source (origin (method url-fetch) (uri (string-append "https://libvirt.org/sources/libvirt-" version ".tar.xz")) (sha256 - (base32 "1d5rmcx5fgb024hw8chbiv886n3jal5wp2yajjk5l4qh9s9gkx35")))) + (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2")) + (patches + (search-patches "libvirt-create-machine-cgroup.patch")))) (build-system gnu-build-system) (arguments `(#:configure-flags @@ -439,6 +441,8 @@ manage system or application containers.") (add-before 'configure 'disable-broken-tests (lambda _ (let ((tests (list "commandtest" ; hangs idly + "qemuxml2argvtest" ; fails + "qemuhotplugtest" ; fails "virnetsockettest" ; tries to network "virshtest"))) ; fails (substitute* "tests/Makefile.in" @@ -480,7 +484,7 @@ manage system or application containers.") ("perl" ,perl) ("pkg-config" ,pkg-config) ("polkit" ,polkit) - ("python" ,python))) + ("python" ,python-wrapper))) (home-page "https://libvirt.org") (synopsis "Simple API for virtualization") (description "Libvirt is a C toolkit to interact with the virtualization -- cgit v1.2.3 From 81ffe6377385a3035d75cf9c8a1b61f32796c2ad Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 6 Nov 2019 12:02:22 +0100 Subject: gnu: cpio: Update to 2.13 [fixes CVE-2015-1197, CVE-2019-14866]. * gnu/packages/cpio.scm (cpio): Update to 2.13. Remove "cpio-CVE-2016-2037.patch". * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/cpio.scm | 5 ++- gnu/packages/patches/cpio-CVE-2016-2037.patch | 49 --------------------------- 3 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 gnu/packages/patches/cpio-CVE-2016-2037.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index ec3974a8aa..2513b4003c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -760,7 +760,6 @@ 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/cpio-CVE-2016-2037.patch \ %D%/packages/patches/cpufrequtils-fix-aclocal.patch \ %D%/packages/patches/crawl-upgrade-saves.patch \ %D%/packages/patches/crda-optional-gcrypt.patch \ diff --git a/gnu/packages/cpio.scm b/gnu/packages/cpio.scm index 77a0c82d2e..58b2f45937 100644 --- a/gnu/packages/cpio.scm +++ b/gnu/packages/cpio.scm @@ -28,15 +28,14 @@ (define-public cpio (package (name "cpio") - (version "2.12") + (version "2.13") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/cpio/cpio-" version ".tar.bz2")) (sha256 (base32 - "0vi9q475h1rki53100zml75vxsykzyhrn70hidy41s5c2rc8r6bh")) - (patches (search-patches "cpio-CVE-2016-2037.patch")))) + "0vbgnhkawdllgnkdn6zn1f56fczwk0518krakz2qbwhxmv2vvdga")))) (build-system gnu-build-system) (home-page "https://www.gnu.org/software/cpio/") (synopsis "Manage cpio and tar file archives") diff --git a/gnu/packages/patches/cpio-CVE-2016-2037.patch b/gnu/packages/patches/cpio-CVE-2016-2037.patch deleted file mode 100644 index f1e068fb45..0000000000 --- a/gnu/packages/patches/cpio-CVE-2016-2037.patch +++ /dev/null @@ -1,49 +0,0 @@ -Fix CVE-2016-2037 (out of bounds write in process_copy_in()). - -Copied from upstream mailing list: -https://lists.gnu.org/archive/html/bug-cpio/2016-01/msg00005.html - ---- - - Other calls to cpio_safer_name_suffix seem to be safe. - . - * src/copyin.c (process_copy_in): Make sure that file_hdr.c_name - has at least two bytes allocated. - * src/util.c (cpio_safer_name_suffix): Document that use of this - function requires to be careful. -Author: Pavel Raiskup - ---- - src/copyin.c | 2 ++ - src/util.c | 5 ++++- - 2 files changed, 6 insertions(+), 1 deletion(-) - -Index: cpio-2.11+dfsg/src/copyin.c -=================================================================== ---- cpio-2.11+dfsg.orig/src/copyin.c -+++ cpio-2.11+dfsg/src/copyin.c -@@ -1433,6 +1433,8 @@ process_copy_in () - break; - } - -+ if (file_hdr.c_namesize <= 1) -+ file_hdr.c_name = xrealloc(file_hdr.c_name, 2); - cpio_safer_name_suffix (file_hdr.c_name, false, !no_abs_paths_flag, - false); - -Index: cpio-2.11+dfsg/src/util.c -=================================================================== ---- cpio-2.11+dfsg.orig/src/util.c -+++ cpio-2.11+dfsg/src/util.c -@@ -1374,7 +1374,10 @@ set_file_times (int fd, - } - - /* Do we have to ignore absolute paths, and if so, does the filename -- have an absolute path? */ -+ have an absolute path? -+ Before calling this function make sure that the allocated NAME buffer has -+ capacity at least 2 bytes to allow us to store the "." string inside. */ -+ - void - cpio_safer_name_suffix (char *name, bool link_target, bool absolute_names, - bool strip_leading_dots) -- cgit v1.2.3 From b26a239c70cab928457e0f9a6da2a2cb89089629 Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Thu, 7 Nov 2019 10:16:19 +0100 Subject: gnu: Add delft-icon-theme. * /gnu/packages/gnome-xyz.scm: New file. (delft-icon-theme): New variable. * /gnu/local.mk: Add it. Signed-off-by: Mathieu Othacehe --- gnu/local.mk | 1 + gnu/packages/gnome-xyz.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 gnu/packages/gnome-xyz.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 2513b4003c..0f02c4b6be 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -213,6 +213,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/gl.scm \ %D%/packages/glib.scm \ %D%/packages/gnome.scm \ + %D%/packages/gnome-xyz.scm \ %D%/packages/gnu-doc.scm \ %D%/packages/gnucash.scm \ %D%/packages/gnunet.scm \ diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm new file mode 100644 index 0000000000..1981431b60 --- /dev/null +++ b/gnu/packages/gnome-xyz.scm @@ -0,0 +1,60 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Leo Prikler +;;; +;;; 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 packages gnome-xyz) + #:use-module (guix build-system trivial) + #:use-module (guix build-system gnu) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module ((guix licenses) #:prefix license:) + + #:use-module (gnu packages glib) + #:use-module (gnu packages pkg-config)) + +(define-public delft-icon-theme + (package + (name "delft-icon-theme") + (version "1.10") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/madmaxms/iconpack-delft.git") + (commit (string-append "v" version)))) + (sha256 + (base32 + "0vw3yw9f9ygzfd2k3zrfih3r0vkzlhk1bmsk8sapvk7np24i1z9s")) + (file-name (git-file-name name version)))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (copy-recursively (assoc-ref %build-inputs "source") "icons") + (delete-file "icons/README.md") + (delete-file "icons/LICENSE") + (delete-file "icons/logo.jpg") + (copy-recursively "icons" (string-append %output "/share/icons"))))) + (home-page "https://www.gnome-look.org/p/1199881/") + (synopsis "Continuation of Faenza icon theme with up to date app icons") + (description "Delft is a fork of the popular icon theme Faenza with up to +date app icons. It will stay optically close to the original Faenza icons, +which haven't been updated for some years. The new app icons are ported from +the Obsidian icon theme.") + (license license:gpl3))) -- cgit v1.2.3 From b8f0a3fdc8e9263a061e4a3ea79c85099b284b15 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 9 Nov 2019 21:03:19 +0200 Subject: gnu: fribidi: Fix CVE-2019-18397. * gnu/packages/fribidi.scm (fribidi): Replace with fribidi/fixed. (fribidi/fixed): New variable. * gnu/packages/patches/fribidi-CVE-2019-18397.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/fribidi.scm | 13 ++++++++++-- gnu/packages/patches/fribidi-CVE-2019-18397.patch | 26 +++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/fribidi-CVE-2019-18397.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 0f02c4b6be..dcb4546462 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -838,6 +838,7 @@ dist_patch_DATA = \ %D%/packages/patches/flint-ldconfig.patch \ %D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \ %D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \ + %D%/packages/patches/fribidi-CVE-2019-18397.patch \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ %D%/packages/patches/gawk-shell.patch \ diff --git a/gnu/packages/fribidi.scm b/gnu/packages/fribidi.scm index dfd2a77c20..61aa6fd726 100644 --- a/gnu/packages/fribidi.scm +++ b/gnu/packages/fribidi.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Marek Benc -;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2016, 2019 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. @@ -22,10 +22,12 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (guix licenses)) + #:use-module (guix licenses) + #:use-module (gnu packages)) (define-public fribidi (package + (replacement fribidi/fixed) (name "fribidi") (version "1.0.5") (source @@ -45,3 +47,10 @@ Algorithm. This algorithm is used to properly display text in left-to-right or right-to-left ordering as necessary.") (home-page "https://github.com/fribidi/fribidi") (license lgpl2.1+))) + +(define fribidi/fixed + (package + (inherit fribidi) + (source + (origin (inherit (package-source fribidi)) + (patches (search-patches "fribidi-CVE-2019-18397.patch")))))) diff --git a/gnu/packages/patches/fribidi-CVE-2019-18397.patch b/gnu/packages/patches/fribidi-CVE-2019-18397.patch new file mode 100644 index 0000000000..aff1a669b2 --- /dev/null +++ b/gnu/packages/patches/fribidi-CVE-2019-18397.patch @@ -0,0 +1,26 @@ +https://github.com/fribidi/fribidi/commit/034c6e9a1d296286305f4cfd1e0072b879f52568.patch + +From 034c6e9a1d296286305f4cfd1e0072b879f52568 Mon Sep 17 00:00:00 2001 +From: Dov Grobgeld +Date: Thu, 24 Oct 2019 09:37:29 +0300 +Subject: [PATCH] Truncate isolate_level to FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL + +--- + lib/fribidi-bidi.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/fribidi-bidi.c b/lib/fribidi-bidi.c +index 6c84392..d384878 100644 +--- a/lib/fribidi-bidi.c ++++ b/lib/fribidi-bidi.c +@@ -747,7 +747,9 @@ fribidi_get_par_embedding_levels_ex ( + } + + RL_LEVEL (pp) = level; +- RL_ISOLATE_LEVEL (pp) = isolate_level++; ++ RL_ISOLATE_LEVEL (pp) = isolate_level; ++ if (isolate_level < FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL-1) ++ isolate_level++; + base_level_per_iso_level[isolate_level] = new_level; + + if (!FRIBIDI_IS_NEUTRAL (override)) -- cgit v1.2.3 From 0d01a5a9d47781f63c7bea3f6065fb0bed9f07f8 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 9 Nov 2019 20:19:11 +0200 Subject: gnu: patchelf: Update to 0.10. * gnu/packages/elf.scm (patchelf): Update to 0.10. [source]: Remove patches. [arguments]: Remove patch/rework-for-arm phase. Add phase to modify tests for our modified GCC package. [native-inputs]: Add gcc:lib. * gnu/packages/patches/patchelf-page-size.patch, * gnu/packages/patches/patchelf-rework-for-arm.patch: Remove files. * gnu/local.mk (dist_patch_DATA): Remove them. --- gnu/local.mk | 2 - gnu/packages/elf.scm | 41 +- gnu/packages/patches/patchelf-page-size.patch | 70 --- gnu/packages/patches/patchelf-rework-for-arm.patch | 473 --------------------- 4 files changed, 19 insertions(+), 567 deletions(-) delete mode 100644 gnu/packages/patches/patchelf-page-size.patch delete mode 100644 gnu/packages/patches/patchelf-rework-for-arm.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index dcb4546462..e1c1cef854 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1205,8 +1205,6 @@ dist_patch_DATA = \ %D%/packages/patches/p7zip-CVE-2016-9296.patch \ %D%/packages/patches/p7zip-CVE-2017-17969.patch \ %D%/packages/patches/p7zip-remove-unused-code.patch \ - %D%/packages/patches/patchelf-page-size.patch \ - %D%/packages/patches/patchelf-rework-for-arm.patch \ %D%/packages/patches/patchutils-test-perms.patch \ %D%/packages/patches/patch-hurd-path-max.patch \ %D%/packages/patches/pcre2-fix-jit_match-crash.patch \ diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm index 4f365cf205..75caa54296 100644 --- a/gnu/packages/elf.scm +++ b/gnu/packages/elf.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2015 Andreas Enge -;;; Copyright © 2017, 2018 Efraim Flashner +;;; Copyright © 2017, 2018, 2019 Efraim Flashner ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 Marius Bakke @@ -31,6 +31,7 @@ #:use-module (gnu packages) #:use-module (gnu packages compression) #:use-module (gnu packages documentation) + #:use-module (gnu packages gcc) #:use-module (gnu packages m4) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) @@ -198,7 +199,7 @@ static analysis of the ELF binaries at hand.") (define-public patchelf (package (name "patchelf") - (version "0.8") + (version "0.10") (source (origin (method url-fetch) (uri (string-append @@ -207,28 +208,24 @@ static analysis of the ELF binaries at hand.") "/patchelf-" version ".tar.bz2")) (sha256 (base32 - "1rqpg84wrd3fa16wa9vqdvasnc05yz49w207cz1l0wrl4k8q97y9")) - (patches (search-patches "patchelf-page-size.patch")))) + "1wzwvnlyf853hw9zgqq5522bvf8gqadk8icgqa41a5n7593csw7n")))) (build-system gnu-build-system) - - ;; XXX: The upstream 'patchelf' doesn't support ARM. The only available - ;; patch makes significant changes to the algorithm, possibly - ;; introducing bugs. So, we apply the patch only on ARM systems. - (inputs - (if (target-arm32?) - `(("patch/rework-for-arm" ,(search-patch - "patchelf-rework-for-arm.patch"))) - '())) (arguments - (if (target-arm32?) - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch/rework-for-arm - (lambda* (#:key inputs #:allow-other-keys) - (let ((patch-file (assoc-ref inputs "patch/rework-for-arm"))) - (invoke "patch" "--force" "-p1" "--input" patch-file)))))) - '())) - + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-tests + ;; Our GCC code ensures that RUNPATH is never empty, it includes + ;; at least glibc/lib and gcc:lib/lib. + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "tests/no-rpath.sh" + ;; Disable checking for an empty runpath: + (("^if test.*") "") + ;; Find libgcc_s.so, which is necessary for the test: + (("/xxxxxxxxxxxxxxx") (string-append (assoc-ref inputs "gcc:lib") + "/lib"))) + #t))))) + (native-inputs + `(("gcc:lib" ,gcc "lib"))) (home-page "https://nixos.org/patchelf.html") (synopsis "Modify the dynamic linker and RPATH of ELF executables") (description diff --git a/gnu/packages/patches/patchelf-page-size.patch b/gnu/packages/patches/patchelf-page-size.patch deleted file mode 100644 index 1c14047512..0000000000 --- a/gnu/packages/patches/patchelf-page-size.patch +++ /dev/null @@ -1,70 +0,0 @@ -Improve the determination of pageSize in patchelf.cc. - -Patch by Mark H Weaver . - ---- patchelf/src/patchelf.cc.orig 1969-12-31 19:00:01.000000000 -0500 -+++ patchelf/src/patchelf.cc 2014-02-16 20:15:06.283203125 -0500 -@@ -21,11 +21,19 @@ - using namespace std; - - --#ifdef MIPSEL --/* The lemote fuloong 2f kernel defconfig sets a page size of 16KB */ --const unsigned int pageSize = 4096*4; --#else -+/* Note that some platforms support multiple page sizes. Therefore, -+ it is not enough to query the current page size. 'pageSize' must -+ be the maximum architectural page size for the platform, which is -+ typically defined in the corresponding ABI document. -+ -+ XXX FIXME: This won't work when we're cross-compiling. */ -+ -+#if defined __MIPSEL__ || defined __MIPSEB__ || defined __aarch64__ -+const unsigned int pageSize = 65536; -+#elif defined __x86_64__ || defined __i386__ || defined __arm__ - const unsigned int pageSize = 4096; -+#else -+# error maximum architectural page size unknown for this platform - #endif - - ---- patchelf/tests/no-rpath.sh.orig 2014-01-14 08:17:47.000000000 -0500 -+++ patchelf/tests/no-rpath.sh 2015-01-06 18:31:53.418172797 -0500 -@@ -1,23 +1,23 @@ - #! /bin/sh -e - SCRATCH=scratch/$(basename $0 .sh) - --rm -rf ${SCRATCH} --mkdir -p ${SCRATCH} -+if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then -+ rm -rf ${SCRATCH} -+ mkdir -p ${SCRATCH} - --cp ${srcdir}/no-rpath ${SCRATCH}/ -+ cp ${srcdir}/no-rpath ${SCRATCH}/ - --oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) --if test -n "$oldRPath"; then exit 1; fi --../src/patchelf \ -- --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ -- --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx ${SCRATCH}/no-rpath -+ oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) -+ if test -n "$oldRPath"; then exit 1; fi -+ ../src/patchelf \ -+ --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ -+ --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx ${SCRATCH}/no-rpath - --newRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) --if ! echo "$newRPath" | grep -q '/foo:/bar'; then -- echo "incomplete RPATH" -- exit 1 --fi -+ newRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) -+ if ! echo "$newRPath" | grep -q '/foo:/bar'; then -+ echo "incomplete RPATH" -+ exit 1 -+ fi - --if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then - cd ${SCRATCH} && ./no-rpath - fi diff --git a/gnu/packages/patches/patchelf-rework-for-arm.patch b/gnu/packages/patches/patchelf-rework-for-arm.patch deleted file mode 100644 index 6f4eb8f72b..0000000000 --- a/gnu/packages/patches/patchelf-rework-for-arm.patch +++ /dev/null @@ -1,473 +0,0 @@ -Rework the growing algorithm in patchelf to support ARM systems. -See . -This patch copied from: - - -From 0a96239cea6b97b9a0fff80da576e58ca2dfb2a2 Mon Sep 17 00:00:00 2001 -From: Sebastian Parschauer -Date: Sat, 28 Jun 2014 01:24:57 +0200 -Subject: [PATCH] Rework the growing algorithm - -On ARM systems there is no space in virtual memory for another LOAD -area in front of the code LOAD area. So insert data to its end -instead. At this location there should be enough space in virtual -memory due to alignment. We can extend it until the end of the -alignment but the file shift may be greater as it must be aligned -to the page size. Do the same for the data LOAD area. ---- - src/patchelf.cc | 357 ++++++++++++++++++++++---------------------------------- - 1 file changed, 142 insertions(+), 215 deletions(-) - -diff --git a/src/patchelf.cc b/src/patchelf.cc -index dcbfd38..4fce9e6 100644 ---- a/src/patchelf.cc -+++ b/src/patchelf.cc -@@ -116,7 +116,11 @@ private: - - void sortShdrs(); - -- void shiftFile(unsigned int extraPages, Elf_Addr startPage); -+ void shiftFileSingle(size_t fileShift, Elf_Off insertOff); -+ -+ void shiftFile(size_t neededCode, size_t neededData, -+ Elf_Off codeOff[], Elf_Off dataOff[], -+ Elf_Addr *codePage, Elf_Addr *dataPage); - - string getSectionName(const Elf_Shdr & shdr); - -@@ -130,13 +134,11 @@ private: - unsigned int size); - - void writeReplacedSections(Elf_Off & curOff, -- Elf_Addr startAddr, Elf_Off startOffset); -+ Elf_Addr startAddr, Elf_Off startOffset, bool isData); - - void rewriteHeaders(Elf_Addr phdrAddress); - -- void rewriteSectionsLibrary(); -- -- void rewriteSectionsExecutable(); -+ void rewriteSectionsBinary(); - - public: - -@@ -391,46 +393,119 @@ static unsigned int roundUp(unsigned int n, unsigned int m) - - - template --void ElfFile::shiftFile(unsigned int extraPages, Elf_Addr startPage) -+void ElfFile::shiftFileSingle(size_t fileShift, -+ Elf_Off insertOff) - { -- /* Move the entire contents of the file `extraPages' pages -- further. */ - unsigned int oldSize = fileSize; -- unsigned int shift = extraPages * pageSize; -- growFile(fileSize + extraPages * pageSize); -- memmove(contents + extraPages * pageSize, contents, oldSize); -- memset(contents + sizeof(Elf_Ehdr), 0, shift - sizeof(Elf_Ehdr)); -+ -+ /* Grow at the end */ -+ growFile(fileSize + fileShift); -+ -+ /* move the data from the insertion point -+ to the end and zero inserted space */ -+ memmove(contents + insertOff + fileShift, -+ contents + insertOff, oldSize - insertOff); -+ memset(contents + insertOff, 0, fileShift); - - /* Adjust the ELF header. */ - wri(hdr->e_phoff, sizeof(Elf_Ehdr)); -- wri(hdr->e_shoff, rdi(hdr->e_shoff) + shift); -+ if (rdi(hdr->e_shoff) >= insertOff) -+ wri(hdr->e_shoff, rdi(hdr->e_shoff) + fileShift); - - /* Update the offsets in the section headers. */ -- for (int i = 1; i < rdi(hdr->e_shnum); ++i) -- wri(shdrs[i].sh_offset, rdi(shdrs[i].sh_offset) + shift); -+ for (int i = 1; i < rdi(hdr->e_shnum); ++i) { -+ if (rdi(shdrs[i].sh_offset) >= insertOff) -+ wri(shdrs[i].sh_offset, rdi(shdrs[i].sh_offset) + fileShift); -+ } - - /* Update the offsets in the program headers. */ - for (int i = 0; i < rdi(hdr->e_phnum); ++i) { -- wri(phdrs[i].p_offset, rdi(phdrs[i].p_offset) + shift); -- if (rdi(phdrs[i].p_align) != 0 && -- (rdi(phdrs[i].p_vaddr) - rdi(phdrs[i].p_offset)) % rdi(phdrs[i].p_align) != 0) { -- debug("changing alignment of program header %d from %d to %d\n", i, -- rdi(phdrs[i].p_align), pageSize); -- wri(phdrs[i].p_align, pageSize); -+ if (rdi(phdrs[i].p_offset) >= insertOff) -+ wri(phdrs[i].p_offset, rdi(phdrs[i].p_offset) + fileShift); -+ /* Check for ELF load command alignment issue the same -+ way as glibc/elf/dl-load.c does. This gives us the -+ chance to run an interpreter explicitly. */ -+ if (rdi(phdrs[i].p_type) == PT_LOAD && ((rdi(phdrs[i].p_vaddr) - -+ rdi(phdrs[i].p_offset)) & (rdi(phdrs[i].p_align) - 1)) != 0) { -+ debug("changing alignment of program header %d from %d to %d\n", -+ i, rdi(phdrs[i].p_align), pageSize); -+ wri(phdrs[i].p_align, pageSize); - } - } -+} -+ -+template -+void ElfFile::shiftFile(size_t neededCode, -+ size_t neededData, Elf_Off codeOff[], Elf_Off dataOff[], -+ Elf_Addr *codePage, Elf_Addr *dataPage) -+{ -+ /* Move some contents of the file further. The binary has one LOAD area -+ * for code and one for data. There is virtual memory space between -+ * these which we can use due to alignment. -+ */ -+ unsigned int memShift = neededCode; -+ unsigned int fileShift = roundUp(neededCode, pageSize); -+ unsigned int maxMemShift = 0; -+ -+ if (neededCode > 0) { -+ /* find the LOAD program header for code and extend it */ -+ for (int i = 0; i < rdi(hdr->e_phnum); ++i) { -+ if (rdi(phdrs[i].p_type) == PT_LOAD && -+ rdi(phdrs[i].p_flags) & PF_X) { -+ codeOff[1] = rdi(phdrs[i].p_filesz); -+ codeOff[0] = codeOff[1] + rdi(phdrs[i].p_offset); -+ maxMemShift = rdi(phdrs[i].p_memsz) % rdi(phdrs[i].p_align); -+ if (maxMemShift == 0) -+ continue; -+ maxMemShift = rdi(phdrs[i].p_align) - maxMemShift; -+ if (maxMemShift == 0 || memShift > maxMemShift) -+ continue; -+ *codePage = rdi(phdrs[i].p_vaddr); -+ wri(phdrs[i].p_filesz, rdi(phdrs[i].p_filesz) + memShift); -+ wri(phdrs[i].p_memsz, rdi(phdrs[i].p_memsz) + memShift); -+ break; -+ } -+ } -+ debug("codeOff: %#lx, memShift: %d, maxMemShift: %d, fileShift: %d\n", -+ codeOff[1], memShift, maxMemShift, fileShift); -+ if (codeOff[1] == 0 || maxMemShift == 0) -+ goto out; -+ -+ shiftFileSingle(fileShift, codeOff[0]); -+ } -+ -+ /* +++ Do the same for the data LOAD area +++ */ -+ memShift = neededData; -+ fileShift = roundUp(neededData, pageSize); -+ maxMemShift = 0; -+ if (neededData > 0) { -+ /* find the LOAD program header for data and extend it */ -+ for (int i = 0; i < rdi(hdr->e_phnum); ++i) { -+ if (rdi(phdrs[i].p_type) == PT_LOAD && -+ rdi(phdrs[i].p_flags) & PF_W) { -+ dataOff[1] = rdi(phdrs[i].p_filesz); -+ dataOff[0] = dataOff[1] + rdi(phdrs[i].p_offset); -+ maxMemShift = rdi(phdrs[i].p_memsz) % rdi(phdrs[i].p_align); -+ if (maxMemShift == 0) -+ continue; -+ maxMemShift = rdi(phdrs[i].p_align) - maxMemShift; -+ if (maxMemShift == 0 || memShift > maxMemShift) -+ continue; -+ *dataPage = rdi(phdrs[i].p_vaddr); -+ wri(phdrs[i].p_filesz, rdi(phdrs[i].p_filesz) + memShift); -+ wri(phdrs[i].p_memsz, rdi(phdrs[i].p_memsz) + memShift); -+ break; -+ } -+ } -+ debug("dataOff: %#lx, memShift: %d, maxMemShift: %d, fileShift: %d\n", -+ dataOff[1], memShift, maxMemShift, fileShift); -+ if (dataOff[1] == 0 || maxMemShift == 0) -+ goto out; - -- /* Add a segment that maps the new program/section headers and -- PT_INTERP segment into memory. Otherwise glibc will choke. */ -- phdrs.resize(rdi(hdr->e_phnum) + 1); -- wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1); -- Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1]; -- wri(phdr.p_type, PT_LOAD); -- wri(phdr.p_offset, 0); -- wri(phdr.p_vaddr, wri(phdr.p_paddr, startPage)); -- wri(phdr.p_filesz, wri(phdr.p_memsz, shift)); -- wri(phdr.p_flags, PF_R | PF_W); -- wri(phdr.p_align, pageSize); -+ shiftFileSingle(fileShift, dataOff[0]); -+ } -+out: -+ return; - } - - -@@ -491,7 +566,7 @@ string & ElfFile::replaceSection(const SectionName & sectionN - - template - void ElfFile::writeReplacedSections(Elf_Off & curOff, -- Elf_Addr startAddr, Elf_Off startOffset) -+ Elf_Addr startAddr, Elf_Off startOffset, bool isData = false) - { - /* Overwrite the old section contents with 'X's. Do this - *before* writing the new section contents (below) to prevent -@@ -501,6 +576,9 @@ void ElfFile::writeReplacedSections(Elf_Off & curOff, - { - string sectionName = i->first; - Elf_Shdr & shdr = findSection(sectionName); -+ if ((!isData && rdi(shdr.sh_flags) & SHF_WRITE) || -+ (isData && ~(rdi(shdr.sh_flags)) & SHF_WRITE)) -+ continue; - memset(contents + rdi(shdr.sh_offset), 'X', rdi(shdr.sh_size)); - } - -@@ -509,6 +587,9 @@ void ElfFile::writeReplacedSections(Elf_Off & curOff, - { - string sectionName = i->first; - Elf_Shdr & shdr = findSection(sectionName); -+ if ((!isData && rdi(shdr.sh_flags) & SHF_WRITE) || -+ (isData && ~(rdi(shdr.sh_flags)) & SHF_WRITE)) -+ continue; - debug("rewriting section `%s' from offset 0x%x (size %d) to offset 0x%x (size %d)\n", - sectionName.c_str(), rdi(shdr.sh_offset), rdi(shdr.sh_size), curOff, i->second.size()); - -@@ -546,201 +627,47 @@ void ElfFile::writeReplacedSections(Elf_Off & curOff, - curOff += roundUp(i->second.size(), sectionAlignment); - } - -- replacedSections.clear(); -+ if (isData) -+ replacedSections.clear(); - } - - - template --void ElfFile::rewriteSectionsLibrary() -+void ElfFile::rewriteSectionsBinary() - { -- /* For dynamic libraries, we just place the replacement sections -- at the end of the file. They're mapped into memory by a -- PT_LOAD segment located directly after the last virtual address -- page of other segments. */ -- Elf_Addr startPage = 0; -- for (unsigned int i = 0; i < phdrs.size(); ++i) { -- Elf_Addr thisPage = roundUp(rdi(phdrs[i].p_vaddr) + rdi(phdrs[i].p_memsz), pageSize); -- if (thisPage > startPage) startPage = thisPage; -- } -- -- debug("last page is 0x%llx\n", (unsigned long long) startPage); -+ Elf_Off codeOff[2] = {0}, dataOff[2] = {0}; -+ Elf_Addr codePage = 0, dataPage = 0; -+ size_t neededCode = 0, neededData = 0, oldCode = 0, oldData = 0; -+ Elf_Shdr shdr = findSection(".text"); -+ Elf_Addr firstPage = rdi(shdr.sh_addr) - rdi(shdr.sh_offset); - -+ debug("first page is 0x%llx\n", (unsigned long long) firstPage); - -- /* Compute the total space needed for the replaced sections and -- the program headers. */ -- off_t neededSpace = (phdrs.size() + 1) * sizeof(Elf_Phdr); -+ /* Compute the total space needed for the replaced sections */ - for (ReplacedSections::iterator i = replacedSections.begin(); -- i != replacedSections.end(); ++i) -- neededSpace += roundUp(i->second.size(), sectionAlignment); -- debug("needed space is %d\n", neededSpace); -- -- -- size_t startOffset = roundUp(fileSize, pageSize); -- -- growFile(startOffset + neededSpace); -- -- -- /* Even though this file is of type ET_DYN, it could actually be -- an executable. For instance, Gold produces executables marked -- ET_DYN. In that case we can still hit the kernel bug that -- necessitated rewriteSectionsExecutable(). However, such -- executables also tend to start at virtual address 0, so -- rewriteSectionsExecutable() won't work because it doesn't have -- any virtual address space to grow downwards into. As a -- workaround, make sure that the virtual address of our new -- PT_LOAD segment relative to the first PT_LOAD segment is equal -- to its offset; otherwise we hit the kernel bug. This may -- require creating a hole in the executable. The bigger the size -- of the uninitialised data segment, the bigger the hole. */ -- if (isExecutable) { -- if (startOffset >= startPage) { -- debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); -- } else { -- size_t hole = startPage - startOffset; -- /* Print a warning, because the hole could be very big. */ -- fprintf(stderr, "warning: working around a Linux kernel bug by creating a hole of %zu bytes in ‘%s’\n", hole, fileName.c_str()); -- assert(hole % pageSize == 0); -- /* !!! We could create an actual hole in the file here, -- but it's probably not worth the effort. */ -- growFile(fileSize + hole); -- startOffset += hole; -- } -- startPage = startOffset; -- } -- -- -- /* Add a segment that maps the replaced sections and program -- headers into memory. */ -- phdrs.resize(rdi(hdr->e_phnum) + 1); -- wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1); -- Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1]; -- wri(phdr.p_type, PT_LOAD); -- wri(phdr.p_offset, startOffset); -- wri(phdr.p_vaddr, wri(phdr.p_paddr, startPage)); -- wri(phdr.p_filesz, wri(phdr.p_memsz, neededSpace)); -- wri(phdr.p_flags, PF_R | PF_W); -- wri(phdr.p_align, pageSize); -- -- -- /* Write out the replaced sections. */ -- Elf_Off curOff = startOffset + phdrs.size() * sizeof(Elf_Phdr); -- writeReplacedSections(curOff, startPage, startOffset); -- assert((off_t) curOff == startOffset + neededSpace); -- -- -- /* Move the program header to the start of the new area. */ -- wri(hdr->e_phoff, startOffset); -- -- rewriteHeaders(startPage); --} -- -- --template --void ElfFile::rewriteSectionsExecutable() --{ -- /* Sort the sections by offset, otherwise we won't correctly find -- all the sections before the last replaced section. */ -- sortShdrs(); -- -- -- /* What is the index of the last replaced section? */ -- unsigned int lastReplaced = 0; -- for (unsigned int i = 1; i < rdi(hdr->e_shnum); ++i) { -- string sectionName = getSectionName(shdrs[i]); -- if (replacedSections.find(sectionName) != replacedSections.end()) { -- debug("using replaced section `%s'\n", sectionName.c_str()); -- lastReplaced = i; -- } -- } -- -- assert(lastReplaced != 0); -- -- debug("last replaced is %d\n", lastReplaced); -- -- /* Try to replace all sections before that, as far as possible. -- Stop when we reach an irreplacable section (such as one of type -- SHT_PROGBITS). These cannot be moved in virtual address space -- since that would invalidate absolute references to them. */ -- assert(lastReplaced + 1 < shdrs.size()); /* !!! I'm lazy. */ -- size_t startOffset = rdi(shdrs[lastReplaced + 1].sh_offset); -- Elf_Addr startAddr = rdi(shdrs[lastReplaced + 1].sh_addr); -- string prevSection; -- for (unsigned int i = 1; i <= lastReplaced; ++i) { -- Elf_Shdr & shdr(shdrs[i]); -- string sectionName = getSectionName(shdr); -- debug("looking at section `%s'\n", sectionName.c_str()); -- /* !!! Why do we stop after a .dynstr section? I can't -- remember! */ -- if ((rdi(shdr.sh_type) == SHT_PROGBITS && sectionName != ".interp") -- || prevSection == ".dynstr") -- { -- startOffset = rdi(shdr.sh_offset); -- startAddr = rdi(shdr.sh_addr); -- lastReplaced = i - 1; -- break; -+ i != replacedSections.end(); ++i) { -+ shdr = findSection(i->first); -+ if (rdi(shdr.sh_flags) & SHF_WRITE) { -+ oldData += rdi(shdr.sh_size); -+ neededData += roundUp(i->second.size(), sectionAlignment); - } else { -- if (replacedSections.find(sectionName) == replacedSections.end()) { -- debug("replacing section `%s' which is in the way\n", sectionName.c_str()); -- replaceSection(sectionName, rdi(shdr.sh_size)); -- } -+ oldCode += rdi(shdr.sh_size); -+ neededCode += roundUp(i->second.size(), sectionAlignment); - } -- prevSection = sectionName; - } - -- debug("first reserved offset/addr is 0x%x/0x%llx\n", -- startOffset, (unsigned long long) startAddr); -- -- assert(startAddr % pageSize == startOffset % pageSize); -- Elf_Addr firstPage = startAddr - startOffset; -- debug("first page is 0x%llx\n", (unsigned long long) firstPage); -- -- /* Right now we assume that the section headers are somewhere near -- the end, which appears to be the case most of the time. -- Therefore they're not accidentally overwritten by the replaced -- sections. !!! Fix this. */ -- assert((off_t) rdi(hdr->e_shoff) >= startOffset); -- -- -- /* Compute the total space needed for the replaced sections, the -- ELF header, and the program headers. */ -- size_t neededSpace = sizeof(Elf_Ehdr) + phdrs.size() * sizeof(Elf_Phdr); -- for (ReplacedSections::iterator i = replacedSections.begin(); -- i != replacedSections.end(); ++i) -- neededSpace += roundUp(i->second.size(), sectionAlignment); -- -- debug("needed space is %d\n", neededSpace); -- -- /* If we need more space at the start of the file, then grow the -- file by the minimum number of pages and adjust internal -- offsets. */ -- if (neededSpace > startOffset) { -- -- /* We also need an additional program header, so adjust for that. */ -- neededSpace += sizeof(Elf_Phdr); -- debug("needed space is %d\n", neededSpace); -- -- unsigned int neededPages = roundUp(neededSpace - startOffset, pageSize) / pageSize; -- debug("needed pages is %d\n", neededPages); -- if (neededPages * pageSize > firstPage) -- error("virtual address space underrun!"); -- -- firstPage -= neededPages * pageSize; -- startOffset += neededPages * pageSize; -- -- shiftFile(neededPages, firstPage); -- } -- -- -- /* Clear out the free space. */ -- Elf_Off curOff = sizeof(Elf_Ehdr) + phdrs.size() * sizeof(Elf_Phdr); -- debug("clearing first %d bytes\n", startOffset - curOff); -- memset(contents + curOff, 0, startOffset - curOff); -+ debug("needed space is C: %d, D: %d\n", neededCode, neededData); - -+ /* If we need more space within the file, then grow the -+ file and adjust internal offsets. */ -+ shiftFile(neededCode, neededData, codeOff, dataOff, &codePage, -+ &dataPage); -+ assert(codeOff[0] > 0); - - /* Write out the replaced sections. */ -- writeReplacedSections(curOff, firstPage, 0); -- assert((off_t) curOff == neededSpace); -- -+ debug("codePage: %#lx, dataPage: %#lx\n", codePage, dataPage); -+ writeReplacedSections(codeOff[0], codePage + codeOff[1], codeOff[0]); -+ writeReplacedSections(dataOff[0], dataPage + dataOff[1], dataOff[0], true); - - rewriteHeaders(firstPage + rdi(hdr->e_phoff)); - } -@@ -758,10 +685,10 @@ void ElfFile::rewriteSections() - - if (rdi(hdr->e_type) == ET_DYN) { - debug("this is a dynamic library\n"); -- rewriteSectionsLibrary(); -+ rewriteSectionsBinary(); - } else if (rdi(hdr->e_type) == ET_EXEC) { - debug("this is an executable\n"); -- rewriteSectionsExecutable(); -+ rewriteSectionsBinary(); - } else error("unknown ELF type"); - } - --- -2.1.2 - -- cgit v1.2.3 From 0dd6089d344148e7ba39bc4c66288fc006814d60 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 3 May 2019 13:11:57 +0200 Subject: gnu: Add java-svg-salamander. * gnu/packages/java.scm (java-svg-salamander): New variable. * gnu/packages/patches/java-svg-salamander-Fix-non-det.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/java.scm | 47 ++++++++++++ .../patches/java-svg-salamander-Fix-non-det.patch | 86 ++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 gnu/packages/patches/java-svg-salamander-Fix-non-det.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index e1c1cef854..7ef5ef7a6c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1001,6 +1001,7 @@ dist_patch_DATA = \ %D%/packages/patches/java-jeromq-fix-tests.patch \ %D%/packages/patches/java-powermock-fix-java-files.patch \ %D%/packages/patches/java-simple-xml-fix-tests.patch \ + %D%/packages/patches/java-svg-salamander-Fix-non-det.patch \ %D%/packages/patches/java-xerces-bootclasspath.patch \ %D%/packages/patches/java-xerces-build_dont_unzip.patch \ %D%/packages/patches/java-xerces-xjavac_taskdef.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index c41ea20492..32e3c3ce6f 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -11484,3 +11484,50 @@ library and the API is similar.") reading metadata from image files. It is able to read metadata in Exif, IPTC, XMP, ICC and more formats.") (license license:asl2.0))) + +(define-public java-svg-salamander + (package + (name "java-svg-salamander") + (version "1.1.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/blackears/svgSalamander") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf")) + (modules '((guix build utils))) + (snippet + `(for-each delete-file (find-files "." ".*.jar"))) + (patches + (search-patches "java-svg-salamander-Fix-non-det.patch")))) + (build-system ant-build-system) + (arguments + `(#:tests? #f; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "svg-core") + #t)) + (add-before 'build 'copy-jars + (lambda* (#:key inputs #:allow-other-keys) + (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$")) + "../libraries/javacc.jar") + (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$")) + "../libraries/ant.jar") + #t)) + (replace 'install + (install-jars "dist"))))) + (native-inputs + `(("javacc" ,javacc))) + (home-page "https://github.com/blackears/svgSalamander") + (synopsis "SVG engine for Java") + (description "SVG Salamander is an SVG engine for Java that's designed +to be small, fast, and allow programmers to use it with a minimum of fuss. +It's in particular targeted for making it easy to integrate SVG into Java +games and making it much easier for artists to design 2D game content - from +rich interactive menus to charts and graphcs to complex animations.") + (license license:bsd-2))) diff --git a/gnu/packages/patches/java-svg-salamander-Fix-non-det.patch b/gnu/packages/patches/java-svg-salamander-Fix-non-det.patch new file mode 100644 index 0000000000..418fa0867f --- /dev/null +++ b/gnu/packages/patches/java-svg-salamander-Fix-non-det.patch @@ -0,0 +1,86 @@ +From c812efa9fcbfb49a571cc73af83c8da5cb951bcf Mon Sep 17 00:00:00 2001 +From: Julien Lepiller +Date: Thu, 2 May 2019 19:05:33 +0200 +Subject: [PATCH] Fix non determinism and installation + +--- + svg-core/build.xml | 22 ---------------------- + svg-core/nbproject/build-impl.xml | 1 - + 2 files changed, 23 deletions(-) + +diff --git a/svg-core/build.xml b/svg-core/build.xml +index cc72eb7..0f9c3e6 100755 +--- a/svg-core/build.xml ++++ b/svg-core/build.xml +@@ -102,7 +102,6 @@ + + + +- + + + +@@ -112,7 +111,6 @@ + + + +- + + + +@@ -126,7 +124,6 @@ + + + +- + + + +@@ -203,7 +200,6 @@ + + + +- + + + +@@ -213,24 +209,6 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +diff --git a/svg-core/nbproject/build-impl.xml b/svg-core/nbproject/build-impl.xml +index b448d8a..37725ad 100755 +--- a/svg-core/nbproject/build-impl.xml ++++ b/svg-core/nbproject/build-impl.xml +@@ -1045,7 +1045,6 @@ is divided into following sections: + + + +- + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" +-- +2.21.0 + -- cgit v1.2.3 From faab7082ab9587b71ca5ae8becdf72234f3c51d7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Nov 2019 17:15:05 +0100 Subject: gnu: openmpi: Raise the priority of the PSM2 component. This allows us to get better performance by default on machines with OmniPath hardware. * gnu/packages/patches/openmpi-psm2-priority.patch: New file. * gnu/packages/mpi.scm (openmpi)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/mpi.scm | 3 ++- gnu/packages/patches/openmpi-psm2-priority.patch | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/openmpi-psm2-priority.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 7ef5ef7a6c..4e6fb7c1d8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1192,6 +1192,7 @@ dist_patch_DATA = \ %D%/packages/patches/opencv-rgbd-aarch64-test-fix.patch \ %D%/packages/patches/openfoam-4.1-cleanup.patch \ %D%/packages/patches/openjdk-10-idlj-reproducibility.patch \ + %D%/packages/patches/openmpi-psm2-priority.patch \ %D%/packages/patches/openocd-nrf52.patch \ %D%/packages/patches/opensmtpd-fix-crash.patch \ %D%/packages/patches/openssl-runpath.patch \ diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm index 79ee948765..5fde6efae4 100644 --- a/gnu/packages/mpi.scm +++ b/gnu/packages/mpi.scm @@ -174,7 +174,8 @@ bind processes, and much more.") (version-major+minor version) "/downloads/openmpi-" version ".tar.bz2")) (sha256 - (base32 "0ms0zvyxyy3pnx9qwib6zaljyp2b3ixny64xvq3czv3jpr8zf2wh")))) + (base32 "0ms0zvyxyy3pnx9qwib6zaljyp2b3ixny64xvq3czv3jpr8zf2wh")) + (patches (search-patches "openmpi-psm2-priority.patch")))) (build-system gnu-build-system) (inputs `(("hwloc" ,hwloc-2 "lib") diff --git a/gnu/packages/patches/openmpi-psm2-priority.patch b/gnu/packages/patches/openmpi-psm2-priority.patch new file mode 100644 index 0000000000..d9dd558010 --- /dev/null +++ b/gnu/packages/patches/openmpi-psm2-priority.patch @@ -0,0 +1,21 @@ +PSM2 is the only valid implementation for OmniPath (OPA). UCX also +supports OmniPath, but it does so via Verbs, thus getting much lower +performance (typically 3 GiB/s instead of 10 GiB/s). + +To work around that, give the mtl_psm2 component a higher priority +than the pml_ucx component. + +See . + +--- openmpi-4.0.2/ompi/mca/mtl/psm2/mtl_psm2_component.c 2019-11-15 17:06:15.142076840 +0100 ++++ openmpi-4.0.2/ompi/mca/mtl/psm2/mtl_psm2_component.c 2019-11-15 17:06:22.242009379 +0100 +@@ -126,7 +126,7 @@ ompi_mtl_psm2_component_register(void) + setenv("PSM2_DEVICES", "self,shm", 0); + } + +- param_priority = 40; ++ param_priority = 55; + (void) mca_base_component_var_register (&mca_mtl_psm2_component.super.mtl_version, + "priority", "Priority of the PSM2 MTL component", + MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, + -- cgit v1.2.3