From 43ce59c656ee25643335da4729110ea817bafa5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 8 Feb 2023 20:53:28 +0100 Subject: [PATCH 1/4] ustream-ssl*: init at unstable-2022-12-08 --- .../libraries/ustream-ssl/default.nix | 33 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 ++++ 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/libraries/ustream-ssl/default.nix diff --git a/pkgs/development/libraries/ustream-ssl/default.nix b/pkgs/development/libraries/ustream-ssl/default.nix new file mode 100644 index 000000000000..27b40d0a7ce5 --- /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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 24181c424147..aa5aabd12f46 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19299,6 +19299,12 @@ with pkgs; uci = callPackage ../development/libraries/uci { }; + ustream-ssl = callPackage ../development/libraries/ustream-ssl { ssl_implementation = openssl; }; + + ustream-ssl-wolfssl = callPackage ../development/libraries/ustream-ssl { ssl_implementation = wolfssl; }; + + ustream-ssl-mbedtls = callPackage ../development/libraries/ustream-ssl { ssl_implementation = mbedtls_2; }; + uri = callPackage ../development/libraries/uri { stdenv = gcc10StdenvCompat; }; cppcms = callPackage ../development/libraries/cppcms { }; From e0fbf34964af9eaa3e68204e14137ad9a49b640c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 8 Feb 2023 21:24:06 +0100 Subject: [PATCH 2/4] libubox: add ssl flavours --- pkgs/development/libraries/libubox/default.nix | 13 ++++++++++--- pkgs/development/libraries/ustream-ssl/default.nix | 12 ++++++++---- pkgs/top-level/all-packages.nix | 8 +++++++- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/libubox/default.nix b/pkgs/development/libraries/libubox/default.nix index cd8790c0e88e..0a1e1e7f0a21 100644 --- a/pkgs/development/libraries/libubox/default.nix +++ b/pkgs/development/libraries/libubox/default.nix @@ -1,8 +1,8 @@ -{ stdenv, lib, fetchgit, cmake, pkg-config, json_c, with_lua ? false, lua5_1 }: +{ stdenv, lib, fetchgit, cmake, pkg-config, json_c, with_lua ? false, lua5_1, with_ustream_ssl ? false, ustream-ssl }: stdenv.mkDerivation { pname = "libubox"; - version = "unstable-2023-01-03"; + version = "unstable-2023-01-03${lib.optionalString with_ustream_ssl "-${ustream-ssl.ssl_implementation.pname}"}"; src = fetchgit { url = "https://git.openwrt.org/project/libubox.git"; @@ -13,7 +13,14 @@ stdenv.mkDerivation { cmakeFlags = [ "-DBUILD_EXAMPLES=OFF" (if with_lua then "-DLUAPATH=${placeholder "out"}/lib/lua" else "-DBUILD_LUA=OFF") ]; nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ json_c ] ++ lib.optional with_lua lua5_1; + buildInputs = [ json_c ] ++ lib.optional with_lua lua5_1 ++ lib.optional with_ustream_ssl ustream-ssl; + + postInstall = lib.optionalString with_ustream_ssl '' + for fin in $(find ${ustream-ssl} -type f); do + fout="''${fin/"${ustream-ssl}"/"''${out}"}" + ln -s "$fin" "$fout" + done + ''; meta = with lib; { description = "C utility functions for OpenWrt"; diff --git a/pkgs/development/libraries/ustream-ssl/default.nix b/pkgs/development/libraries/ustream-ssl/default.nix index 27b40d0a7ce5..007ebc9c4573 100644 --- a/pkgs/development/libraries/ustream-ssl/default.nix +++ b/pkgs/development/libraries/ustream-ssl/default.nix @@ -1,8 +1,8 @@ -{ stdenv, lib, fetchgit, cmake, pkg-config, libubox, ssl_implementation }: +{ stdenv, lib, fetchgit, cmake, pkg-config, libubox-nossl, ssl_implementation }: stdenv.mkDerivation { pname = "ustream-ssl"; - version = "unstable-2022-12-08"; + version = "unstable-2022-12-08-${ssl_implementation.pname}"; src = fetchgit { url = "https://git.openwrt.org/project/ustream-ssl.git"; @@ -12,8 +12,8 @@ stdenv.mkDerivation { 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|ubox_include_dir libubox/ustream.h|ubox_include_dir libubox/ustream.h HINTS ${libubox-nossl}/include|g" \ + -e "s|ubox_library NAMES ubox|ubox_library NAMES ubox HINTS ${libubox-nossl}/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 ''; @@ -23,6 +23,10 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ ssl_implementation ]; + passthru = { + inherit ssl_implementation; + }; + meta = with lib; { description = "ustream SSL wrapper"; homepage = "https://git.openwrt.org/?p=project/ustream-ssl.git;a=summary"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aa5aabd12f46..141617f13a97 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21751,7 +21751,13 @@ with pkgs; libu2f-server = callPackage ../development/libraries/libu2f-server { }; - libubox = callPackage ../development/libraries/libubox { }; + libubox-nossl = callPackage ../development/libraries/libubox { }; + + libubox = callPackage ../development/libraries/libubox { with_ustream_ssl = true; }; + + libubox-wolfssl = callPackage ../development/libraries/libubox { with_ustream_ssl = true; ustream-ssl = ustream-ssl-wolfssl; }; + + libubox-mbedtls = callPackage ../development/libraries/libubox { with_ustream_ssl = true; ustream-ssl = ustream-ssl-mbedtls; }; libudev-zero = callPackage ../development/libraries/libudev-zero { }; From f3ba738bfe13f22543ea4d69f874c2b220eacb4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 8 Feb 2023 21:32:58 +0100 Subject: [PATCH 3/4] libnl-tiny: init at unstable-2022-12-13 --- pkgs/os-specific/linux/libnl-tiny/default.nix | 28 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/os-specific/linux/libnl-tiny/default.nix diff --git a/pkgs/os-specific/linux/libnl-tiny/default.nix b/pkgs/os-specific/linux/libnl-tiny/default.nix new file mode 100644 index 000000000000..fc520830f6a2 --- /dev/null +++ b/pkgs/os-specific/linux/libnl-tiny/default.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchgit, cmake, pkg-config }: + +stdenv.mkDerivation { + pname = "libnl-tiny"; + version = "unstable-2022-12-13"; + + src = fetchgit { + url = "https://git.openwrt.org/project/libnl-tiny.git"; + rev = "f5d9b7e4f534a69cbd35c3f150fa6d57b9d631e4"; + sha256 = "0c5ycsdas8rr5c33gd0mnmm515dq631fmdjn5mp2j1m0j1bk7hc0"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + + preConfigure = '' + sed -e 's|''${prefix}/@CMAKE_INSTALL_LIBDIR@|@CMAKE_INSTALL_FULL_LIBDIR@|g' \ + -e 's|''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@|@CMAKE_INSTALL_FULL_INCLUDEDIR@|g' \ + -i libnl-tiny.pc.in + ''; + + meta = with lib; { + description = "Tiny OpenWrt fork of libnl"; + homepage = "https://git.openwrt.org/?p=project/libnl-tiny.git;a=summary"; + license = licenses.isc; + maintainers = with maintainers; [ mkg20001 ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 141617f13a97..86a4cd7068fb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25926,6 +25926,8 @@ with pkgs; libnl = callPackage ../os-specific/linux/libnl { }; + libnl-tiny = callPackage ../os-specific/linux/libnl-tiny { }; + libtraceevent = callPackage ../os-specific/linux/libtraceevent {}; libtracefs = callPackage ../os-specific/linux/libtracefs {}; From 965ceadeb5e87eb851953733f2d450b57b5b79c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 8 Feb 2023 21:39:21 +0100 Subject: [PATCH 4/4] uclient-fetch: init at unstable-2022-02-24 --- .../development/libraries/uclient/default.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/libraries/uclient/default.nix diff --git a/pkgs/development/libraries/uclient/default.nix b/pkgs/development/libraries/uclient/default.nix new file mode 100644 index 000000000000..458d726f2ca6 --- /dev/null +++ b/pkgs/development/libraries/uclient/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchgit, cmake, pkg-config, libubox }: + +stdenv.mkDerivation { + pname = "uclient"; + version = "unstable-2022-02-24"; + + src = fetchgit { + url = "https://git.openwrt.org/project/uclient.git"; + rev = "644d3c7e13c6a64bf5cb628137ee5bd4dada4b74"; + sha256 = "0vy4whs64699whp92d1zl7a8kh16yrfywqq0yp2y809l9z19sw22"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buidInputs = [ libubox ]; + + preConfigure = '' + sed -e 's|ubox_include_dir libubox/ustream-ssl.h|ubox_include_dir libubox/ustream-ssl.h HINTS ${libubox}/include|g' \ + -e 's|ubox_library NAMES ubox|ubox_library NAMES ubox HINTS ${libubox}/lib|g' \ + -i CMakeLists.txt + ''; + + meta = with lib; { + description = "Tiny OpenWrt fork of libnl"; + homepage = "https://git.openwrt.org/?p=project/uclient.git;a=summary"; + license = licenses.isc; + maintainers = with maintainers; [ mkg20001 ]; + mainProgram = "uclient-fetch"; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 86a4cd7068fb..87bf4c1ea13d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19299,6 +19299,8 @@ with pkgs; uci = callPackage ../development/libraries/uci { }; + uclient = callPackage ../development/libraries/uclient { }; + ustream-ssl = callPackage ../development/libraries/ustream-ssl { ssl_implementation = openssl; }; ustream-ssl-wolfssl = callPackage ../development/libraries/ustream-ssl { ssl_implementation = wolfssl; };