about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video/kodi/build-kodi-addon.nix
blob: 8f9c05d8fa12ec3489a72cbcfde12d33a9ac22a0 (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 ./$sourceDir
    d=$out${addonDir}/${namespace}
    mkdir -p $d
    sauce="."
    [ -d ${namespace} ] && sauce=${namespace}
    cp -R "$sauce/"* $d

    runHook postInstall
  '';
} // attrs))