about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorRaito Bezarius <masterancpp@gmail.com>2023-06-18 14:13:35 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2023-08-20 11:49:15 +0200
commitb4b1ce244338c3b8b66a6fd17f9dd3aa3e31f9ec (patch)
treef937550e24407eaa618ed0724679a50a6890596f /pkgs/build-support
parentccbd98db50f27ff15014284f876beee2217bceae (diff)
fetchNextcloudApp: meta propagation for licenses, etc.
This improves the metadata propgation for nc4nix-generated packages.

Adds:

- licenses (best effort given spdxId doesn't seem guaranteed here)
- homepage
- longDescription
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/fetchnextcloudapp/default.nix18
1 files changed, 17 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchnextcloudapp/default.nix b/pkgs/build-support/fetchnextcloudapp/default.nix
index a7a3066ffab39..29a3f727a0824 100644
--- a/pkgs/build-support/fetchnextcloudapp/default.nix
+++ b/pkgs/build-support/fetchnextcloudapp/default.nix
@@ -1,10 +1,20 @@
-{ stdenv, fetchzip, applyPatches, ... }:
+{ stdenv, fetchzip, applyPatches, lib, ... }:
 { url
 , sha256
+, licenses
 , patches ? [ ]
 , name ? null
 , version ? null
+, description ? null
+, homepage ? null
 }:
+let
+  # TODO: do something better
+  licenseMap = {
+    "agpl" = lib.licenses.agpl3Only;
+    "apache" = lib.licenses.asl20;
+  };
+in
 if name != null || version != null then throw ''
   `pkgs.fetchNextcloudApp` has been changed to use `fetchzip`.
   To update, please
@@ -23,5 +33,11 @@ else applyPatches {
       fi
       popd &>/dev/null
     '';
+    meta =
+    ({
+      licenses = map (licenseString: licenseMap.${licenseString}) licenses;
+      longDescription = description;
+      inherit homepage;
+    });
   };
 }