From patchwork Fri Jan 27 01:08:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaelyn Takata X-Patchwork-Id: 46433 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 80C8B27BBED; Fri, 27 Jan 2023 01:09:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C795E27BBE9 for ; Fri, 27 Jan 2023 01:09:11 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLDEo-0008Fd-LZ; Thu, 26 Jan 2023 20:09:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLDEm-0008Dn-1q for guix-patches@gnu.org; Thu, 26 Jan 2023 20:09:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLDEl-0006ZU-Pi for guix-patches@gnu.org; Thu, 26 Jan 2023 20:09:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pLDEl-0003kB-Kz for guix-patches@gnu.org; Thu, 26 Jan 2023 20:09:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61067] [PATCH v2 4/5] gnu: wine64: Share phases with parent wine package. Resent-From: Kaelyn Takata Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Jan 2023 01:09:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61067 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61067@debbugs.gnu.org Cc: Kaelyn Takata Received: via spool by 61067-submit@debbugs.gnu.org id=B61067.167478173214332 (code B ref 61067); Fri, 27 Jan 2023 01:09:03 +0000 Received: (at 61067) by debbugs.gnu.org; 27 Jan 2023 01:08:52 +0000 Received: from localhost ([127.0.0.1]:36470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLDEZ-0003j5-Co for submit@debbugs.gnu.org; Thu, 26 Jan 2023 20:08:51 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:36561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLDEX-0003is-Jn for 61067@debbugs.gnu.org; Thu, 26 Jan 2023 20:08:50 -0500 Date: Fri, 27 Jan 2023 01:08:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1674781723; x=1675040923; bh=DVSGeYq6q9yeTDb25Sfur4zzOxrzKAigp/8DmekqhrU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=MDFw8DyITamSomm+pOU+nPp+vuMfzG6PHz31DN3BcNZkrvboo6fKmbsS5JaqQei7k EjvvvnTpQKN9AQviZAGbVI4RVMjYgx7Yc1vI+8fHA8KWyvBsLg6yP6QEcXF1le+Tlc TAgBKGSIq7rNZIAdhXmUcOJHU+MUorvLmCV7vkYN2MLbSQoU5EmIAvko7xG+v/sKWY XqeRkYhcv+owzI0MBCG7VNnzwoifHgUKN+Jqz+lSPuWOwTGjI1li4Hsg2yLSo5vH2P 0Z/HSucMgPGFNuGR4vJ9W6ZBrbXUyw6xuujeT4ONZWjSppE/Gs/gSGbGNz8phd9qlU zLZSkxupuKfCQ== Message-ID: <7f816cebacd3a33ec675fbe75bcee4f311efa3ac.1674781160.git.kaelyn.alexi@protonmail.com> In-Reply-To: References: Feedback-ID: 34709329:user:proton MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Kaelyn Takata X-ACL-Warn: , Kaelyn Takata via Guix-patches X-Patchwork-Original-From: Kaelyn Takata via Guix-patches via From: Kaelyn Takata Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/wine.scm (wine64): Share phases with parent wine package. --- gnu/packages/wine.scm | 134 ++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 78 deletions(-) -- 2.39.1 diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm index b9a8396b75..263ec80416 100644 --- a/gnu/packages/wine.scm +++ b/gnu/packages/wine.scm @@ -217,84 +217,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"))))