Skip to content

Commit a97d373

Browse files
committed
allow editors to find libfmt declarations
1 parent f6f2332 commit a97d373

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

deps/libfmt/default.nix

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@
55
stdenv ? pkgs.stdenv,
66
cmake ? pkgs.cmake
77
}:
8-
stdenv.mkDerivation rec {
9-
pname = "fmt";
10-
version = "12.0.0";
8+
let
9+
libfmt = stdenv.mkDerivation rec {
10+
pname = "fmt";
11+
version = "12.0.0";
1112

12-
src = pkgs.fetchFromGitHub {
13-
owner = "fmtlib";
14-
repo = "fmt";
15-
rev = "12.0.0";
16-
hash = "sha256-AZDmIeU1HbadC+K0TIAGogvVnxt0oE9U6ocpawIgl6g=";
17-
};
13+
src = pkgs.fetchFromGitHub {
14+
owner = "fmtlib";
15+
repo = "fmt";
16+
rev = "12.0.0";
17+
hash = "sha256-AZDmIeU1HbadC+K0TIAGogvVnxt0oE9U6ocpawIgl6g=";
18+
};
1819

19-
nativeBuildInputs = [ cmake ];
20+
nativeBuildInputs = [ cmake ];
2021

21-
cmakeFlags = [
22-
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
23-
"-DBUILD_SHARED_LIBS=OFF"
22+
cmakeFlags = [
23+
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
24+
"-DBUILD_SHARED_LIBS=OFF"
2425

25-
"-DFMT_TEST=OFF"
26-
"-DFMT_DOC=OFF"
27-
"-DFMT_INSTALL=ON"
28-
];
29-
}
26+
"-DFMT_TEST=OFF"
27+
"-DFMT_DOC=OFF"
28+
"-DFMT_INSTALL=ON"
29+
];
30+
};
31+
in
32+
libfmt // {
33+
include = "${libfmt}/include";
34+
lib = "${libfmt}/lib";
35+
}

develop.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ includeos.pkgs.mkShell.override { inherit (includeos) stdenv; } rec {
8383
jq \
8484
--arg libcxx "${includeos.libraries.libcxx.include}" \
8585
--arg libc "${includeos.libraries.libc}" \
86-
--arg localsrc "${toString ./.}" \
86+
--arg libfmt "${includeos.passthru.libfmt.include}" \
87+
--arg localsrc "${toString ./.}" \
8788
'
8889
map(.command |= ( .
8990
+ " -isystem \($libcxx)"
9091
+ " -isystem \($libc)/include"
92+
+ " -I \($libfmt)"
9193
| gsub("(?<a>-I)(?<b>/lib/LiveUpdate/include)"; .a + $localsrc + .b)
9294
))
9395
' "$CCDB" > "$tmp" && mv "$tmp" "$CCDB"

0 commit comments

Comments
 (0)