summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Kehayias <john.kehayias@protonmail.com>2025-02-02 17:53:09 -0500
committerJohn Kehayias <john.kehayias@protonmail.com>2025-02-03 15:57:36 -0500
commite65677969e7ba6afd6c327379e24da0bed2f3adc (patch)
treeba6c1f38ed2391d7c63781c5cd8d8e05e05598b0
parent5c6ef7cafdfabdacae8ce33410b41168a952d4ff (diff)
nonguix: binary-build-system: Use add-rpath instead of set-rpath.
Fixes #369. Previously we were using "patchelf --set-rpath" in binary-build-system for binaries to find dependencies in Guix. However, this will override any previous setting, including if "$ORIGIN" was in RUNPATH. For Electron applications specifically (like signal-desktop and heroic), bundled libraries were not found without wrapping with LD_LIBRARY_PATH. While this does work, it is not ideal and led to issues in child processes that inherit LD_LIBRARY_PATH, namely breaking games using Wine/Proton in Heroic. A possible consequence of this commit is that Guix added paths to RUNPATH are after what was originally set, perhaps leading to library loading/compatibility issues. However, we always try to replace all needed libraries with Guix packages (just that Electron applications seem to require bundled libraries in $ORIGIN). * nonguix/build/binary-build-system.scm (patchelf): Use add-rpath instead of set-rpath. * nongnu/packages/game-client.scm (heroic-client)[arguments]<#:phases>: Remove 'wrap-where-patchelf-does-not-work phase as it is no longer needed (needed libraries are found with $ORIGIN preserved in RUNPATH). * nongnu/packages/messaging.scm (element-desktop, signal-desktop): Likewise. * nongnu/packages/editors.scm (vscodium): Likewise.
-rw-r--r--nongnu/packages/editors.scm10
-rw-r--r--nongnu/packages/game-client.scm10
-rw-r--r--nongnu/packages/messaging.scm20
-rw-r--r--nonguix/build/binary-build-system.scm2
4 files changed, 5 insertions, 37 deletions
diff --git a/nongnu/packages/editors.scm b/nongnu/packages/editors.scm
index 4d19646..9073c9c 100644
--- a/nongnu/packages/editors.scm
+++ b/nongnu/packages/editors.scm
@@ -83,15 +83,7 @@
83 #:startup-w-m-class "Code" 83 #:startup-w-m-class "Code"
84 #:comment 84 #:comment
85 '(("en" "Code Editing. Redefined.") 85 '(("en" "Code Editing. Redefined.")
86 (#f "Code Editing. Redefined.")))))) 86 (#f "Code Editing. Redefined.")))))))))
87 (add-after 'install-wrapper 'wrap-where-patchelf-does-not-work
88 (lambda _
89 (wrap-program (string-append #$output "/bin/codium")
90 `("LD_LIBRARY_PATH" ":"
91 prefix
92 (,(string-join
93 (list (string-append #$output "/opt/vscodium"))
94 ":")))))))))
95 (supported-systems '("armhf-linux" "aarch64-linux" "x86_64-linux")) 87 (supported-systems '("armhf-linux" "aarch64-linux" "x86_64-linux"))
96 (native-inputs 88 (native-inputs
97 (list tar)) 89 (list tar))
diff --git a/nongnu/packages/game-client.scm b/nongnu/packages/game-client.scm
index cb2730b..1f8b021 100644
--- a/nongnu/packages/game-client.scm
+++ b/nongnu/packages/game-client.scm
@@ -97,15 +97,7 @@
97 (lambda _ 97 (lambda _
98 (mkdir-p (string-append #$output "/bin")) 98 (mkdir-p (string-append #$output "/bin"))
99 (symlink (string-append #$output "/lib/Heroic/heroic") 99 (symlink (string-append #$output "/lib/Heroic/heroic")
100 (string-append #$output "/bin/heroic")))) 100 (string-append #$output "/bin/heroic")))))))
101 (add-after 'install-wrapper 'wrap-where-patchelf-does-not-work
102 (lambda _
103 (wrap-program (string-append #$output "/lib/Heroic/heroic")
104 `("LD_LIBRARY_PATH" ":" prefix
105 (,(string-join
106 (list
107 (string-append #$output "/lib/Heroic"))
108 ":")))))))))
109 (home-page "https://heroicgameslauncher.com") 101 (home-page "https://heroicgameslauncher.com")
110 (synopsis "A Native GOG, Amazon and Epic Games Launcher") 102 (synopsis "A Native GOG, Amazon and Epic Games Launcher")
111 (description "Heroic is an Open Source Game Launcher. Right now it supports launching 103 (description "Heroic is an Open Source Game Launcher. Right now it supports launching
diff --git a/nongnu/packages/messaging.scm b/nongnu/packages/messaging.scm
index 4275e2e..4af8e6f 100644
--- a/nongnu/packages/messaging.scm
+++ b/nongnu/packages/messaging.scm
@@ -69,15 +69,7 @@
69 (lambda _ 69 (lambda _
70 (mkdir-p (string-append #$output "/bin")) 70 (mkdir-p (string-append #$output "/bin"))
71 (symlink (string-append #$output "/lib/Element/element-desktop") 71 (symlink (string-append #$output "/lib/Element/element-desktop")
72 (string-append #$output "/bin/element-desktop")))) 72 (string-append #$output "/bin/element-desktop")))))))
73 (add-after 'install-wrapper 'wrap-where-patchelf-does-not-work
74 (lambda _
75 (wrap-program (string-append #$output "/lib/Element/element-desktop")
76 `("LD_LIBRARY_PATH" ":" prefix
77 (,(string-join
78 (list
79 (string-append #$output "/lib/Element"))
80 ":")))))))))
81 (home-page "https://github.com/vector-im/element-desktop") 73 (home-page "https://github.com/vector-im/element-desktop")
82 (synopsis "Matrix collaboration client for desktop") 74 (synopsis "Matrix collaboration client for desktop")
83 (description "Element Desktop is a Matrix client for desktop with Element Web at 75 (description "Element Desktop is a Matrix client for desktop with Element Web at
@@ -123,15 +115,7 @@ its core.")
123 (lambda _ 115 (lambda _
124 (mkdir-p (string-append #$output "/bin")) 116 (mkdir-p (string-append #$output "/bin"))
125 (symlink (string-append #$output "/lib/Signal/signal-desktop") 117 (symlink (string-append #$output "/lib/Signal/signal-desktop")
126 (string-append #$output "/bin/signal-desktop")))) 118 (string-append #$output "/bin/signal-desktop")))))))
127 (add-after 'install-wrapper 'wrap-where-patchelf-does-not-work
128 (lambda _
129 (wrap-program (string-append #$output "/lib/Signal/signal-desktop")
130 `("LD_LIBRARY_PATH" ":" prefix
131 (,(string-join
132 (list
133 (string-append #$output "/lib/Signal"))
134 ":")))))))))
135 (home-page "https://signal.org/") 119 (home-page "https://signal.org/")
136 (synopsis "Private messenger using the Signal protocol") 120 (synopsis "Private messenger using the Signal protocol")
137 (description "Signal Desktop is an Electron application that links with Signal on Android 121 (description "Signal Desktop is an Electron application that links with Signal on Android
diff --git a/nonguix/build/binary-build-system.scm b/nonguix/build/binary-build-system.scm
index ccfc3eb..88d4e46 100644
--- a/nonguix/build/binary-build-system.scm
+++ b/nonguix/build/binary-build-system.scm
@@ -113,7 +113,7 @@ The inputs are optional when the file is an executable."
113 (make-rpath name))) 113 (make-rpath name)))
114 runpath) 114 runpath)
115 ":"))) 115 ":")))
116 (invoke "patchelf" "--set-rpath" rpath binary))) 116 (invoke "patchelf" "--add-rpath" rpath binary)))
117 #t) 117 #t)
118 118
119 (display "Using patchelf version: ") 119 (display "Using patchelf version: ")