GNU bug report logs - #40084
[PATCH] gnu: Add v86d.

Previous Next

Package: guix-patches;

Reported by: Florian Pelz <pelzflorian <at> pelzflorian.de>

Date: Sun, 15 Mar 2020 21:49:01 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <m.othacehe <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: Florian Pelz <pelzflorian <at> pelzflorian.de>
Cc: 40084 <at> debbugs.gnu.org
Subject: [bug#40084] [PATCH] gnu: Add v86d.
Date: Thu, 19 Mar 2020 15:49:08 +0100
[Message part 1 (text/plain, inline)]
On Sun, Mar 15, 2020 at 10:48:51PM +0100, Florian Pelz wrote:
> +         ;; 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))))

I don't see why you're decompressing the tarball manually, this seems to
work just as well:

 (add-after 'unpack 'unpack-x86emu-sources
   (lambda* (#:key inputs #:allow-other-keys)
     (begin
       (format #t "decompressing x86emu source code~%")
       (with-directory-excursion "libs"
         (invoke (string-append (assoc-ref inputs "tar") "/bin/tar")
                 "xvf" (assoc-ref inputs "xorg-server-sources")
                 "--strip-components=3"
                 "--wildcards" "*/hw/xfree86/x86emu/")
         ;; extract license:
         (with-directory-excursion "x86emu"
           (invoke (string-append (assoc-ref inputs "tar") "/bin/tar")
                   "xvf" (assoc-ref inputs "xorg-server-sources")
                   "--strip-components=1"
                   "--wildcards" "*/COPYING"))
         #t))))

If it's about efficiency or robustness in some way, I'd suggest leaving
a comment detailing the reason. Either way, I'd bind the path to tar in
a `let', as well as the path to "xorg-server-sources" if we decide to
not decompress separately.

> +         (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))))

These phases are missing the trailing #t.

I don't know how to test the package, but it passes lint & build,
including --rounds=2 to check for reproducibility.

Regards,
Jakub Kądziołka
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 5 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.