lol

paho-mqtt-cpp: pass static/shared build to cmake

Allows to build paho-mqtt-cpp with pkgsStatic,
which results in the following build failure without this change:
```console
$ nix build ".#paho-mqtt-cpp"
error: builder for '/nix/store/hppw8cjha4qkvxl3670886rm4i2q0mi0-paho.mqtt.cpp-static-x86_64-unknown-linux-musl-1.3.2.drv' failed with exit code 2;
last 10 log lines:
> [ 87%] Building CXX object src/CMakeFiles/paho-cpp-objs.dir/topic.cpp.o
> [ 93%] Building CXX object src/CMakeFiles/paho-cpp-objs.dir/will_options.cpp.o
> [ 93%] Built target paho-cpp-objs
> [100%] Linking CXX shared library libpaho-mqttpp3.so
> /nix/store/zq91mr9h32cippzbnn321vrmbqkh4mi5-x86_64-unknown-linux-musl-binutils-2.40/bin/x86_64-unknown-linux-musl-ld: /nix/store/xqh4v9h8zlizphynp8d0mik2j2rzd94s-x86_64-unknown-linux-musl-gcc-13.2.0/lib/gcc/x86_64-unknown-linux-musl/13.2.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
> /nix/store/zq91mr9h32cippzbnn321vrmbqkh4mi5-x86_64-unknown-linux-musl-binutils-2.40/bin/x86_64-unknown-linux-musl-ld: failed to set dynamic section sizes: bad value
> collect2: error: ld returned 1 exit status
> make[2]: *** [src/CMakeFiles/paho-mqttpp3.dir/build.make:114: src/libpaho-mqttpp3.so.1.3.2] Error 1
> make[1]: *** [CMakeFiles/Makefile2:161: src/CMakeFiles/paho-mqttpp3.dir/all] Error 2
> make: *** [Makefile:156: all] Error 2
For full logs, run 'nix log /nix/store/hppw8cjha4qkvxl3670886rm4i2q0mi0-paho.mqtt.cpp-static-x86_64-unknown-linux-musl-1.3.2.drv'.
```

Co-authored-by: Nikolay Korotkiy <sikmir@disroot.org>

+7 -1
+7 -1
pkgs/development/libraries/paho-mqtt-cpp/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, cmake, openssl, paho-mqtt-c }: 1 + { lib, stdenv, fetchFromGitHub, cmake, openssl, paho-mqtt-c, enableStatic ? stdenv.hostPlatform.isStatic, enableShared ? !stdenv.hostPlatform.isStatic }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "paho.mqtt.cpp"; ··· 14 14 nativeBuildInputs = [ cmake ]; 15 15 16 16 buildInputs = [ openssl paho-mqtt-c ]; 17 + 18 + cmakeFlags = [ 19 + (lib.cmakeBool "PAHO_WITH_SSL" true) 20 + (lib.cmakeBool "PAHO_BUILD_STATIC" enableStatic) 21 + (lib.cmakeBool "PAHO_BUILD_SHARED" enableShared) 22 + ]; 17 23 18 24 meta = with lib; { 19 25 description = "Eclipse Paho MQTT C++ Client Library";