summary refs log tree commit diff
path: root/pkgs/development/libraries/mysocketw/default.nix
blob: 32987d649922a5c5f821a5ec3cb78fe3f4dd0ef7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib
, stdenv
, fetchFromGitHub
, openssl
, cmake
}:

stdenv.mkDerivation rec {
  pname = "mysocketw";
  version = "3.11.0";

  src = fetchFromGitHub {
    owner = "RigsOfRods";
    repo = "socketw";
    rev = version;
    hash = "sha256-mpfhmKE2l59BllkOjmURIfl17lAakXpmGh2x9SFSaAo=";
  };

  nativeBuildInputs = [
    cmake
  ];

  buildInputs = [
    openssl
  ];

  postPatch = lib.optionalString stdenv.isDarwin ''
    substituteInPlace src/Makefile \
        --replace -Wl,-soname, -Wl,-install_name,$out/lib/
  '';

  meta = with lib; {
    description = "Cross platform (Linux/FreeBSD/Unix/Win32) streaming socket C++";
    homepage = "https://github.com/RigsOfRods/socketw";
    license = licenses.lgpl21Plus;
    maintainers = with maintainers; [ ];
  };
}