diff --git a/lib/nodes/iec60870.cpp b/lib/nodes/iec60870.cpp index 126c145d7..65be0d701 100644 --- a/lib/nodes/iec60870.cpp +++ b/lib/nodes/iec60870.cpp @@ -203,7 +203,7 @@ std::optional ASDUData::checkASDU(CS101_ASDU const &asdu) cons } default: - assert(!"unreachable"); + throw RuntimeError { "unsupported asdu type" }; } std::optional time_cp56; @@ -761,7 +761,7 @@ int SlaveNode::parse(json_t *json, const uuid_t sn_uuid) break; default: - assert(!"unreachable"); + throw RuntimeError { "unsupported signal type" }; } } else initial_value.f = 0.0; diff --git a/packaging/nix/lib60870.nix b/packaging/nix/lib60870.nix index bb0404279..b1595ab44 100644 --- a/packaging/nix/lib60870.nix +++ b/packaging/nix/lib60870.nix @@ -8,6 +8,7 @@ stdenv.mkDerivation { pname = "lib60870"; version = "villas"; src = src; + separateDebugInfo = true; nativeBuildInputs = [cmake]; preConfigure = "cd lib60870-C"; meta = with lib; { diff --git a/packaging/nix/libdatachannel.nix b/packaging/nix/libdatachannel.nix index 8821842e9..388c845eb 100644 --- a/packaging/nix/libdatachannel.nix +++ b/packaging/nix/libdatachannel.nix @@ -12,6 +12,7 @@ stdenv.mkDerivation { pname = "libdatachannel"; version = "villas"; src = src; + separateDebugInfo = true; nativeBuildInputs = [cmake pkg-config]; buildInputs = [libnice libpcap openssl]; cmakeFlags = [ diff --git a/packaging/nix/libiec61850.nix b/packaging/nix/libiec61850.nix index 44d939efd..df8426ed1 100644 --- a/packaging/nix/libiec61850.nix +++ b/packaging/nix/libiec61850.nix @@ -8,6 +8,7 @@ stdenv.mkDerivation { pname = "libiec61850"; version = "villas"; src = src; + separateDebugInfo = true; nativeBuildInputs = [cmake]; meta = with lib; { description = "open-source library for the IEC 61850 protocols"; diff --git a/packaging/nix/villas.nix b/packaging/nix/villas.nix index 8659975eb..534967fcc 100644 --- a/packaging/nix/villas.nix +++ b/packaging/nix/villas.nix @@ -2,6 +2,7 @@ # general configuration src, version, + withGpl ? true, withAllExtras ? false, withAllFormats ? false, withAllHooks ? false, @@ -32,6 +33,7 @@ coreutils, fpga, graphviz, + jq, lib, makeWrapper, pkg-config, @@ -69,12 +71,14 @@ stdenv.mkDerivation { inherit src version; pname = "villas"; - cmakeFlags = - [ - "-DDOWNLOAD_GO=OFF" - "-DCMAKE_BUILD_TYPE=Release" - ] + outputs = ["out" "dev"]; + separateDebugInfo = true; + cmakeFlags = [] + ++ lib.optionals (!withGpl) ["-DWITHOUT_GPL=ON"] ++ lib.optionals withFormatProtobuf ["-DCMAKE_FIND_ROOT_PATH=${protobufcBuildBuild}/bin"]; + postPatch = '' + patchShebangs --host ./tools + ''; preConfigure = '' rm -df common rm -df fpga @@ -82,9 +86,10 @@ stdenv.mkDerivation { ${lib.optionalString withNodeFpga "ln -s ${fpga} fpga"} ''; postInstall = '' - patchShebangs --build $out/bin/villas wrapProgram $out/bin/villas \ --set PATH ${lib.makeBinPath [(placeholder "out") gnugrep coreutils]} + wrapProgram $out/bin/villas-api \ + --set PATH ${lib.makeBinPath [coreutils curl jq]} ''; nativeBuildInputs = [ cmake