From b178fc236908ad2da86734ea8e01abd3ff8981da Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 17 Apr 2018 13:38:12 +0200 Subject: gremlin: Add 'strip-runpath'. * guix/build/gremlin.scm (strip-runpath): New procedure. * tests/gremlin.scm (c-compiler): New variable. ("strip-runpath"): New test. --- tests/gremlin.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/gremlin.scm b/tests/gremlin.scm index 2885554967..1b47d5c384 100644 --- a/tests/gremlin.scm +++ b/tests/gremlin.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,12 +18,14 @@ (define-module (test-gremlin) #:use-module (guix elf) + #:use-module ((guix utils) #:select (call-with-temporary-directory)) #:use-module (guix build utils) #:use-module (guix build gremlin) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-64) #:use-module (rnrs io ports) + #:use-module (ice-9 popen) #:use-module (ice-9 match)) (define %guile-executable @@ -37,6 +39,9 @@ (define read-elf (compose parse-elf get-bytevector-all)) +(define c-compiler + (or (which "gcc") (which "cc") (which "g++"))) + (test-begin "gremlin") @@ -63,4 +68,32 @@ "../${ORIGIN}/bar/$ORIGIN/baz" "ORIGIN/foo"))) +(unless c-compiler + (test-skip 1)) +(test-equal "strip-runpath" + "hello\n" + (call-with-temporary-directory + (lambda (directory) + (with-directory-excursion directory + (call-with-output-file "t.c" + (lambda (port) + (display "int main () { puts(\"hello\"); }" port))) + (invoke c-compiler "t.c" + "-Wl,-rpath=/foo" "-Wl,-rpath=/bar") + (let* ((dyninfo (elf-dynamic-info + (parse-elf (call-with-input-file "a.out" + get-bytevector-all)))) + (old (elf-dynamic-info-runpath dyninfo)) + (new (strip-runpath "a.out")) + (new* (strip-runpath "a.out"))) + (validate-needed-in-runpath "a.out") + (and (member "/foo" old) (member "/bar" old) + (not (member "/foo" new)) + (not (member "/bar" new)) + (equal? new* new) + (let* ((pipe (open-input-pipe "./a.out")) + (str (get-string-all pipe))) + (close-pipe pipe) + str))))))) + (test-end "gremlin") -- cgit v1.2.3 ass='left'>AgeCommit message (Expand)Author 2018-05-17Merge branch 'master' into core-updatesMark H Weaver 2018-05-14gnu: opencv: Ignore CVEs....* gnu/packages/image-processing.scm (opencv)[properties]: Add a lint-hidden-cve property and add three CVEs to be ignored. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Björn Höfling 2018-05-09gnu: Add opencv....* gnu/packages/image-processing.scm (opencv): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Björn Höfling 2018-03-18gnu: Switch from xproto to xorgproto....* gnu/packages/compton.scm (compton)[inputs]: Replace XPROTO with XORGPROTO. * gnu/packages/enlightenment.scm (efl)[inputs]: Likewise. * gnu/packages/gnome.scm (totem)[inputs]: Likewise. * gnu/packages/haskell.scm (ghc-x11-xft)[inputs]: Likewise. * gnu/packages/image-processing.scm (vtk)[inputs]: Likewise. * gnu/packages/mate.scm (mate-control-center, mate-netbook, mate-screensaver, mate-utils)[native-inputs]: Likewise. * gnu/packages/xdisorg.scm (xautomation)[native-inputs]: Likewise. * gnu/packages/xnee.scm (xnee)[inputs]: Likewise. * gnu/packages/xorg.scm (imake, lndir, libxshmfence, libfontenc, libfs, libxcomposite, libxdmcp, libxft, libxmu, libxpm, libxres, makedepend, mkfontscale, sessreg, xev, xf86-video-qxl, xkbcomp-intermediate, xkbutils, xlsfonts, xmodmap, xpr, xprop, xrandr, xset, xwd, xwininfo, xwud, xorg-rgb, libxdamage, libxrender, libxv, libice, libxau, libxfixes, libxfont, libxi, libxrandr, libxvmc, xorg-server, libxcursor, libxaw, twm, xinit, xterm)[inputs]: Likewise. (xorgproto): Move expression before all other -proto packages. (xproto)[properties]: Mark as superseded by XORGPROTO. Marius Bakke 2018-01-23Merge branch 'master' into core-updatesMark H Weaver 2018-01-21gnu: mia: Update to 2.4.6....* gnu/packages/image-processing.scm (mia): Update to 2.4.6. Tobias Geerinckx-Rice 2017-12-19gnu: Remove redundant cmake libdir configure flags....* gnu/packages/bioinformatics.scm (imp)[arguments]: Remove CMAKE_INSTALL_LIBDIR flag. * gnu/packages/calendar.scm (libical): Same. * gnu/packages/engineering.scm (kicad): Same. * gnu/packages/games.scm (openrct2, mgba): Same. * gnu/packages/gl.scm (virtualgl): Same. * gnu/packages/image-processing.scm (mia): Same. * gnu/packages/linux.scm (rdma-core): Same. * gnu/packages/machine-learning.scm (dlib): Same. * gnu/packages/maths.scm (lapack, superlu, z3): Same. * gnu/packages/password-utils.scm (keepassxc): Same. * gnu/packages/photo.scm (darktable): Same. * gnu/packages/rdesktop.scm (freerdp): Same. Efraim Flashner 2017-06-03gnu: Remove old vtk module dependence in image-processing.scm....* gnu/packages/image-processing.scm: Remove old vtk module dependence. Julien Lepiller 2017-06-02gnu: Move vtk to image-processing.scm....* gnu/packages/image-processing.scm (vtk): New variable. * gnu/packages/vtk.scm: Delete file. * gnu/local.mk (GNU_SYSTEM_MODULES): Remove it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> John Darrington 2017-05-15gnu: Add mia....* gnu/packages/image-processing.scm (mia): New variable. Co-authored-by: Ricardo Wurmus <rekado@elephly.net> John Darrington 2017-05-15gnu: Add dcmtk....* gnu/packages/image-processing.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Co-authored-by: Ricardo Wurmus <rekado@elephly.net> John Darrington