Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 54 lines 1.3 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 libxcrypt, 6}: 7 8stdenv.mkDerivation rec { 9 pname = "bftpd"; 10 version = "6.3"; 11 12 src = fetchurl { 13 url = "mirror://sourceforge/project/${pname}/${pname}/${pname}-${version}/${pname}-${version}.tar.gz"; 14 sha256 = "sha256-f7XZCSrGwmQqyf5C4xtJ46Q4SDHxbr15rDzcAK1PvB4="; 15 }; 16 17 # utmp has been replaced by utmpx since Mac OS X 10.6 (Snow Leopard): 18 # 19 # https://stackoverflow.com/a/37913019 20 # 21 # bftpd does not have support for this, so disable it. 22 # 23 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' 24 for file in login.*; do 25 substituteInPlace $file --replace-fail "#ifdef HAVE_UTMP_H" "#if 0" 26 done 27 ''; 28 29 buildInputs = [ libxcrypt ]; 30 31 CFLAGS = "-std=gnu89"; 32 33 preConfigure = '' 34 sed -re 's/-[og] 0//g' -i Makefile* 35 ''; 36 37 postInstall = '' 38 mkdir -p $out/share/doc/${pname} 39 mv $out/etc/*.conf $out/share/doc/${pname} 40 rm -rf $out/{etc,var} 41 ''; 42 43 enableParallelBuilding = true; 44 45 meta = with lib; { 46 description = "Minimal ftp server"; 47 mainProgram = "bftpd"; 48 downloadPage = "http://bftpd.sf.net/download.html"; 49 homepage = "http://bftpd.sf.net/"; 50 license = licenses.gpl2Plus; 51 maintainers = with maintainers; [ raskin ]; 52 platforms = platforms.all; 53 }; 54}