gnu: patchelf: Update to 0.8.
[jackhill/guix/guix.git] / gnu / packages / elf.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages elf)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+))
25 #:use-module (gnu packages)
26 #:use-module (gnu packages m4)
27 #:use-module (gnu packages compression))
28
29 (define-public elfutils
30 (package
31 (name "elfutils")
32 (version "0.157")
33 (source (origin
34 (method url-fetch)
35 (uri (string-append
36 "https://fedorahosted.org/releases/e/l/elfutils/"
37 version "/elfutils-" version ".tar.bz2"))
38 (sha256
39 (base32
40 "11ffbihw9zs2dhmlww9zilwvmv6v1pr6bvnz5dnzn0lxq70ckbag"))))
41 (build-system gnu-build-system)
42
43 ;; Separate programs because that's usually not what elfutils users want,
44 ;; and because they duplicate what Binutils provides.
45 (outputs '("out" ; libelf.so, elfutils/*.h, etc.
46 "bin")) ; ld, nm, objdump, etc.
47
48 (native-inputs `(("m4" ,m4)))
49 (inputs `(("zlib" ,zlib)))
50 (home-page "https://fedorahosted.org/elfutils/")
51 (synopsis "Linker and ELF manipulation tools")
52 (description
53 "This package provides command-line tools to manipulate binaries in the
54 Executable and Linkable Format (ELF). This includes ld, ar, objdump,
55 addr2line, and more.")
56
57 ;; Libraries are dual-licensed LGPLv3.0+ | GPLv2, and programs are GPLv3+.
58 (license lgpl3+)))
59
60 (define-public libelf
61 (package
62 (name "libelf")
63 (version "0.8.13")
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "http://www.mr511.de/software/libelf-"
67 version ".tar.gz"))
68 (sha256
69 (base32
70 "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr"))))
71 (build-system gnu-build-system)
72 (arguments '(#:phases (alist-replace
73 'configure
74 (lambda* (#:key outputs #:allow-other-keys)
75 ;; This old `configure' script doesn't support
76 ;; variables passed as arguments.
77 (let ((out (assoc-ref outputs "out")))
78 (setenv "CONFIG_SHELL" (which "bash"))
79 (zero?
80 (system* "./configure"
81 (string-append "--prefix=" out)))))
82 %standard-phases)))
83 (home-page "http://www.mr511.de/software/english.html")
84 (synopsis "ELF object file access library")
85 (description "Libelf is a C library to access ELF object files.")
86 (license lgpl2.0+)))
87
88 (define-public patchelf
89 (package
90 (name "patchelf")
91 (version "0.8")
92 (source (origin
93 (method url-fetch)
94 (uri (string-append
95 "http://nixos.org/releases/patchelf/patchelf-"
96 version
97 "/patchelf-" version ".tar.bz2"))
98 (sha256
99 (base32
100 "1rqpg84wrd3fa16wa9vqdvasnc05yz49w207cz1l0wrl4k8q97y9"))
101 (patches (list (search-patch "patchelf-page-size.patch")))))
102 (build-system gnu-build-system)
103 (home-page "http://nixos.org/patchelf.html")
104 (synopsis "Modify the dynamic linker and RPATH of ELF executables")
105 (description
106 "PatchELF allows the ELF \"interpreter\" and RPATH of an ELF binary to be
107 changed.")
108 (license gpl3+)))