unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaelyn Takata via Guix-patches via <guix-patches@gnu.org>
To: 61067@debbugs.gnu.org
Cc: Kaelyn Takata <kaelyn.alexi@protonmail.com>, liliana.prikler@gmail.com
Subject: [bug#61067] [PATCH v3 4/5] gnu: wine64: Share phases with parent wine package.
Date: Thu, 02 Feb 2023 21:24:08 +0000	[thread overview]
Message-ID: <221fdb108116f5e6c18b804a94a9b2f22ee2b14d.1675372737.git.kaelyn.alexi@protonmail.com> (raw)
In-Reply-To: <cover.1675372737.git.kaelyn.alexi@protonmail.com>

* gnu/packages/wine.scm (wine64): Share phases with parent wine package.
---
 gnu/packages/wine.scm | 134 ++++++++++++++++++------------------------
 1 file changed, 56 insertions(+), 78 deletions(-)

diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index ceef09ea5d..3b637f76e5 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -236,84 +236,62 @@ (define-public wine64
     (inputs (modify-inputs (package-inputs wine)
               (prepend wine)))
     (arguments
-     (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 \", arch_install_dirs[arch] );")))))
-          (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")
-      (strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
-                                 #:system)
-                               (package-arguments wine))))
+     (substitute-keyword-arguments
+         (strip-keyword-arguments '(#:system) (package-arguments wine))
+       ((#:make-flags _)
+        #~(list "SHELL=bash"
+                (string-append "libdir=" #$output "/lib/wine64"))
+        )
+       ((#:phases phases)
+        #~(modify-phases #$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")
+                  `((delete 'wrap-executable)
+                    (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 '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")))))))
+       ((#:configure-flags configure-flags '())
+        #~(cons "--enable-win64" #$configure-flags))))
     (synopsis "Implementation of the Windows API (WoW64 version)")
     (supported-systems '("x86_64-linux" "aarch64-linux"))))

--
2.39.1






  parent reply	other threads:[~2023-02-02 21:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26  0:17 [bug#61067] [PATCH 0/3] Update wine and wine-staging packages to 8.0 Kaelyn Takata via Guix-patches via
2023-01-26  0:23 ` [bug#61067] [PATCH 1/3] gnu: wine: Update " Kaelyn Takata via Guix-patches via
2023-01-26  0:24 ` [bug#61067] [PATCH 2/3] gnu: wine: Build more reproducibly Kaelyn Takata via Guix-patches via
2023-01-26 19:28   ` Liliana Marie Prikler
2023-01-26 20:46     ` Kaelyn via Guix-patches via
2023-01-26 21:09       ` Liliana Marie Prikler
2023-01-27  1:07         ` Kaelyn via Guix-patches via
2023-01-26  0:24 ` [bug#61067] [PATCH 3/3] gnu: wine-staging: Update to 8.0 Kaelyn Takata via Guix-patches via
2023-01-27  1:07 ` [bug#61067] [PATCH v2 0/5] Update wine and wine-staging packages " Kaelyn Takata via Guix-patches via
2023-01-27  1:08   ` [bug#61067] [PATCH v2 1/5] gnu: wine: Update " Kaelyn Takata via Guix-patches via
2023-01-27  1:08   ` [bug#61067] [PATCH v2 2/5] gnu: wine-staging: " Kaelyn Takata via Guix-patches via
2023-01-27  1:08   ` [bug#61067] [PATCH v2 3/5] gnu: wine-minimal: Share phases with parent wine package Kaelyn Takata via Guix-patches via
2023-01-27 18:03     ` Liliana Marie Prikler
2023-01-27 18:15       ` Kaelyn via Guix-patches via
2023-01-30 20:39       ` Kaelyn via Guix-patches via
2023-01-31 19:19         ` Liliana Marie Prikler
2023-01-27  1:08   ` [bug#61067] [PATCH v2 4/5] gnu: wine64: " Kaelyn Takata via Guix-patches via
2023-01-27  1:08   ` [bug#61067] [PATCH v2 5/5] gnu: wine: Build more reproducibly Kaelyn Takata via Guix-patches via
2023-01-30 20:35 ` [bug#61067] [PATCH] gnu: wine: Invert the relationship between wine and wine-minimal Kaelyn Takata via Guix-patches via
2023-02-02 21:23 ` [bug#61067] [PATCH v3 0/5] Update wine and wine-staging packages to 8.0 Kaelyn Takata via Guix-patches via
2023-02-02 21:23   ` [bug#61067] [PATCH v3 1/5] gnu: wine: Update " Kaelyn Takata via Guix-patches via
2023-02-02 21:23   ` [bug#61067] [PATCH v3 2/5] gnu: wine-staging: " Kaelyn Takata via Guix-patches via
2023-02-02 21:23   ` [bug#61067] [PATCH v3 3/5] gnu: wine-minimal: Make the parent of wine so phases can be shared Kaelyn Takata via Guix-patches via
2023-02-02 21:24   ` Kaelyn Takata via Guix-patches via [this message]
2023-02-02 21:24   ` [bug#61067] [PATCH v3 5/5] gnu: wine-minimal: Build more reproducibly Kaelyn Takata via Guix-patches via
2023-02-05  6:13   ` bug#61067: [PATCH v3 0/5] Update wine and wine-staging packages to 8.0 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=221fdb108116f5e6c18b804a94a9b2f22ee2b14d.1675372737.git.kaelyn.alexi@protonmail.com \
    --to=guix-patches@gnu.org \
    --cc=61067@debbugs.gnu.org \
    --cc=kaelyn.alexi@protonmail.com \
    --cc=liliana.prikler@gmail.com \
    /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).