default.nix (1824B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 fetchurl, 6 replaceVars, 7 cmake, 8 boost, 9 jre, 10 }: 11 12 let 13 json_src = fetchFromGitHub { 14 owner = "ArthurSonzogni"; 15 repo = "nlohmann_json_cmake_fetchcontent"; 16 tag = "v3.9.1"; 17 hash = "sha256-5A18zFqbgDc99pqQUPcpwHi89WXb8YVR9VEwO18jH2I="; 18 }; 19 antlr_src = fetchFromGitHub { 20 owner = "ArthurSonzogni"; 21 repo = "antlr4"; 22 rev = "remove-pthread"; 23 hash = "sha256-ohhj59+rBZBUvL9exURx4BHgeM+zUUvvcHkdh8hJLw0="; 24 }; 25 antlr_jar = fetchurl { 26 url = "http://www.antlr.org/download/antlr-4.11.1-complete.jar"; 27 hash = "sha256-YpdeGStK8mIrcrXwExVT7jy86X923CpBYy3MVeJUc+E="; 28 }; 29 kgt_src = fetchFromGitHub { 30 owner = "ArthurSonzogni"; 31 repo = "kgt"; 32 rev = "56c3f46cf286051096d9295118c048219fe0d776"; 33 hash = "sha256-xH0htDZd2UihLn7PHKLjEYETzcBSeJFOMNredTqlCW8="; 34 }; 35 in 36 stdenv.mkDerivation (finalAttrs: { 37 pname = "diagon"; 38 version = "1.1.158"; 39 40 src = fetchFromGitHub { 41 owner = "ArthurSonzogni"; 42 repo = "Diagon"; 43 rev = "v${finalAttrs.version}"; 44 hash = "sha256-Qxk3+1T0IPmvB5v3jaqvBnESpss6L8bvoW+R1l5RXdQ="; 45 }; 46 47 patches = [ 48 # Prevent CMake from trying to fetch libraries from GitHub 49 (replaceVars ./deps.patch { 50 inherit 51 antlr_src 52 antlr_jar 53 json_src 54 kgt_src 55 ; 56 }) 57 ]; 58 59 nativeBuildInputs = [ 60 cmake 61 jre 62 ]; 63 64 buildInputs = [ boost ]; 65 66 cmakeFlags = [ (lib.cmakeBool "DIAGON_BUILD_TESTS" finalAttrs.doCheck) ]; 67 68 doCheck = false; 69 70 postCheck = '' 71 ./input_output_test 72 ''; 73 74 meta = { 75 description = "Interactive ASCII art diagram generators"; 76 homepage = "https://github.com/ArthurSonzogni/Diagon"; 77 license = lib.licenses.mit; 78 maintainers = [ lib.maintainers.sikmir ]; 79 platforms = lib.platforms.unix; 80 skip.ci = true; 81 }; 82 })