git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #149751 from CorbanR/add_user_to_maintainers

libpulsar: init at 2.9.1

commitbff70d25ffb12e24451f3015ca5aae83284b34ba author0x4A6F <0x4A6F@users.noreply.github.com> dateWed 2 Mar 2022, 17:45 (5 years ago) parent276f639d59d843
3 files changed+121
maintainers/maintainer-list.nix+17 pkgs/development/libraries/libpulsar/default.nix+102 pkgs/top-level/all-packages.nix+2
maintainers/maintainer-list.nix+17
@@ -2418,6 +2418,23 @@
24182418 githubId = 5510514;
24192419 name = "Conrad Mearns";
24202420 };
2421+ corbanr = {
2422+ email = "corban@raunco.co";
2423+ github = "CorbanR";
2424+ githubId = 1918683;
2425+ matrix = "@corbansolo:matrix.org";
2426+ name = "Corban Raun";
2427+ keys = [
2428+ {
2429+ longkeyid = "rsa4096/0xA697A56F1F151189";
2430+ fingerprint = "6607 0B24 8CE5 64ED 22CE 0950 A697 A56F 1F15 1189";
2431+ }
2432+ {
2433+ longkeyid = "ed25519/0x230F4AC153F90F29";
2434+ fingerprint = "D8CB 816A B678 A4E6 1EC7 5325 230F 4AC1 53F9 0F29";
2435+ }
2436+ ];
2437+ };
24212438 couchemar = {
24222439 email = "couchemar@yandex.ru";
24232440 github = "couchemar";
pkgs/development/libraries/libpulsar/default.nixnew file+102
@@ -0,0 +1,102 @@
1+{ lib
2+, clang-tools
3+, llvmPackages
4+, boost17x
5+, protobuf
6+, python3Support ? false
7+, python3
8+, log4cxxSupport ? false
9+, log4cxx
10+, snappySupport ? false
11+, snappy
12+, zlibSupport ? true
13+, zlib
14+, zstdSupport ? true
15+, zstd
16+, gtest
17+, gtestSupport ? false
18+, cmake
19+, curl
20+, fetchurl
21+, jsoncpp
22+, openssl
23+, pkg-config
24+, stdenv
25+}:
26+
27+let
28+ /*
29+ Check if null or false
30+ Example:
31+ let result = enableFeature null
32+ => "OFF"
33+ let result = enableFeature false
34+ => "OFF"
35+ let result = enableFeature «derivation»
36+ => "ON"
37+ */
38+ enableCmakeFeature = p: if (p == null || p == false) then "OFF" else "ON";
39+
40+ # Not really sure why I need to do this.. If I call clang-tools without the override it defaults to a different version and fails
41+ clangTools = clang-tools.override { inherit stdenv llvmPackages; };
42+ # If boost has python enabled, then boost-python package will be installed which is used by libpulsars python wrapper
43+ boost = if python3Support then boost17x.override { inherit stdenv; enablePython = python3Support; python = python3; } else boost17x;
44+ defaultOptionals = [ boost protobuf ]
45+ ++ lib.optional python3Support python3
46+ ++ lib.optional snappySupport snappy.dev
47+ ++ lib.optional zlibSupport zlib
48+ ++ lib.optional zstdSupport zstd
49+ ++ lib.optional log4cxxSupport log4cxx;
50+
51+in
52+stdenv.mkDerivation rec {
53+ pname = "libpulsar";
54+ version = "2.9.1";
55+
56+ src = fetchurl {
57+ hash = "sha512-NKHiL7D/Lmnn6ICpQyUmmQYQETz4nZPJU9/4LMRDUQ3Pck6qDh+t6CRk+b9UQ2Vb0jvPIGTjEsSp2nC7TJk3ug==";
58+ url = "mirror://apache/pulsar/pulsar-${version}/apache-pulsar-${version}-src.tar.gz";
59+ };
60+
61+ sourceRoot = "apache-pulsar-${version}-src/pulsar-client-cpp";
62+
63+ # clang-tools needed for clang-format
64+ nativeBuildInputs = [ cmake pkg-config clangTools ]
65+ ++ defaultOptionals
66+ ++ lib.optional gtestSupport gtest.dev;
67+
68+ buildInputs = [ jsoncpp openssl curl ]
69+ ++ defaultOptionals;
70+
71+ # Needed for GCC on Linux
72+ NIX_CFLAGS_COMPILE = [ "-Wno-error=return-type" ];
73+
74+ cmakeFlags = [
75+ "-DBUILD_TESTS=${enableCmakeFeature gtestSupport}"
76+ "-DBUILD_PYTHON_WRAPPER=${enableCmakeFeature python3Support}"
77+ "-DUSE_LOG4CXX=${enableCmakeFeature log4cxxSupport}"
78+ "-DClangTools_PATH=${clangTools}/bin"
79+ ];
80+
81+ enableParallelBuilding = true;
82+ doInstallCheck = true;
83+ installCheckPhase = ''
84+ echo ${lib.escapeShellArg ''
85+ #include <pulsar/Client.h>
86+ int main (int argc, char **argv) {
87+ pulsar::Client client("pulsar://localhost:6650");
88+ return 0;
89+ }
90+ ''} > test.cc
91+ $CXX test.cc -L $out/lib -I $out/include -lpulsar -o test
92+ '';
93+
94+ meta = with lib; {
95+ homepage = "https://pulsar.apache.org/docs/en/client-libraries-cpp";
96+ description = "Apache Pulsar C++ library";
97+
98+ platforms = platforms.all;
99+ license = licenses.asl20;
100+ maintainers = [ maintainers.corbanr ];
101+ };
102+}
pkgs/top-level/all-packages.nix+2
@@ -18570,6 +18570,8 @@ with pkgs;
1857018570
1857118571 libptytty = callPackage ../development/libraries/libptytty { };
1857218572
18573+ libpulsar = callPackage ../development/libraries/libpulsar { };
18574+
1857318575 libpwquality = callPackage ../development/libraries/libpwquality { };
1857418576
1857518577 libqalculate = callPackage ../development/libraries/libqalculate {