diff --git a/pkgs/desktops/mate/caja-with-extensions/default.nix b/pkgs/desktops/mate/caja-with-extensions/default.nix deleted file mode 100644 index 4de6d5d6d760..000000000000 --- a/pkgs/desktops/mate/caja-with-extensions/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv -, lib -, makeWrapper -, caja-extensions -, caja -, extensions ? [ caja-extensions ] -, mateUpdateScript -}: - -stdenv.mkDerivation { - pname = "${caja.pname}-with-extensions"; - version = caja.version; - - dontUnpack = true; - - nativeBuildInputs = [ - makeWrapper - ]; - - inherit caja; - - installPhase = '' - mkdir -p $out/bin - makeWrapper $caja/bin/caja $out/bin/caja \ - --set CAJA_EXTENSION_DIRS ${lib.concatMapStringsSep ":" (x: "${x.outPath}/lib/caja/extensions-2.0") extensions} - ''; - - inherit (caja.meta); -} diff --git a/pkgs/desktops/mate/caja/with-extensions.nix b/pkgs/desktops/mate/caja/with-extensions.nix new file mode 100644 index 000000000000..b9a55b4b9209 --- /dev/null +++ b/pkgs/desktops/mate/caja/with-extensions.nix @@ -0,0 +1,61 @@ +{ stdenv +, lib +, glib +, wrapGAppsHook +, xorg +, caja +, cajaExtensions +, extensions ? [ ] +, useDefaultExtensions ? true +}: + +let + selectedExtensions = extensions ++ (lib.optionals useDefaultExtensions cajaExtensions); +in +stdenv.mkDerivation { + pname = "${caja.pname}-with-extensions"; + version = caja.version; + + src = null; + + nativeBuildInputs = [ + glib + wrapGAppsHook + ]; + + buildInputs = lib.forEach selectedExtensions (x: x.buildInputs) ++ selectedExtensions + ++ [ caja ] ++ caja.buildInputs; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + preferLocalBuild = true; + allowSubstitutes = false; + + installPhase = '' + runHook preInstall + + mkdir -p $out + ${xorg.lndir}/bin/lndir -silent ${caja} $out + + dbus_service_path="share/dbus-1/services/org.mate.freedesktop.FileManager1.service" + rm -f $out/share/applications/* "$out/$dbus_service_path" + for file in ${caja}/share/applications/*; do + substitute "$file" "$out/share/applications/$(basename $file)" \ + --replace-fail "${caja}" "$out" + done + substitute "${caja}/$dbus_service_path" "$out/$dbus_service_path" \ + --replace-fail "${caja}" "$out" + + runHook postInstall + ''; + + preFixup = lib.optionalString (selectedExtensions != [ ]) '' + gappsWrapperArgs+=( + --set CAJA_EXTENSION_DIRS ${lib.concatMapStringsSep ":" (x: "${x.outPath}/lib/caja/extensions-2.0") selectedExtensions} + ) + ''; + + inherit (caja.meta); +} diff --git a/pkgs/desktops/mate/default.nix b/pkgs/desktops/mate/default.nix index 50287c544c12..910c973ff4ec 100644 --- a/pkgs/desktops/mate/default.nix +++ b/pkgs/desktops/mate/default.nix @@ -14,7 +14,7 @@ let caja = callPackage ./caja { }; caja-dropbox = callPackage ./caja-dropbox { }; caja-extensions = callPackage ./caja-extensions { }; - caja-with-extensions = callPackage ./caja-with-extensions { }; + caja-with-extensions = callPackage ./caja/with-extensions.nix { }; engrampa = callPackage ./engrampa { }; eom = callPackage ./eom { }; libmatekbd = callPackage ./libmatekbd { }; @@ -96,6 +96,9 @@ let pluma ]; + cajaExtensions = [ + caja-extensions + ]; }; in lib.makeScope pkgs.newScope packages