Merge pull request #177249 from dotlambda/rapidjson-tests

rapidjson: run tests

authored by Rick van Schijndel and committed by GitHub abb346a4 7c0bac48

+68 -18
+34 -5
pkgs/development/libraries/rapidjson/default.nix
··· 1 - { stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, cmake }: 2 3 stdenv.mkDerivation rec { 4 pname = "rapidjson"; ··· 16 url = "https://src.fedoraproject.org/rpms/rapidjson/raw/48402da9f19d060ffcd40bf2b2e6987212c58b0c/f/rapidjson-1.1.0-c++20.patch"; 17 sha256 = "1qm62iad1xfsixv1li7qy475xc7gc04hmi2q21qdk6l69gk7mf82"; 18 }) 19 ]; 20 21 nativeBuildInputs = [ pkg-config cmake ]; 22 23 - preConfigure = '' 24 - substituteInPlace CMakeLists.txt --replace "-Werror" "" 25 - substituteInPlace example/CMakeLists.txt --replace "-Werror" "" 26 ''; 27 28 meta = with lib; { 29 description = "Fast JSON parser/generator for C++ with both SAX/DOM style API"; 30 homepage = "http://rapidjson.org/"; 31 license = licenses.mit; 32 platforms = platforms.unix; 33 - maintainers = with maintainers; [ cstrahan ]; 34 }; 35 }
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , fetchpatch 5 + , pkg-config 6 + , cmake 7 + , gtest 8 + }: 9 10 stdenv.mkDerivation rec { 11 pname = "rapidjson"; ··· 23 url = "https://src.fedoraproject.org/rpms/rapidjson/raw/48402da9f19d060ffcd40bf2b2e6987212c58b0c/f/rapidjson-1.1.0-c++20.patch"; 24 sha256 = "1qm62iad1xfsixv1li7qy475xc7gc04hmi2q21qdk6l69gk7mf82"; 25 }) 26 + (fetchpatch { 27 + url = "https://git.alpinelinux.org/aports/plain/community/rapidjson/do-not-include-gtest-src-dir.patch"; 28 + hash = "sha256-BjSZEwfCXA/9V+kxQ/2JPWbc26jQn35CfN8+8NW24s4="; 29 + }) 30 ]; 31 32 + postPatch = '' 33 + find -name CMakeLists.txt | xargs \ 34 + sed -i -e "s/-Werror//g" -e "s/-march=native//g" 35 + ''; 36 + 37 nativeBuildInputs = [ pkg-config cmake ]; 38 39 + cmakeFlags = [ 40 + "-DGTEST_SOURCE_DIR=${gtest.dev}/include" 41 + ]; 42 + 43 + checkInputs = [ 44 + gtest 45 + ]; 46 + 47 + checkPhase = '' 48 + runHook preCheck 49 + 50 + ctest -E '.*valgrind.*' 51 + 52 + runHook postCheck 53 ''; 54 + 55 + doCheck = true; 56 57 meta = with lib; { 58 description = "Fast JSON parser/generator for C++ with both SAX/DOM style API"; 59 homepage = "http://rapidjson.org/"; 60 license = licenses.mit; 61 platforms = platforms.unix; 62 + maintainers = with maintainers; [ cstrahan dotlambda ]; 63 }; 64 }
+34 -13
pkgs/development/python-modules/python-rapidjson/default.nix
··· 1 { lib 2 , buildPythonPackage 3 , fetchPypi 4 , pythonOlder 5 - , pytest 6 , pytz 7 , glibcLocales 8 }: 9 10 - buildPythonPackage rec { 11 version = "1.6"; 12 pname = "python-rapidjson"; 13 - disabled = pythonOlder "3.4"; 14 15 src = fetchPypi { 16 inherit pname version; 17 sha256 = "sha256-GJzxqWv5/NhtADYPFa12qDzgiJuK6NHLD9srKZXlocg="; 18 }; 19 20 - LC_ALL="en_US.utf-8"; 21 - buildInputs = [ glibcLocales ]; 22 23 - # buildInputs = [ ]; 24 - checkInputs = [ pytest pytz ]; 25 - # propagatedBuildInputs = [ ]; 26 27 - checkPhase = '' 28 - pytest tests 29 - ''; 30 31 meta = with lib; { 32 homepage = "https://github.com/python-rapidjson/python-rapidjson"; 33 - description = "Python wrapper around rapidjson "; 34 license = licenses.mit; 35 - maintainers = [ maintainers.costrouc ]; 36 }; 37 }
··· 1 { lib 2 , buildPythonPackage 3 + , fetchFromGitHub 4 + , fetchpatch 5 , fetchPypi 6 , pythonOlder 7 + , rapidjson 8 + , pytestCheckHook 9 , pytz 10 , glibcLocales 11 }: 12 13 + let 14 + rapidjson' = rapidjson.overrideAttrs (old: { 15 + version = "unstable-2022-05-24"; 16 + src = fetchFromGitHub { 17 + owner = "Tencent"; 18 + repo = "rapidjson"; 19 + rev = "232389d4f1012dddec4ef84861face2d2ba85709"; 20 + hash = "sha256-RLvDcInUa8E8DRA4U/oXEE8+TZ0SDXXDU/oWvpfDWjw="; 21 + }; 22 + patches = [ 23 + (fetchpatch { 24 + url = "https://git.alpinelinux.org/aports/plain/community/rapidjson/do-not-include-gtest-src-dir.patch"; 25 + hash = "sha256-BjSZEwfCXA/9V+kxQ/2JPWbc26jQn35CfN8+8NW24s4="; 26 + }) 27 + ]; 28 + }); 29 + in buildPythonPackage rec { 30 version = "1.6"; 31 pname = "python-rapidjson"; 32 + disabled = pythonOlder "3.7"; 33 34 src = fetchPypi { 35 inherit pname version; 36 sha256 = "sha256-GJzxqWv5/NhtADYPFa12qDzgiJuK6NHLD9srKZXlocg="; 37 }; 38 39 + setupPyBuildFlags = [ 40 + "--rj-include-dir=${lib.getDev rapidjson'}/include" 41 + ]; 42 43 + checkInputs = [ 44 + pytestCheckHook 45 + pytz 46 + ]; 47 48 + disabledTestPaths = [ 49 + "benchmarks" 50 + ]; 51 52 meta = with lib; { 53 homepage = "https://github.com/python-rapidjson/python-rapidjson"; 54 + description = "Python wrapper around rapidjson"; 55 license = licenses.mit; 56 + maintainers = with maintainers; [ costrouc dotlambda ]; 57 }; 58 }