Files
nixpkgs/pkgs/by-name/xb/xbps/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

70 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
which,
zlib,
openssl,
libarchive,
}:
stdenv.mkDerivation rec {
pname = "xbps";
version = "0.59.2";
src = fetchFromGitHub {
owner = "void-linux";
repo = "xbps";
rev = version;
hash = "sha256-3+LzFLDZ1zfRPBETMlpEn66zsfHRHQLlgeZPdMtmA14=";
};
nativeBuildInputs = [
pkg-config
which
];
buildInputs = [
zlib
openssl
libarchive
];
patches = [
./cert-paths.patch
];
env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result -Wno-error=deprecated-declarations";
postPatch = ''
# _BSD_SOURCE causes cpp warning
# https://github.com/void-linux/xbps/issues/576
substituteInPlace bin/xbps-fbulk/main.c lib/util.c lib/external/dewey.c lib/external/fexec.c \
--replace 'define _BSD_SOURCE' 'define _DEFAULT_SOURCE' \
--replace '# define _BSD_SOURCE' '#define _DEFAULT_SOURCE'
# fix calloc argument cause a build failure
substituteInPlace bin/xbps-fbulk/main.c \
--replace-fail 'calloc(sizeof(*depn), 1)' 'calloc(1UL, sizeof(*depn))'
# fix unprefixed ranlib (needed on cross)
substituteInPlace lib/Makefile \
--replace 'SILENT}ranlib ' 'SILENT}$(RANLIB) '
# Don't try to install keys to /var/db/xbps, put in $out/share for now
substituteInPlace data/Makefile \
--replace '$(DESTDIR)/$(DBDIR)' '$(DESTDIR)/$(SHAREDIR)'
'';
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://github.com/void-linux/xbps";
description = "X Binary Package System";
platforms = platforms.linux; # known to not work on Darwin, at least
license = licenses.bsd2;
maintainers = with maintainers; [ dtzWill ];
};
}