![Bobby Rong](/assets/img/avatar_default.png)
By simply adding cp -r ./ $out to postInstall, you will find the previous substitution does not work at all, this is documented in Nixpkgs manual, that for substituteAll, "Environment variables that start with an uppercase letter or an underscore are filtered out".
74 lines
1.8 KiB
Nix
74 lines
1.8 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchurl
|
|
, pkg-config
|
|
, gettext
|
|
, gtk3
|
|
, gupnp
|
|
, mate
|
|
, imagemagick
|
|
, wrapGAppsHook
|
|
, mateUpdateScript
|
|
, glib
|
|
, substituteAll
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "caja-extensions";
|
|
version = "1.26.1";
|
|
|
|
src = fetchurl {
|
|
url = "https://pub.mate-desktop.org/releases/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
|
sha256 = "WJwZ4/oQJC1iOaXMuVhVmENqVuvpTS6ypQtZUMzh1SA=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
gettext
|
|
wrapGAppsHook
|
|
];
|
|
|
|
buildInputs = [
|
|
gtk3
|
|
gupnp
|
|
mate.caja
|
|
mate.mate-desktop
|
|
imagemagick
|
|
];
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./hardcode-gsettings.patch;
|
|
caja_gsetttings_path = glib.getSchemaPath mate.caja;
|
|
term_gsetttings_path = glib.getSchemaPath mate.mate-terminal;
|
|
})
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace open-terminal/caja-open-terminal.c --subst-var-by \
|
|
GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"}
|
|
substituteInPlace sendto/caja-sendto-command.c --subst-var-by \
|
|
GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"}
|
|
substituteInPlace wallpaper/caja-wallpaper-extension.c --subst-var-by \
|
|
GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"}
|
|
|
|
for f in image-converter/caja-image-{resizer,rotator}.c; do
|
|
substituteInPlace $f --replace "/usr/bin/convert" "${imagemagick}/bin/convert"
|
|
done
|
|
'';
|
|
|
|
configureFlags = [ "--with-cajadir=$$out/lib/caja/extensions-2.0" ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
passthru.updateScript = mateUpdateScript { inherit pname; };
|
|
|
|
meta = with lib; {
|
|
description = "Set of extensions for Caja file manager";
|
|
homepage = "https://mate-desktop.org";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.unix;
|
|
maintainers = teams.mate.members;
|
|
};
|
|
}
|