2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl, lib
|
2019-12-16 15:32:41 +00:00
|
|
|
, ncurses, openssl, aspell, gnutls, gettext
|
2017-11-03 10:25:22 +00:00
|
|
|
, zlib, curl, pkgconfig, libgcrypt
|
2016-10-20 13:28:27 +01:00
|
|
|
, cmake, makeWrapper, libobjc, libresolv, libiconv
|
2016-10-14 22:30:38 +01:00
|
|
|
, asciidoctor # manpages
|
2016-02-18 06:07:23 +00:00
|
|
|
, guileSupport ? true, guile
|
|
|
|
, luaSupport ? true, lua5
|
2019-06-16 20:59:06 +01:00
|
|
|
, perlSupport ? true, perl
|
2019-09-04 17:13:50 +01:00
|
|
|
, pythonSupport ? true, python3Packages
|
2016-02-18 06:07:23 +00:00
|
|
|
, rubySupport ? true, ruby
|
|
|
|
, tclSupport ? true, tcl
|
2017-11-03 10:25:22 +00:00
|
|
|
, extraBuildInputs ? []
|
2018-09-05 16:01:45 +01:00
|
|
|
}:
|
2016-02-18 06:07:23 +00:00
|
|
|
|
|
|
|
let
|
2019-09-04 17:13:50 +01:00
|
|
|
inherit (python3Packages) python;
|
2017-11-03 10:25:22 +00:00
|
|
|
plugins = [
|
|
|
|
{ name = "perl"; enabled = perlSupport; cmakeFlag = "ENABLE_PERL"; buildInputs = [ perl ]; }
|
|
|
|
{ name = "tcl"; enabled = tclSupport; cmakeFlag = "ENABLE_TCL"; buildInputs = [ tcl ]; }
|
|
|
|
{ name = "ruby"; enabled = rubySupport; cmakeFlag = "ENABLE_RUBY"; buildInputs = [ ruby ]; }
|
|
|
|
{ name = "guile"; enabled = guileSupport; cmakeFlag = "ENABLE_GUILE"; buildInputs = [ guile ]; }
|
|
|
|
{ name = "lua"; enabled = luaSupport; cmakeFlag = "ENABLE_LUA"; buildInputs = [ lua5 ]; }
|
2019-09-04 17:13:50 +01:00
|
|
|
{ name = "python"; enabled = pythonSupport; cmakeFlag = "ENABLE_PYTHON3"; buildInputs = [ python ]; }
|
2017-11-03 10:25:22 +00:00
|
|
|
];
|
|
|
|
enabledPlugins = builtins.filter (p: p.enabled) plugins;
|
2016-02-18 06:07:23 +00:00
|
|
|
|
weechat: seperate weechat-unwrapped from wrapper
If I have a patch I want to apply to weechat, I can't do that with
overrideAttrs like I can with almost every other package, because that
only applies to the wrapper derivation. For other wrapped packages, one
can usually call the wrapper with any version of the derivation, but the
weechat derivation didn't expose a wrapper creation function.
Taking inspiration from other packages, particularly Firefox, I
extracted the wrapper into its own function, made the default weechat
derivation use that, and added weechat-unwrapped.
Now I can add my custom patch like this:
(wrapWeechat
(weechat-unwrapped.overrideAttrs (oldAttrs: {
patches = [
(fetchpatch {
url = "https://github.com/weechat/weechat/commit/55767f5f116db3cb56cf85f52aa80feff45b6abf.patch?full_index=1";
sha256 = "1pkcdsby57diqds1y5hhl0fr4i8j0zax32jb0gqd36siki3lza3d";
})
];
}))
{ configure =
{ availablePlugins, ... }:
{
plugins = with availablePlugins; [
(python.withPackages (packages: with packages; [ potr websocket_client ]))
];
};
})
There is a small backward incompatibility here: previously, it was
possible to get an unwrapped weechat like this:
weechat.override { configure = null; }
This didn't seem too important to keep around since it was also possible
to get an unwrapped weechat in a much more obvious way:
weechat.unwrapped
I could probably make it so that the first way still worked, if that
behavior turns out to really have been important.
2018-07-25 17:36:41 +01:00
|
|
|
in
|
2017-11-03 10:25:22 +00:00
|
|
|
assert lib.all (p: p.enabled -> ! (builtins.elem null p.buildInputs)) plugins;
|
|
|
|
stdenv.mkDerivation rec {
|
2020-03-29 15:04:28 +01:00
|
|
|
version = "2.8";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "weechat";
|
2010-08-05 16:47:15 +01:00
|
|
|
|
2017-11-03 10:25:22 +00:00
|
|
|
src = fetchurl {
|
2018-10-25 12:42:48 +01:00
|
|
|
url = "https://weechat.org/files/src/weechat-${version}.tar.bz2";
|
2020-03-29 15:04:28 +01:00
|
|
|
sha256 = "0xpzl7985j47rpmly4r833jxd448xpy7chqphaxmhlql2c0gc08z";
|
2017-11-03 10:25:22 +00:00
|
|
|
};
|
2010-08-05 16:47:15 +01:00
|
|
|
|
2017-11-03 10:25:22 +00:00
|
|
|
outputs = [ "out" "man" ] ++ map (p: p.name) enabledPlugins;
|
2015-08-21 22:02:39 +01:00
|
|
|
|
2017-11-03 10:25:22 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
cmakeFlags = with stdenv.lib; [
|
|
|
|
"-DENABLE_MAN=ON"
|
|
|
|
"-DENABLE_DOC=ON"
|
weechat: 2.6 -> 2.7
Disables support for Javascript and PHP:
- Javascript requires an old version of v8
- PHP requires a larger number of dependencies in addition to php-embed
Changelog [1]:
New features
- core: add option weechat.look.nick_color_hash_salt to shuffle nick colors (issue #635)
- core: add different icons sizes (16x16 to 512x512) (issue #1347)
- core: add file weechat.desktop
- core: add reverse of string for screen in evaluation of expressions with "revscr:"
- core: add length of string (number of chars and on screen) in evaluation of expressions with "length:xxx" and "lengthscr:xxx"
- core: add calculation of expression in evaluation of expressions with "calc:xxx" (issue #997)
- core: add optional default path (evaluated) in completion "filename"
- core: add support of modifiers in evaluation of expressions with "modifier:name,data,string"
- api: add modifier "color_encode_ansi" (issue #528)
- api: add modifier "eval_path_home"
- irc: add filters on raw buffer (issue #1000)
- irc: add option irc.look.display_pv_warning_address to display a warning in private buffer if the remote nick address has changed (issue #892)
- irc: add server option "ssl_password" (issue #115, issue #1416)
- irc: add "user" in output of irc_message_parse (issue #136)
- irc: add options irc.color.message_kick and irc.color.reason_kick (issue #683, issue #684)
- logger: add option logger.file.color_lines (issue #528, issue #621)
- script: add options "-ol" and "-il" in command "/script list" to send translated string with list of scripts loaded, display "No scripts loaded" if no scripts are loaded
- xfer: add option xfer.file.download_temporary_suffix with default value ".part" (issue #1237)
Bug fixes
- core: set buffer name, short name and title only if the value has changed
- core: fix scrolling up in bare mode when switched to bare mode at the top of the buffer (issue #899, issue #978)
- core: optimize load of configuration files
- core: fix window separators not respecting window splits (issue #630)
- core: fix cursor mode info when prefix_align is none and with words split across lines (issue #610, issue #617, issue #619)
- core: add support of reverse video in ANSI color codes
- core: fixed segfault during excessive evaluation in function string_repeat (issue #1400)
- buflist: fix extra spaces between buffers when conditions are used to hide buffers (regression introduced in version 2.6) (issue #1403)
- irc: do not automatically open a channel with name "0" (issue #1429)
- irc: remove option irc.network.channel_encode, add server option "charset_message" to control which part of the IRC message is decoded/encoded to the target charset (issue #832)
- irc: use path from option xfer.file.upload_path to complete filename in command "/dcc send" (issue #60)
- logger: fix write in log file if it has been deleted or renamed (issue #123)
- python: send "bytes" instead of "str" to callbacks in Python 3 when the string is not UTF-8 valid (issue #1389)
- relay: send message "_buffer_title_changed" to clients only when the title is changed
- xfer: fix memory leak when a xfer is freed and when the plugin is unloaded
Tests
- unit: add tests on GUI color functions
Build
- core: fix build on Haiku (issue #1420)
- core: fix build on Alpine
- core: remove file FindTCL.cmake
- core: display an error on missing dependency in CMake (issue #916, issue #956)
- debian: disable Javascript plugin on Debian Sid and Ubuntu Eoan
- debian: build with Guile 2.2
- guile: add support of Guile 2.2, disable /guile eval (issue #1098)
- python: add detection of Python 3.8
[1] https://weechat.org/files/changelog/ChangeLog-2.7.html
2019-12-08 22:16:35 +00:00
|
|
|
"-DENABLE_JAVASCRIPT=OFF" # Requires v8 <= 3.24.3, https://github.com/weechat/weechat/issues/360
|
|
|
|
"-DENABLE_PHP=OFF"
|
2016-10-14 22:30:38 +01:00
|
|
|
]
|
2017-11-03 10:25:22 +00:00
|
|
|
++ optionals stdenv.isDarwin ["-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib" "-DCMAKE_FIND_FRAMEWORK=LAST"]
|
|
|
|
++ map (p: "-D${p.cmakeFlag}=" + (if p.enabled then "ON" else "OFF")) plugins
|
|
|
|
;
|
|
|
|
|
|
|
|
buildInputs = with stdenv.lib; [
|
2019-12-16 15:32:41 +00:00
|
|
|
ncurses openssl aspell gnutls gettext zlib curl pkgconfig
|
2017-11-03 10:25:22 +00:00
|
|
|
libgcrypt makeWrapper cmake asciidoctor
|
|
|
|
]
|
|
|
|
++ optionals stdenv.isDarwin [ libobjc libresolv ]
|
|
|
|
++ concatMap (p: p.buildInputs) enabledPlugins
|
|
|
|
++ extraBuildInputs;
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix}"
|
|
|
|
# Fix '_res_9_init: undefined symbol' error
|
|
|
|
+ (stdenv.lib.optionalString stdenv.isDarwin "-DBIND_8_COMPAT=1 -lresolv");
|
|
|
|
|
|
|
|
postInstall = with stdenv.lib; ''
|
|
|
|
for p in ${concatMapStringsSep " " (p: p.name) enabledPlugins}; do
|
|
|
|
from=$out/lib/weechat/plugins/$p.so
|
|
|
|
to=''${!p}/lib/weechat/plugins/$p.so
|
|
|
|
mkdir -p $(dirname $to)
|
|
|
|
mv $from $to
|
|
|
|
done
|
|
|
|
'';
|
2010-08-05 16:47:15 +01:00
|
|
|
|
2017-11-03 10:25:22 +00:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.weechat.org/";
|
2017-11-03 10:25:22 +00:00
|
|
|
description = "A fast, light and extensible chat client";
|
2018-04-04 13:42:06 +01:00
|
|
|
longDescription = ''
|
|
|
|
You can find more documentation as to how to customize this package
|
|
|
|
(eg. adding python modules for scripts that would require them, etc.)
|
|
|
|
on https://nixos.org/nixpkgs/manual/#sec-weechat .
|
|
|
|
'';
|
2017-11-03 10:25:22 +00:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2020-05-09 10:25:07 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ lovek323 lheckemann ma27 ];
|
2017-11-03 10:25:22 +00:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
weechat: seperate weechat-unwrapped from wrapper
If I have a patch I want to apply to weechat, I can't do that with
overrideAttrs like I can with almost every other package, because that
only applies to the wrapper derivation. For other wrapped packages, one
can usually call the wrapper with any version of the derivation, but the
weechat derivation didn't expose a wrapper creation function.
Taking inspiration from other packages, particularly Firefox, I
extracted the wrapper into its own function, made the default weechat
derivation use that, and added weechat-unwrapped.
Now I can add my custom patch like this:
(wrapWeechat
(weechat-unwrapped.overrideAttrs (oldAttrs: {
patches = [
(fetchpatch {
url = "https://github.com/weechat/weechat/commit/55767f5f116db3cb56cf85f52aa80feff45b6abf.patch?full_index=1";
sha256 = "1pkcdsby57diqds1y5hhl0fr4i8j0zax32jb0gqd36siki3lza3d";
})
];
}))
{ configure =
{ availablePlugins, ... }:
{
plugins = with availablePlugins; [
(python.withPackages (packages: with packages; [ potr websocket_client ]))
];
};
})
There is a small backward incompatibility here: previously, it was
possible to get an unwrapped weechat like this:
weechat.override { configure = null; }
This didn't seem too important to keep around since it was also possible
to get an unwrapped weechat in a much more obvious way:
weechat.unwrapped
I could probably make it so that the first way still worked, if that
behavior turns out to really have been important.
2018-07-25 17:36:41 +01:00
|
|
|
}
|