core/pkgs/build-support/fetchnextcloudapp/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
962 B
Nix
Raw Normal View History

2024-05-02 00:46:19 +00:00
{
stdenv,
fetchzip,
applyPatches,
lib,
...
}:
{
2024-06-30 08:16:52 +00:00
url,
2024-05-02 00:46:19 +00:00
hash ? "",
sha256 ? "",
appName ? null,
appVersion ? null,
2024-06-30 08:16:52 +00:00
license,
2024-05-02 00:46:19 +00:00
patches ? [ ],
description ? null,
homepage ? null,
2024-06-30 08:16:52 +00:00
}:
2024-05-02 00:46:19 +00:00
applyPatches (
2024-06-30 08:16:52 +00:00
{
2024-05-02 00:46:19 +00:00
inherit patches;
src = fetchzip {
inherit url hash sha256;
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
'';
meta =
{
license = lib.licenses.${license};
longDescription = description;
inherit homepage;
2024-06-30 08:16:52 +00:00
}
2024-05-02 00:46:19 +00:00
// lib.optionalAttrs (description != null) { longDescription = description; }
// lib.optionalAttrs (homepage != null) { inherit homepage; };
};
}
// lib.optionalAttrs (appName != null && appVersion != null) {
name = "nextcloud-app-${appName}-${appVersion}";
}
)