Commit b33b32fc authored by Adam Joseph's avatar Adam Joseph
Browse files

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.
parent d74180d0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -136,7 +136,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
@@ -214,6 +217,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

+2 −0
Original line number Diff line number Diff line
@@ -212,8 +212,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