mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
Merge pull request #193075 from Ma27/nextcloud-pkg-fix
fetchNextcloudApp: rewrite with fetchzip & applyPatches
This commit is contained in:
commit
a914b9460d
@ -734,6 +734,16 @@
|
||||
<literal>[ "lua54" "luau" ]</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>pkgs.fetchNextcloudApp</literal> has been rewritten
|
||||
to circumvent impurities in e.g. tarballs from GitHub and to
|
||||
make it easier to apply patches. This means that your hashes
|
||||
are out-of-date and the (previously required) attributes
|
||||
<literal>name</literal> and <literal>version</literal> are no
|
||||
longer accepted.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-release-22.11-notable-changes">
|
||||
|
@ -236,6 +236,10 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
|
||||
|
||||
- `stylua` no longer accepts `lua52Support` and `luauSupport` overrides, use `features` instead, which defaults to `[ "lua54" "luau" ]`.
|
||||
|
||||
- `pkgs.fetchNextcloudApp` has been rewritten to circumvent impurities in e.g. tarballs from GitHub and to make it easier to
|
||||
apply patches. This means that your hashes are out-of-date and the (previously required) attributes `name` and `version`
|
||||
are no longer accepted.
|
||||
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
|
||||
## Other Notable Changes {#sec-release-22.11-notable-changes}
|
||||
|
@ -1,32 +1,27 @@
|
||||
{ stdenv, fetchurl, ... }:
|
||||
{ name
|
||||
, url
|
||||
, version
|
||||
{ stdenv, fetchzip, applyPatches, ... }:
|
||||
{ url
|
||||
, sha256
|
||||
, patches ? [ ]
|
||||
, name ? null
|
||||
, version ? null
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "nc-app-${name}";
|
||||
inherit version patches;
|
||||
|
||||
src = fetchurl {
|
||||
if name != null || version != null then throw ''
|
||||
`pkgs.fetchNextcloudApp` has been changed to use `fetchzip`.
|
||||
To update, please
|
||||
* remove `name`/`version`
|
||||
* update the hash
|
||||
''
|
||||
else applyPatches {
|
||||
inherit patches;
|
||||
src = fetchzip {
|
||||
inherit url 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
|
||||
'';
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user