mate.caja-with-extensions: Reimplement using lndir

This installs missing desktop files and icons and allows dropping
the caja-extensions hardcode gsettings patch.
This commit is contained in:
Bobby Rong 2024-02-22 23:55:54 +08:00
parent 8f62b25ef6
commit 239d44557a
No known key found for this signature in database
3 changed files with 65 additions and 30 deletions

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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