unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45744] [PATCH] gnu: Add libx86emu.
@ 2021-01-09 14:42 Vincent Legoll
  2021-01-11 17:58 ` Vincent Legoll
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Legoll @ 2021-01-09 14:42 UTC (permalink / raw)
  To: 45744; +Cc: Vincent Legoll

* 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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [bug#45744] [PATCH] gnu: Add libx86emu.
  2021-01-09 14:42 [bug#45744] [PATCH] gnu: Add libx86emu Vincent Legoll
@ 2021-01-11 17:58 ` Vincent Legoll
  0 siblings, 0 replies; 2+ messages in thread
From: Vincent Legoll @ 2021-01-11 17:58 UTC (permalink / raw)
  To: 45744

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:
>
> * 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-11 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09 14:42 [bug#45744] [PATCH] gnu: Add libx86emu Vincent Legoll
2021-01-11 17:58 ` Vincent Legoll

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).