diff --git a/flake.lock b/flake.lock index e5e249861..30c61f57c 100644 --- a/flake.lock +++ b/flake.lock @@ -17,71 +17,18 @@ "type": "gitlab" } }, - "lib60870": { - "flake": false, - "locked": { - "lastModified": 1672404819, - "narHash": "sha256-9o+gWQbpCJb+UZzPNmzGqpWD0QbGjg41is/f1POUEQs=", - "owner": "mz-automation", - "repo": "lib60870", - "rev": "53a6b3c1cf3023e51cf81763b1ccf048edcd1c64", - "type": "github" - }, - "original": { - "owner": "mz-automation", - "ref": "v2.3.2", - "repo": "lib60870", - "type": "github" - } - }, - "libdatachannel": { - "flake": false, - "locked": { - "lastModified": 1683797946, - "narHash": "sha256-kSK+5gFMG6tq89R1m08gNBKPdwyR/mLEDhWXQ/uk34o=", - "ref": "refs/tags/v0.18.4", - "rev": "7a5e01071ae635e06f175233abd11d623f09cbb8", - "revCount": 2459, - "submodules": true, - "type": "git", - "url": "https://github.com/paullouisageneau/libdatachannel.git" - }, - "original": { - "ref": "refs/tags/v0.18.4", - "submodules": true, - "type": "git", - "url": "https://github.com/paullouisageneau/libdatachannel.git" - } - }, - "libiec61850": { - "flake": false, - "locked": { - "lastModified": 1647022552, - "narHash": "sha256-1vT0ry6IJqilpM7g9l7fx+ET+Dyo24WAyWqTyPM9nQw=", - "owner": "mz-automation", - "repo": "libiec61850", - "rev": "210cf30897631fe2006ac50483caf8fd616622a2", - "type": "github" - }, - "original": { - "owner": "mz-automation", - "ref": "v1.5.1", - "repo": "libiec61850", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1709884566, - "narHash": "sha256-NSYJg2sfdO/XS3L8XN/59Zhzn0dqWm7XtVnKI2mHq3w=", + "lastModified": 1711370797, + "narHash": "sha256-2xu0jVSjuKhN97dqc4bVtvEH52Rwh6+uyI1XCnzoUyI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2be119add7b37dc535da2dd4cba68e2cf8d1517e", + "rev": "c726225724e681b3626acc941c6f95d2b0602087", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.11", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -89,9 +36,6 @@ "root": { "inputs": { "ethercat": "ethercat", - "lib60870": "lib60870", - "libdatachannel": "libdatachannel", - "libiec61850": "libiec61850", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index f7c3b4baf..09c5c303b 100644 --- a/flake.nix +++ b/flake.nix @@ -4,30 +4,12 @@ description = "VILLASnode is a client/server application to connect simulation equipment and software."; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; ethercat = { url = "gitlab:etherlab.org/ethercat/stable-1.5"; flake = false; }; - - lib60870 = { - url = "github:mz-automation/lib60870/v2.3.2"; - flake = false; - }; - - libdatachannel = { - type = "git"; - url = "https://github.com/paullouisageneau/libdatachannel.git"; - ref = "refs/tags/v0.18.4"; - submodules = true; - flake = false; - }; - - libiec61850 = { - url = "github:mz-automation/libiec61850/v1.5.1"; - flake = false; - }; }; outputs = { @@ -107,18 +89,6 @@ ethercat = pkgs.callPackage (nixDir + "/ethercat.nix") { src = inputs.ethercat; }; - - lib60870 = pkgs.callPackage (nixDir + "/lib60870.nix") { - src = inputs.lib60870; - }; - - libdatachannel = pkgs.callPackage (nixDir + "/libdatachannel.nix") { - src = inputs.libdatachannel; - }; - - libiec61850 = pkgs.callPackage (nixDir + "/libiec61850.nix") { - src = inputs.libiec61850; - }; }; in { # Standard flake attribute for normal packages (not cross-compiled) diff --git a/include/villas/node/config.hpp.in b/include/villas/node/config.hpp.in index ab3e7c172..cb4423a5e 100644 --- a/include/villas/node/config.hpp.in +++ b/include/villas/node/config.hpp.in @@ -59,3 +59,6 @@ #cmakedefine REDISPP_WITH_TLS #cmakedefine REDISPP_WITH_URI #cmakedefine RABBITMQ_C_NEW_INCLUDE_DIR + +/* Library versions */ +#define RTC_VERSION ((@LibDataChannel_VERSION_MAJOR@ << 16) | (@LibDataChannel_VERSION_MINOR@ << 8) | (@LibDataChannel_VERSION_PATCH@ << 0)) diff --git a/include/villas/nodes/webrtc/peer_connection.hpp b/include/villas/nodes/webrtc/peer_connection.hpp index 0d71e5144..96dd6266f 100644 --- a/include/villas/nodes/webrtc/peer_connection.hpp +++ b/include/villas/nodes/webrtc/peer_connection.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -25,15 +26,19 @@ * But C++ ADL based overload set construction does not find these operators, * if these are invoked in the spdlog/fmt libraries. * - * See this issue for a short explaination of ADL errors: + * See this issue for a short explanation of ADL errors: * https://github.com/gabime/spdlog/issues/1227#issuecomment-532009129 * * Adding the global ::operator<< overload set to the namespace rtc where * the data structures are defined, allows ADL to pick these up in spdlog/fmt. + * + * Since libdatachannel 0.20, operator<< has been moved into the rtc namespace. */ +#if RTC_VERSION <= 0x001400 namespace rtc { using ::operator<<; } +#endif #ifndef FMT_LEGACY_OSTREAM_FORMATTER template <> diff --git a/packaging/nix/lib60870.nix b/packaging/nix/lib60870.nix deleted file mode 100644 index 5aac968ec..000000000 --- a/packaging/nix/lib60870.nix +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH -# SPDX-License-Identifier: Apache-2.0 -{ - cmake, - lib, - stdenv, - src, -}: -stdenv.mkDerivation { - pname = "lib60870"; - version = "villas"; - src = src; - separateDebugInfo = true; - nativeBuildInputs = [cmake]; - preConfigure = "cd lib60870-C"; - meta = with lib; { - description = "implementation of the IEC 60870-5-101/104 protocol"; - homepage = "https://libiec61850.com/"; - license = licenses.gpl3; - }; -} diff --git a/packaging/nix/libdatachannel.nix b/packaging/nix/libdatachannel.nix deleted file mode 100644 index 63a028320..000000000 --- a/packaging/nix/libdatachannel.nix +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH -# SPDX-License-Identifier: Apache-2.0 -{ - cmake, - lib, - libnice, - libpcap, - pkg-config, - stdenv, - src, - openssl, -}: -stdenv.mkDerivation { - pname = "libdatachannel"; - version = "villas"; - src = src; - separateDebugInfo = true; - nativeBuildInputs = [cmake pkg-config]; - buildInputs = [libnice libpcap openssl]; - cmakeFlags = [ - "-DUSE_NICE=ON" # Use libnice for better protocol support - "-DNO_WEBSOCKET=ON" # VILLASnode uses libwebsockets instead - "-DNO_MEDIA=ON" # VILLASnode does not use media transport features - ]; - meta = with lib; { - description = "C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets"; - homepage = "https://libdatachannel.org/"; - license = licenses.mpl20; - }; -} diff --git a/packaging/nix/libiec61850.nix b/packaging/nix/libiec61850.nix deleted file mode 100644 index 81ffdc86a..000000000 --- a/packaging/nix/libiec61850.nix +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH -# SPDX-License-Identifier: Apache-2.0 -{ - cmake, - lib, - stdenv, - src, -}: -stdenv.mkDerivation { - pname = "libiec61850"; - version = "villas"; - src = src; - separateDebugInfo = true; - nativeBuildInputs = [cmake]; - meta = with lib; { - description = "open-source library for the IEC 61850 protocols"; - homepage = "https://libiec61850.com/"; - license = licenses.gpl3; - }; -}