2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchFromGitLab
|
2022-09-09 14:08:57 +00:00
|
|
|
, asciidoc
|
|
|
|
, binutils
|
|
|
|
, coreutils
|
|
|
|
, curl
|
|
|
|
, gpgme
|
|
|
|
, installShellFiles
|
|
|
|
, libarchive
|
|
|
|
, makeWrapper
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, zlib
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
# Compression tools in scripts/libmakepkg/util/compress.sh.in
|
|
|
|
, gzip
|
|
|
|
, bzip2
|
|
|
|
, xz
|
|
|
|
, zstd
|
|
|
|
, lrzip
|
|
|
|
, lzop
|
|
|
|
, ncompress
|
|
|
|
, lz4
|
|
|
|
, lzip
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# pacman-key runtime dependencies
|
|
|
|
, gawk
|
|
|
|
, gettext
|
|
|
|
, gnugrep
|
|
|
|
, gnupg
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# 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/"
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.mkDerivation (final: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pacman";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "6.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.archlinux.org";
|
|
|
|
owner = "pacman";
|
|
|
|
repo = "pacman";
|
|
|
|
rev = "v${final.version}";
|
|
|
|
hash = "sha256-uHBq1A//YSqFATlyqjC5ZgmvPkNKqp7sVew+nbmLH78=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
asciidoc
|
2024-04-21 15:54:59 +00:00
|
|
|
gettext
|
2022-09-09 14:08:57 +00:00
|
|
|
installShellFiles
|
2024-01-25 14:12:00 +00:00
|
|
|
libarchive
|
2022-09-09 14:08:57 +00:00
|
|
|
makeWrapper
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
gpgme
|
|
|
|
libarchive
|
|
|
|
openssl
|
|
|
|
perl
|
|
|
|
zlib
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
patches = [
|
|
|
|
./dont-create-empty-dirs.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
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
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace meson.build \
|
|
|
|
--replace "install_dir : SYSCONFDIR" "install_dir : '$out/etc'" \
|
|
|
|
--replace "join_paths(DATAROOTDIR, 'libalpm/hooks/')" "'${sysHookDir}'" \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace "join_paths(PREFIX, DATAROOTDIR, get_option('keyringdir'))" "'\$KEYRING_IMPORT_DIR'" \
|
|
|
|
--replace "join_paths(SYSCONFDIR, 'makepkg.conf.d/')" "'$out/etc/makepkg.conf.d/'"
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace doc/meson.build \
|
|
|
|
--replace "/bin/true" "${coreutils}/bin/true"
|
|
|
|
substituteInPlace scripts/repo-add.sh.in \
|
|
|
|
--replace bsdtar "${libarchive}/bin/bsdtar"
|
|
|
|
substituteInPlace scripts/pacman-key.sh.in \
|
|
|
|
--replace "local KEYRING_IMPORT_DIR='@keyringdir@'" "" \
|
2024-04-21 15:54:59 +00:00
|
|
|
--subst-var-by keyringdir '\$KEYRING_IMPORT_DIR'
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
hardeningDisable = [ "fortify3" ];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --bash scripts/pacman --zsh scripts/_pacman
|
|
|
|
wrapProgram $out/bin/makepkg \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ binutils ]}
|
|
|
|
wrapProgram $out/bin/pacman-key \
|
2022-11-21 17:40:18 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [
|
|
|
|
"${placeholder "out"}"
|
|
|
|
coreutils
|
|
|
|
gawk
|
|
|
|
gettext
|
|
|
|
gnugrep
|
|
|
|
gnupg
|
|
|
|
]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple library-based package manager";
|
2022-09-09 14:08:57 +00:00
|
|
|
homepage = "https://archlinux.org/pacman/";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://gitlab.archlinux.org/pacman/pacman/-/raw/v${final.version}/NEWS";
|
2022-09-09 14:08:57 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pacman";
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ samlukeyes123 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|