nixpkgs-suyu/pkgs/applications/video/kodi/build-kodi-addon.nix
Jeremy Fleischman a88c3bbfe1
kodi: allow using patch with kodi addons
I see no reason why we shouldn't just copy from `.` rather than `$src`.
One benefit of this is that the various patch phases update the context
of `.` rather than the immutable `$src`, which means they actually have
an effect on the build derivation now.
2022-01-02 02:16:31 -08:00

25 lines
485 B
Nix

{ stdenv, toKodiAddon, addonDir }:
{ name ? "${attrs.pname}-${attrs.version}"
, namespace
, sourceDir ? ""
, ... } @ attrs:
toKodiAddon (stdenv.mkDerivation ({
name = "kodi-" + name;
dontStrip = true;
extraRuntimeDependencies = [ ];
installPhase = ''
runHook preInstall
cd ./$sourceDir
d=$out${addonDir}/${namespace}
mkdir -p $d
sauce="."
[ -d ${namespace} ] && sauce=${namespace}
cp -R "$sauce/"* $d
runHook postInstall
'';
} // attrs))