btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / us / usrsctp / package.nix
blob58448d0a453d7a6c955d3a587fc50077595d4836
1 { stdenv, lib, fetchFromGitHub, fetchpatch, cmake }:
3 stdenv.mkDerivation rec {
4   pname = "usrsctp";
5   version = "0.9.5.0";
7   src = fetchFromGitHub {
8     owner = "sctplab";
9     repo = "usrsctp";
10     rev = version;
11     sha256 = "10ndzkip8blgkw572n3dicl6mgjaa7kygwn3vls80liq92vf1sa9";
12   };
14   patches = [
15     # usrsctp fails to build with clang 15+ due to set but unused variable and missing prototype
16     # errors. These issues are fixed in the master branch, but a new release with them has not
17     # been made. The following patch can be dropped once a release has been made.
18     ./clang-fix-build.patch
20     (fetchpatch {
21       name = "freebsd-14.patch";
22       url = "https://github.com/sctplab/usrsctp/commit/ac559d2a95277e5e0827e9ee5a1d3b1b50e0822a.patch";
23       hash = "sha256-QBlzH37Xwwnn1y8pM941Zesz18p2EazfeD0lCU8n6nI=";
24     })
25   ];
27   nativeBuildInputs = [ cmake ];
29   # https://github.com/sctplab/usrsctp/issues/662
30   postPatch = ''
31     substituteInPlace usrsctplib/CMakeLists.txt \
32       --replace '$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
33       --replace '$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
34   '';
36   meta = with lib; {
37     homepage = "https://github.com/sctplab/usrsctp";
38     description = "Portable SCTP userland stack";
39     maintainers = with maintainers; [ misuzu ];
40     license = licenses.bsd3;
41     platforms = platforms.unix;
42   };