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
+12 -4
View File
@@ -1,4 +1,11 @@
{ stdenv, fetchurl, undmg, cpio, xar, lib }:
{
stdenv,
fetchurl,
undmg,
cpio,
xar,
lib,
}:
stdenv.mkDerivation rec {
pname = "fpc-binary";
@@ -25,8 +32,8 @@ stdenv.mkDerivation rec {
url = "mirror://sourceforge/project/freepascal/Mac%20OS%20X/${version}/fpc-${version}.intelarm64-macosx.dmg";
sha256 = "05d4510c8c887e3c68de20272abf62171aa5b2ef1eba6bce25e4c0bc41ba8b7d";
}
else throw "Not supported on ${stdenv.hostPlatform.system}.";
else
throw "Not supported on ${stdenv.hostPlatform.system}.";
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
undmg
@@ -39,7 +46,8 @@ stdenv.mkDerivation rec {
./binary-builder.sh
else if stdenv.hostPlatform.isDarwin then
./binary-builder-darwin.sh
else throw "Not supported on ${stdenv.hostPlatform}.";
else
throw "Not supported on ${stdenv.hostPlatform}.";
meta = {
description = "Free Pascal Compiler from a binary distribution";
+46 -14
View File
@@ -1,6 +1,27 @@
{ lib, stdenv, fetchurl, gawk, fetchpatch, undmg, cpio, xar, libiconv }:
{
lib,
stdenv,
fetchurl,
gawk,
fetchpatch,
undmg,
cpio,
xar,
libiconv,
}:
let startFPC = import ./binary.nix { inherit stdenv fetchurl undmg cpio xar lib; }; in
let
startFPC = import ./binary.nix {
inherit
stdenv
fetchurl
undmg
cpio
xar
lib
;
};
in
stdenv.mkDerivation rec {
version = "3.2.2";
@@ -11,20 +32,25 @@ stdenv.mkDerivation rec {
sha256 = "85ef993043bb83f999e2212f1bca766eb71f6f973d362e2290475dbaaf50161f";
};
buildInputs = [ startFPC gawk ];
buildInputs = [
startFPC
gawk
];
glibc = stdenv.cc.libc.out;
# Patch paths for linux systems. Other platforms will need their own patches.
patches = [
./mark-paths.patch # mark paths for later substitution in postPatch
] ++ lib.optional stdenv.hostPlatform.isAarch64 (fetchpatch {
# backport upstream patch for aarch64 glibc 2.34
url = "https://gitlab.com/freepascal.org/fpc/source/-/commit/a20a7e3497bccf3415bf47ccc55f133eb9d6d6a0.patch";
hash = "sha256-xKTBwuOxOwX9KCazQbBNLhMXCqkuJgIFvlXewHY63GM=";
stripLen = 1;
extraPrefix = "fpcsrc/";
});
patches =
[
./mark-paths.patch # mark paths for later substitution in postPatch
]
++ lib.optional stdenv.hostPlatform.isAarch64 (fetchpatch {
# backport upstream patch for aarch64 glibc 2.34
url = "https://gitlab.com/freepascal.org/fpc/source/-/commit/a20a7e3497bccf3415bf47ccc55f133eb9d6d6a0.patch";
hash = "sha256-xKTBwuOxOwX9KCazQbBNLhMXCqkuJgIFvlXewHY63GM=";
stripLen = 1;
extraPrefix = "fpcsrc/";
});
postPatch = ''
# substitute the markers set by the mark-paths patch
@@ -46,7 +72,10 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS="-syslibroot $SDKROOT -L${lib.getLib libiconv}/lib"
'';
makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ];
makeFlags = [
"NOGDB=1"
"FPC=${startFPC}/bin/fpc"
];
installFlags = [ "INSTALL_PREFIX=\${out}" ];
@@ -71,7 +100,10 @@ stdenv.mkDerivation rec {
description = "Free Pascal Compiler from a source distribution";
homepage = "https://www.freepascal.org";
maintainers = [ maintainers.raskin ];
license = with licenses; [ gpl2 lgpl2 ];
license = with licenses; [
gpl2
lgpl2
];
platforms = platforms.unix;
};
}
+92 -49
View File
@@ -1,8 +1,26 @@
{ stdenv, lib, fetchurl, makeWrapper, writeText
, fpc, gtk2, glib, pango, atk, gdk-pixbuf
, libXi, xorgproto, libX11, libXext
, gdb, gnumake, binutils
, withQt ? false, qtbase ? null, libqt5pas ? null, wrapQtAppsHook ? null
{
stdenv,
lib,
fetchurl,
makeWrapper,
writeText,
fpc,
gtk2,
glib,
pango,
atk,
gdk-pixbuf,
libXi,
xorgproto,
libX11,
libXext,
gdb,
gnumake,
binutils,
withQt ? false,
qtbase ? null,
libqt5pas ? null,
wrapQtAppsHook ? null,
}:
# TODO:
@@ -13,15 +31,17 @@ let
# as of 2.0.10 a suffix is being added. That may or may not disappear and then
# come back, so just leave this here.
majorMinorPatch = v:
builtins.concatStringsSep "." (lib.take 2 (lib.splitVersion v));
majorMinorPatch = v: builtins.concatStringsSep "." (lib.take 2 (lib.splitVersion v));
overrides = writeText "revision.inc" (lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v:
"const ${k} = '${v}';") {
# this is technically the SVN revision but as we don't have that replace
# it with the version instead of showing "Unknown"
RevisionStr = version;
}));
overrides = writeText "revision.inc" (
lib.concatStringsSep "\n" (
lib.mapAttrsToList (k: v: "const ${k} = '${v}';") {
# this is technically the SVN revision but as we don't have that replace
# it with the version instead of showing "Unknown"
RevisionStr = version;
}
)
);
in
stdenv.mkDerivation rec {
@@ -37,13 +57,25 @@ stdenv.mkDerivation rec {
cp ${overrides} ide/${overrides.name}
'';
buildInputs = [
# we need gtk2 unconditionally as that is the default target when building applications with lazarus
fpc gtk2 glib libXi xorgproto
libX11 libXext pango atk
stdenv.cc gdk-pixbuf
]
++ lib.optionals withQt [ libqt5pas qtbase ];
buildInputs =
[
# we need gtk2 unconditionally as that is the default target when building applications with lazarus
fpc
gtk2
glib
libXi
xorgproto
libX11
libXext
pango
atk
stdenv.cc
gdk-pixbuf
]
++ lib.optionals withQt [
libqt5pas
qtbase
];
# Disable parallel build, errors:
# Fatal: (1018) Compilation aborted
@@ -64,25 +96,27 @@ stdenv.mkDerivation rec {
LCL_PLATFORM = if withQt then "qt5" else "gtk2";
NIX_LDFLAGS = lib.concatStringsSep " " ([
"-L${lib.getLib stdenv.cc.cc}/lib"
"-lX11"
"-lXext"
"-lXi"
"-latk-1.0"
"-lc"
"-lcairo"
"-lgcc_s"
"-lgdk-x11-2.0"
"-lgdk_pixbuf-2.0"
"-lglib-2.0"
"-lgtk-x11-2.0"
"-lpango-1.0"
]
++ lib.optionals withQt [
"-L${lib.getLib libqt5pas}/lib"
"-lQt5Pas"
]);
NIX_LDFLAGS = lib.concatStringsSep " " (
[
"-L${lib.getLib stdenv.cc.cc}/lib"
"-lX11"
"-lXext"
"-lXi"
"-latk-1.0"
"-lc"
"-lcairo"
"-lgcc_s"
"-lgdk-x11-2.0"
"-lgdk_pixbuf-2.0"
"-lglib-2.0"
"-lgtk-x11-2.0"
"-lpango-1.0"
]
++ lib.optionals withQt [
"-L${lib.getLib libqt5pas}/lib"
"-lQt5Pas"
]
);
preBuild = ''
mkdir -p $out/share "$out/lazarus"
@@ -91,20 +125,29 @@ stdenv.mkDerivation rec {
--replace '/usr/fpcsrc' "$out/share/fpcsrc"
'';
postInstall = let
ldFlags = ''$(echo "$NIX_LDFLAGS" | sed -re 's/-rpath [^ ]+//g')'';
in ''
wrapProgram $out/bin/startlazarus \
--prefix NIX_LDFLAGS ' ' "${ldFlags}" \
--prefix NIX_LDFLAGS_${binutils.suffixSalt} ' ' "${ldFlags}" \
--prefix LCL_PLATFORM ' ' "$LCL_PLATFORM" \
--prefix PATH ':' "${lib.makeBinPath [ fpc gdb gnumake binutils ]}"
'';
postInstall =
let
ldFlags = ''$(echo "$NIX_LDFLAGS" | sed -re 's/-rpath [^ ]+//g')'';
in
''
wrapProgram $out/bin/startlazarus \
--prefix NIX_LDFLAGS ' ' "${ldFlags}" \
--prefix NIX_LDFLAGS_${binutils.suffixSalt} ' ' "${ldFlags}" \
--prefix LCL_PLATFORM ' ' "$LCL_PLATFORM" \
--prefix PATH ':' "${
lib.makeBinPath [
fpc
gdb
gnumake
binutils
]
}"
'';
meta = with lib; {
description = "Graphical IDE for the FreePascal language";
homepage = "https://www.lazarus.freepascal.org";
license = licenses.gpl2Plus ;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
+12 -2
View File
@@ -1,4 +1,11 @@
{ mkDerivation, lib, lazarus, qmake, qtbase, qtx11extras }:
{
mkDerivation,
lib,
lazarus,
qmake,
qtbase,
qtx11extras,
}:
mkDerivation {
pname = "libqt5pas";
@@ -13,7 +20,10 @@ mkDerivation {
nativeBuildInputs = [ qmake ];
buildInputs = [ qtbase qtx11extras ];
buildInputs = [
qtbase
qtx11extras
];
meta = with lib; {
description = "Free Pascal Qt5 binding library";