Files
nixpkgs/pkgs/build-support/fetchnextcloudapp/default.nix
T
Arnout Engelen ef82ab6ef8 nextcloud: specify sourceProvenance for apps
Looks like most apps are built from tarballs that contain
compiled vue templates and vendored dependencies, so this
seems like a more accurate default.
2025-10-31 11:42:24 +01:00

55 lines
1.4 KiB
Nix

{
fetchurl,
fetchzip,
applyPatches,
lib,
...
}:
{
name ?
if appName == null || appVersion == null then null else "nextcloud-app-${appName}-${appVersion}",
url,
hash ? "",
sha256 ? "",
sha512 ? "",
appName ? null,
appVersion ? null,
license,
patches ? [ ],
description ? null,
longDescription ? description,
homepage ? null,
maintainers ? [ ],
teams ? [ ],
unpack ? false, # whether to use fetchzip rather than fetchurl
}:
applyPatches {
${if name == null then null else "name"} = name;
inherit patches;
src = (if unpack then fetchzip else fetchurl) {
inherit url;
${if hash == "" then null else "hash"} = hash;
${if sha256 == "" then null else "sha256"} = sha256;
${if sha512 == "" then null else "sha512"} = sha512;
meta = {
license = lib.licenses.${license};
${if description == null then null else "description"} = description;
${if longDescription == null then null else "longDescription"} = longDescription;
${if homepage == null then null else "homepage"} = homepage;
inherit maintainers teams;
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode # vendored deps, compiled vue templates, etc
];
};
};
prePatch = ''
if [ ! -f ./appinfo/info.xml ]; then
echo "appinfo/info.xml doesn't exist in $out, aborting!"
exit 1
fi
'';
}