2009-09-16 16:35:38 +02:00
|
|
|
{ fetchurl, stdenv, unzip, libtool }:
|
2008-07-29 16:26:03 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2009-08-11 01:50:07 +02:00
|
|
|
name = "crypto++-5.6.0";
|
2008-07-29 16:26:03 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2009-08-11 01:50:07 +02:00
|
|
|
url = "mirror://sourceforge/cryptopp/cryptopp560.zip";
|
|
|
|
sha256 = "1icbk50mr1sqycqbxbqg703m8aamz23ajgl22ychxdahz2sz08mm";
|
2008-07-29 16:26:03 +02:00
|
|
|
};
|
|
|
|
|
2009-08-11 01:50:07 +02:00
|
|
|
patches = [ ./pic.patch ]
|
|
|
|
++ stdenv.lib.optional (builtins.currentSystem != "i686-cygwin") ./dll.patch;
|
|
|
|
|
|
|
|
|
2009-09-16 16:35:38 +02:00
|
|
|
buildInputs = [ unzip ]
|
|
|
|
|
|
|
|
# For some reason the makefile sets "AR = libtool" on Darwin.
|
|
|
|
++ stdenv.lib.optional (builtins.currentSystem == "i686-darwin") libtool;
|
2008-07-29 16:26:03 +02:00
|
|
|
|
|
|
|
# Unpack the thing in a subdirectory.
|
|
|
|
unpackPhase = ''
|
|
|
|
echo "unpacking Crypto++ to \`${name}' from \`$PWD'..."
|
|
|
|
mkdir "${name}" && (cd "${name}" && unzip "$src")
|
|
|
|
sourceRoot="$PWD/${name}"
|
|
|
|
'';
|
|
|
|
|
2009-08-11 01:50:07 +02:00
|
|
|
# Deal with one of the crappiest build system around there.
|
|
|
|
buildPhase = ''
|
|
|
|
# These guys forgot a file or something.
|
|
|
|
: > modexppc.cpp
|
|
|
|
|
|
|
|
make PREFIX="$out" all cryptopp.dll
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir "$out"
|
|
|
|
make install PREFIX="$out"
|
|
|
|
cp -v cryptopp.dll "$out/lib/libcryptopp.so"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = "make test";
|
2008-07-29 16:26:03 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Crypto++, a free C++ class library of cryptographic schemes";
|
|
|
|
homepage = http://cryptopp.com/;
|
|
|
|
license = "Public Domain";
|
2009-08-11 01:50:07 +02:00
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
2008-07-29 16:26:03 +02:00
|
|
|
};
|
2009-08-11 01:50:07 +02:00
|
|
|
}
|