about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/protobufc
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/protobufc')
-rw-r--r--nixpkgs/pkgs/development/libraries/protobufc/1.3.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/protobufc/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/protobufc/generic.nix21
3 files changed, 44 insertions, 32 deletions
diff --git a/nixpkgs/pkgs/development/libraries/protobufc/1.3.nix b/nixpkgs/pkgs/development/libraries/protobufc/1.3.nix
deleted file mode 100644
index 82126727282c..000000000000
--- a/nixpkgs/pkgs/development/libraries/protobufc/1.3.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ callPackage, fetchFromGitHub, ... } @ args:
-
-callPackage ./generic.nix (args // rec {
-  version = "1.3.3";
-  src = fetchFromGitHub {
-    owner = "protobuf-c";
-    repo = "protobuf-c";
-    rev = "v${version}";
-    sha256 = "13948amsjj9xpa4yl6amlyk3ksr96bbd4ngshh2yzflwcslhg6gv";
-  };
-})
diff --git a/nixpkgs/pkgs/development/libraries/protobufc/default.nix b/nixpkgs/pkgs/development/libraries/protobufc/default.nix
new file mode 100644
index 000000000000..dc3b2c92f191
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobufc/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, autoreconfHook
+, pkg-config
+, protobuf
+, zlib
+, buildPackages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "protobuf-c";
+  version = "1.4.1";
+
+  src = fetchFromGitHub {
+    owner = "protobuf-c";
+    repo = "protobuf-c";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-TJCLzxozuZ8ynrBQ2lKyk03N+QA/lbOwywUjDUdTlbM=";
+  };
+
+  patches = [
+    # https://github.com/protobuf-c/protobuf-c/pull/534
+    (fetchpatch {
+      url = "https://github.com/protobuf-c/protobuf-c/commit/a6c9ea5207aeac61c57b446ddf5a6b68308881d8.patch";
+      hash = "sha256-wTb8+YbvrCrOVpgthI5SJdG/CpQcOzCX4Bv47FPY804=";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ protobuf zlib ];
+
+  PROTOC = lib.getExe buildPackages.protobuf;
+
+  meta = with lib; {
+    homepage = "https://github.com/protobuf-c/protobuf-c/";
+    description = "C bindings for Google's Protocol Buffers";
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ nickcao ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobufc/generic.nix b/nixpkgs/pkgs/development/libraries/protobufc/generic.nix
deleted file mode 100644
index b64d75076baf..000000000000
--- a/nixpkgs/pkgs/development/libraries/protobufc/generic.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ lib, stdenv, src, version
-, autoreconfHook, pkg-config, protobuf, zlib
-, ...
-}:
-
-stdenv.mkDerivation {
-  pname = "protobuf-c";
-  inherit version;
-
-  inherit src;
-
-  nativeBuildInputs = [ autoreconfHook pkg-config ];
-  buildInputs = [ protobuf zlib ];
-
-  meta = with lib; {
-    homepage = "https://github.com/protobuf-c/protobuf-c/";
-    description = "C bindings for Google's Protocol Buffers";
-    license = licenses.bsd2;
-    platforms = platforms.all;
-  };
-}