lol
1{ lib, stdenv
2, build2
3, fetchurl
4, libuuid
5, enableShared ? !stdenv.hostPlatform.isStatic
6, enableStatic ? !enableShared
7}:
8
9stdenv.mkDerivation rec {
10 pname = "libbutl";
11 version = "0.15.0";
12
13 outputs = [ "out" "dev" "doc" ];
14
15 src = fetchurl {
16 url = "https://pkg.cppget.org/1/alpha/build2/libbutl-${version}.tar.gz";
17 sha256 = "sha256-yzs6DFt6peJPPaMQ3rtx+kiYu7H+bUuShcdnEN90WWI=";
18 };
19
20 nativeBuildInputs = [
21 build2
22 ];
23
24 strictDeps = true;
25
26 # Should be true for anything built with build2,
27 # but especially important when bootstrapping
28 disallowedReferences = [ build2 ];
29
30 postPatch = lib.optionalString stdenv.isLinux ''
31 substituteInPlace libbutl/uuid-linux.cxx \
32 --replace '"libuuid.so' '"${lib.getLib libuuid}/lib/libuuid.so'
33 '';
34
35 build2ConfigureFlags = [
36 "config.bin.lib=${build2.configSharedStatic enableShared enableStatic}"
37 ];
38
39 doCheck = true;
40
41 meta = with lib; {
42 description = "build2 utility library";
43 longDescription = ''
44 This library is a collection of utilities that are used throughout the
45 build2 toolchain.
46 '';
47 homepage = "https://build2.org/";
48 changelog = "https://git.build2.org/cgit/libbutl/log";
49 license = licenses.mit;
50 maintainers = with maintainers; [ r-burns ];
51 platforms = platforms.all;
52 };
53}