From patchwork Sun Mar 15 21:48:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "pelzflorian (Florian Pelz)" X-Patchwork-Id: 20701 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 1526C27BBEA; Sun, 15 Mar 2020 21:57:02 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB,T_DKIM_INVALID,URIBL_BLOCKED autolearn=no 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 ESMTP id 82C4827BBE4 for ; Sun, 15 Mar 2020 21:57:01 +0000 (GMT) Received: from localhost ([::1]:59344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDbFk-0006aX-IW for patchwork@mira.cbaines.net; Sun, 15 Mar 2020 17:57:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47876) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDb83-0004Ty-PH for guix-patches@gnu.org; Sun, 15 Mar 2020 17:49:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDb82-0003Pw-3O for guix-patches@gnu.org; Sun, 15 Mar 2020 17:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58007) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDb81-0003Nw-VR for guix-patches@gnu.org; Sun, 15 Mar 2020 17:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jDb81-0001IQ-T1 for guix-patches@gnu.org; Sun, 15 Mar 2020 17:49:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40084] [PATCH] gnu: Add v86d. Resent-From: Florian Pelz Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Mar 2020 21:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40084 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40084@debbugs.gnu.org Cc: Florian Pelz X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15843089394972 (code B ref -1); Sun, 15 Mar 2020 21:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Mar 2020 21:48:59 +0000 Received: from localhost ([127.0.0.1]:35747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDb7y-0001I7-QD for submit@debbugs.gnu.org; Sun, 15 Mar 2020 17:48:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:37117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDb7x-0001I0-By for submit@debbugs.gnu.org; Sun, 15 Mar 2020 17:48:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47621) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDb7v-0004R9-46 for guix-patches@gnu.org; Sun, 15 Mar 2020 17:48:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDb7s-0001qG-Ey for guix-patches@gnu.org; Sun, 15 Mar 2020 17:48:54 -0400 Received: from pelzflorian.de ([5.45.111.108]:52048 helo=mail.pelzflorian.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDb7r-0001Z6-QK for guix-patches@gnu.org; Sun, 15 Mar 2020 17:48:52 -0400 Received: from localhost.localdomain (x52716394.dyn.telefonica.de [82.113.99.148]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 90E973604F7; Sun, 15 Mar 2020 22:48:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1584308929; bh=TWolNTSi5cNjGgB3GRNFIDxK+S2cmCi2rV5MGCEUTnA=; h=From:To:Cc:Subject:Date; b=LNLN0qZx175v8cKpuLi1iJATOfkvDYhmfGE6NPGEnXcxg3zgcwCMr4iOzvlgE4VNm CQruYCejbAATHmwUf6iLz7TiTKD43ZLnnLfP8WAvZnf5pxklc0n6vLIDl1sX+Ggao0 ZY9X/kitFDpG8cXkA0as3z3v+FJJswtOdqxe6HPI= From: Florian Pelz Date: Sun, 15 Mar 2020 22:48:51 +0100 Message-Id: <20200315214851.30981-1-pelzflorian@pelzflorian.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/xorg.scm (v86d): New variable. --- gnu/packages/xorg.scm | 109 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index f951e565ff..be381adc43 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -21,6 +21,7 @@ ;;; Copyright © 2019 nee ;;; Copyright © 2019 Yoshinori Arai ;;; Copyright © 2020 Leo Prikler +;;; Copyright © 2020 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -3446,6 +3447,114 @@ X server.") X server.") (license license:x11))) +(define-public v86d + (package + (name "v86d") + (version "0.1.10") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mjanusz/v86d.git") + (commit (string-append name "-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1c4iiggb5r9i2hxhk8c6q1m2vpfva39l1w33fsfkrz6fav6x34pp")) + (modules '((guix build utils))) + (snippet + '(begin + ;; remove bundled x86emu + (for-each delete-file + (filter (lambda (name) ;keep customized Makefile + (not (string-suffix? "Makefile" name))) + (find-files "libs/x86emu"))) + ;; remove non-working vbetest utility program (it is unnecessary) + (delete-file "libs/lrmi-0.10/vbe.h") + (delete-file "libs/lrmi-0.10/vbetest.c") + #t)))) + + ;; We keep the bundled copy of the Linux Real Mode Interface lrmi-0.10, + ;; because it includes fixes missing from upstream lrmi. We do not use + ;; libx86, because we already use x86emu with the more current lrmi. + + (inputs `(("xorg-server-sources" ,(package-source xorg-server)) ;for x86emu + ("xorgproto" ,xorgproto))) ;upstream x86emu uses X11/Xfuncproto.h + (outputs '("out" ;main v86d helper + "testvbe")) ;test program for listing video modes + (supported-systems '("i686-linux" "x86_64-linux")) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;there are no tests + #:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 popen)) + #:phases + (modify-phases %standard-phases + ;; Replace the bundled x86emu with its upstream copy from Xorg-server: + (add-after 'unpack 'unpack-x86emu-sources + (lambda* (#:key inputs #:allow-other-keys) + (begin + (format #t "decompressing x86emu source code~%") + (with-directory-excursion "libs" + (call-with-output-file "xorg-server.tar" + (lambda (out) + (let* ((xz (assoc-ref inputs "xz")) + (srcs (assoc-ref inputs "xorg-server-sources")) + (pipe (open-pipe* OPEN_READ + (string-append xz "/bin/xz") + "-cd" srcs))) + (dump-port pipe out) + (unless (= (status:exit-val (close-pipe pipe)) 0) + (error "xz decompress failed"))))) + (invoke (string-append (assoc-ref inputs "tar") "/bin/tar") + "xvf" "xorg-server.tar" "--strip-components=3" + "--wildcards" "*/hw/xfree86/x86emu/") + ;; extract license: + (with-directory-excursion "x86emu" + (invoke (string-append (assoc-ref inputs "tar") "/bin/tar") + "xvf" "../xorg-server.tar" "--strip-components=1" + "--wildcards" "*/COPYING")) + (delete-file "xorg-server.tar") + #t)))) + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (setenv "CC" (which "gcc")) + (setenv "DESTDIR" out) + (invoke "./configure" "--with-x86emu")))) + (add-after 'build 'build-testvbe + (lambda _ + (invoke "make" "testvbe"))) + (add-after 'install 'install-testvbe + (lambda* (#:key outputs #:allow-other-keys) + (let ((testvbe (assoc-ref outputs "testvbe")) + (olddest (getenv "DESTDIR"))) + (setenv "DESTDIR" testvbe) + (invoke "make" "install_testvbe") + (setenv "DESTDIR" olddest)))) + (add-after 'install 'install-docs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc-dir (string-append out "/share/doc/v86d"))) + (mkdir-p doc-dir) + (copy-file "README" + (string-append doc-dir "/README")) + (copy-file "libs/lrmi-0.10/README" + (string-append doc-dir "/README.lrmi")) + (copy-file "libs/x86emu/COPYING" + (string-append doc-dir "/COPYING.xorg-server.x86emu")) + #t)))))) + (home-page "https://github.com/mjanusz/v86d") + (synopsis "Userspace helper for uvesafb") + (description + "v86d provides a backend for kernel drivers that need to execute x86 BIOS +code. The code is executed in a controlled environment and the results are +passed back to the kernel via the netlink interface. v86d is required by the +uvesafb Linux kernel module that provides an fbdev framebuffer when Kernel +Mode Setting is unavailable. It can be a last resort when no other Xorg X +server driver works.") + (license (list license:gpl2 + license:x11)))) ;for bundled lrmi and x86emu (define-public xf86-video-vmware (package