skawarePackages: factor out the common parts
Introduce a `skawarePackages.buildPackage` function that contains the common setup, removing a lot of duplication. In particular, we require that the build directory has to be empty after the `fixupPhase`, to make sure every relevant file is moved to the outputs. A next step would be to deduplicate the `configureFlags` attributes and only require a `skawareInputs` field.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ stdenv, execline, fetchgit, s6, s6-dns, skalibs
|
||||
{ stdenv, skawarePackages
|
||||
|
||||
# Whether to build the TLS/SSL tools and what library to use
|
||||
# acceptable values: "libressl", false
|
||||
@@ -6,11 +6,9 @@
|
||||
, sslSupport ? "libressl" , libressl
|
||||
}:
|
||||
|
||||
with skawarePackages;
|
||||
let
|
||||
inherit (stdenv) lib;
|
||||
|
||||
version = "2.3.0.3";
|
||||
|
||||
sslSupportEnabled = sslSupport != false;
|
||||
sslLibs = {
|
||||
"libressl" = libressl;
|
||||
@@ -19,25 +17,18 @@ let
|
||||
in
|
||||
assert sslSupportEnabled -> sslLibs ? ${sslSupport};
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
name = "s6-networking-${version}";
|
||||
buildPackage {
|
||||
pname = "s6-networking";
|
||||
version = "2.3.0.3";
|
||||
sha256 = "06kv2l31ch0zw538bpivgnwymb056x5hpmqafglffgkbq3izp7wc";
|
||||
|
||||
src = fetchgit {
|
||||
url = "git://git.skarnet.org/s6-networking";
|
||||
rev = "refs/tags/v${version}";
|
||||
sha256 = "06kv2l31ch0zw538bpivgnwymb056x5hpmqafglffgkbq3izp7wc";
|
||||
};
|
||||
description = "A suite of small networking utilities for Unix systems";
|
||||
|
||||
outputs = [ "bin" "lib" "dev" "doc" "out" ];
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# TODO: nsss support
|
||||
configureFlags = [
|
||||
"--enable-absolute-paths"
|
||||
"--libdir=\${lib}/lib"
|
||||
"--libexecdir=\${lib}/libexec"
|
||||
"--dynlibdir=\${lib}/lib"
|
||||
@@ -61,20 +52,16 @@ stdenv.mkDerivation rec {
|
||||
"--enable-ssl=${sslSupport}"
|
||||
"--with-include=${lib.getDev sslLibs.${sslSupport}}/include"
|
||||
"--with-lib=${lib.getLib sslLibs.${sslSupport}}/lib"
|
||||
])
|
||||
++ (lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
|
||||
"--with-dynlib=${lib.getLib sslLibs.${sslSupport}}/lib"
|
||||
]);
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $doc/share/doc/s6-networking/
|
||||
# remove all s6 executables from build directory
|
||||
rm $(find -name "s6-*" -type f -mindepth 1 -maxdepth 1 -executable)
|
||||
rm minidentd
|
||||
rm libs6net.* libstls.*
|
||||
|
||||
mv doc $doc/share/doc/s6-networking/html
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://www.skarnet.org/software/s6-networking/;
|
||||
description = "A suite of small networking utilities for Unix systems";
|
||||
platforms = lib.platforms.all;
|
||||
license = lib.licenses.isc;
|
||||
maintainers = with stdenv.lib.maintainers; [ pmahoney Profpatsch ];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user