summary refs log tree commit diff
diff options
context:
space:
mode:
authorRutger Helling <rhelling@mykolab.com>2017-12-31 18:57:06 +0100
committerRutger Helling <rhelling@mykolab.com>2017-12-31 19:05:47 +0100
commit58cbcb02a5311641336d1bb3650d362fe445bf04 (patch)
tree0eda16c51bdb88a4938a148b2e88b75e15d5dd8a
parent5cead945540bfc7141c3eb7ac197c881dae39b63 (diff)
downloadguix-58cbcb02a5311641336d1bb3650d362fe445bf04.tar.gz
gnu: wine64: Add 32-bit support.
* gnu/packages/wine.scm (wine64)[inputs]: Add wine.
[arguments]: Install libraries to /lib/wine64. Don't inherit phases. Add
'copy-win32-files phase.
[description]: Update description.
-rw-r--r--gnu/packages/wine.scm34
1 files changed, 30 insertions, 4 deletions
diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 937ce9eac6..48cd830d0a 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -160,16 +160,42 @@ integrate Windows applications into your desktop.")
   (package
     (inherit wine)
     (name "wine64")
+    (inputs `(("wine" ,wine)
+              ,@(package-inputs wine)))
     (arguments
      `(#:make-flags
        (list "SHELL=bash"
-             (string-append "libdir=" %output "/lib"))
+             (string-append "libdir=" %output "/lib/wine64"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'copy-wine32-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (copy-file (string-append (assoc-ref %build-inputs "wine")
+                                       "/bin/wine") (string-append (assoc-ref
+                                       %outputs "out") "/bin/wine"))
+             (copy-file (string-append (assoc-ref %build-inputs "wine")
+                                       "/bin/wine-preloader") (string-append
+                                       (assoc-ref %outputs "out")
+                                       "/bin/wine-preloader"))
+             #t))
+         (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))))
+               #t))))
        #:configure-flags
        (list "--enable-win64"
-             (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
-       ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:system)
+             (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 (64-bit version)")
+    (synopsis "Implementation of the Windows API (WOW64 version)")
     (supported-systems '("x86_64-linux" "aarch64-linux"))))
 
 ;; TODO: This is wine development version, provided for historical reasons.