chromium: late-bind xdg-utils if broken

xdg-utils does not cross-compile.  Let's late-bind (using the
runtime $PATH) in this scenario so a native-built xdg-utils can be
used instead.
This commit is contained in:
Adam Joseph
2023-07-05 03:32:15 -07:00
parent 84ada07d73
commit 758bf4cb8a
2 changed files with 7 additions and 1 deletions
@@ -139,7 +139,10 @@ let
bzip2 flac speex opusWithCustomModes
libevent expat libjpeg snappy
libcap
xdg-utils minizip libwebp
] ++ lib.optionals (!xdg-utils.meta.broken) [
xdg-utils
] ++ [
minizip libwebp
libusb1 re2
ffmpeg libxslt libxml2
nasm
@@ -225,6 +228,7 @@ let
'/usr/share/locale/' \
'${glibc}/share/locale/'
'' + lib.optionalString (!xdg-utils.meta.broken) ''
sed -i -e 's@"\(#!\)\?.*xdg-@"\1${xdg-utils}/bin/xdg-@' \
chrome/browser/shell_integration_linux.cc
@@ -213,8 +213,10 @@ in stdenv.mkDerivation {
export XDG_DATA_DIRS=$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH\''${XDG_DATA_DIRS:+:}\$XDG_DATA_DIRS
'' + lib.optionalString (!xdg-utils.meta.broken) ''
# Mainly for xdg-open but also other xdg-* tools (this is only a fallback; \$PATH is suffixed so that other implementations can be used):
export PATH="\$PATH\''${PATH:+:}${xdg-utils}/bin"
'' + ''
.
w