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