[PATCH] gnu: Add libx86emu.

DoneSubmitted by Vincent Legoll.
Details
2 participants
  • Ludovic Courtès
  • Vincent Legoll
Owner
unassigned
Severity
normal
V
V
Vincent Legoll wrote on 9 Jan 2021 15:42
(address . guix-patches@gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20210109144256.2209-1-vincent.legoll@gmail.com
* gnu/packages/emulators.scm (libx86emu): New variable.
---
gnu/packages/emulators.scm | 48 ++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Toggle diff (68 lines)
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 1d94090f48..4b76dcef79 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -72,6 +72,7 @@
   #:use-module (gnu packages music)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -591,6 +592,53 @@ and Game Boy Color games.")
     ;; BSD-3, and "discord-rpc" is Expat.
     (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
 
+(define-public libx86emu
+  (package
+    (name "libx86emu")
+    (version "3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/wfeldt/libx86emu")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("nasm" ,nasm)
+       ("perl" ,perl)))   ; for the `./test/prepare_test' script
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'version-file
+           (lambda _
+             (invoke "chmod" "-x" "./git2log")    ; we are not in a full git repository
+             (with-output-to-file "./VERSION"     ; emulate what git2log would have done
+               (lambda _
+                 (display ,version)))
+             #t))
+         (replace 'check
+           (lambda _
+             (invoke "make" "test")))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "make" "install"
+                     (string-append "DESTDIR=" (assoc-ref outputs "out"))
+                     (string-append "LIBDIR=" (assoc-ref outputs "out") "/usr/lib")) ; avoid using `ldd /bin/sh' to choose between 32 and 64 bits libdir
+             #t))
+         (delete 'configure))))
+    (home-page "https://github.com/wfeldt/libx86emu")
+    (synopsis "x86 emulation library")
+    (description "libx86emu is a small library to emulate x86 instructions.  The
+focus here is not a complete emulation (use qemu for this) but to cover enough
+for typical firmware blobs.  At the moment 'regular' 32-bit instructions are
+covered together with basic protected mode support.  Not done are fpu, mmx, or
+any of the other instruction set extensions.")
+    (license (license:non-copyleft
+              "https://github.com/wfeldt/libx86emu/blob/master/LICENSE"))))
+
 (define-public sameboy
   (package
     (name "sameboy")
-- 
2.30.0
V
V
Vincent Legoll wrote on 11 Jan 2021 18:58
(name . Guix Patches)(address . guix-patches@gnu.org)
CAEwRq=ow8+EPj2Mjrm6mDDR5tPbyxE5VyWTDfksd24UF499dDw@mail.gmail.com
Hello,

Please disregard this patch, I'll followup with an updated (better) one

On Sat, Jan 9, 2021 at 3:43 PM Vincent Legoll <vincent.legoll@gmail.com> wrote:
Toggle quote (77 lines)
>
> * gnu/packages/emulators.scm (libx86emu): New variable.
> ---
> gnu/packages/emulators.scm | 48 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
>
> diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
> index 1d94090f48..4b76dcef79 100644
> --- a/gnu/packages/emulators.scm
> +++ b/gnu/packages/emulators.scm
> @@ -72,6 +72,7 @@
> #:use-module (gnu packages music)
> #:use-module (gnu packages ncurses)
> #:use-module (gnu packages networking)
> + #:use-module (gnu packages perl)
> #:use-module (gnu packages pkg-config)
> #:use-module (gnu packages pulseaudio)
> #:use-module (gnu packages python)
> @@ -591,6 +592,53 @@ and Game Boy Color games.")
> ;; BSD-3, and "discord-rpc" is Expat.
> (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
>
> +(define-public libx86emu
> + (package
> + (name "libx86emu")
> + (version "3.1")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/wfeldt/libx86emu")
> + (commit version)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b"))))
> + (build-system gnu-build-system)
> + (native-inputs
> + `(("nasm" ,nasm)
> + ("perl" ,perl))) ; for the `./test/prepare_test' script
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'version-file
> + (lambda _
> + (invoke "chmod" "-x" "./git2log") ; we are not in a full git repository
> + (with-output-to-file "./VERSION" ; emulate what git2log would have done
> + (lambda _
> + (display ,version)))
> + #t))
> + (replace 'check
> + (lambda _
> + (invoke "make" "test")))
> + (replace 'install
> + (lambda* (#:key outputs #:allow-other-keys)
> + (invoke "make" "install"
> + (string-append "DESTDIR=" (assoc-ref outputs "out"))
> + (string-append "LIBDIR=" (assoc-ref outputs "out") "/usr/lib")) ; avoid using `ldd /bin/sh' to choose between 32 and 64 bits libdir
> + #t))
> + (delete 'configure))))
> + (home-page "https://github.com/wfeldt/libx86emu")
> + (synopsis "x86 emulation library")
> + (description "libx86emu is a small library to emulate x86 instructions. The
> +focus here is not a complete emulation (use qemu for this) but to cover enough
> +for typical firmware blobs. At the moment 'regular' 32-bit instructions are
> +covered together with basic protected mode support. Not done are fpu, mmx, or
> +any of the other instruction set extensions.")
> + (license (license:non-copyleft
> + "https://github.com/wfeldt/libx86emu/blob/master/LICENSE"))))
> +
> (define-public sameboy
> (package
> (name "sameboy")
> --
> 2.30.0
>


--
Vincent Legoll
L
L
Ludovic Courtès wrote on 13 Apr 2021 23:17
control message for bug #45744
(address . control@debbugs.gnu.org)
877dl5j343.fsf@gnu.org
tags 45744 wontfix
close 45744
quit
?
Your comment

This issue is archived.

To comment on this conversation send email to 45744@debbugs.gnu.org