@@ -0,0 +1,39 @@
1+{ stdenv, fetchFromGitHub, pkgconfig, which, zlib, openssl, libarchive }:
2+
3+stdenv.mkDerivation rec {
4+ name = "xbps-${version}";
5+ version = "0.52";
6+
7+ src = fetchFromGitHub {
8+ owner = "voidlinux";
9+ repo = "xbps";
10+ rev = version;
11+ sha256 = "1sf6iy9l3dijsczsngzbhksshfm1374g2rrdasc04l6gz35l2cdp";
12+ };
13+
14+ nativeBuildInputs = [ pkgconfig which ];
15+
16+ buildInputs = [ zlib openssl libarchive ];
17+
18+ patches = [ ./cert-paths.patch ];
19+
20+ postPatch = ''
21+ # fix unprefixed ranlib (needed on cross)
22+ substituteInPlace lib/Makefile \
23+ --replace 'SILENT}ranlib ' 'SILENT}$(RANLIB) '
24+
25+ # Don't try to install keys to /var/db/xbps, put in $out/share for now
26+ substituteInPlace data/Makefile \
27+ --replace '$(DESTDIR)/$(DBDIR)' '$(DESTDIR)/$(SHAREDIR)'
28+ '';
29+
30+ enableParallelBuilding = true;
31+
32+ meta = with stdenv.lib; {
33+ homepage = https://github.com/voidlinux/xbps;
34+ description = "The X Binary Package System";
35+ platforms = platforms.linux; # known to not work on Darwin, at least
36+ license = licenses.bsd2;
37+ maintainers = with maintainers; [ dtzWill ];
38+ };
39+}