Merge pull request #188038 from SamLukeYes/pacman

This commit is contained in:
Sandro 2022-09-04 02:21:07 +02:00 committed by GitHub
commit a567e6bda5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 109 additions and 22 deletions

View file

@ -11570,6 +11570,12 @@
fingerprint = "AE8C 0836 FDF6 3FFC 9580 C588 B156 8953 B193 9F1C"; fingerprint = "AE8C 0836 FDF6 3FFC 9580 C588 B156 8953 B193 9F1C";
}]; }];
}; };
samlukeyes123 = {
email = "samlukeyes123@gmail.com";
github = "SamLukeYes";
githubId = 12882091;
name = "Sam L. Yes";
};
samrose = { samrose = {
email = "samuel.rose@gmail.com"; email = "samuel.rose@gmail.com";
github = "samrose"; github = "samrose";

View file

@ -1,41 +1,102 @@
{ stdenv, lib, fetchurl, pkg-config, m4, perl, libarchive, openssl, zlib, bzip2, { lib
xz, curl, runtimeShell }: , stdenv
, fetchpatch
, fetchurl
, asciidoc
, binutils
, bzip2
, coreutils
, curl
, gnupg
, gpgme
, installShellFiles
, libarchive
, makeWrapper
, meson
, ninja
, openssl
, perl
, pkg-config
, xz
, zlib
# 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 rec { stdenv.mkDerivation rec {
pname = "pacman"; pname = "pacman";
version = "5.2.2"; version = "6.0.1";
src = fetchurl { src = fetchurl {
url = "https://sources.archlinux.org/other/${pname}/${pname}-${version}.tar.gz"; url = "https://sources.archlinux.org/other/${pname}/${pname}-${version}.tar.xz";
sha256 = "1829jcc300fxidr3cahx5kpnxkpg500daqgn2782hg5m5ygil85v"; hash = "sha256-DbYUVuVqpJ4mDokcCwJb4hAxnmKxVSHynT6TsA079zE=";
}; };
enableParallelBuilding = true; nativeBuildInputs = [
asciidoc
configureFlags = [ installShellFiles
# trying to build docs fails with a2x errors, unable to fix through asciidoc makeWrapper
"--disable-doc" meson
ninja
"--sysconfdir=/etc" pkg-config
"--localstatedir=/var"
"--with-scriptlet-shell=${runtimeShell}"
]; ];
installFlags = [ "sysconfdir=${placeholder "out"}/etc" ]; buildInputs = [
bzip2
curl
gpgme
libarchive
openssl
perl
xz
zlib
];
nativeBuildInputs = [ pkg-config m4 ]; patches = [
buildInputs = [ curl perl libarchive openssl zlib bzip2 xz ]; ./dont-create-empty-dirs.patch
# Add keyringdir meson option to configure the keyring directory
(fetchpatch {
url = "https://gitlab.archlinux.org/pacman/pacman/-/commit/79bd512181af12ec80fd8f79486fc9508fa4a1b3.patch";
hash = "sha256-ivTPwWe06Q5shn++R6EY0x3GC0P4X0SuC+F5sndfAtM=";
})
];
postFixup = '' postPatch = ''
substituteInPlace $out/bin/repo-add \ substituteInPlace meson.build \
--replace "install_dir : SYSCONFDIR" "install_dir : '$out/etc'" \
--replace "join_paths(DATAROOTDIR, 'libalpm/hooks/')" "'${sysHookDir}'" \
--replace "join_paths(PREFIX, DATAROOTDIR, get_option('keyringdir'))" "'\$KEYRING_IMPORT_DIR'"
substituteInPlace doc/meson.build \
--replace "/bin/true" "${coreutils}/bin/true"
substituteInPlace scripts/repo-add.sh.in \
--replace bsdtar "${libarchive}/bin/bsdtar" --replace bsdtar "${libarchive}/bin/bsdtar"
substituteInPlace scripts/pacman-key.sh.in \
--replace "local KEYRING_IMPORT_DIR='@keyringdir@'" "" \
--subst-var-by keyringdir '\$KEYRING_IMPORT_DIR' \
--replace "--batch --check-trustdb" "--batch --check-trustdb --allow-weak-key-signatures"
''; # the line above should be removed once Arch migrates to gnupg 2.3.x
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 [ gnupg ]}
''; '';
meta = with lib; { meta = with lib; {
description = "A simple library-based package manager"; description = "A simple library-based package manager";
homepage = "https://www.archlinux.org/pacman/"; homepage = "https://archlinux.org/pacman/";
license = licenses.gpl2; changelog = "https://gitlab.archlinux.org/pacman/pacman/-/raw/v${version}/NEWS";
license = licenses.gpl2Plus;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ mt-caret ]; maintainers = with maintainers; [ samlukeyes123 ];
}; };
} }

View file

@ -0,0 +1,20 @@
diff --git a/meson.build b/meson.build
index c8ee42fd..610401ca 100644
--- a/meson.build
+++ b/meson.build
@@ -414,15 +414,6 @@ install_data(
'proto/proto.install',
install_dir : join_paths(DATAROOTDIR, 'pacman'))
-foreach path : [
- join_paths(LOCALSTATEDIR, 'lib/pacman/'),
- join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/'),
- join_paths(DATAROOTDIR, 'makepkg-template/'),
- join_paths(DATAROOTDIR, 'libalpm/hooks/'),
- ]
- meson.add_install_script('sh', '-c', 'mkdir -p "$DESTDIR/@0@"'.format(path))
-endforeach
-
TEST_ENV = environment()
TEST_ENV.set('PMTEST_SCRIPTLIB_DIR', join_paths(meson.project_source_root(), 'scripts/library/'))
TEST_ENV.set('PMTEST_LIBMAKEPKG_DIR', join_paths(meson.project_build_root(), 'scripts/libmakepkg/'))