about summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorWael Nasreddine <wael.nasreddine@gmail.com>2024-06-27 11:51:00 -0700
committerGitHub <noreply@github.com>2024-06-27 11:51:00 -0700
commitc61a59aa2b4276e9501a9fdf6438e334b9535723 (patch)
tree4bc16f9653385d5a47ca5f16e14f2ee9afb0beba /pkgs/development/libraries
parent816c5c955e3447f187974064638e357d34fb9369 (diff)
parente36b4564d2860f2d61fbf7631c77ebc324a437e9 (diff)
Merge pull request #288422 from liarokapisv/nanopb_update_and_cross_support
nanopb: 0.4.6 -> 0.4.8, cross-compilation support
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/nanopb/default.nix76
-rw-r--r--pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix30
-rw-r--r--pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto7
-rw-r--r--pkgs/development/libraries/nanopb/test-message-with-options/default.nix33
-rw-r--r--pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options1
-rw-r--r--pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto5
-rw-r--r--pkgs/development/libraries/nanopb/test-simple-proto2/default.nix27
-rw-r--r--pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto5
-rw-r--r--pkgs/development/libraries/nanopb/test-simple-proto3/default.nix26
-rw-r--r--pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto5
10 files changed, 0 insertions, 215 deletions
diff --git a/pkgs/development/libraries/nanopb/default.nix b/pkgs/development/libraries/nanopb/default.nix
deleted file mode 100644
index 5353bac3e1a30..0000000000000
--- a/pkgs/development/libraries/nanopb/default.nix
+++ /dev/null
@@ -1,76 +0,0 @@
-{ callPackage
-, cmake
-, fetchFromGitHub
-, lib
-, protobuf
-, python3
-, stdenv
-, buildPackages
-, mallocBuild ? false
-}:
-
-stdenv.mkDerivation rec {
-  pname = "nanopb";
-  version = "0.4.6";
-
-  src = fetchFromGitHub {
-    owner = pname;
-    repo = pname;
-    rev = version;
-    sha256 = "sha256-B9J+GkgOBR4iZaP6/2ykcjbkifoyhkuukkjK/CLBZj0=";
-  };
-
-  nativeBuildInputs = [ cmake python3 python3.pkgs.wrapPython ];
-
-  pythonPath = with python3.pkgs; [ python3.pkgs.protobuf six ];
-
-  cmakeFlags = [
-    "-DBUILD_SHARED_LIBS=ON" # generate $out/lib/libprotobuf-nanopb.so{.0,}
-    "-DBUILD_STATIC_LIBS=ON" # generate $out/lib/libprotobuf-nanopb.a
-    "-Dnanopb_PROTOC_PATH=${buildPackages.protobuf}/bin/protoc"
-  ] ++ lib.optional mallocBuild "-DCMAKE_C_FLAGS=-DPB_ENABLE_MALLOC 1";
-
-  postInstall = ''
-    mkdir -p $out/share/nanopb/generator/proto
-    cp ../generator/proto/nanopb.proto $out/share/nanopb/generator/proto/nanopb.proto
-    cp ../pb_common.c ../pb_decode.c ../pb_encode.c $out/include/
-  '';
-
-  postFixup = ''
-    wrapPythonPrograms
-  '';
-
-  passthru.tests = {
-    simple-proto2 = callPackage ./test-simple-proto2 {};
-    simple-proto3 = callPackage ./test-simple-proto3 {};
-    message-with-annotations = callPackage ./test-message-with-annotations {};
-    message-with-options = callPackage ./test-message-with-options {};
-  };
-
-  meta = with lib; {
-    inherit (protobuf.meta) platforms;
-
-    description = "Protocol Buffers with small code size";
-    homepage = "https://jpa.kapsi.fi/nanopb/";
-    license = licenses.zlib;
-    maintainers = with maintainers; [ kalbasit ];
-
-    longDescription = ''
-      Nanopb is a small code-size Protocol Buffers implementation in ansi C. It
-      is especially suitable for use in microcontrollers, but fits any memory
-      restricted system.
-
-      - Homepage: jpa.kapsi.fi/nanopb
-      - Documentation: jpa.kapsi.fi/nanopb/docs
-      - Downloads: jpa.kapsi.fi/nanopb/download
-      - Forum: groups.google.com/forum/#!forum/nanopb
-
-      In order to use the nanopb options in your proto files, you'll need to
-      tell protoc where to find the nanopb.proto file.
-      You can do so with the --proto_path (-I) option to add the directory
-      ''${nanopb}/share/nanopb/generator/proto like so:
-
-      protoc --proto_path=. --proto_path=''${nanopb}/share/nanopb/generator/proto --plugin=protoc-gen-nanopb=''${nanopb}/bin/protoc-gen-nanopb --nanopb_out=out file.proto
-    '';
-  };
-}
diff --git a/pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix b/pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix
deleted file mode 100644
index c2ffe6135fbb5..0000000000000
--- a/pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ lib, stdenv, protobuf, nanopb }:
-
-stdenv.mkDerivation {
-  name = "nanopb-test-message-with-annotations";
-  meta.timeout = 60;
-  src = lib.fileset.toSource {
-    root = ./.;
-    fileset = lib.fileset.unions [ ./withannotations.proto ];
-  };
-
-  # protoc requires any .proto file to be compiled to reside within it's
-  # proto_path. By default the current directory is automatically added to the
-  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
-  # not work because they end up in the store at different locations.
-  dontInstall = true;
-  buildPhase = ''
-    mkdir $out
-
-    ${protobuf}/bin/protoc --proto_path=. --proto_path=${nanopb}/share/nanopb/generator/proto --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out withannotations.proto
-  '';
-
-  doCheck = true;
-  checkPhase = ''
-    grep -q WithAnnotations $out/withannotations.pb.c || (echo "error: WithAnnotations not found in $out/withannotations.pb.c"; exit 1)
-    grep -q WithAnnotations $out/withannotations.pb.h || (echo "error: WithAnnotations not found in $out/withannotations.pb.h"; exit 1)
-    grep -q "pb_byte_t uuid\[16\]" $out/withannotations.pb.h || (echo "error: uuid is not of type pb_byte_t and of size 16 in $out/withannotations.pb.h"; exit 1)
-    grep -q "FIXED_LENGTH_BYTES, uuid" $out/withannotations.pb.h || (echo "error: uuid is not of fixed lenght bytes in $out/withannotations.pb.h"; exit 1)
-    grep -q "#define WithAnnotations_size" $out/withannotations.pb.h || (echo "error: the size of WithAnnotations is not known in $out/withannotations.pb.h"; exit 1)
-  '';
-}
diff --git a/pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto b/pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto
deleted file mode 100644
index d8109e877d68b..0000000000000
--- a/pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto
+++ /dev/null
@@ -1,7 +0,0 @@
-syntax = "proto3";
-
-import "nanopb.proto";
-
-message WithAnnotations {
-  bytes uuid = 1 [(nanopb).max_size = 16, (nanopb).fixed_length = true];
-}
diff --git a/pkgs/development/libraries/nanopb/test-message-with-options/default.nix b/pkgs/development/libraries/nanopb/test-message-with-options/default.nix
deleted file mode 100644
index f6bf28f3b6457..0000000000000
--- a/pkgs/development/libraries/nanopb/test-message-with-options/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ lib, stdenv, protobuf, nanopb }:
-
-stdenv.mkDerivation {
-  name = "nanopb-test-message-with-options";
-  meta.timeout = 60;
-  src = lib.fileset.toSource {
-    root = ./.;
-    fileset = lib.fileset.unions [
-      ./withoptions.proto
-      ./withoptions.options
-    ];
-  };
-
-  # protoc requires any .proto file to be compiled to reside within it's
-  # proto_path. By default the current directory is automatically added to the
-  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
-  # not work because they end up in the store at different locations.
-  dontInstall = true;
-  buildPhase = ''
-    mkdir $out
-
-    ${protobuf}/bin/protoc --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out withoptions.proto
-  '';
-
-  doCheck = true;
-  checkPhase = ''
-    grep -q WithOptions $out/withoptions.pb.c || (echo "error: WithOptions not found in $out/withoptions.pb.c"; exit 1)
-    grep -q WithOptions $out/withoptions.pb.h || (echo "error: WithOptions not found in $out/withoptions.pb.h"; exit 1)
-    grep -q "pb_byte_t uuid\[16\]" $out/withoptions.pb.h || (echo "error: uuid is not of type pb_byte_t and of size 16 in $out/withoptions.pb.h"; exit 1)
-    grep -q "FIXED_LENGTH_BYTES, uuid" $out/withoptions.pb.h || (echo "error: uuid is not of fixed lenght bytes in $out/withoptions.pb.h"; exit 1)
-    grep -q "#define WithOptions_size" $out/withoptions.pb.h || (echo "error: the size of WithOptions is not known in $out/withoptions.pb.h"; exit 1)
-  '';
-}
diff --git a/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options b/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options
deleted file mode 100644
index ecf98a2173678..0000000000000
--- a/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options
+++ /dev/null
@@ -1 +0,0 @@
- WithOptions.uuid max_size:16 fixed_length:true
diff --git a/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto b/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto
deleted file mode 100644
index 5a5da3a1c9732..0000000000000
--- a/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto
+++ /dev/null
@@ -1,5 +0,0 @@
-syntax = "proto3";
-
-message WithOptions {
-  bytes uuid = 1;
-}
diff --git a/pkgs/development/libraries/nanopb/test-simple-proto2/default.nix b/pkgs/development/libraries/nanopb/test-simple-proto2/default.nix
deleted file mode 100644
index f8cd35cbf3979..0000000000000
--- a/pkgs/development/libraries/nanopb/test-simple-proto2/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ lib, stdenv, protobuf, nanopb }:
-
-stdenv.mkDerivation {
-  name = "nanopb-test-simple-proto2";
-  meta.timeout = 60;
-  src = lib.fileset.toSource {
-    root = ./.;
-    fileset = lib.fileset.unions [ ./simple.proto ];
-  };
-
-  # protoc requires any .proto file to be compiled to reside within it's
-  # proto_path. By default the current directory is automatically added to the
-  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
-  # not work because they end up in the store at different locations.
-  dontInstall = true;
-  buildPhase = ''
-    mkdir $out
-
-    ${protobuf}/bin/protoc --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out simple.proto
-  '';
-
-  doCheck = true;
-  checkPhase = ''
-    grep -q SimpleMessage $out/simple.pb.c || (echo "ERROR: SimpleMessage not found in $out/simple.pb.c"; exit 1)
-    grep -q SimpleMessage $out/simple.pb.h || (echo "ERROR: SimpleMessage not found in $out/simple.pb.h"; exit 1)
-  '';
-}
diff --git a/pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto b/pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto
deleted file mode 100644
index b02936b1ae267..0000000000000
--- a/pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto
+++ /dev/null
@@ -1,5 +0,0 @@
-syntax = "proto2";
-
-message SimpleMessage {
-  required int32 lucky_number = 1;
-}
diff --git a/pkgs/development/libraries/nanopb/test-simple-proto3/default.nix b/pkgs/development/libraries/nanopb/test-simple-proto3/default.nix
deleted file mode 100644
index d92698d21ece5..0000000000000
--- a/pkgs/development/libraries/nanopb/test-simple-proto3/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ lib, stdenv, protobuf, nanopb }:
-
-stdenv.mkDerivation {
-  name = "nanopb-test-simple-proto3";
-  meta.timeout = 60;
-  src = lib.fileset.toSource {
-    root = ./.;
-    fileset = lib.fileset.unions [ ./simple.proto ];
-  };
-  # protoc requires any .proto file to be compiled to reside within it's
-  # proto_path. By default the current directory is automatically added to the
-  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
-  # not work because they end up in the store at different locations.
-  dontInstall = true;
-  buildPhase = ''
-    mkdir $out
-
-    ${protobuf}/bin/protoc --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out simple.proto
-  '';
-
-  doCheck = true;
-  checkPhase = ''
-    grep -q SimpleMessage $out/simple.pb.c || (echo "ERROR: SimpleMessage not found in $out/simple.pb.c"; exit 1)
-    grep -q SimpleMessage $out/simple.pb.h || (echo "ERROR: SimpleMessage not found in $out/simple.pb.h"; exit 1)
-  '';
-}
diff --git a/pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto b/pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto
deleted file mode 100644
index 6b99cdb5daa7c..0000000000000
--- a/pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto
+++ /dev/null
@@ -1,5 +0,0 @@
-syntax = "proto3";
-
-message SimpleMessage {
-  int32 lucky_number = 1;
-}