package.nix (1853B)
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 __structuredAttrs = true; 41 42 src = fetchFromGitHub { 43 owner = "ArthurSonzogni"; 44 repo = "Diagon"; 45 rev = "v${finalAttrs.version}"; 46 hash = "sha256-Qxk3+1T0IPmvB5v3jaqvBnESpss6L8bvoW+R1l5RXdQ="; 47 }; 48 49 patches = [ 50 # Prevent CMake from trying to fetch libraries from GitHub 51 (replaceVars ./deps.patch { 52 inherit 53 antlr_src 54 antlr_jar 55 json_src 56 kgt_src 57 ; 58 }) 59 ]; 60 61 nativeBuildInputs = [ 62 cmake 63 jre 64 ]; 65 66 buildInputs = [ boost ]; 67 68 cmakeFlags = [ (lib.cmakeBool "DIAGON_BUILD_TESTS" finalAttrs.doCheck) ]; 69 70 doCheck = false; 71 72 postCheck = '' 73 ./input_output_test 74 ''; 75 76 meta = { 77 description = "Interactive ASCII art diagram generators"; 78 homepage = "https://github.com/ArthurSonzogni/Diagon"; 79 license = lib.licenses.mit; 80 maintainers = [ lib.maintainers.sikmir ]; 81 platforms = lib.platforms.unix; 82 skip.ci = true; 83 }; 84 })
