summary refs log tree commit diff
path: root/gnu/packages/admin.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-08-05 00:15:08 -0400
committerMark H Weaver <mhw@netris.org>2014-08-05 20:00:29 -0400
commit42dc3af5bfc8458de0289d66cb069d0e2efbad39 (patch)
tree27711398146f64806aaa5deed3cfa6a7183be00c /gnu/packages/admin.scm
parentf0176a9f185f081535b02764b3bfe1151ce315be (diff)
downloadguix-42dc3af5bfc8458de0289d66cb069d0e2efbad39.tar.gz
gnu: Add flashrom.
* gnu/packages/patches/flashrom-use-libftdi1.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/admin.scm (flashrom): New variable.
Diffstat (limited to 'gnu/packages/admin.scm')
-rw-r--r--gnu/packages/admin.scm47
1 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 4a88fdd76a..8abc6677ac 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -48,6 +48,9 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages pciutils)
+  #:use-module (gnu packages libusb)
+  #:use-module (gnu packages libftdi)
   #:use-module (gnu packages xorg))
 
 (define-public dmd
@@ -803,3 +806,47 @@ reliability depending on the manufacturer.  This will often include usage
 status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory
 module slots, and the list of I/O ports (e.g. serial, parallel, USB).")
     (license gpl2+)))
+
+(define-public flashrom
+  (package
+    (name "flashrom")
+    (version "0.9.7")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://download.flashrom.org/releases/flashrom-"
+                    version ".tar.bz2"))
+              (sha256
+               (base32
+                "1s9pc4yls2s1gcg2ar4q75nym2z5v6lxq36bl6lq26br00nj2mas"))
+              (patches (list (search-patch "flashrom-use-libftdi1.patch")))))
+    (build-system gnu-build-system)
+    (inputs `(("dmidecode" ,dmidecode)
+              ("pciutils" ,pciutils)
+              ("libusb" ,libusb)
+              ("libftdi" ,libftdi)))
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (arguments
+     '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
+       #:tests? #f   ; no 'check' target
+       #:phases
+       (alist-delete
+        'configure
+        (alist-cons-before
+         'build 'patch-exec-paths
+         (lambda* (#:key inputs #:allow-other-keys)
+           (substitute* "dmi.c"
+             (("\"dmidecode\"")
+              (format #f "~S"
+                      (string-append (assoc-ref inputs "dmidecode")
+                                     "/sbin/dmidecode")))))
+         %standard-phases))))
+    (home-page "http://flashrom.org/")
+    (synopsis "Identify, read, write, erase, and verify ROM/flash chips")
+    (description
+     "flashrom is a utility for identifying, reading, writing,
+verifying and erasing flash chips.  It is designed to flash
+BIOS/EFI/coreboot/firmware/optionROM images on mainboards,
+network/graphics/storage controller cards, and various other
+programmer devices.")
+    (license gpl2)))