nur-packages

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

default.nix (942B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   cmake,
      6   gtest,
      7 }:
      8 
      9 stdenv.mkDerivation (finalAttrs: {
     10   pname = "microjson";
     11   version = "0.1.0";
     12 
     13   src = fetchFromGitHub {
     14     owner = "semlanik";
     15     repo = "microjson";
     16     rev = "v${finalAttrs.version}";
     17     hash = "sha256-6kGshpy0CDg/8z3unZvGs0Uh1gglZ7yrIGc9/X+M0i8=";
     18   };
     19 
     20   postPatch = ''
     21     substituteInPlace CMakeLists.txt \
     22       --replace-fail 'CMAKE_CXX_STANDARD 11' 'CMAKE_CXX_STANDARD 17'
     23     substituteInPlace tests/CMakeLists.txt \
     24       --replace-fail "find_package(microjson CONFIG REQUIRED)" ""
     25   '';
     26 
     27   nativeBuildInputs = [
     28     cmake
     29     gtest
     30   ];
     31 
     32   cmakeFlags = [ (lib.cmakeBool "MICROJSON_MAKE_TESTS" true) ];
     33 
     34   doCheck = true;
     35 
     36   meta = {
     37     description = "Tiny streaming json deserializer";
     38     homepage = "https://github.com/semlanik/microjson";
     39     license = lib.licenses.mit;
     40     maintainers = [ lib.maintainers.sikmir ];
     41     platforms = lib.platforms.unix;
     42   };
     43 })