From 6e7c87e6f3e19c9d1ad405cda8bd654172b959e2 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 27 Jul 2024 14:34:44 +0200 Subject: [PATCH] flatbuffers_23: init at 23.5.26 Required at least for onnxruntime, which asserts hard on this version. --- pkgs/development/libraries/flatbuffers/23.nix | 47 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/libraries/flatbuffers/23.nix diff --git a/pkgs/development/libraries/flatbuffers/23.nix b/pkgs/development/libraries/flatbuffers/23.nix new file mode 100644 index 000000000000..5263694b0562 --- /dev/null +++ b/pkgs/development/libraries/flatbuffers/23.nix @@ -0,0 +1,47 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + python3, +}: + +stdenv.mkDerivation rec { + pname = "flatbuffers"; + version = "23.5.26"; + + src = fetchFromGitHub { + owner = "google"; + repo = "flatbuffers"; + rev = "v${version}"; + hash = "sha256-e+dNPNbCHYDXUS/W+hMqf/37fhVgEGzId6rhP3cToTE="; + }; + + nativeBuildInputs = [ + cmake + python3 + ]; + + cmakeFlags = [ + "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" + "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF" + ]; + + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + checkTarget = "test"; + + meta = with lib; { + description = "Memory Efficient Serialization Library"; + longDescription = '' + FlatBuffers is an efficient cross platform serialization library for + games and other memory constrained apps. It allows you to directly + access serialized data without unpacking/parsing it first, while still + having great forwards/backwards compatibility. + ''; + homepage = "https://google.github.io/flatbuffers/"; + license = licenses.asl20; + maintainers = [ maintainers.teh ]; + mainProgram = "flatc"; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3462d27600c0..772530b9b5d5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23563,6 +23563,7 @@ with pkgs; protozero = callPackage ../development/libraries/protozero { }; flatbuffers = callPackage ../development/libraries/flatbuffers { }; + flatbuffers_23 = callPackage ../development/libraries/flatbuffers/23.nix { }; nanopbMalloc = callPackage ../by-name/na/nanopb/package.nix { enableMalloc = true; };