From patchwork Mon Aug 30 19:35:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghav Gururajan X-Patchwork-Id: 32425 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2D4D127BBE1; Mon, 30 Aug 2021 20:42:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5A82E27BBE3 for ; Mon, 30 Aug 2021 20:42:17 +0100 (BST) Received: from localhost ([::1]:36060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKnAe-0000Sp-GP for patchwork@mira.cbaines.net; Mon, 30 Aug 2021 15:42:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKn4d-0007gs-9B for guix-patches@gnu.org; Mon, 30 Aug 2021 15:36:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKn4c-00027p-Un for guix-patches@gnu.org; Mon, 30 Aug 2021 15:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKn4c-0000nw-Q6 for guix-patches@gnu.org; Mon, 30 Aug 2021 15:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50283] [PATCH v1 1/2] gnu: Add libx86emu. References: <2c8e9e9d-c492-ea37-3414-c38e8bc4b2a1@raghavgururajan.name> In-Reply-To: <2c8e9e9d-c492-ea37-3414-c38e8bc4b2a1@raghavgururajan.name> Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Aug 2021 19:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 50283@debbugs.gnu.org Cc: Raghav Gururajan Received: via spool by 50283-submit@debbugs.gnu.org id=B50283.16303521573066 (code B ref 50283); Mon, 30 Aug 2021 19:36:02 +0000 Received: (at 50283) by debbugs.gnu.org; 30 Aug 2021 19:35:57 +0000 Received: from localhost ([127.0.0.1]:60338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKn4T-0000nE-5K for submit@debbugs.gnu.org; Mon, 30 Aug 2021 15:35:57 -0400 Received: from out2.migadu.com ([188.165.223.204]:45581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKn4N-0000mu-2q for 50283@debbugs.gnu.org; Mon, 30 Aug 2021 15:35:51 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1630352145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vGVwNgdaBrK0LltdUDyY/MIdRwKQgMnNlgncaYv6xmk=; b=hkbiy26KdhGNPGvjAZz8SbH5OR6hNjeKJyk96tG4oEM862GuDuvgXTbDMcegBxrcRbAHXg dzYyfKVk4DUzuEwAIuAbFrP2VdLjpCSO1HhUKGApjZ5ilyLoMiwpwPPMgVHRmYGg5V2SOd jZ21svFkY11z6rg1s3PeIOz47y/VB+w7NaF600fBt3Vh9PRSal+BeMV4tefbUNxW++qBkD Jltia6vxsdIiCYSiF7SgeyH27X/bNv0XEC45HsmO8Ce/ElZdGACTC4goyr73CR9FlVF86A wHsQ2OmD1rB8KTrUg6OsssnZe8gZns0NIQIiFQ0nocJXsuytNkP5wkRbpBj3gA== Date: Mon, 30 Aug 2021 15:35:24 -0400 Message-Id: <20210830193525.2288-1-rg@raghavgururajan.name> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Raghav Gururajan X-ACL-Warn: , Raghav Gururajan via Guix-patches X-Patchwork-Original-From: Raghav Gururajan via Guix-patches via From: Raghav Gururajan X-getmail-retrieved-from-mailbox: Patches * 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