all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 55302@debbugs.gnu.org
Subject: [bug#55302] [PATCH 3/4] gnu: wine64: Use new package style.
Date: Sat, 7 May 2022 17:39:25 +0200	[thread overview]
Message-ID: <e40f762aaa9a1145910e708415ac6d967ff6b1cf.camel@gmail.com> (raw)
In-Reply-To: <f9d007eb923c97c8c0de42bbba8ba0d3a5ae47ed.camel@gmail.com>

* gnu/packages/wine.scm (wine64)[arguments]: Convert to list of G-Expessions.
<#:configure-flags,#:make-flags>: Use ‘#$output’ instead of ‘%output’.
<#:phases>: Replace labels with search-input-file.
---
 gnu/packages/wine.scm | 169 ++++++++++++++++++++----------------------
 1 file changed, 79 insertions(+), 90 deletions(-)

diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index eb71a8caa8..1ab9153f84 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -219,96 +219,85 @@ (define-public wine64
     (inputs (modify-inputs (package-inputs wine)
               (prepend wine)))
     (arguments
-     `(#:make-flags
-       (list "SHELL=bash"
-             (string-append "libdir=" %output "/lib/wine64"))
-       #:phases
-       (modify-phases %standard-phases
-         ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader
-         ;; when installing to x86_64-linux so both are available.
-         ;; TODO: Add more JSON files as they become available in Mesa.
-         ,@(match (%current-system)
-             ((or "x86_64-linux")
-              `((add-after 'copy-wine32-binaries 'wrap-executable
-                  (lambda* (#:key inputs outputs #:allow-other-keys)
-                    (let* ((out (assoc-ref outputs "out")))
-                      (wrap-program (string-append out "/bin/wine-preloader")
-                        `("VK_ICD_FILENAMES" ":" =
-                          (,(string-append
-                             (assoc-ref inputs "mesa")
-                             "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
-                             (assoc-ref inputs "mesa")
-                             "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
-                             (assoc-ref inputs "wine")
-                             "/share/vulkan/icd.d/radeon_icd.i686.json" ":"
-                             (assoc-ref inputs "wine")
-                             "/share/vulkan/icd.d/intel_icd.i686.json"))))
-                      (wrap-program (string-append out "/bin/wine64-preloader")
-                        `("VK_ICD_FILENAMES" ":" =
-                          (,(string-append
-                             (assoc-ref inputs "mesa")
-                             "/share/vulkan/icd.d/radeon_icd.x86_64.json"
-                             ":" (assoc-ref inputs "mesa")
-                             "/share/vulkan/icd.d/intel_icd.x86_64.json"
-                             ":" (assoc-ref inputs "wine")
-                             "/share/vulkan/icd.d/radeon_icd.i686.json"
-                             ":" (assoc-ref inputs "wine")
-                             "/share/vulkan/icd.d/intel_icd.i686.json"))))
-                      #t)))))
-             (_
-              `()))
-         (add-after 'unpack 'patch-SHELL
-           (lambda _
-             (substitute* "configure"
-               ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
-               (("/bin/sh")
-                (which "bash")))))
-         (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 );")))))
-         (add-after 'install 'copy-wine32-binaries
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((wine32 (assoc-ref %build-inputs "wine"))
-                    (out (assoc-ref %outputs "out")))
-               ;; Copy the 32-bit binaries needed for WoW64.
-               (copy-file (string-append wine32 "/bin/wine")
-                          (string-append out "/bin/wine"))
-               ;; Copy the real 32-bit wine-preloader instead of the wrapped
-               ;; version.
-               (copy-file (string-append wine32 "/bin/.wine-preloader-real")
-                          (string-append out "/bin/wine-preloader")))))
-         (add-after 'install 'copy-wine32-libraries
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((wine32 (assoc-ref %build-inputs "wine"))
-                    (out (assoc-ref %outputs "out")))
-               (copy-recursively (string-append wine32 "/lib/wine32")
-                                 (string-append out "/lib/wine32")))))
-         (add-after 'compress-documentation 'copy-wine32-manpage
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((wine32 (assoc-ref %build-inputs "wine"))
-                    (out (assoc-ref %outputs "out")))
-               ;; Copy the missing man file for the wine binary from wine.
-               (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
-                          (string-append out "/share/man/man1/wine.1.gz")))))
-         (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))))))))
-       #:configure-flags
-       (list "--enable-win64"
-             (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
-       ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
-                                    #:system)
-                                  (package-arguments wine))))
+     (cons*
+      #:make-flags
+      #~(list "SHELL=bash"
+              (string-append "libdir=" #$output "/lib/wine64"))
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader
+          ;; when installing to x86_64-linux so both are available.
+          ;; TODO: Add more JSON files as they become available in Mesa.
+          #$@(match (%current-system)
+               ((or "x86_64-linux")
+                `((add-after 'copy-wine32-binaries 'wrap-executable
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (icd-files (map
+                                         (lambda (basename)
+                                           (search-input-file
+                                            inputs
+                                            (string-append "/share/vulkan/icd.d/"
+                                                           basename)))
+                                         '("radeon_icd.x86_64.json"
+                                           "intel_icd.x86_64.json"
+                                           "radeon_icd.i686.json"
+                                           "intel_icd.i686.json"))))
+                        (wrap-program (string-append out "/bin/wine-preloader")
+                          `("VK_ICD_FILENAMES" ":" = ,icd-files))
+                        (wrap-program (string-append out "/bin/wine64-preloader")
+                          `("VK_ICD_FILENAMES" ":" = ,icd-files)))))))
+               (_
+                `()))
+          (add-after 'unpack 'patch-SHELL
+            (lambda _
+              (substitute* "configure"
+                ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
+                (("/bin/sh")
+                 (which "bash")))))
+          (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 );")))))
+          (add-after 'install 'copy-wine32-binaries
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let ((out (assoc-ref %outputs "out")))
+                ;; Copy the 32-bit binaries needed for WoW64.
+                (copy-file (search-input-file inputs "/bin/wine")
+                           (string-append out "/bin/wine"))
+                ;; Copy the real 32-bit wine-preloader instead of the wrapped
+                ;; version.
+                (copy-file (search-input-file inputs "/bin/.wine-preloader-real")
+                           (string-append out "/bin/wine-preloader")))))
+          (add-after 'install 'copy-wine32-libraries
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let* ((out (assoc-ref %outputs "out")))
+                (copy-recursively (search-input-directory inputs "/lib/wine32")
+                                  (string-append out "/lib/wine32")))))
+          (add-after 'compress-documentation 'copy-wine32-manpage
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let* ((out (assoc-ref %outputs "out")))
+                ;; Copy the missing man file for the wine binary from wine.
+                (copy-file (search-input-file inputs "/share/man/man1/wine.1.gz")
+                           (string-append out "/share/man/man1/wine.1.gz")))))
+          (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))))))))
+      #:configure-flags
+      #~(list "--enable-win64"
+              (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib/wine64"))
+      (strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
+                                 #:system)
+                               (package-arguments wine))))
     (synopsis "Implementation of the Windows API (WoW64 version)")
     (supported-systems '("x86_64-linux" "aarch64-linux"))))
 
-- 
2.36.0





  parent reply	other threads:[~2022-05-07 16:12 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 ` [bug#55302] [PATCH 2/4] gnu: wine: Use new package style Liliana Marie Prikler
2022-05-07 15:39 ` Liliana Marie Prikler [this message]
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

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

  git send-email \
    --in-reply-to=e40f762aaa9a1145910e708415ac6d967ff6b1cf.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.