about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/flatbuffers
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/libraries/flatbuffers
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/flatbuffers')
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/default.nix (renamed from nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix)22
3 files changed, 12 insertions, 52 deletions
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix
deleted file mode 100644
index 1ad490d3a01b..000000000000
--- a/nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ callPackage, fetchpatch, lib, stdenv }:
-
-callPackage ./generic.nix {
-  version = "1.12.0";
-  sha256 = "0f7xd66vc1lzjbn7jzd5kyqrgxpsfxi4zc7iymhb5xrwyxipjl1g";
-
-  patches = [
-    (fetchpatch {
-      # Fixed a compilation error with GCC 10.0 to 11.0. June 1, 2020.
-      # Should be included in the next release after 1.12.0
-      url = "https://github.com/google/flatbuffers/commit/988164f6e1675bbea9c852e2d6001baf4d1fcf59.patch";
-      sha256 = "0d8c2bywqmkhdi0a41cry85wy4j58pl0vd6h5xpfqm3fr8w0mi9s";
-      excludes = [ "src/idl_gen_cpp.cpp" ];
-    })
-    (fetchpatch {
-      # Fixed a compilation error with GCC 10.0 to 11.0. July 6, 2020.
-      # Should be included in the next release after 1.12.0
-      url = "https://github.com/google/flatbuffers/pull/6020/commits/44c7a4cf439b0a298720b5a448bcc243a882b0c9.patch";
-      sha256 = "126xwkvnlc4ignjhxv9jygfd9j6kr1jx39hyk0ddpcmvzfqsccf4";
-    })
-  ];
-
-  preConfigure = lib.optionalString stdenv.buildPlatform.isDarwin ''
-    rm BUILD
-  '';
-}
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix
deleted file mode 100644
index 27b661ee0900..000000000000
--- a/nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ callPackage, fetchpatch }:
-
-callPackage ./generic.nix {
-  version = "2.0.0";
-  sha256 = "1zbf6bdpps8369r1ql00irxrp58jnalycc8jcapb8iqg654vlfz8";
-
-  patches = [
-    # Pull patch pending upstream inclustion for gcc-12 support:
-    #  https://github.com/google/flatbuffers/pull/6946
-    (fetchpatch {
-      name = "gcc-12.patch";
-      url = "https://github.com/google/flatbuffers/commit/17d9f0c4cf47a9575b4f43a2ac33eb35ba7f9e3e.patch";
-      sha256 = "0sksk47hi7camja9ppnjr88jfdgj0nxqxy8976qs1nx73zkgbpf9";
-    })
-  ];
-}
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
index 1cdfb4b9c870..42e7c665f2b2 100644
--- a/nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
@@ -2,29 +2,30 @@
 , stdenv
 , fetchFromGitHub
 , cmake
-, version
-, sha256
-, patches ? [ ]
-, preConfigure ? null
+, python3
 }:
 
 stdenv.mkDerivation rec {
   pname = "flatbuffers";
-  inherit version;
+  version = "2.0.6";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "flatbuffers";
     rev = "v${version}";
-    inherit sha256;
+    sha256 = "sha256-0bJ0n/5yzj6lHXLKJzHUS0Bnlmys+X7pY/3LGapVh6k=";
   };
 
-  inherit patches preConfigure;
+  nativeBuildInputs = [ cmake python3 ];
 
-  nativeBuildInputs = [ cmake ];
+  postPatch = ''
+    # Fix default value of "test_data_path" to make tests work
+    substituteInPlace tests/test.cpp --replace '"tests/";' '"../tests/";'
+  '';
 
   cmakeFlags = [
     "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}"
+    "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
   ];
 
   doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
@@ -38,9 +39,10 @@ stdenv.mkDerivation rec {
       access serialized data without unpacking/parsing it first, while still
       having great forwards/backwards compatibility.
     '';
-    maintainers = [ maintainers.teh ];
+    homepage = "https://google.github.io/flatbuffers/";
     license = licenses.asl20;
+    maintainers = [ maintainers.teh ];
+    mainProgram = "flatc";
     platforms = platforms.unix;
-    homepage = "https://google.github.io/flatbuffers/";
   };
 }