2023-10-09 19:29:22 +00:00
|
|
|
{ stdenv, fetchzip, applyPatches, lib, ... }:
|
2022-10-21 18:38:19 +00:00
|
|
|
{ url
|
2021-10-14 00:43:12 +00:00
|
|
|
, sha256
|
2023-10-09 19:29:22 +00:00
|
|
|
, appName ? null
|
|
|
|
, appVersion ? null
|
|
|
|
, license
|
2021-10-14 00:43:12 +00:00
|
|
|
, patches ? [ ]
|
2023-10-09 19:29:22 +00:00
|
|
|
, description ? null
|
|
|
|
, homepage ? null
|
2021-10-14 00:43:12 +00:00
|
|
|
}:
|
2023-10-09 19:29:22 +00:00
|
|
|
applyPatches ({
|
2022-10-21 18:38:19 +00:00
|
|
|
inherit patches;
|
|
|
|
src = fetchzip {
|
2021-10-14 00:43:12 +00:00
|
|
|
inherit url sha256;
|
2022-10-21 18:38:19 +00:00
|
|
|
postFetch = ''
|
|
|
|
pushd $out &>/dev/null
|
|
|
|
if [ ! -f ./appinfo/info.xml ]; then
|
|
|
|
echo "appinfo/info.xml doesn't exist in $out, aborting!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
popd &>/dev/null
|
|
|
|
'';
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = {
|
|
|
|
license = lib.licenses.${license};
|
|
|
|
longDescription = description;
|
|
|
|
inherit homepage;
|
|
|
|
} // lib.optionalAttrs (description != null) {
|
|
|
|
longDescription = description;
|
|
|
|
} // lib.optionalAttrs (homepage != null) {
|
|
|
|
inherit homepage;
|
|
|
|
};
|
2021-10-14 00:43:12 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
} // lib.optionalAttrs (appName != null && appVersion != null) {
|
|
|
|
name = "nextcloud-app-${appName}-${appVersion}";
|
|
|
|
})
|