···11+{ stdenv, fetchurl, openssl }:
22+33+with stdenv;
44+with stdenv.lib;
55+66+mkDerivation rec {
77+ name = "wraith-${version}";
88+ version = "1.4.6";
99+ src = fetchurl {
1010+ url = "mirror://sourceforge/wraithbotpack/wraith-v${version}.tar.gz";
1111+ sha256 = "0vb2hbjmwh040f5yhxvwcfxvgxa0q9zdy9vvddydn8zn782d7wl8";
1212+ };
1313+ buildInputs = [ openssl ];
1414+ patches = [ ./dlopen.patch ];
1515+ postPatch = ''
1616+ substituteInPlace src/libssl.cc --subst-var-by openssl ${openssl}
1717+ substituteInPlace src/libcrypto.cc --subst-var-by openssl ${openssl}
1818+ '';
1919+ configureFlags = "--with-openssl=${openssl}";
2020+ installPhase = ''
2121+ mkdir -p $out/bin
2222+ cp -a wraith $out/bin/wraith
2323+ ln -s wraith $out/bin/hub
2424+ '';
2525+2626+ meta = {
2727+ description = "An IRC channel management bot written purely in C/C++";
2828+ longDescription = ''
2929+ Wraith is an IRC channel management bot written purely in C/C++. It has
3030+ been in development since late 2003. It is based on Eggdrop 1.6.12 but has
3131+ since evolved into something much different at its core. TCL and loadable
3232+ modules are currently not supported.
3333+3434+ Maintainer's Notes:
3535+ Copy the binary out of the store before running it with the -C option to
3636+ configure it. See https://github.com/wraith/wraith/wiki/GettingStarted .
3737+3838+ The binary will not run when moved onto non-NixOS systems; use patchelf
3939+ to fix its runtime dependenices.
4040+ '';
4141+ homepage = http://wraith.botpack.net/;
4242+ license = licenses.gpl2Plus;
4343+ maintainers = with maintainers; [ elitak ];
4444+ platforms = platforms.linux;
4545+ };
4646+}