From 8fe327a4322baa8279f09eb3a87ffd92dbdc8a18 Mon Sep 17 00:00:00 2001 From: Eric Litak Date: Fri, 8 Apr 2016 14:10:57 -0700 Subject: [PATCH] wraith: init at 1.4.6 --- .../networking/irc/wraith/default.nix | 46 ++++++++++++++++++ .../networking/irc/wraith/dlopen.patch | 48 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 96 insertions(+) create mode 100644 pkgs/applications/networking/irc/wraith/default.nix create mode 100644 pkgs/applications/networking/irc/wraith/dlopen.patch diff --git a/pkgs/applications/networking/irc/wraith/default.nix b/pkgs/applications/networking/irc/wraith/default.nix new file mode 100644 index 00000000000..f36bbc00064 --- /dev/null +++ b/pkgs/applications/networking/irc/wraith/default.nix @@ -0,0 +1,46 @@ +{ stdenv, fetchurl, openssl }: + +with stdenv; +with stdenv.lib; + +mkDerivation rec { + name = "wraith-${version}"; + version = "1.4.6"; + src = fetchurl { + url = "mirror://sourceforge/wraithbotpack/wraith-v${version}.tar.gz"; + sha256 = "0vb2hbjmwh040f5yhxvwcfxvgxa0q9zdy9vvddydn8zn782d7wl8"; + }; + buildInputs = [ openssl ]; + patches = [ ./dlopen.patch ]; + postPatch = '' + substituteInPlace src/libssl.cc --subst-var-by openssl ${openssl} + substituteInPlace src/libcrypto.cc --subst-var-by openssl ${openssl} + ''; + configureFlags = "--with-openssl=${openssl}"; + installPhase = '' + mkdir -p $out/bin + cp -a wraith $out/bin/wraith + ln -s wraith $out/bin/hub + ''; + + meta = { + description = "An IRC channel management bot written purely in C/C++"; + longDescription = '' + Wraith is an IRC channel management bot written purely in C/C++. It has + been in development since late 2003. It is based on Eggdrop 1.6.12 but has + since evolved into something much different at its core. TCL and loadable + modules are currently not supported. + + Maintainer's Notes: + Copy the binary out of the store before running it with the -C option to + configure it. See https://github.com/wraith/wraith/wiki/GettingStarted . + + The binary will not run when moved onto non-NixOS systems; use patchelf + to fix its runtime dependenices. + ''; + homepage = http://wraith.botpack.net/; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ elitak ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/networking/irc/wraith/dlopen.patch b/pkgs/applications/networking/irc/wraith/dlopen.patch new file mode 100644 index 00000000000..bfc854ef9e9 --- /dev/null +++ b/pkgs/applications/networking/irc/wraith/dlopen.patch @@ -0,0 +1,48 @@ +diff --git a/src/libcrypto.cc b/src/libcrypto.cc +index 0339258..68746c8 100644 +--- a/src/libcrypto.cc ++++ b/src/libcrypto.cc +@@ -95,17 +95,9 @@ int load_libcrypto() { + } + + sdprintf("Loading libcrypto"); ++ dlerror(); // Clear Errors ++ libcrypto_handle = dlopen("@openssl@/lib/libcrypto.so", RTLD_LAZY|RTLD_GLOBAL); + +- bd::Array libs_list(bd::String("libcrypto.so." SHLIB_VERSION_NUMBER " libcrypto.so libcrypto.so.0.9.8 libcrypto.so.7 libcrypto.so.6").split(' ')); +- +- for (size_t i = 0; i < libs_list.length(); ++i) { +- dlerror(); // Clear Errors +- libcrypto_handle = dlopen(bd::String(libs_list[i]).c_str(), RTLD_LAZY|RTLD_GLOBAL); +- if (libcrypto_handle) { +- sdprintf("Found libcrypto: %s", bd::String(libs_list[i]).c_str()); +- break; +- } +- } + if (!libcrypto_handle) { + fprintf(stderr, STR("Unable to find libcrypto\n")); + return(1); +diff --git a/src/libssl.cc b/src/libssl.cc +index b432c7b..8940998 100644 +--- a/src/libssl.cc ++++ b/src/libssl.cc +@@ -68,17 +68,9 @@ int load_libssl() { + } + + sdprintf("Loading libssl"); ++ dlerror(); // Clear Errors ++ libssl_handle = dlopen("@openssl@/lib/libssl.so", RTLD_LAZY); + +- bd::Array libs_list(bd::String("libssl.so." SHLIB_VERSION_NUMBER " libssl.so libssl.so.0.9.8 libssl.so.7 libssl.so.6").split(' ')); +- +- for (size_t i = 0; i < libs_list.length(); ++i) { +- dlerror(); // Clear Errors +- libssl_handle = dlopen(bd::String(libs_list[i]).c_str(), RTLD_LAZY); +- if (libssl_handle) { +- sdprintf("Found libssl: %s", bd::String(libs_list[i]).c_str()); +- break; +- } +- } + if (!libssl_handle) { + fprintf(stderr, STR("Unable to find libssl\n")); + return(1); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4e4bc839d08..022c47a90e4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16392,6 +16392,8 @@ in wmutils-core = callPackage ../tools/X11/wmutils-core { }; + wraith = callPackage ../applications/networking/irc/wraith { }; + wxmupen64plus = callPackage ../misc/emulators/wxmupen64plus { }; x2x = callPackage ../tools/X11/x2x { };