2016-02-02 23:02:31 +00:00
|
|
|
|
{ stdenv, fetchFromGitHub, perl, zlib
|
2018-11-18 08:01:02 +00:00
|
|
|
|
, withCryptodev ? false, cryptodev
|
2016-02-02 23:02:31 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2019-08-13 22:52:01 +01:00
|
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
|
pname = "openssl-chacha";
|
2016-09-04 06:26:59 +01:00
|
|
|
|
version = "2016-08-22";
|
2016-02-02 23:02:31 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "PeterMosmans";
|
|
|
|
|
repo = "openssl";
|
2016-09-04 06:26:59 +01:00
|
|
|
|
rev = "293717318e903b95f4d7e83a98a087282f37efc3";
|
|
|
|
|
sha256 = "134j3anjnj2q99xsd8d47bwvjp73qkdsimdd9riyjxa3hd8ysr00";
|
2016-02-02 23:02:31 +00:00
|
|
|
|
};
|
|
|
|
|
|
2016-08-29 01:30:01 +01:00
|
|
|
|
outputs = [ "bin" "dev" "out" "man" ];
|
2016-04-11 00:10:50 +01:00
|
|
|
|
setOutputFlags = false;
|
|
|
|
|
|
2016-02-02 23:02:31 +00:00
|
|
|
|
nativeBuildInputs = [ perl zlib ];
|
2018-11-18 08:01:02 +00:00
|
|
|
|
buildInputs = stdenv.lib.optional withCryptodev cryptodev;
|
2016-02-02 23:02:31 +00:00
|
|
|
|
|
|
|
|
|
configureScript = "./config";
|
|
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
|
"zlib"
|
|
|
|
|
"shared"
|
|
|
|
|
"experimental-jpake"
|
|
|
|
|
"enable-md2"
|
|
|
|
|
"enable-rc5"
|
|
|
|
|
"enable-rfc3779"
|
|
|
|
|
"enable-gost"
|
|
|
|
|
"--libdir=lib"
|
|
|
|
|
"--openssldir=etc/ssl"
|
|
|
|
|
] ++ stdenv.lib.optionals withCryptodev [
|
|
|
|
|
"-DHAVE_CRYPTODEV"
|
|
|
|
|
"-DUSE_CRYPTODEV_DIGESTS"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
makeFlags = [
|
2016-04-11 00:10:50 +01:00
|
|
|
|
"MANDIR=$(man)/share/man"
|
2016-02-02 23:02:31 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Parallel building is broken in OpenSSL.
|
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
# If we're building dynamic libraries, then don't install static
|
|
|
|
|
# libraries.
|
|
|
|
|
if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
|
|
|
|
|
rm "$out/lib/"*.a
|
|
|
|
|
fi
|
|
|
|
|
|
2016-04-11 00:10:50 +01:00
|
|
|
|
mkdir -p $bin
|
|
|
|
|
mv $out/bin $bin/
|
|
|
|
|
|
|
|
|
|
mkdir $dev
|
|
|
|
|
mv $out/include $dev/
|
|
|
|
|
|
2016-02-02 23:02:31 +00:00
|
|
|
|
# remove dependency on Perl at runtime
|
2016-04-11 00:10:50 +01:00
|
|
|
|
rm -r $out/etc/ssl/misc
|
|
|
|
|
|
|
|
|
|
rmdir $out/etc/ssl/{certs,private}
|
2016-02-02 23:02:31 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
|
# Check to make sure we don't depend on perl
|
|
|
|
|
if grep -r '${perl}' $out; then
|
|
|
|
|
echo "Found an erroneous dependency on perl ^^^" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = {
|
2017-08-17 22:56:35 +01:00
|
|
|
|
homepage = https://www.openssl.org/;
|
2016-02-02 23:02:31 +00:00
|
|
|
|
description = "A cryptographic library that implements the SSL and TLS protocols";
|
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.cstrahan ];
|
2018-10-25 21:09:50 +01:00
|
|
|
|
license = licenses.openssl;
|
2016-02-02 23:02:31 +00:00
|
|
|
|
priority = 10; # resolves collision with ‘man-pages’
|
|
|
|
|
};
|
|
|
|
|
}
|