6 , httpSupport ? true, curl
8 , linenoiseSupport ? cliSupport, linenoise
9 , enableLTO ? stdenv.cc.isGNU
12 assert enableLTO -> stdenv.cc.isGNU;
14 stdenv.mkDerivation rec {
18 src = fetchFromGitHub {
22 sha256 = "sha256-Tahi2K8Q/KPc9MN7yWhkqp/MzXfzJzrGSsvnTCyI03U=";
25 nativeBuildInputs = [ cmake ];
29 ] ++ lib.optional httpSupport curl
30 ++ lib.optional linenoiseSupport linenoise;
33 ./0001-force-sqlite-to-be-found.patch
36 postPatch = lib.optionalString (!enableLTO) ''
37 sed -i src/CMakeLists.txt \
38 -e 's/-flto/${lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation"}/'
42 "-DBUILD_CLI=${if cliSupport then "ON" else "OFF"}"
43 "-DDISABLE_HTTP=${if httpSupport then "OFF" else "ON"}"
44 "-DDISABLE_LINENOISE=${if linenoiseSupport then "OFF" else "ON"}"
45 ] ++ lib.optionals enableLTO [ # TODO: LTO with LLVM
46 "-DCMAKE_AR=${stdenv.cc.cc}/bin/gcc-ar"
47 "-DCMAKE_RANLIB=${stdenv.cc.cc}/bin/gcc-ranlib"
54 sed -i tests/runTests.du \
56 sed -i tests/path/realpath.du \
58 sed -i tests/path/isDir.du \
59 -e 's,/usr/bin,/build/source,' \
65 ./dictu tests/runTests.du
70 cp -r /build/source/src/include $out/include
72 cp /build/source/build/src/libdictu_api* $out/lib
73 '' + lib.optionalString cliSupport ''
74 install -Dm755 /build/source/dictu $out/bin/dictu
78 description = "High-level dynamically typed, multi-paradigm, interpreted programming language";
79 homepage = "https://dictu-lang.com";
80 license = licenses.mit;
81 maintainers = with maintainers; [ luc65r ];
82 platforms = platforms.all;
83 broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/staging-next/dictu.x86_64-darwin