1{ stdenv, fetchurl, autoreconfHook }:
2
3stdenv.mkDerivation rec {
4 name = "libbsd-${version}";
5 version = "0.9.1";
6
7 src = fetchurl {
8 url = "https://libbsd.freedesktop.org/releases/${name}.tar.xz";
9 sha256 = "1957w2wi7iqar978qlfsm220dwywnrh5m58nrnn9zmi74ds3bn2n";
10 };
11
12 # darwin changes configure.ac which means we need to regenerate
13 # the configure scripts
14 nativeBuildInputs = [ autoreconfHook ];
15
16 patches = stdenv.lib.optional stdenv.isDarwin ./darwin.patch
17 # Suitable for all but limited to musl to avoid rebuild
18 ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl.patch;
19
20 meta = with stdenv.lib; {
21 description = "Common functions found on BSD systems";
22 homepage = https://libbsd.freedesktop.org/;
23 license = licenses.bsd3;
24 platforms = platforms.linux ++ platforms.darwin;
25 maintainers = with maintainers; [ matthewbauer ];
26 };
27}