From b4b1ce244338c3b8b66a6fd17f9dd3aa3e31f9ec Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 18 Jun 2023 14:13:35 +0200 Subject: [PATCH] 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 --- .../fetchnextcloudapp/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchnextcloudapp/default.nix b/pkgs/build-support/fetchnextcloudapp/default.nix index a7a3066ffab3..29a3f727a082 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; + }); }; }