summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorAaron Jheng <wentworth@outlook.com>2023-10-06 03:27:27 +0000
committerAaron Jheng <wentworth@outlook.com>2023-10-11 13:20:31 +0000
commit80aaa46d4c7d6f121a4fb9879a8e41c536186c8a (patch)
treed306932e174e3461214b93d76315afb913d1c62a /pkgs/development
parentee14e5df159199e807a5a3ddaebff0366b5aae84 (diff)
downloadnixpkgs-80aaa46d4c7d6f121a4fb9879a8e41c536186c8a.tar
nixpkgs-80aaa46d4c7d6f121a4fb9879a8e41c536186c8a.tar.gz
nixpkgs-80aaa46d4c7d6f121a4fb9879a8e41c536186c8a.tar.bz2
nixpkgs-80aaa46d4c7d6f121a4fb9879a8e41c536186c8a.tar.lz
nixpkgs-80aaa46d4c7d6f121a4fb9879a8e41c536186c8a.tar.xz
nixpkgs-80aaa46d4c7d6f121a4fb9879a8e41c536186c8a.tar.zst
nixpkgs-80aaa46d4c7d6f121a4fb9879a8e41c536186c8a.zip
protobuf: use new package definition only
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/onnxruntime/default.nix6
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix4
-rw-r--r--pkgs/development/libraries/opencv/4.x.nix6
-rw-r--r--pkgs/development/libraries/protobuf/3.21.nix6
-rw-r--r--pkgs/development/libraries/protobuf/3.23.nix6
-rw-r--r--pkgs/development/libraries/protobuf/3.24.nix6
-rw-r--r--pkgs/development/libraries/protobuf/generic-v3-cmake.nix116
-rw-r--r--pkgs/development/libraries/protobuf/generic.nix4
8 files changed, 10 insertions, 144 deletions
diff --git a/pkgs/development/libraries/onnxruntime/default.nix b/pkgs/development/libraries/onnxruntime/default.nix
index 4a9ee61f561..5252875b27e 100644
--- a/pkgs/development/libraries/onnxruntime/default.nix
+++ b/pkgs/development/libraries/onnxruntime/default.nix
@@ -17,7 +17,7 @@
 , microsoft-gsl
 , iconv
 , gtest
-, protobuf3_21
+, protobuf_21
 , pythonSupport ? true
 }:
 
