2021-09-25 21:19:14 +01:00
|
|
|
{ stdenv, gnutar, findutils, fetchurl, ... }:
|
|
|
|
{ name
|
|
|
|
, url
|
|
|
|
, version
|
|
|
|
, sha256
|
|
|
|
, patches ? [ ]
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "nc-app-${name}";
|
|
|
|
inherit version patches;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-10-09 21:36:35 +01:00
|
|
|
inherit url sha256;
|
2021-09-25 21:19:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gnutar
|
|
|
|
findutils
|
|
|
|
];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
tar -xzpf $src
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
approot="$(dirname $(dirname $(find -path '*/appinfo/info.xml' | head -n 1)))"
|
|
|
|
|
|
|
|
if [ -d "$approot" ];
|
|
|
|
then
|
|
|
|
mv "$approot/" $out
|
|
|
|
chmod -R a-w $out
|
|
|
|
else
|
|
|
|
echo "Could not find appinfo/info.xml"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
}
|