about summary refs log tree commit diff
path: root/pkgs/applications/video/kodi/build-kodi-addon.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/video/kodi/build-kodi-addon.nix')
-rw-r--r--pkgs/applications/video/kodi/build-kodi-addon.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/applications/video/kodi/build-kodi-addon.nix b/pkgs/applications/video/kodi/build-kodi-addon.nix
new file mode 100644
index 000000000000..cd768b6fa991
--- /dev/null
+++ b/pkgs/applications/video/kodi/build-kodi-addon.nix
@@ -0,0 +1,21 @@
+{ stdenv, toKodiAddon, addonDir }:
+{ name ? "${attrs.pname}-${attrs.version}"
+, namespace
+, sourceDir ? ""
+, ... } @ attrs:
+toKodiAddon (stdenv.mkDerivation ({
+  name = "kodi-" + name;
+
+  dontStrip = true;
+
+  extraRuntimeDependencies = [ ];
+
+  installPhase = ''
+    cd $src/$sourceDir
+    d=$out${addonDir}/${namespace}
+    mkdir -p $d
+    sauce="."
+    [ -d ${namespace} ] && sauce=${namespace}
+    cp -R "$sauce/"* $d
+  '';
+} // attrs))