nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "simdjson";
10 version = "4.2.4";
11
12 src = fetchFromGitHub {
13 owner = "simdjson";
14 repo = "simdjson";
15 tag = "v${finalAttrs.version}";
16 hash = "sha256-TTZcdnD7XT5n39n7rSlA81P3pid+5ek0noxjXAGbb64=";
17 };
18
19 nativeBuildInputs = [ cmake ];
20
21 cmakeFlags = [
22 (lib.cmakeBool "SIMDJSON_DEVELOPER_MODE" false)
23 (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
24 ]
25 ++ lib.optionals (with stdenv.hostPlatform; isPower && isBigEndian) [
26 # Assume required CPU features are available, since otherwise we
27 # just get a failed build.
28 (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-mpower8-vector")
29 ];
30
31 meta = {
32 homepage = "https://simdjson.org/";
33 description = "Parsing gigabytes of JSON per second";
34 license = lib.licenses.asl20;
35 platforms = lib.platforms.all;
36 maintainers = with lib.maintainers; [ chessai ];
37 };
38})