about summary refs log tree commit diff
path: root/pkgs/development/libraries/ustream-ssl
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2023-02-08 20:53:28 +0100
committerMaciej Krüger <mkg20001@gmail.com>2023-02-08 21:10:06 +0100
commit43ce59c656ee25643335da4729110ea817bafa5e (patch)
tree66093b12afc2d86ce97468d98ed7ff1336daf3eb /pkgs/development/libraries/ustream-ssl
parent857052b13a9ae808c9a5926e569c32fd20aff99c (diff)
ustream-ssl*: init at unstable-2022-12-08
Diffstat (limited to 'pkgs/development/libraries/ustream-ssl')
-rw-r--r--pkgs/development/libraries/ustream-ssl/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/libraries/ustream-ssl/default.nix b/pkgs/development/libraries/ustream-ssl/default.nix
new file mode 100644
index 0000000000000..27b40d0a7ce56
--- /dev/null
+++ b/pkgs/development/libraries/ustream-ssl/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchgit, cmake, pkg-config, libubox, ssl_implementation }:
+
+stdenv.mkDerivation {
+  pname = "ustream-ssl";
+  version = "unstable-2022-12-08";
+
+  src = fetchgit {
+    url = "https://git.openwrt.org/project/ustream-ssl.git";
+    rev = "9217ab46536353c7c792951b57163063f5ec7a3b";
+    sha256 = "1ldyyb3is213iljyccx98f56rb69rfpgdcb1kjxw9a176hvpipdd";
+  };
+
+  preConfigure = ''
+    sed -r \
+        -e "s|ubox_include_dir libubox/ustream.h|ubox_include_dir libubox/ustream.h HINTS ${libubox}/include|g" \
+        -e "s|ubox_library NAMES ubox|ubox_library NAMES ubox HINTS ${libubox}/lib|g" \
+        -e "s|^  FIND_LIBRARY\((.+)\)|  FIND_LIBRARY\(\1 HINTS ${if ssl_implementation ? lib then ssl_implementation.lib else ssl_implementation.out}\)|g" \
+        -i CMakeLists.txt
+  '';
+
+  cmakeFlags = [ "-D${lib.toUpper ssl_implementation.pname}=ON" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ ssl_implementation ];
+
+  meta = with lib; {
+    description = "ustream SSL wrapper";
+    homepage = "https://git.openwrt.org/?p=project/ustream-ssl.git;a=summary";
+    license = licenses.isc;
+    maintainers = with maintainers; [ fpletz ];
+    platforms = platforms.all;
+  };
+}