···1+{ stdenv, fetchurl, openssl }:
2+3+with stdenv;
4+with stdenv.lib;
5+6+mkDerivation rec {
7+ name = "wraith-${version}";
8+ version = "1.4.6";
9+ src = fetchurl {
10+ url = "mirror://sourceforge/wraithbotpack/wraith-v${version}.tar.gz";
11+ sha256 = "0vb2hbjmwh040f5yhxvwcfxvgxa0q9zdy9vvddydn8zn782d7wl8";
12+ };
13+ buildInputs = [ openssl ];
14+ patches = [ ./dlopen.patch ];
15+ postPatch = ''
16+ substituteInPlace src/libssl.cc --subst-var-by openssl ${openssl}
17+ substituteInPlace src/libcrypto.cc --subst-var-by openssl ${openssl}
18+ '';
19+ configureFlags = "--with-openssl=${openssl}";
20+ installPhase = ''
21+ mkdir -p $out/bin
22+ cp -a wraith $out/bin/wraith
23+ ln -s wraith $out/bin/hub
24+ '';
25+26+ meta = {
27+ description = "An IRC channel management bot written purely in C/C++";
28+ longDescription = ''
29+ Wraith is an IRC channel management bot written purely in C/C++. It has
30+ been in development since late 2003. It is based on Eggdrop 1.6.12 but has
31+ since evolved into something much different at its core. TCL and loadable
32+ modules are currently not supported.
33+34+ Maintainer's Notes:
35+ Copy the binary out of the store before running it with the -C option to
36+ configure it. See https://github.com/wraith/wraith/wiki/GettingStarted .
37+38+ The binary will not run when moved onto non-NixOS systems; use patchelf
39+ to fix its runtime dependenices.
40+ '';
41+ homepage = http://wraith.botpack.net/;
42+ license = licenses.gpl2Plus;
43+ maintainers = with maintainers; [ elitak ];
44+ platforms = platforms.linux;
45+ };
46+}