guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#50283] [PATCH v1 1/2] gnu: Add libx86emu.


From: Raghav Gururajan
Subject: [bug#50283] [PATCH v1 1/2] gnu: Add libx86emu.
Date: Mon, 30 Aug 2021 15:35:24 -0400

* gnu/packages/virtualization.scm (libx86emu): New variable.
---
 gnu/packages/virtualization.scm | 52 +++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index e952c009b5..6dd5127bc6 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -130,6 +130,58 @@
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 match))
 
+(define-public libx86emu
+  (package
+    (name "libx86emu")
+    (version "3.1")
+    (home-page "https://github.com/wfeldt/libx86emu";)
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url home-page)
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (include (string-append out "/include"))
+                    (lib (string-append out "/lib")))
+               ;; Remove unnecessary variables and
+               ;; correct the values of version and prefix.
+               (substitute* (find-files "." "Makefile")
+                 (("GIT2LOG.*=.*$") "")
+                 (("GITDEPS.*=.*$") "")
+                 (("VERSION.*=.*$")
+                  (string-append "VERSION := "
+                                 ,version "\n"))
+                 (("BRANCH.*=.*$") "")
+                 (("PREFIX.*=.*$")
+                  (string-append "PREFIX := " out "\n"))
+                 (("MAJOR_VERSION.*=.*$")
+                  (string-append "MAJOR_VERSION := "
+                                 ,(version-major version) "\n"))
+                 (("LIBDIR.*=.*$")
+                  (string-append "LIBDIR = " lib "\n"))
+                 (("/usr/include") include)))))
+         (delete 'configure))))         ; no configure script
+    (native-inputs
+     `(("nasm" ,nasm)
+       ("perl" ,perl)))
+    (synopsis "ISA x86 emulation library")
+    (description "Libx86emu is a small library to emulate x86 instructions.  
The
+focus here is not a complete emulation but to cover enough for typical
+firmware blobs.")
+    (license license:isc)))
+
 (define (qemu-patch commit file-name sha256-bv)
   "Return an origin for COMMIT."
   (origin
-- 
2.33.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]