unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 55302@debbugs.gnu.org
Subject: [bug#55302] [PATCH 2/4] gnu: wine: Use new package style.
Date: Sat, 7 May 2022 17:36:07 +0200	[thread overview]
Message-ID: <dc83124706abb4f70ae22b3277594c4901cbd57e.camel@gmail.com> (raw)
In-Reply-To: <f9d007eb923c97c8c0de42bbba8ba0d3a5ae47ed.camel@gmail.com>

* gnu/packages/wine.scm (wine)[inputs, native-inputs]: Drop labels.
[arguments]: Convert to list of G-Expressions.
<#:configure-flags,#:make-flags>: Replace ‘%output’ with ‘#$output’.
<#:phases>: Use ‘search-input-file’ instead of input labels.
---
 gnu/packages/wine.scm | 187 +++++++++++++++++++++---------------------
 1 file changed, 92 insertions(+), 95 deletions(-)

diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 5d8e9f5b90..eb71a8caa8 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2017, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,6 +26,7 @@
 (define-module (gnu packages wine)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
@@ -89,118 +91,113 @@ (define-public wine
         (base32 "1f0r00b6lk59cmpj42b7f2jrd58d7vxfvpp54j7arwjhdg4yjxlg"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("bison" ,bison)
-       ("flex" ,flex)
-       ("gettext" ,gettext-minimal)
-       ("perl" ,perl)
-       ("pkg-config" ,pkg-config)))
+     (list bison flex gettext-minimal perl pkg-config))
     (inputs
      ;; Some libraries like libjpeg are now compiled into native PE objects.
      ;; The ELF objects provided by Guix packages are of no use.  Whilst this
      ;; is technically bundling, it's quite defensible.  It might be possible
      ;; to build some of these from Guix PACKAGE-SOURCE but attempts were not
      ;; fruitful so far.  See <https://www.winehq.org/announce/7.0>.
-     `(("alsa-lib" ,alsa-lib)
-       ("dbus" ,dbus)
-       ("cups" ,cups)
-       ("eudev" ,eudev)
-       ("fontconfig" ,fontconfig)
-       ("freetype" ,freetype)
-       ("gnutls" ,gnutls)
-       ("gst-plugins-base" ,gst-plugins-base)
-       ("libgphoto2" ,libgphoto2)
-       ("libldap" ,openldap)
-       ("libnetapi" ,samba)
-       ("libsane" ,sane-backends)
-       ("libpcap" ,libpcap)
-       ("libusb" ,libusb)
-       ("libICE" ,libice)
-       ("libX11" ,libx11)
-       ("libXi" ,libxi)
-       ("libXext" ,libxext)
-       ("libXcursor" ,libxcursor)
-       ("libXrender" ,libxrender)
-       ("libXrandr" ,libxrandr)
-       ("libXinerama" ,libxinerama)
-       ("libXxf86vm" ,libxxf86vm)
-       ("libXcomposite" ,libxcomposite)
-       ("mit-krb5" ,mit-krb5)
-       ("openal" ,openal)
-       ("pulseaudio" ,pulseaudio)
-       ("sdl2" ,sdl2)
-       ("unixodbc" ,unixodbc)
-       ("v4l-utils" ,v4l-utils)
-       ("vkd3d" ,vkd3d)
-       ("vulkan-loader" ,vulkan-loader)))
+     (list alsa-lib
+           cups
+           dbus
+           eudev
+           fontconfig
+           freetype
+           gnutls
+           gst-plugins-base
+           libgphoto2
+           openldap
+           samba
+           sane-backends
+           libpcap
+           libusb
+           libice
+           libx11
+           libxi
+           libxext
+           libxcursor
+           libxrender
+           libxrandr
+           libxinerama
+           libxxf86vm
+           libxcomposite
+           mit-krb5
+           openal
+           pulseaudio
+           sdl2
+           unixodbc
+           v4l-utils
+           vkd3d
+           vulkan-loader))
     (arguments
-     `(;; Force a 32-bit build targeting a similar architecture, i.e.:
-       ;; armhf for armhf/aarch64, i686 for i686/x86_64.
-       #:system ,@(match (%current-system)
-                    ((or "armhf-linux" "aarch64-linux")
-                     `("armhf-linux"))
-                    (_
-                     `("i686-linux")))
+     (list
+      ;; Force a 32-bit build targeting a similar architecture, i.e.:
+      ;; armhf for armhf/aarch64, i686 for i686/x86_64.
+      #:system (match (%current-system)
+                 ((or "armhf-linux" "aarch64-linux") "armhf-linux")
+                 (_ "i686-linux"))
 
        ;; XXX: There's a test suite, but it's unclear whether it's supposed to
        ;; pass.
        #:tests? #f
 
        #:configure-flags
-       (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32"))
+       #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib/wine32"))
 
        #:make-flags
-       (list "SHELL=bash"
-             (string-append "libdir=" %output "/lib/wine32"))
+       #~(list "SHELL=bash"
+               (string-append "libdir=" #$output "/lib/wine32"))
 
        #:phases
-       (modify-phases %standard-phases
-         ;; Explicitly set the 32-bit version of vulkan-loader when installing
-         ;; to i686-linux or x86_64-linux.
-         ;; TODO: Add more JSON files as they become available in Mesa.
-         ,@(match (%current-system)
-             ((or "i686-linux" "x86_64-linux")
-              `((add-after 'install 'wrap-executable
-                  (lambda* (#:key inputs outputs #:allow-other-keys)
-                    (let* ((out (assoc-ref outputs "out"))
-                           (icd (string-append out "/share/vulkan/icd.d")))
-                      (mkdir-p icd)
-                      (copy-file (string-append
-                                  (assoc-ref inputs "mesa")
-                                  "/share/vulkan/icd.d/radeon_icd.i686.json")
-                                 (string-append icd "/radeon_icd.i686.json"))
-                      (copy-file (string-append
-                                  (assoc-ref inputs "mesa")
-                                  "/share/vulkan/icd.d/intel_icd.i686.json")
-                                 (string-append icd "/intel_icd.i686.json"))
-                      (wrap-program (string-append out "/bin/wine-preloader")
-                        `("VK_ICD_FILENAMES" ":" =
-                          (,(string-append icd
-                                           "/radeon_icd.i686.json" ":"
-                                           icd "/intel_icd.i686.json")))))))))
-             (_
-              `()))
-         (add-after 'unpack 'patch-SHELL
-           (lambda _
-             (substitute* "configure"
-               ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
-               (("/bin/sh")
-                (which "bash")))))
-         (add-after 'configure 'patch-dlopen-paths
-           ;; Hardcode dlopened sonames to absolute paths.
-           (lambda _
-             (let* ((library-path (search-path-as-string->list
-                                   (getenv "LIBRARY_PATH")))
-                    (find-so (lambda (soname)
-                               (search-path library-path soname))))
-               (substitute* "include/config.h"
-                 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
-                  (format #f "~a\"~a\"" defso (find-so soname)))))))
-         (add-after 'patch-generated-file-shebangs 'patch-makedep
-           (lambda* (#:key outputs #:allow-other-keys)
-             (substitute* "tools/makedep.c"
-               (("output_filenames\\( unix_libs \\);" all)
-                (string-append all
-                               "output ( \" -Wl,-rpath=%s \", so_dir );"))))))))
+       #~(modify-phases %standard-phases
+           ;; Explicitly set the 32-bit version of vulkan-loader when installing
+           ;; to i686-linux or x86_64-linux.
+           ;; TODO: Add more JSON files as they become available in Mesa.
+           #$@(match (%current-system)
+                ((or "i686-linux" "x86_64-linux")
+                 `((add-after 'install 'wrap-executable
+                     (lambda* (#:key inputs outputs #:allow-other-keys)
+                       (let* ((out (assoc-ref outputs "out"))
+                              (icd (string-append out "/share/vulkan/icd.d")))
+                         (mkdir-p icd)
+                         (copy-file (search-input-file
+                                     inputs
+                                     "/share/vulkan/icd.d/radeon_icd.i686.json")
+                                    (string-append icd "/radeon_icd.i686.json"))
+                         (copy-file (search-input-file
+                                     inputs
+                                     "/share/vulkan/icd.d/intel_icd.i686.json")
+                                    (string-append icd "/intel_icd.i686.json"))
+                         (wrap-program (string-append out "/bin/wine-preloader")
+                           `("VK_ICD_FILENAMES" ":" =
+                             (,(string-append icd
+                                              "/radeon_icd.i686.json" ":"
+                                              icd "/intel_icd.i686.json")))))))))
+                (_
+                 `()))
+           (add-after 'unpack 'patch-SHELL
+             (lambda _
+               (substitute* "configure"
+                 ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
+                 (("/bin/sh")
+                  (which "bash")))))
+           (add-after 'configure 'patch-dlopen-paths
+             ;; Hardcode dlopened sonames to absolute paths.
+             (lambda _
+               (let* ((library-path (search-path-as-string->list
+                                     (getenv "LIBRARY_PATH")))
+                      (find-so (lambda (soname)
+                                 (search-path library-path soname))))
+                 (substitute* "include/config.h"
+                   (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
+                    (format #f "~a\"~a\"" defso (find-so soname)))))))
+           (add-after 'patch-generated-file-shebangs 'patch-makedep
+             (lambda* (#:key outputs #:allow-other-keys)
+               (substitute* "tools/makedep.c"
+                 (("output_filenames\\( unix_libs \\);" all)
+                  (string-append all
+                                 "output ( \" -Wl,-rpath=%s \", so_dir );"))))))))
     (home-page "https://www.winehq.org/")
     (synopsis "Implementation of the Windows API (32-bit only)")
     (description
-- 
2.36.0





  parent reply	other threads:[~2022-05-07 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07 15:46 [bug#55302] [PATCH 0/4] *** SUBJECT HERE *** Liliana Marie Prikler
2022-05-07  9:46 ` [bug#55302] [PATCH 1/4] gnu: wine: Update to 7.8 Liliana Marie Prikler
2022-05-07  9:47 ` [bug#55302] [PATCH 4/4] gnu: wine-staging: " Liliana Marie Prikler
2022-05-07 15:36 ` Liliana Marie Prikler [this message]
2022-05-07 15:39 ` [bug#55302] [PATCH 3/4] gnu: wine64: Use new package style Liliana Marie Prikler
2022-05-07 15:46 ` [bug#55302] [PATCH 0/4] Update wine and wine-staging to 7.8 Liliana Marie Prikler
2022-05-10  9:51   ` pelzflorian (Florian Pelz)
2022-05-20 18:16   ` Ludovic Courtès
2022-05-21 11:08     ` Liliana Marie Prikler
2022-05-21 11:09       ` bug#55302: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc83124706abb4f70ae22b3277594c4901cbd57e.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=55302@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).