about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video/kodi/build-kodi-addon.nix
blob: 572d5dda8053020f9617bbfdc7b1e4b323ca6144 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ stdenv, toKodiAddon, addonDir }:
{ name ? "${attrs.pname}-${attrs.version}"
, namespace
, sourceDir ? ""
, ... } @ attrs:
toKodiAddon (stdenv.mkDerivation ({
  name = "kodi-" + name;

  dontStrip = true;

  extraRuntimeDependencies = [ ];

  installPhase = ''
    runHook preInstall

    cd $src/$sourceDir
    d=$out${addonDir}/${namespace}
    mkdir -p $d
    sauce="."
    [ -d ${namespace} ] && sauce=${namespace}
    cp -R "$sauce/"* $d

    runHook postInstall
  '';
} // attrs))