nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, openssl }:
2
3stdenv.mkDerivation rec {
4 pname = "mysocketw";
5 version = "031026";
6 src = fetchurl {
7 url = "https://www.digitalfanatics.org/cal/socketw/files/SocketW${version}.tar.gz";
8 sha256 = "0crinikhdl7xihzmc3k3k41pgxy16d5ci8m9sza1lbibns7pdwj4";
9 };
10
11 patches = [ ./gcc.patch ];
12
13 buildInputs = [ openssl ];
14
15 postPatch = lib.optionalString stdenv.isDarwin ''
16 substituteInPlace src/Makefile \
17 --replace -Wl,-soname, -Wl,-install_name,$out/lib/
18 '';
19
20 makeFlags = [ "PREFIX=$(out)" "CXX=${stdenv.cc.targetPrefix}c++" ];
21
22 meta = {
23 description = "Cross platform (Linux/FreeBSD/Unix/Win32) streaming socket C++";
24 license = lib.licenses.lgpl21Plus;
25 platforms = lib.platforms.all;
26 };
27}