Silvan Mosberger 4f0dadbf38 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 a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

142 lines
3.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
asciidoc,
binutils,
coreutils,
curl,
gpgme,
installShellFiles,
libarchive,
makeWrapper,
meson,
ninja,
openssl,
perl,
pkg-config,
zlib,
# Compression tools in scripts/libmakepkg/util/compress.sh.in
gzip,
bzip2,
xz,
zstd,
lrzip,
lzop,
ncompress,
lz4,
lzip,
# pacman-key runtime dependencies
gawk,
gettext,
gnugrep,
gnupg,
# Tells pacman where to find ALPM hooks provided by packages.
# This path is very likely to be used in an Arch-like root.
sysHookDir ? "/usr/share/libalpm/hooks/",
}:
stdenv.mkDerivation (final: {
pname = "pacman";
version = "7.0.0";
src = fetchFromGitLab {
domain = "gitlab.archlinux.org";
owner = "pacman";
repo = "pacman";
rev = "v${final.version}";
hash = "sha256-ejOBxN2HjV4dZwFA7zvPz3JUJa0xiJ/jZ+evEQYG1Mc=";
};
strictDeps = true;
nativeBuildInputs = [
asciidoc
gettext
installShellFiles
libarchive
makeWrapper
meson
ninja
pkg-config
];
buildInputs = [
curl
gpgme
libarchive
openssl
perl
zlib
];
patches = [
./dont-create-empty-dirs.patch
];
postPatch =
let
compressionTools = [
gzip
bzip2
xz
zstd
lrzip
lzop
ncompress
lz4
lzip
];
in
''
echo 'export PATH=${lib.makeBinPath compressionTools}:$PATH' >> scripts/libmakepkg/util/compress.sh.in
substituteInPlace meson.build \
--replace-fail "install_dir : SYSCONFDIR" "install_dir : '$out/etc'" \
--replace-fail "join_paths(DATAROOTDIR, 'libalpm/hooks/')" "'${sysHookDir}'" \
--replace-fail "join_paths(SYSCONFDIR, 'makepkg.conf.d/')" "'$out/etc/makepkg.conf.d/'"
substituteInPlace doc/meson.build \
--replace-fail "/bin/true" "${coreutils}/bin/true"
substituteInPlace scripts/repo-add.sh.in \
--replace-fail bsdtar "${libarchive}/bin/bsdtar"
# Fix https://gitlab.archlinux.org/pacman/pacman/-/issues/171
substituteInPlace scripts/libmakepkg/source/git.sh.in \
--replace-warn "---mirror" "--mirror"
'';
mesonFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
];
postInstall = ''
installShellCompletion --bash scripts/pacman --zsh scripts/_pacman
wrapProgram $out/bin/makepkg \
--prefix PATH : ${lib.makeBinPath [ binutils ]}
wrapProgram $out/bin/pacman-key \
--prefix PATH : ${
lib.makeBinPath [
"${placeholder "out"}"
coreutils
gawk
gettext
gnugrep
gnupg
]
}
'';
meta = with lib; {
description = "Simple library-based package manager";
homepage = "https://archlinux.org/pacman/";
changelog = "https://gitlab.archlinux.org/pacman/pacman/-/raw/v${final.version}/NEWS";
license = licenses.gpl2Plus;
platforms = platforms.linux;
mainProgram = "pacman";
maintainers = with maintainers; [ samlukeyes123 ];
};
})