nixpkgs/pkgs/applications/networking/irc/hexchat/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

51 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchpatch, pkgconfig, gtk2, lua, perl, python3
, pciutils, dbus-glib, libcanberra-gtk2, libproxy
, enchant2, libnotify, openssl, isocodes
, desktop-file-utils
, meson, ninja
}:
stdenv.mkDerivation rec {
pname = "hexchat";
version = "2.14.3";
src = fetchFromGitHub {
owner = "hexchat";
repo = "hexchat";
rev = "v${version}";
sha256 = "08kvp0dcn3bvmlqcfp9312075bwkqkpa8m7zybr88pfp210gfl85";
};
nativeBuildInputs = [ meson ninja pkgconfig ];
buildInputs = [
gtk2 lua perl python3 pciutils dbus-glib libcanberra-gtk2 libproxy
libnotify openssl desktop-file-utils
isocodes
];
#hexchat and hexchat-text loads enchant spell checking library at run time and so it needs to have route to the path
postPatch = ''
sed -i "s,libenchant-2.so.2,${enchant2}/lib/libenchant-2.so.2,g" src/fe-gtk/sexy-spell-entry.c
sed -i "/flag.startswith('-I')/i if flag.contains('no-such-path')\ncontinue\nendif" plugins/perl/meson.build
chmod +x meson_post_install.py
for f in meson_post_install.py \
src/common/make-te.py \
plugins/perl/generate_header.py \
po/validate-textevent-translations
do
patchShebangs $f
done
'';
mesonFlags = [ "-Dwith-lua=lua" "-Dwith-text=true" ];
meta = with lib; {
description = "A popular and easy to use graphical IRC (chat) client";
homepage = "https://hexchat.github.io/";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ romildo ];
};
}