diff --git a/pkgs/development/libraries/skalibs/default.nix b/pkgs/development/libraries/skalibs/default.nix new file mode 100644 index 00000000000..842d74848df --- /dev/null +++ b/pkgs/development/libraries/skalibs/default.nix @@ -0,0 +1,58 @@ +{stdenv, fetchurl}: + +let + + version = "1.6.0.0"; + +in stdenv.mkDerivation rec { + name = "skalibs-${version}"; + + src = fetchurl { + url = "http://skarnet.org/software/skalibs/${name}.tar.gz"; + sha256 = "0jz3farll9n5jvz3g6wri99s6njkgmnf0r9jqjlg03f20dzv8c8w"; + }; + + sourceRoot = "prog/${name}"; + + # See http://skarnet.org/cgi-bin/archive.cgi?1:mss:75:201405:pkmodhckjklemogbplje + patches = [ ./getpeereid.patch ]; + + configurePhase = '' + pushd conf-compile + + printf "$out/bin" > conf-defaultpath + printf "$out/etc" > conf-etc + printf "$out/bin" > conf-install-command + printf "$out/include" > conf-install-include + printf "$out/libexec" > conf-install-libexec + printf "$out/lib" > conf-install-library + printf "$out/lib" > conf-install-library.so + printf "$out/sysdeps" > conf-install-sysdeps + + # let nix builder strip things, cross-platform + truncate --size 0 conf-stripbins + truncate --size 0 conf-striplibs + + rm -f flag-slashpackage + touch flag-allstatic + touch flag-forcedevr + + popd + ''; + + preBuild = '' + patchShebangs src/sys + ''; + + preInstall = '' + mkdir -p "$out/etc" + ''; + + meta = { + homepage = http://skarnet.org/software/skalibs/; + description = "A set of general-purpose C programming libraries."; + platforms = stdenv.lib.platforms.all; + license = stdenv.lib.licenses.isc; + }; + +} diff --git a/pkgs/development/libraries/skalibs/getpeereid.patch b/pkgs/development/libraries/skalibs/getpeereid.patch new file mode 100644 index 00000000000..c366780e267 --- /dev/null +++ b/pkgs/development/libraries/skalibs/getpeereid.patch @@ -0,0 +1,28 @@ +--- a/src/libstddjb/getpeereid.h ++++ b/src/libstddjb/getpeereid.h +@@ -3,6 +3,14 @@ + #ifndef GETPEEREID_H + #define GETPEEREID_H + ++#include "sysdeps.h" ++ ++#ifdef HASGETPEEREID ++/* syscall exists - do nothing */ ++ ++#else ++ + extern int getpeereid (int, int *, int *) ; + + #endif ++#endif +--- a/src/libstddjb/ipc_eid.c ++++ b/src/libstddjb/ipc_eid.c +@@ -5,7 +5,7 @@ + + int ipc_eid (int s, unsigned int *u, unsigned int *g) + { +- int dummyu, dummyg ; ++ unsigned int dummyu, dummyg ; + if (getpeereid(s, &dummyu, &dummyg) < 0) return -1 ; + *u = (unsigned int)dummyu ; + *g = (unsigned int)dummyg ; diff --git a/pkgs/servers/s6/default.nix b/pkgs/servers/s6/default.nix new file mode 100644 index 00000000000..045e31207ba --- /dev/null +++ b/pkgs/servers/s6/default.nix @@ -0,0 +1,57 @@ +{stdenv, fetchurl, skalibs, execline}: + +let + + version = "1.1.3.2"; + +in stdenv.mkDerivation rec { + + name = "s6-${version}"; + + src = fetchurl { + url = "http://www.skarnet.org/software/s6/${name}.tar.gz"; + sha256 = "0djxdd3d3mlp63sjqqs0ilf8p68m86c1s98d82fl0kgaaibpsikp"; + }; + + buildInputs = [ skalibs execline ]; + + sourceRoot = "admin/${name}"; + + configurePhase = '' + pushd conf-compile + + printf "$out/bin" > conf-install-command + printf "$out/include" > conf-install-include + printf "$out/lib" > conf-install-library + printf "$out/lib" > conf-install-library.so + printf "$out/sysdeps" > conf-install-sysdeps + + # let nix builder strip things, cross-platform + truncate --size 0 conf-stripbins + truncate --size 0 conf-striplibs + + printf "${skalibs}/sysdeps" > import + printf "%s\n%s" "${skalibs}/include" "${execline}/include" > path-include + printf "%s\n%s" "${skalibs}/lib" "${execline}/lib" > path-library + + rm -f flag-slashpackage + touch flag-allstatic + + popd + ''; + + preBuild = '' + substituteInPlace "src/daemontools-extras/s6-log.c" \ + --replace '"execlineb"' '"${execline}/bin/execlineb"' + + patchShebangs src/sys + ''; + + meta = { + homepage = http://www.skarnet.org/software/s6/; + description = "skarnet.org's small & secure supervision software suite."; + platforms = stdenv.lib.platforms.all; + license = stdenv.lib.licenses.isc; + }; + +} diff --git a/pkgs/tools/misc/execline/default.nix b/pkgs/tools/misc/execline/default.nix new file mode 100644 index 00000000000..ba0784138b3 --- /dev/null +++ b/pkgs/tools/misc/execline/default.nix @@ -0,0 +1,54 @@ +{stdenv, fetchurl, skalibs}: + +let + + version = "1.3.1.1"; + +in stdenv.mkDerivation rec { + + name = "execline-${version}"; + + src = fetchurl { + url = "http://skarnet.org/software/execline/${name}.tar.gz"; + sha256 = "1br3qzif166kbp4k813ljbyq058p7mfsp2lj88n8vi4dmj935nzg"; + }; + + buildInputs = [ skalibs ]; + + sourceRoot = "admin/${name}"; + + configurePhase = '' + pushd conf-compile + + printf "$out/bin" > conf-install-command + printf "$out/include" > conf-install-include + printf "$out/lib" > conf-install-library + printf "$out/lib" > conf-install-library.so + printf "$out/sysdeps" > conf-install-sysdeps + + printf "${skalibs}/sysdeps" > import + printf "${skalibs}/include" > path-include + printf "${skalibs}/lib" > path-library + + # let nix builder strip things, cross-platform + truncate --size 0 conf-stripbins + truncate --size 0 conf-striplibs + + rm -f flag-slashpackage + touch flag-allstatic + + popd + ''; + + preBuild = '' + patchShebangs src/sys + ''; + + meta = { + homepage = http://skarnet.org/software/execline/; + description = "A small scripting language, to be used in place of a shell in non-interactive scripts."; + platforms = stdenv.lib.platforms.all; + license = stdenv.lib.licenses.isc; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 15da2e5e4e1..8f5ce8da047 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -987,6 +987,8 @@ let exempi = callPackage ../development/libraries/exempi { }; + execline = callPackage ../tools/misc/execline { }; + exercism = callPackage ../development/tools/exercism { }; exif = callPackage ../tools/graphics/exif { }; @@ -6169,6 +6171,8 @@ let sfml_git = callPackage ../development/libraries/sfml { }; + skalibs = callPackage ../development/libraries/skalibs { }; + slang = callPackage ../development/libraries/slang { }; slibGuile = callPackage ../development/libraries/slib { @@ -6978,6 +6982,8 @@ let rippled = callPackage ../servers/rippled { }; + s6 = callPackage ../servers/s6 { }; + spamassassin = callPackage ../servers/mail/spamassassin { inherit (perlPackages) HTMLParser NetDNS NetAddrIP DBFile HTTPDate MailDKIM LWP IOSocketSSL;