[bug#35031] gnu: Add dxvk.

Message ID 20190328155707.22856-1-mail@ambrevar.xyz
State Accepted
Headers show
Series [bug#35031] gnu: Add dxvk. | expand

Commit Message

Pierre Neidhardt March 28, 2019, 3:57 p.m. UTC
* gnu/packages/wine.scm (dxvk): New variable.
---
 gnu/packages/wine.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Pierre Neidhardt March 28, 2019, 5:17 p.m. UTC | #1
This does not work yet.
This needs winegcc to build, but meson seems to be using "gcc" by
default.
Is there a way to override this?
Pierre Neidhardt March 28, 2019, 5:20 p.m. UTC | #2
Here is the meson log:

--8<---------------cut here---------------start------------->8---
Build started at 2019-03-28T15:20:27.700496
Main binary: /gnu/store/r68bi4640vm0s7zsgyk7shsag8ibl3nc-python-wrapper-3.7.0/bin/python
Python system: Linux
The Meson build system
Version: 0.49.0
Source dir: /tmp/guix-build-dxvk-1.0.1.drv-0/source
Build dir: /tmp/guix-build-dxvk-1.0.1.drv-0/build
Build type: native build
Project name: dxvk
Project version: v1.0.1
Sanity testing C compiler: gcc
Is cross compiler: False.
Sanity check compiler command line: gcc /tmp/guix-build-dxvk-1.0.1.drv-0/build/meson-private/sanitycheckc.c -o /tmp/guix-build-dxvk-1.0.1.drv-0/build/meson-private/sanitycheckc.exe
Sanity check compile stdout:

-----
Sanity check compile stderr:
/gnu/store/d8gir0hpm64krsq63rbrzzkgrisvic1a-mingw-w64-5.0.4/lib/crt1.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status

-----

meson.build:1:0: ERROR:  Compiler gcc can not compile programs.
--8<---------------cut here---------------end--------------->8---

Note that

--8<---------------cut here---------------start------------->8---
winegcc /tmp/guix-build-dxvk-1.0.1.drv-0/build/meson-private/sanitycheckc.c -o /tmp/guix-build-dxvk-1.0.1.drv-0/build/meson-private/sanitycheckc.exe
--8<---------------cut here---------------end--------------->8---

works.
Pierre Neidhardt March 28, 2019, 5:38 p.m. UTC | #3
(Sorry for the spam.)

Figure one thing out: removing mingw from the inputs solves the gcc
vs. winegcc issue.

Now dxvk fails to compile with the following error:


--8<---------------cut here---------------start------------->8---
starting phase `build'
[1/189] Generating version.h with a custom command.
[2/189] Compiling C++ object 'src/util/ed6d25d@@util@sta/util_env.cpp.o'.
FAILED: src/util/ed6d25d@@util@sta/util_env.cpp.o 
wineg++ -Isrc/util/ed6d25d@@util@sta -Isrc/util -I../source/src/util -I../source/./include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=c++1z -DNOMINMAX -fPIC -m64 --no-gnu-unique -MD -MQ 'src/util/ed6d25d@@util@sta/util_env.cpp.o' -MF 'src/util/ed6d25d@@util@sta/util_env.cpp.o.d' -o 'src/util/ed6d25d@@util@sta/util_env.cpp.o' -c ../source/src/util/util_env.cpp
In file included from ../source/src/util/util_env.h:3:0,
                 from ../source/src/util/util_env.cpp:1:
../source/src/util/util_string.h:9:15: error: expected ‘{’ before ‘::’ token
 namespace dxvk::str {
               ^
../source/src/util/util_string.h:9:17: error: ‘str’ in namespace ‘::’ does not name a type
 namespace dxvk::str {
                 ^
In file included from ../source/src/util/util_env.cpp:1:0:
../source/src/util/util_env.h:5:15: error: expected ‘{’ before ‘::’ token
 namespace dxvk::env {
               ^
../source/src/util/util_env.h:5:17: error: ‘env’ in namespace ‘::’ does not name a type
 namespace dxvk::env {
                 ^
../source/src/util/util_env.cpp:5:15: error: expected ‘{’ before ‘::’ token
 namespace dxvk::env {
               ^
../source/src/util/util_env.cpp:5:17: error: ‘env’ in namespace ‘::’ does not name a type
 namespace dxvk::env {
                 ^
../source/src/util/util_env.cpp:54:1: error: expected ‘}’ at end of input
 }
 ^
../source/src/util/util_env.cpp:54:1: error: expected ‘}’ at end of input
../source/src/util/util_env.cpp:54:1: error: expected ‘}’ at end of input
winegcc: g++ failed
ninja: build stopped: subcommand failed.
Backtrace:
           4 (primitive-load "/gnu/store/wnn0w163nxrr3v48y0d1pwpsfxj…")
In ice-9/eval.scm:
   191:35  3 (_ _)
In srfi/srfi-1.scm:
   863:16  2 (every1 #<procedure 5365c0 at /gnu/store/073micbrwvihh…> …)
In /gnu/store/073micbrwvihh46kj1b607xjgjyfxv2f-module-import/guix/build/gnu-build-system.scm:
   799:28  1 (_ _)
In /gnu/store/073micbrwvihh46kj1b607xjgjyfxv2f-module-import/guix/build/utils.scm:
    616:6  0 (invoke _ . _)

/gnu/store/073micbrwvihh46kj1b607xjgjyfxv2f-module-import/guix/build/utils.scm:616:6: In procedure invoke:
Throw to key `srfi-34' with args `(#<condition &invoke-error [program: "ninja" arguments: ("-j" "1") exit-status: 1 term-signal: #f stop-signal: #f] 491d40>)'.
note: keeping build directory `/tmp/guix-build-dxvk-1.0.1.drv-11'

--8<---------------cut here---------------end--------------->8---

Looks like it does not understand C++ :p
Pierre Neidhardt Oct. 30, 2019, 3:32 p.m. UTC | #4
Fixed with 76dbadac59ae4083f9b6360a1381b5dec43affa6.

Patch

diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index c7a57f5ec4..84a52a2436 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -5,6 +5,7 @@ 
 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +29,7 @@ 
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
@@ -50,6 +52,7 @@ 
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages kerberos)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages mingw)
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pulseaudio)
@@ -532,3 +535,33 @@  integrated into the main branch.")
     (synopsis "Implementation of the Windows API (staging branch, WoW64
 version)")
     (supported-systems '("x86_64-linux" "aarch64-linux"))))
+
+(define-public dxvk
+  (package
+    (name "dxvk")
+    (version "1.0.1")
+    (home-page "https://github.com/doitsujin/dxvk/")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0ah9nnlpygb31z67fyml3qqin793jnksz8wyzy5nsiwxnlpxj90q"))))
+    (build-system meson-build-system)
+    ;; TODO: Match arch.
+    (arguments
+     `(#:configure-flags (list "--cross-file"
+                               (string-append (assoc-ref %build-inputs "source")
+                                              "/build-wine64.txt"))))
+    (native-inputs
+     `(("mingw" ,mingw-w64)
+       ("glslang" ,glslang)
+       ("wine" ,wine64)))
+    (synopsis "Vulkan-based D3D11 and D3D10 implementation for Wine")
+    (description "A Vulkan-based translation layer for Direct3D 10/11 which
+allows running 3D applications using Wine.")
+    (supported-systems '("i686-linux" "x86_64-linux"))
+    (license license:zlib)))