2024-08-01 11:00:23 +00:00
|
|
|
{ fetchurl, fetchzip, applyPatches, lib, ... }:
|
2022-09-26 18:32:33 +00:00
|
|
|
{ url
|
2024-03-21 16:24:29 +00:00
|
|
|
, hash ? ""
|
|
|
|
, sha256 ? ""
|
2023-08-20 10:30:34 +00:00
|
|
|
, appName ? null
|
|
|
|
, appVersion ? null
|
|
|
|
, license
|
2021-09-25 20:19:14 +00:00
|
|
|
, patches ? [ ]
|
2023-06-18 12:13:35 +00:00
|
|
|
, description ? null
|
|
|
|
, homepage ? null
|
2024-08-04 11:54:11 +00:00
|
|
|
, unpack ? false # whether to use fetchzip rather than fetchurl
|
2021-09-25 20:19:14 +00:00
|
|
|
}:
|
2023-08-20 11:29:58 +00:00
|
|
|
applyPatches ({
|
2022-09-26 18:32:33 +00:00
|
|
|
inherit patches;
|
2024-08-01 11:00:23 +00:00
|
|
|
src = (if unpack then fetchzip else fetchurl) {
|
2024-03-21 16:24:29 +00:00
|
|
|
inherit url hash sha256;
|
2023-08-20 10:30:34 +00:00
|
|
|
meta = {
|
|
|
|
license = lib.licenses.${license};
|
2023-06-18 12:13:35 +00:00
|
|
|
longDescription = description;
|
|
|
|
inherit homepage;
|
2023-08-20 11:29:58 +00:00
|
|
|
} // lib.optionalAttrs (description != null) {
|
|
|
|
longDescription = description;
|
|
|
|
} // lib.optionalAttrs (homepage != null) {
|
|
|
|
inherit homepage;
|
2023-08-20 10:30:34 +00:00
|
|
|
};
|
2021-09-25 20:19:14 +00:00
|
|
|
};
|
2024-08-01 11:00:23 +00:00
|
|
|
prePatch = ''
|
|
|
|
if [ ! -f ./appinfo/info.xml ]; then
|
|
|
|
echo "appinfo/info.xml doesn't exist in $out, aborting!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
'';
|
2023-08-20 10:30:34 +00:00
|
|
|
} // lib.optionalAttrs (appName != null && appVersion != null) {
|
|
|
|
name = "nextcloud-app-${appName}-${appVersion}";
|
|
|
|
})
|