Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl }: 2 3stdenv.mkDerivation rec { 4 pname = "socklog"; 5 version = "2.1.0"; 6 7 src = fetchurl { 8 url = "http://smarden.org/socklog/socklog-${version}.tar.gz"; 9 sha256 = "0mdlmhiq2j2fip7c4l669ams85yc3c1s1d89am7dl170grw9m1ma"; 10 }; 11 12 sourceRoot = "admin/socklog-${version}"; 13 14 outputs = [ "out" "man" "doc" ]; 15 16 postPatch = '' 17 # Fails to run as user without supplementary groups 18 echo "int main() { return 0; }" >src/chkshsgr.c 19 20 # Fixup implicit function declarations 21 sed -i src/pathexec_run.c -e '1i#include <unistd.h>' 22 sed -i src/prot.c -e '1i#include <unistd.h>' -e '2i#include <grp.h>' 23 sed -i src/seek_set.c -e '1i#include <unistd.h>' 24 ''; 25 26 configurePhase = '' 27 echo "$NIX_CC/bin/cc $NIX_CFLAGS_COMPILE" >src/conf-cc 28 echo "$NIX_CC/bin/cc -s" >src/conf-ld 29 ''; 30 31 buildPhase = "package/compile"; 32 33 installPhase = '' 34 mkdir -p $out/bin 35 mv command"/"* $out/bin 36 37 for i in {1,8} ; do 38 mkdir -p $man/share/man/man$i 39 mv man"/"*.$i $man/share/man/man$i 40 done 41 42 mkdir -p $doc/share/doc/socklog/html 43 mv doc/*.html $doc/share/doc/socklog/html/ 44 ''; 45 46 checkPhase = "package/check"; 47 48 doCheck = true; 49 50 meta = with lib; { 51 description = "System and kernel logging services"; 52 homepage = "http://smarden.org/socklog/"; 53 license = licenses.publicDomain; 54 platforms = platforms.unix; 55 maintainers = [ maintainers.joachifm ]; 56 }; 57}