From patchwork Sat May 7 15:39:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 39144 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 EC3F527BBEC; Sat, 7 May 2022 17:12:42 +0100 (BST) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS 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 DD30927BBEA for ; Sat, 7 May 2022 17:12:41 +0100 (BST) Received: from localhost ([::1]:46362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnN2v-00077k-3K for patchwork@mira.cbaines.net; Sat, 07 May 2022 12:12:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnN2L-0006FB-RA for guix-patches@gnu.org; Sat, 07 May 2022 12:12:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnN2L-00039I-I1 for guix-patches@gnu.org; Sat, 07 May 2022 12:12:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnN2L-0006O7-Dc for guix-patches@gnu.org; Sat, 07 May 2022 12:12:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55302] [PATCH 3/4] gnu: wine64: Use new package style. References: In-Reply-To: Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 May 2022 16:12:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55302 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55302@debbugs.gnu.org Received: via spool by 55302-submit@debbugs.gnu.org id=B55302.165193989324337 (code B ref 55302); Sat, 07 May 2022 16:12:05 +0000 Received: (at 55302) by debbugs.gnu.org; 7 May 2022 16:11:33 +0000 Received: from localhost ([127.0.0.1]:52777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnN1p-0006KR-83 for submit@debbugs.gnu.org; Sat, 07 May 2022 12:11:33 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnN1k-0006JT-1H for 55302@debbugs.gnu.org; Sat, 07 May 2022 12:11:29 -0400 Received: by mail-ed1-f68.google.com with SMTP id a21so11788202edb.1 for <55302@debbugs.gnu.org>; Sat, 07 May 2022 09:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:mime-version:to:content-transfer-encoding :message-id; bh=vG5OZWc0JurEGrsCdNiAAx/3Uyrs/GLzaXFoR9yU8y4=; b=WhZloC27WiF13A8p1ztCN3VByJbduyh4qQJ8jNldjkLXat+cjyWBQe993hEHZepmti wAM2WIVuyO9Zqx6QFjCTXH8Fu5ojdtHYS4rRVIzVhUzReduG30QErGtL4EkM1oisgRc/ 0TQaHQWTYTPNrGDysba1LYsxiHOSldX7ouVTOqslhgraLCGODUxm6n6N9OaxKM2W9oBE 6FgHrfMGy1cD08mCZpO20GU2ZXJO39/zbmB7bQjAwC9ybNfQiKKJfMGkJiFXMfGygDKl yOtBVfE2KAWGMfakz7omN2VtHwINAFTb4GptuPZENlyRcO3K0EPz+A6CL+i3u50Ox95b x/7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:mime-version:to :content-transfer-encoding:message-id; bh=vG5OZWc0JurEGrsCdNiAAx/3Uyrs/GLzaXFoR9yU8y4=; b=Ml8ztY7aD+4s9B8VVyYF/B+1ZZKZNykqlfOjRNlkGLd2mfp+2ODrSFj7XC/Yu7buhX tTgt57+XuT5zHcS3TUQuPNO3tCXKLtRfWHxJWPnmUFwJRi+4HKESQInZzrjnJA1T6u1l WO/zJ3mmbFL/nqT9t3My+9zzxzkph1TBTNC/Ne8IarXXP7utD3JBzVNZqPdVnutjDK1n URaSa5cWYEbL1/plSHJoE79G7dr9QyxcvG0FcIGGLuBtkPqHsXaO4usU4+B/zjoA+LCU /6DG1+PdACNN1EcjdkDA2EIFlC0ZrndbWscmZWP03YqoXhcchPvSoFq/M2Pn+NdBBde0 mHNQ== X-Gm-Message-State: AOAM533AjPemsWHX8YfDDHp9U02bCV2Xgr8HSFr14uqiYRR3m2+fLl7V CeidQ/psWwFRcMiQyYdMlQyouFQ4SXY= X-Google-Smtp-Source: ABdhPJwf13b11d26fr8OIHEfgB38HlfwOvxnNYLzKkXiO3WfqTVVTk2cvCWAr4+g3ncAjS+Qzk3q5Q== X-Received: by 2002:a05:6402:289a:b0:425:d682:105d with SMTP id eg26-20020a056402289a00b00425d682105dmr9315853edb.175.1651939882297; Sat, 07 May 2022 09:11:22 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id e15-20020a50e44f000000b0042617ba63c7sm3769813edm.81.2022.05.07.09.11.21 for <55302@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 May 2022 09:11:21 -0700 (PDT) From: Liliana Marie Prikler Date: Sat, 7 May 2022 17:39:25 +0200 MIME-Version: 1.0 Message-ID: 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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"))))