treewide: format all inactive Nix files

After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
This commit is contained in:
Silvan Mosberger
2024-12-10 20:26:33 +01:00
parent b32a094368
commit 4f0dadbf38
21293 changed files with 701276 additions and 428232 deletions
@@ -1,10 +1,11 @@
{ lib
, stdenv
, fetchurl
, ant
, jdk
, makeWrapper
, stripJavaArchivesHook
{
lib,
stdenv,
fetchurl,
ant,
jdk,
makeWrapper,
stripJavaArchivesHook,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -1,4 +1,9 @@
{lib, stdenv, fetchurl, jdk}:
{
lib,
stdenv,
fetchurl,
jdk,
}:
stdenv.mkDerivation rec {
pname = "libmatthew-java";
@@ -8,8 +13,8 @@ stdenv.mkDerivation rec {
url = "https://src.fedoraproject.org/repo/pkgs/libmatthew-java/libmatthew-java-${version}.tar.gz/8455b8751083ce25c99c2840609271f5/libmatthew-java-${version}.tar.gz";
sha256 = "1yldkhsdzm0a41a0i881bin2jklhp85y3ah245jd6fz3npcx7l85";
};
JAVA_HOME=jdk;
PREFIX="\${out}";
JAVA_HOME = jdk;
PREFIX = "\${out}";
buildInputs = [ jdk ];
meta = with lib; {
@@ -1,7 +1,15 @@
{ fetchurl, lib, stdenv, unzip, ant, javac, jvm }:
{
fetchurl,
lib,
stdenv,
unzip,
ant,
javac,
jvm,
}:
let
xbeans = fetchurl {
xbeans = fetchurl {
url = "http://archive.apache.org/dist/xmlbeans/binaries/xmlbeans-2.2.0.zip";
sha256 = "1pb08d9j81d0wz5wj31idz198iwhqb7mch872n08jh1354rjlqwk";
};
@@ -17,29 +25,34 @@ stdenv.mkDerivation rec {
patches = [ ./gcj-type-mismatch.patch ];
hardeningDisable = [ "fortify" "format" ];
hardeningDisable = [
"fortify"
"format"
];
preConfigure =
''
find -name \*.jar -or -name \*.class -exec rm -v {} \;
preConfigure = ''
find -name \*.jar -or -name \*.class -exec rm -v {} \;
# The build process tries to download it by itself.
mkdir -p "build/tmp-xbean"
ln -sv "${xbeans}" "build/tmp-xbean/xbean.zip"
'';
# The build process tries to download it by itself.
mkdir -p "build/tmp-xbean"
ln -sv "${xbeans}" "build/tmp-xbean/xbean.zip"
'';
nativeBuildInputs = [ unzip ];
buildInputs = [ ant javac jvm ];
buildInputs = [
ant
javac
jvm
];
buildPhase = "ant jar";
doCheck = false;
doCheck = false;
# FIXME: Install javadoc as well.
installPhase =
''
mkdir -p "$out/share/java"
cp -v *.jar "$out/share/java"
'';
installPhase = ''
mkdir -p "$out/share/java"
cp -v *.jar "$out/share/java"
'';
meta = with lib; {
description = "Implementation of JavaScript written in Java";
@@ -52,7 +65,10 @@ stdenv.mkDerivation rec {
homepage = "http://www.mozilla.org/rhino/";
license = with licenses; [ mpl11 /* or */ gpl2Plus ];
license = with licenses; [
mpl11 # or
gpl2Plus
];
platforms = platforms.linux ++ platforms.darwin;
};
}
@@ -1,58 +1,74 @@
{ lib
, stdenv
, fetchurl
, unzip
, jre
, jre8
, genericUpdater
, writeShellScript
, common-updater-scripts
, gnused
{
lib,
stdenv,
fetchurl,
unzip,
jre,
jre8,
genericUpdater,
writeShellScript,
common-updater-scripts,
gnused,
}:
let
inherit (lib.versions) major majorMinor splitVersion;
inherit (lib.strings) concatStringsSep versionAtLeast;
common = { pname, version, src, description, java ? jre
, prog ? null, jar ? null, license ? lib.licenses.mpl20
, updateScript ? null }:
stdenv.mkDerivation (finalAttrs: let
mainProgram = if prog == null then pname else prog;
jar' = if jar == null then pname else jar;
in {
inherit pname version src;
common =
{
pname,
version,
src,
description,
java ? jre,
prog ? null,
jar ? null,
license ? lib.licenses.mpl20,
updateScript ? null,
}:
stdenv.mkDerivation (
finalAttrs:
let
mainProgram = if prog == null then pname else prog;
jar' = if jar == null then pname else jar;
in
{
inherit pname version src;
nativeBuildInputs = [ unzip ];
nativeBuildInputs = [ unzip ];
buildCommand = ''
unzip $src -d $out
mkdir -p $out/bin $out/share $out/share/java
cp -s "$out"/*.jar "$out/share/java/" # */
rm -rf $out/notices
mv $out/doc $out/share
cat > $out/bin/${mainProgram} <<EOF
#! $shell
export JAVA_HOME=${jre}
exec ${jre}/bin/java -jar $out/${jar'}.jar "\$@"
EOF
chmod a+x $out/bin/${mainProgram}
'';
buildCommand = ''
unzip $src -d $out
mkdir -p $out/bin $out/share $out/share/java
cp -s "$out"/*.jar "$out/share/java/" # */
rm -rf $out/notices
mv $out/doc $out/share
cat > $out/bin/${mainProgram} <<EOF
#! $shell
export JAVA_HOME=${jre}
exec ${jre}/bin/java -jar $out/${jar'}.jar "\$@"
EOF
chmod a+x $out/bin/${mainProgram}
'';
passthru = lib.optionalAttrs (updateScript != null) {
inherit updateScript;
};
passthru = lib.optionalAttrs (updateScript != null) {
inherit updateScript;
};
meta = with lib; {
inherit description license mainProgram;
homepage = if versionAtLeast finalAttrs.version "11"
then "https://www.saxonica.com/products/latest.xml"
else "https://www.saxonica.com/products/archive.xml";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
maintainers = with maintainers; [ rvl ];
platforms = platforms.all;
};
});
meta = with lib; {
inherit description license mainProgram;
homepage =
if versionAtLeast finalAttrs.version "11" then
"https://www.saxonica.com/products/latest.xml"
else
"https://www.saxonica.com/products/archive.xml";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
maintainers = with maintainers; [ rvl ];
platforms = platforms.all;
};
}
);
# Saxon release zipfiles and tags often use dashes instead of dots.
dashify = version: concatStringsSep "-" (splitVersion version);
@@ -63,25 +79,35 @@ let
# Older releases were uploaded to SourceForge. They are also
# available from the Saxon-Archive GitHub repository.
github = {
updateScript = version: genericUpdater {
versionLister = writeShellScript "saxon-he-versionLister" ''
export PATH="${lib.makeBinPath [ common-updater-scripts gnused ]}:$PATH"
major_ver="${major version}"
list-git-tags --url="https://github.com/Saxonica/Saxon-HE.git" \
| sed -En \
-e "s/SaxonHE([0-9]+)-([0-9]+)/\1.\2/" \
-e "/^''${major_ver:-[0-9]+}\./p"
updateScript =
version:
genericUpdater {
versionLister = writeShellScript "saxon-he-versionLister" ''
export PATH="${
lib.makeBinPath [
common-updater-scripts
gnused
]
}:$PATH"
major_ver="${major version}"
list-git-tags --url="https://github.com/Saxonica/Saxon-HE.git" \
| sed -En \
-e "s/SaxonHE([0-9]+)-([0-9]+)/\1.\2/" \
-e "/^''${major_ver:-[0-9]+}\./p"
'';
};
downloadUrl = version: let
tag = "SaxonHE${dashify version}";
filename = "${major version}/Java/${tag}J.zip";
in
downloadUrl =
version:
let
tag = "SaxonHE${dashify version}";
filename = "${major version}/Java/${tag}J.zip";
in
"https://raw.githubusercontent.com/Saxonica/Saxon-HE/${tag}/${filename}";
};
in {
in
{
saxon = common rec {
pname = "saxon";
version = "6.5.3";