From patchwork Thu Feb 2 21:24:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaelyn Takata X-Patchwork-Id: 46620 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 B1C4E27BBEB; Thu, 2 Feb 2023 21:25:24 +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=unavailable 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 9171C27BBE9 for ; Thu, 2 Feb 2023 21:25:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNh4p-0007qJ-Ix; Thu, 02 Feb 2023 16:25:03 -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 1pNh4o-0007q1-JT for guix-patches@gnu.org; Thu, 02 Feb 2023 16:25:02 -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 1pNh4o-0006md-A1 for guix-patches@gnu.org; Thu, 02 Feb 2023 16:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNh4o-0003hk-5c for guix-patches@gnu.org; Thu, 02 Feb 2023 16:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61067] [PATCH v3 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: Thu, 02 Feb 2023 21:25:02 +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 , liliana.prikler@gmail.com Received: via spool by 61067-submit@debbugs.gnu.org id=B61067.167537306014151 (code B ref 61067); Thu, 02 Feb 2023 21:25:02 +0000 Received: (at 61067) by debbugs.gnu.org; 2 Feb 2023 21:24:20 +0000 Received: from localhost ([127.0.0.1]:36010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNh47-0003g6-Ry for submit@debbugs.gnu.org; Thu, 02 Feb 2023 16:24:20 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]:18713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNh45-0003fj-Vq for 61067@debbugs.gnu.org; Thu, 02 Feb 2023 16:24:18 -0500 Date: Thu, 02 Feb 2023 21:24:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1675373052; x=1675632252; bh=OaGkvkZ2PPaKs51UC/iUkUg/xxO81TWZATYK6E9qRmo=; 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=y1u+w6biVUUEbLsWAiBw5KuQjPyieCi6aVbrKRcfn5D3XC9GivXnPxQxu6c0rJfzz ozjfZpALGvd4s7XYid/lvw5piWiK335N4wEIHHsBzHFF/7MO77e7cA1QqZ6LlS+Myn /j7wkGV+v/vxMOec1fvldErvMOwUW/MUVB5lNGoJHieOBT+Ein4IQR9KfZrAAm2Vbb iTbZawAyvwfIMSOgkHxgTHQoy1USQq7Hht3NTm1QUqOx6UP2AF8yQ/1GHLw/wzLHjy xW8ST1yJBILmhpP9bl2u+eAxagypHihETdVGTD6udm91YDv+e+NM9z5xKm29UJ+eYB cQs5N6p9+a9eA== Message-ID: <221fdb108116f5e6c18b804a94a9b2f22ee2b14d.1675372737.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 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"))))