nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1841B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   fetchurl,
      6   substituteAll,
      7   cmake,
      8   boost,
      9   jre,
     10 }:
     11 
     12 let
     13   json_src = fetchFromGitHub {
     14     owner = "ArthurSonzogni";
     15     repo = "nlohmann_json_cmake_fetchcontent";
     16     rev = "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     (substituteAll {
     50       src = ./deps.patch;
     51       inherit
     52         antlr_src
     53         antlr_jar
     54         json_src
     55         kgt_src
     56         ;
     57     })
     58   ];
     59 
     60   nativeBuildInputs = [
     61     cmake
     62     jre
     63   ];
     64 
     65   buildInputs = [ boost ];
     66 
     67   cmakeFlags = [ (lib.cmakeBool "DIAGON_BUILD_TESTS" finalAttrs.doCheck) ];
     68 
     69   doCheck = false;
     70 
     71   postCheck = ''
     72     ./input_output_test
     73   '';
     74 
     75   meta = {
     76     description = "Interactive ASCII art diagram generators";
     77     homepage = "https://github.com/ArthurSonzogni/Diagon";
     78     license = lib.licenses.mit;
     79     maintainers = [ lib.maintainers.sikmir ];
     80     platforms = lib.platforms.unix;
     81     skip.ci = true;
     82   };
     83 })