2016-02-18 07:07:23 +01:00
|
|
|
{ stdenv, fetchurl, ncurses, openssl, aspell, gnutls
|
|
|
|
, zlib, curl , pkgconfig, libgcrypt
|
2016-10-20 14:28:27 +02:00
|
|
|
, cmake, makeWrapper, libobjc, libresolv, libiconv
|
2016-10-14 23:30:38 +02:00
|
|
|
, asciidoctor # manpages
|
2016-02-18 07:07:23 +01:00
|
|
|
, guileSupport ? true, guile
|
|
|
|
, luaSupport ? true, lua5
|
|
|
|
, perlSupport ? true, perl
|
|
|
|
, pythonPackages
|
|
|
|
, rubySupport ? true, ruby
|
|
|
|
, tclSupport ? true, tcl
|
2015-02-28 02:34:18 +01:00
|
|
|
, extraBuildInputs ? [] }:
|
2010-08-05 17:47:15 +02:00
|
|
|
|
2016-02-18 07:07:23 +01:00
|
|
|
assert guileSupport -> guile != null;
|
|
|
|
assert luaSupport -> lua5 != null;
|
|
|
|
assert perlSupport -> perl != null;
|
|
|
|
assert rubySupport -> ruby != null;
|
|
|
|
assert tclSupport -> tcl != null;
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pythonPackages) python pycrypto pync;
|
|
|
|
in
|
|
|
|
|
2012-06-02 00:04:08 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2017-04-23 13:51:34 +02:00
|
|
|
version = "1.7.1";
|
2012-06-02 00:04:08 +02:00
|
|
|
name = "weechat-${version}";
|
2010-08-05 17:47:15 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-06-07 15:21:00 +02:00
|
|
|
url = "http://weechat.org/files/src/weechat-${version}.tar.bz2";
|
2017-04-23 13:51:34 +02:00
|
|
|
sha256 = "1020m1lsm8lg9n0dlxgp2wbn9b0r11g8r0namnzi2x6gvxn7iyf0";
|
2010-08-05 17:47:15 +02:00
|
|
|
};
|
|
|
|
|
2016-10-14 23:30:38 +02:00
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
cmakeFlags = with stdenv.lib; [
|
|
|
|
"-DENABLE_MAN=ON"
|
|
|
|
"-DENABLE_DOC=ON"
|
|
|
|
]
|
2016-09-07 01:59:16 +02:00
|
|
|
++ optionals stdenv.isDarwin ["-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib" "-DCMAKE_FIND_FRAMEWORK=LAST"]
|
2016-02-18 07:07:23 +01:00
|
|
|
++ optional (!guileSupport) "-DENABLE_GUILE=OFF"
|
|
|
|
++ optional (!luaSupport) "-DENABLE_LUA=OFF"
|
|
|
|
++ optional (!perlSupport) "-DENABLE_PERL=OFF"
|
|
|
|
++ optional (!rubySupport) "-DENABLE_RUBY=OFF"
|
|
|
|
++ optional (!tclSupport) "-DENABLE_TCL=OFF"
|
|
|
|
;
|
2015-08-21 23:02:39 +02:00
|
|
|
|
2016-02-18 07:07:23 +01:00
|
|
|
buildInputs = with stdenv.lib; [
|
|
|
|
ncurses python openssl aspell gnutls zlib curl pkgconfig
|
|
|
|
libgcrypt pycrypto makeWrapper
|
|
|
|
cmake
|
2016-10-14 23:30:38 +02:00
|
|
|
asciidoctor
|
|
|
|
]
|
2016-10-20 14:28:27 +02:00
|
|
|
++ optionals stdenv.isDarwin [ pync libobjc libresolv ]
|
2016-02-18 07:07:23 +01:00
|
|
|
++ optional guileSupport guile
|
|
|
|
++ optional luaSupport lua5
|
|
|
|
++ optional perlSupport perl
|
|
|
|
++ optional rubySupport ruby
|
|
|
|
++ optional tclSupport tcl
|
2015-02-28 02:34:18 +01:00
|
|
|
++ extraBuildInputs;
|
2010-08-05 17:47:15 +02:00
|
|
|
|
2016-10-03 19:22:08 +02:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix}"
|
|
|
|
# Fix '_res_9_init: undefined symbol' error
|
2016-10-20 14:28:27 +02:00
|
|
|
+ (stdenv.lib.optionalString stdenv.isDarwin "-DBIND_8_COMPAT=1 -lresolv");
|
2014-05-14 03:31:43 +02:00
|
|
|
|
2016-08-19 14:48:07 +02:00
|
|
|
postInstall = with stdenv.lib; ''
|
2014-05-14 06:46:39 +02:00
|
|
|
NIX_PYTHONPATH="$out/lib/${python.libPrefix}/site-packages"
|
2015-02-28 02:34:18 +01:00
|
|
|
wrapProgram "$out/bin/weechat" \
|
2016-08-19 14:48:07 +02:00
|
|
|
${optionalString perlSupport "--prefix PATH : ${perl}/bin"} \
|
|
|
|
--prefix PATH : ${pythonPackages.python}/bin \
|
2015-02-28 02:34:18 +01:00
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH" \
|
|
|
|
--prefix PYTHONPATH : "$NIX_PYTHONPATH"
|
2012-12-28 02:17:04 +01:00
|
|
|
'';
|
|
|
|
|
2010-08-05 17:47:15 +02:00
|
|
|
meta = {
|
2013-10-07 13:24:54 +02:00
|
|
|
homepage = http://www.weechat.org/;
|
2010-08-05 17:47:15 +02:00
|
|
|
description = "A fast, light and extensible chat client";
|
2012-06-02 00:04:08 +02:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2014-05-14 03:31:43 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ lovek323 garbas the-kenny ];
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2010-08-05 17:47:15 +02:00
|
|
|
};
|
|
|
|
}
|