1{
2 stdenv,
3 lib,
4 fetchgit,
5 cmake,
6 pkg-config,
7 libubox-nossl,
8 ssl_implementation,
9 additional_buildInputs ? [ ],
10}:
11
12stdenv.mkDerivation {
13 pname = "ustream-ssl";
14 version = "0-unstable-2024-03-26";
15
16 src = fetchgit {
17 url = "https://git.openwrt.org/project/ustream-ssl.git";
18 rev = "7621339d7694abef5da5e5353ac440f2d39dcecb";
19 hash = "sha256-No0Pk8KbkT7W4Rav7W3rMKEJISbp7RRoRx7t6LPMxlk=";
20 };
21
22 preConfigure = ''
23 sed -r \
24 -e "s|ubox_include_dir libubox/ustream.h|ubox_include_dir libubox/ustream.h HINTS ${libubox-nossl}/include|g" \
25 -e "s|ubox_library NAMES ubox|ubox_library NAMES ubox HINTS ${libubox-nossl}/lib|g" \
26 -e "s|^ FIND_LIBRARY\((.+)\)| FIND_LIBRARY\(\1 HINTS ${
27 if ssl_implementation ? lib then ssl_implementation.lib else ssl_implementation.out
28 }\)|g" \
29 -i CMakeLists.txt
30 '';
31
32 cmakeFlags = [ "-D${lib.toUpper ssl_implementation.pname}=ON" ];
33
34 nativeBuildInputs = [
35 cmake
36 pkg-config
37 ];
38 buildInputs = [ ssl_implementation ] ++ additional_buildInputs;
39
40 passthru = {
41 inherit ssl_implementation;
42 };
43
44 meta = with lib; {
45 description = "ustream SSL wrapper";
46 homepage = "https://git.openwrt.org/?p=project/ustream-ssl.git;a=summary";
47 license = licenses.isc;
48 maintainers = with maintainers; [
49 fpletz
50 mkg20001
51 ];
52 platforms = platforms.all;
53 };
54}