summary refs log tree commit diff
path: root/pkgs/development/libraries/libbsd/default.nix
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2018-06-06 03:43:49 +0000
committerOrivej Desh <orivej@gmx.fr>2018-06-06 04:09:15 +0000
commit05fedecad9db7f06385d26b60e6353c7edc7d56a (patch)
tree25d4362ea194ffadf0caa3385d8f6735edd46700 /pkgs/development/libraries/libbsd/default.nix
parentf2682af9c9777068933c863065bf02b8d72706a6 (diff)
Revert "libbsd: replace with nbcompat"
This reverts commit 480434f7eeefed7026dbbd11a4a0b1e4bfc1f137.

netbsd.compat does not provide include files that are provided by libbsd [1], and it
encumbers its transitive dependents with an obligatory include file that setups
BSD-compatible C environment [2].

[1] https://github.com/NixOS/nixpkgs/pull/41320#issuecomment-394922277
[2] https://github.com/NixOS/nixpkgs/pull/41320#issuecomment-394928845
Diffstat (limited to 'pkgs/development/libraries/libbsd/default.nix')
-rw-r--r--pkgs/development/libraries/libbsd/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libbsd/default.nix b/pkgs/development/libraries/libbsd/default.nix
new file mode 100644
index 0000000000000..ff9412ceb5804
--- /dev/null
+++ b/pkgs/development/libraries/libbsd/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "libbsd-${version}";
+  version = "0.8.7";
+
+  src = fetchurl {
+    url = "http://libbsd.freedesktop.org/releases/${name}.tar.xz";
+    sha256 = "0c9bl49zs0xdddcwj5dh0lay9sxi2m1yi74848g8p87mb87g2j7m";
+  };
+
+  # darwin changes configure.ac which means we need to regenerate
+  # the configure scripts
+  nativeBuildInputs = [ autoreconfHook ];
+
+  patches = stdenv.lib.optional stdenv.isDarwin ./darwin.patch
+    # Suitable for all, but limited to musl to avoid rebuilds
+    ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+      # https://cgit.freedesktop.org/libbsd/commit/?id=1f8a3f7bccfc84b195218ad0086ebd57049c3490
+      ./non-glibc.patch
+      # https://cgit.freedesktop.org/libbsd/commit/?id=11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd
+      ./cdefs.patch
+      # https://cgit.freedesktop.org/libbsd/commit/?id=b20272f5a966333b49fdf2bda797e2a9f0227404
+      ./features.patch
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Common functions found on BSD systems";
+    homepage = https://libbsd.freedesktop.org/;
+    license = licenses.bsd3;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
+}