Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 imgui,
8 SDL2,
9 xorg,
10 imnodes,
11 withExamples ? false,
12}:
13
14stdenv.mkDerivation {
15 pname = "imnodes";
16 version = "unstable-2024-03-12";
17 outputs = [
18 "out"
19 "dev"
20 ];
21
22 src = fetchFromGitHub {
23 owner = "Nelarius";
24 repo = "imnodes";
25 rev = "8563e1655bd9bb1f249e6552cc6274d506ee788b";
26 hash = "sha256-E7NNCxYq9dyVvutWbpl2a+D2Ap2ErvdYHBDqpX0kb0c=";
27 };
28 patches = [
29 # CMake install rules
30 (fetchpatch {
31 url = "https://github.com/Nelarius/imnodes/commit/ff20336fcd82ce07c39fabd76d5bc9fa0a08b3bc.patch";
32 hash = "sha256-JHOUjwMofDwt2kg6SLPFZmuQC4bOfjGa3qHFr5MdPIE=";
33 })
34 ];
35
36 nativeBuildInputs = [ cmake ];
37 buildInputs = [
38 imgui
39 ]
40 ++ lib.optionals withExamples [
41 SDL2
42 xorg.libXext
43 ];
44
45 cmakeFlags = [ (lib.cmakeBool "IMNODES_EXAMPLES" withExamples) ];
46
47 passthru.tests.examples = imnodes.override { withExamples = true; };
48
49 meta = {
50 description = "Small, dependency-free node editor for dear imgui";
51 homepage = "https://github.com/Nelarius/imnodes";
52 license = lib.licenses.mit;
53 maintainers = with lib.maintainers; [ SomeoneSerge ];
54 mainProgram = "imnodes";
55 platforms = lib.platforms.all;
56 };
57}