nur-packages

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

commit 39c2b4cdf1842bc4a27343677c643ae2771ad00a
parent 5302ef120b61004ad2c4b1d8bb8d34c7a0845e89
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Thu, 30 Jul 2020 09:18:20 +0300

Add microjson

Diffstat:
Mnix/sources.json | 14++++++++++++++
Mpkgs/default.nix | 1+
Apkgs/development/libraries/microjson/default.nix | 30++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/nix/sources.json b/nix/sources.json @@ -495,6 +495,20 @@ "url": "https://github.com/mapbox/mercantile/archive/9e7b52f6a2019f904b2ceba3f5f9ca6ac8f02b80.tar.gz", "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" }, + "microjson": { + "branch": "master", + "builtin": false, + "date": "2020-07-04T11:11:24Z", + "description": "Tiny streaming json deserializer", + "homepage": "https://github.com/semlanik/microjson", + "owner": "semlanik", + "repo": "microjson", + "rev": "b1b37757a36f19399e38088609bc63312c50137f", + "sha256": "0byjiizzsgb742mvqrr513b22idkqsdrvvixyczkh25lkj3aqhga", + "type": "tarball", + "url": "https://github.com/semlanik/microjson/archive/b1b37757a36f19399e38088609bc63312c50137f.tar.gz", + "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" + }, "mikatools": { "branch": "master", "builtin": false, diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -82,6 +82,7 @@ lib.makeScope newScope ( automake = pkgs.automake111x; }; libshell = callPackage ./development/libraries/libshell { }; + microjson = callPackage ./development/libraries/microjson { }; ### DEVELOPMENT / PERL MODULES diff --git a/pkgs/development/libraries/microjson/default.nix b/pkgs/development/libraries/microjson/default.nix @@ -0,0 +1,30 @@ +{ stdenv, cmake, gtest, sources }: +let + pname = "microjson"; + date = stdenv.lib.substring 0 10 sources.microjson.date; + version = "unstable-" + date; +in +stdenv.mkDerivation { + inherit pname version; + src = sources.microjson; + + postPatch = '' + substituteInPlace tests/CMakeLists.txt \ + --replace "find_package(microjson CONFIG REQUIRED)" "" + ''; + + nativeBuildInputs = [ cmake gtest ]; + + cmakeFlags = [ + "-DMICROJSON_MAKE_TESTS=ON" + ]; + + doCheck = true; + + meta = with stdenv.lib; { + inherit (sources.microjson) description homepage; + license = licenses.mit; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.unix; + }; +}