@@ -92,7 +92,7 @@ stdenv.mkDerivation rec {
     cmake
     pkg-config
     python3Packages.python
-    protobuf3_21
+    protobuf_21
   ] ++ lib.optionals pythonSupport (with python3Packages; [
     setuptools
     wheel
@@ -177,7 +177,7 @@ stdenv.mkDerivation rec {
   '';
 
   passthru = {
-    protobuf = protobuf3_21;
+    protobuf = protobuf_21;
     tests = lib.optionalAttrs pythonSupport {
       python = python3Packages.onnxruntime;
     };
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index 037192d871e..7e928a98c53 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -2,7 +2,7 @@
 , fetchFromGitHub
 , fetchpatch
 , cmake, pkg-config, unzip, zlib, pcre, hdf5
-, glog, boost, gflags, protobuf3_21
+, glog, boost, gflags, protobuf_21
 , config
 
 , enableJPEG      ? true, libjpeg
@@ -186,7 +186,7 @@ stdenv.mkDerivation {
 
   buildInputs =
        [ zlib pcre hdf5 glog boost gflags ]
-    ++ lib.optional useSystemProtobuf protobuf3_21
+    ++ lib.optional useSystemProtobuf protobuf_21
     ++ lib.optional enablePython pythonPackages.python
     ++ lib.optional enableGtk2 gtk2
     ++ lib.optional enableGtk3 gtk3
diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix
index 68099a57c63..6268a2c02e5 100644
--- a/pkgs/development/libraries/opencv/4.x.nix
+++ b/pkgs/development/libraries/opencv/4.x.nix
@@ -11,7 +11,7 @@
 , hdf5
 , boost
 , gflags
-, protobuf3_21
+, protobuf_21
 , config
 , ocl-icd
 , buildPackages
@@ -317,7 +317,7 @@ stdenv.mkDerivation {
     echo '"(build info elided)"' > modules/core/version_string.inc
   '';
 
-  buildInputs = [ zlib pcre boost gflags protobuf3_21 ]
+  buildInputs = [ zlib pcre boost gflags protobuf_21 ]
     ++ lib.optional enablePython pythonPackages.python
     ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) hdf5
     ++ lib.optional enableGtk2 gtk2
@@ -369,7 +369,7 @@ stdenv.mkDerivation {
     "-DOPENCV_GENERATE_PKGCONFIG=ON"
     "-DWITH_OPENMP=ON"
     "-DBUILD_PROTOBUF=OFF"
-    "-DProtobuf_PROTOC_EXECUTABLE=${lib.getExe buildPackages.protobuf3_21}"
+    "-DProtobuf_PROTOC_EXECUTABLE=${lib.getExe buildPackages.protobuf_21}"
     "-DPROTOBUF_UPDATE_FILES=ON"
     "-DOPENCV_ENABLE_NONFREE=${printEnabled enableUnfree}"
     "-DBUILD_TESTS=${printEnabled runAccuracyTests}"
diff --git a/pkgs/development/libraries/protobuf/3.21.nix b/pkgs/development/libraries/protobuf/3.21.nix
deleted file mode 100644
index fe85be8cf02..00000000000
--- a/pkgs/development/libraries/protobuf/3.21.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ callPackage, ... } @ args:
-
-callPackage ./generic-v3-cmake.nix ({
-  version = "3.21.12";
-  sha256 = "sha256-VZQEFHq17UsTH5CZZOcJBKiScGV2xPJ/e6gkkVliRCU=";
-} // args)
diff --git a/pkgs/development/libraries/protobuf/3.23.nix b/pkgs/development/libraries/protobuf/3.23.nix
deleted file mode 100644
index 2d658d57419..00000000000
--- a/pkgs/development/libraries/protobuf/3.23.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ callPackage, ... } @ args:
-
-callPackage ./generic-v3-cmake.nix ({
-  version = "3.23.4";
-  sha256 = "sha256-eI+mrsZAOLEsdyTC3B+K+GjD3r16CmPx1KJ2KhCwFdg=";
-} // args)
diff --git a/pkgs/development/libraries/protobuf/3.24.nix b/pkgs/development/libraries/protobuf/3.24.nix
deleted file mode 100644
index 60ad747194d..00000000000
--- a/pkgs/development/libraries/protobuf/3.24.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ callPackage, ... } @ args:
-
-callPackage ./generic-v3-cmake.nix ({
-  version = "3.24.3";
-  sha256 = "sha256-wXGQW/o674DeLXX2IlyZskl5OrBcSRptOMoJqLQGm94=";
-} // args)
diff --git a/pkgs/development/libraries/protobuf/generic-v3-cmake.nix b/pkgs/development/libraries/protobuf/generic-v3-cmake.nix
deleted file mode 100644
index dd31aba434c..00000000000
--- a/pkgs/development/libraries/protobuf/generic-v3-cmake.nix
+++ /dev/null
@@ -1,116 +0,0 @@
-# The cmake version of this build is meant to enable both cmake and .pc being exported
-# this is important because grpc exports a .cmake file which also expects for protobuf
-# to have been exported through cmake as well.
-{ lib
-, stdenv
-, abseil-cpp
-, buildPackages
-, cmake
-, fetchFromGitHub
-, fetchpatch
-, gtest
-, zlib
-, version
-, sha256
-
-  # downstream dependencies
-, python3
-, grpc
-, enableShared ? !stdenv.hostPlatform.isStatic
-
-, ...
-}:
-
-stdenv.mkDerivation (finalAttrs: {
-  pname = "protobuf";
-  inherit version;
-
-  src = fetchFromGitHub {
-    owner = "protocolbuffers";
-    repo = "protobuf";
-    rev = "v${version}";
-    inherit sha256;
-  };
-
-  postPatch = lib.optionalString stdenv.isDarwin ''
-    substituteInPlace src/google/protobuf/testing/googletest.cc \
-      --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
-  '';
-
-  patches = lib.optionals (lib.versionOlder version "3.22") [
-    # fix protobuf-targets.cmake installation paths, and allow for CMAKE_INSTALL_LIBDIR to be absolute
-    # https://github.com/protocolbuffers/protobuf/pull/10090
-    (fetchpatch {
-      url = "https://github.com/protocolbuffers/protobuf/commit/a7324f88e92bc16b57f3683403b6c993bf68070b.patch";
-      sha256 = "sha256-SmwaUjOjjZulg/wgNmR/F5b8rhYA2wkKAjHIOxjcQdQ=";
-    })
-  ] ++ lib.optionals stdenv.hostPlatform.isStatic [
-    ./static-executables-have-no-rpath.patch
-  ];
-
-  nativeBuildInputs =
-    let
-      protobufVersion = "${lib.versions.major version}_${lib.versions.minor version}";
-    in
-    [
-      cmake
-    ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-      # protoc of the same version must be available for build. For non-cross builds, it's able to
-      # re-use the executable generated as part of the build
-      buildPackages."protobuf${protobufVersion}"
-    ];
-
-  buildInputs = [
-    gtest
-    zlib
-  ];
-
-  propagatedBuildInputs = [
-    abseil-cpp
-  ];
-
-  strictDeps = true;
-
-  cmakeDir = if lib.versionOlder version "3.22" then "../cmake" else null;
-  cmakeFlags = [
-    "-Dprotobuf_USE_EXTERNAL_GTEST=ON"
-    "-Dprotobuf_ABSL_PROVIDER=package"
-  ] ++ lib.optionals enableShared [
-    "-Dprotobuf_BUILD_SHARED_LIBS=ON"
-  ]
-  # Tests fail to build on 32-bit platforms; fixed in 3.22
-  # https://github.com/protocolbuffers/protobuf/issues/10418
-  ++ lib.optionals (stdenv.targetPlatform.is32bit && lib.versionOlder version "3.22") [
-    "-Dprotobuf_BUILD_TESTS=OFF"
-  ];
-
-  # FIXME: investigate.  3.24 and 3.23 have different errors.
-  # At least some of it is not reproduced on some other machine; example:
-  # https://hydra.nixos.org/build/235677717/nixlog/4/tail
-  doCheck = !(stdenv.isDarwin && lib.versionAtLeast version "3.23");
-
-  passthru = {
-    tests = {
-      pythonProtobuf = python3.pkgs.protobuf.override (_: {
-        protobuf = finalAttrs.finalPackage;
-      });
-      inherit grpc;
-    };
-
-    inherit abseil-cpp;
-  };
-
-  meta = {
-    description = "Google's data interchange format";
-    longDescription = ''
-      Protocol Buffers are a way of encoding structured data in an efficient
-      yet extensible format. Google uses Protocol Buffers for almost all of
-      its internal RPC protocols and file formats.
-    '';
-    license = lib.licenses.bsd3;
-    platforms = lib.platforms.all;
-    homepage = "https://protobuf.dev/";
-    maintainers = with lib.maintainers; [ jonringer ];
-    mainProgram = "protoc";
-  };
-})
diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix
index 6d4f64fd578..adf271a6dc4 100644
--- a/pkgs/development/libraries/protobuf/generic.nix
+++ b/pkgs/development/libraries/protobuf/generic.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
     owner = "protocolbuffers";
     repo = "protobuf";
     rev = "v${version}";
-    sha256 = hash;
+    inherit hash;
   };
 
   postPatch = lib.optionalString stdenv.isDarwin ''
@@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
     # https://github.com/protocolbuffers/protobuf/pull/10090
     (fetchpatch {
       url = "https://github.com/protocolbuffers/protobuf/commit/a7324f88e92bc16b57f3683403b6c993bf68070b.patch";
-      sha256 = "sha256-SmwaUjOjjZulg/wgNmR/F5b8rhYA2wkKAjHIOxjcQdQ=";
+      hash = "sha256-SmwaUjOjjZulg/wgNmR/F5b8rhYA2wkKAjHIOxjcQdQ=";
     })
   ] ++ lib.optionals stdenv.hostPlatform.isStatic [
     ./static-executables-have-no-rpath.patch