about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libbutl
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libbutl')
-rw-r--r--nixpkgs/pkgs/development/libraries/libbutl/default.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libbutl/default.nix b/nixpkgs/pkgs/development/libraries/libbutl/default.nix
new file mode 100644
index 000000000000..55aacf160f37
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbutl/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv
+, build2
+, fetchurl
+, libuuid
+, enableShared ? !stdenv.hostPlatform.isStatic
+, enableStatic ? !enableShared
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libbutl";
+  version = "0.14.0";
+
+  outputs = [ "out" "dev" "doc" ];
+
+  src = fetchurl {
+    url = "https://pkg.cppget.org/1/alpha/build2/libbutl-${version}.tar.gz";
+    sha256 = "sha256-zKufrUsLZmjw6pNbOAv+dPyolWpgXgygEnW0Lka6zw8=";
+  };
+
+  nativeBuildInputs = [
+    build2
+  ];
+
+  strictDeps = true;
+
+  # Should be true for anything built with build2,
+  # but especially important when bootstrapping
+  disallowedReferences = [ build2 ];
+
+  postPatch = lib.optionalString stdenv.isLinux ''
+    substituteInPlace libbutl/uuid-linux.cxx \
+      --replace '"libuuid.so' '"${lib.getLib libuuid}/lib/libuuid.so'
+  '';
+
+  build2ConfigureFlags = [
+    "config.bin.lib=${build2.configSharedStatic enableShared enableStatic}"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "build2 utility library";
+    longDescription = ''
+      This library is a collection of utilities that are used throughout the
+      build2 toolchain.
+    '';
+    homepage = "https://build2.org/";
+    changelog = "https://git.build2.org/cgit/libbutl/log";
+    license = licenses.mit;
+    maintainers = with maintainers; [ r-burns ];
+    platforms = platforms.all;
+  };
+}