1{ lib, stdenv, fetchFromGitHub, m4, pkg-config, tcl
2, bzip2, elfutils, libarchive, libbsd, xz, openssl, zlib
3}:
4
5stdenv.mkDerivation (finalAttrs: {
6 pname = "pkg";
7 version = "1.19.1";
8
9 src = fetchFromGitHub {
10 owner = "freebsd";
11 repo = "pkg";
12 rev = finalAttrs.version;
13 sha256 = "WHR2evPn4Y0wzGwVUEuYPrDDnuPSsYHr4xIofAHeTJk=";
14 };
15
16 setOutputFlags = false;
17 separateDebugInfo = true;
18
19 nativeBuildInputs = [ m4 pkg-config tcl ];
20 buildInputs = [ bzip2 elfutils libarchive openssl xz zlib ]
21 ++ lib.optional stdenv.isLinux libbsd;
22
23 enableParallelBuilding = true;
24
25 preInstall = ''
26 mkdir -p $out/etc
27 '';
28
29 meta = with lib; {
30 homepage = "https://github.com/freebsd/pkg";
31 description = "Package management tool for FreeBSD";
32 maintainers = with maintainers; [ qyliss ];
33 platforms = with platforms; darwin ++ freebsd ++ linux ++ netbsd ++ openbsd;
34 license = licenses.bsd2;
35 };
36})