Skip to content

Instantly share code, notes, and snippets.

@teburd
Last active October 29, 2020 21:21
Show Gist options
  • Save teburd/35f6e8aa490836140c35c2027a99b441 to your computer and use it in GitHub Desktop.
Save teburd/35f6e8aa490836140c35c2027a99b441 to your computer and use it in GitHub Desktop.
[nix-shell:~/oes/openfmb.adapters/nix]$ env | grep CMAKE_
CMAKE_INCLUDE_PATH=/nix/store/p4651hzjlvghlwym1fq931cz26qdp2ir-openssl-1.1.1g-dev/include:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1/include:/nix/store/p4651hzjlvghlwym1fq931cz26qdp2ir-openssl-1.1.1g-dev/include:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1/include
CMAKE_PREFIX_PATH=/nix/store/r9djcvv9hh6cma006jxlcz3xljz7zck0-cmake-3.18.2:/nix/store/vxfscsxa34n8wrvhkpdm1027rd5n92jf-pkg-config-wrapper-0.29.2:/nix/store/qza56yd923g39sbnn6gn5xh3awrz4lfl-patchelf-0.12:/nix/store/8madhhcxhxlf0rrc5hdsk65l206r3cc6-gcc-wrapper-9.3.0:/nix/store/h770niqkf08ksgm0n6a271kc21w95b13-binutils-wrapper-2.31.1:/nix/store/p4651hzjlvghlwym1fq931cz26qdp2ir-openssl-1.1.1g-dev:/nix/store/wp81dnxgrpi4lgy20r82kfg9nwrmypkm-openssl-1.1.1g-bin:/nix/store/7figba9q8yrgz4gj9yhqgjri97h9snsb-openssl-1.1.1g:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1:/nix/store/r9djcvv9hh6cma006jxlcz3xljz7zck0-cmake-3.18.2:/nix/store/vxfscsxa34n8wrvhkpdm1027rd5n92jf-pkg-config-wrapper-0.29.2:/nix/store/qza56yd923g39sbnn6gn5xh3awrz4lfl-patchelf-0.12:/nix/store/8madhhcxhxlf0rrc5hdsk65l206r3cc6-gcc-wrapper-9.3.0:/nix/store/h770niqkf08ksgm0n6a271kc21w95b13-binutils-wrapper-2.31.1:/nix/store/p4651hzjlvghlwym1fq931cz26qdp2ir-openssl-1.1.1g-dev:/nix/store/wp81dnxgrpi4lgy20r82kfg9nwrmypkm-openssl-1.1.1g-bin:/nix/store/7figba9q8yrgz4gj9yhqgjri97h9snsb-openssl-1.1.1g:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1
CMAKE_LIBRARY_PATH=/nix/store/7figba9q8yrgz4gj9yhqgjri97h9snsb-openssl-1.1.1g/lib:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1/lib:/nix/store/7figba9q8yrgz4gj9yhqgjri97h9snsb-openssl-1.1.1g/lib:/nix/store/wh5j5mw05klr3jp9vvdcr7p1rmw9jz5m-paho-mqtt-c-1.3.1/lib
[nix-shell:~/oes/openfmb.adapters/nix]$ unpackPhase
unpacking source archive /nix/store/4yf3jik1h5nvb5zm55gwfvc50cqsmgzv-v1.1.tar.gz
unpacker appears to have produced no directories
exit
nix-build packages.nix -A paho-mqtt-cpp  ✔  10207  15:11:26
these derivations will be built:
/nix/store/0vyilqkmjjrs7h4xahc5j91lrkhr07yj-paho-mqtt-cpp-1.1.drv
building '/nix/store/0vyilqkmjjrs7h4xahc5j91lrkhr07yj-paho-mqtt-cpp-1.1.drv'...
unpacking sources
unpacking source archive /nix/store/4yf3jik1h5nvb5zm55gwfvc50cqsmgzv-v1.1.tar.gz
source root is paho.mqtt.cpp-1.1
setting SOURCE_DATE_EPOCH to timestamp 1570913123 of file paho.mqtt.cpp-1.1/travis_install.sh
patching sources
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/share/doc/paho-mqtt-cpp -DCMAKE_INSTALL_INFODIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/hiwz81i1g3fn3p0acjs042a4h5fri6dh-binutils-2.31.1/bin/strip -DCMAKE_RANLIB=/nix/store/hiwz81i1g3fn3p0acjs042a4h5fri6dh-binutils-2.31.1/bin/ranlib -DCMAKE_AR=/nix/store/hiwz81i1g3fn3p0acjs042a4h5fri6dh-binutils-2.31.1/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/rajkh2c2n56y6k5ikkyg6bwliixl2rf5-paho-mqtt-cpp-1.1
-- The CXX compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/8madhhcxhxlf0rrc5hdsk65l206r3cc6-gcc-wrapper-9.3.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: /nix/store/7figba9q8yrgz4gj9yhqgjri97h9snsb-openssl-1.1.1g/lib/libcrypto.so (found version "1.1.1g")
CMake Error at /nix/store/r9djcvv9hh6cma006jxlcz3xljz7zck0-cmake-3.18.2/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find PahoMqttC (missing: PAHO_MQTT_C_LIBRARIES)
Call Stack (most recent call first):
/nix/store/r9djcvv9hh6cma006jxlcz3xljz7zck0-cmake-3.18.2/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
cmake/FindPahoMqttC.cmake:30 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/CMakeLists.txt:26 (find_package)
-- Configuring incomplete, errors occurred!
See also "/build/paho.mqtt.cpp-1.1/build/CMakeFiles/CMakeOutput.log".
builder for '/nix/store/0vyilqkmjjrs7h4xahc5j91lrkhr07yj-paho-mqtt-cpp-1.1.drv' failed with exit code 1
error: build of '/nix/store/0vyilqkmjjrs7h4xahc5j91lrkhr07yj-paho-mqtt-cpp-1.1.drv' failed
{ system ? builtins.currentSystem }:
let
pkgs = import <nixpkgs> { inherit system; };
in
rec {
paho-mqtt-c = import ./paho-mqtt-c.nix {
inherit (pkgs) stdenv lib fetchurl cmake openssl pkg-config;
};
paho-mqtt-cpp = import ./paho-mqtt-cpp.nix {
inherit paho-mqtt-c;
inherit (pkgs) stdenv lib fetchurl cmake openssl pkg-config;
};
}
{ stdenv, lib, fetchurl, cmake, openssl, pkg-config, ... }:
stdenv.mkDerivation rec {
pname = "paho-mqtt-c";
version = "1.3.1";
src = fetchurl {
url = "https://github.com/eclipse/paho.mqtt.c/archive/v${version}.tar.gz";
sha256 = "0pm599w3dn9700v1gg97157gmaqnigr0v70k54v63wrxmrkfskkv";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [
openssl
];
}
{ stdenv, lib, fetchurl, cmake, openssl, pkg-config, paho-mqtt-c,... }:
stdenv.mkDerivation rec {
pname = "paho-mqtt-cpp";
version = "1.1";
src = fetchurl {
url = "https://github.com/eclipse/paho.mqtt.cpp/archive/v${version}.tar.gz";
sha256 = "1ghbnx60345hdf45fpim7l6p6nj3346qdbkn1qfza7nrkqs460yb";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ openssl paho-mqtt-c ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment