at 23.05-pre 63 lines 1.6 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, fetchpatch 5, fetchurl 6, openssl 7, cmake 8}: 9 10let 11 12 joinpaths-src = fetchurl { 13 url = "https://github.com/AnotherFoxGuy/CMakeCM/raw/afe41f4536ae21f6f11f83e8c0b8b8c450ef1332/modules/JoinPaths.cmake"; 14 hash = "sha256-eUsNj6YqO3mMffEtUBFFgNGkeiNL+2tNgwkutkam7MQ="; 15 }; 16 17in 18stdenv.mkDerivation rec { 19 pname = "mysocketw"; 20 version = "3.11.0"; 21 22 src = fetchFromGitHub { 23 owner = "RigsOfRods"; 24 repo = "socketw"; 25 rev = version; 26 hash = "sha256-mpfhmKE2l59BllkOjmURIfl17lAakXpmGh2x9SFSaAo="; 27 }; 28 29 patches = [ 30 # in master post 3.11.0, see https://github.com/RigsOfRods/socketw/issues/16 31 (fetchpatch { 32 name = "fix-pkg-config.patch"; 33 url = "https://github.com/RigsOfRods/socketw/commit/17cad062c3673bd0da74a2fecadb01dbf9813a07.patch"; 34 sha256 = "01b019gfm01g0r1548cizrf7mqigsda8jnrzhg8dhi9c49nfw1bp"; 35 }) 36 ]; 37 38 nativeBuildInputs = [ 39 cmake 40 ]; 41 42 buildInputs = [ 43 openssl 44 ]; 45 46 postUnpack = ''( 47 mkdir -p source/build/_cmcm-modules/resolved && cd $_ 48 cp ${joinpaths-src} JoinPaths.cmake 49 printf %s 'https://AnotherFoxGuy.com/CMakeCM::modules/JoinPaths.cmake.1' > JoinPaths.cmake.whence 50 )''; 51 52 postPatch = lib.optionalString stdenv.isDarwin '' 53 substituteInPlace src/Makefile \ 54 --replace -Wl,-soname, -Wl,-install_name,$out/lib/ 55 ''; 56 57 meta = with lib; { 58 description = "Cross platform (Linux/FreeBSD/Unix/Win32) streaming socket C++"; 59 homepage = "https://github.com/RigsOfRods/socketw"; 60 license = licenses.lgpl21Plus; 61 maintainers = with maintainers; [ ]; 62 }; 63}