3
0
Fork 0
forked from mirrors/nixpkgs

weechat-xmpp: create proper runtime environment

The `weechat-xmpp` plugin requires `pydns` to properly resolve the
XMPP host. Furthermore it's much easier to use substituteAll rather than
messing around with substituteInPlace in a patched file.
This commit is contained in:
Maximilian Bosch 2018-08-08 17:55:43 +02:00
parent eb0207f132
commit 09e58bc4e7
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
3 changed files with 12 additions and 11 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, xmpppy }:
{ stdenv, fetchFromGitHub, xmpppy, pydns, substituteAll, buildEnv }:
stdenv.mkDerivation {
name = "weechat-jabber-2017-08-30";
@ -15,15 +15,14 @@ stdenv.mkDerivation {
cp jabber.py $out/share/jabber.py
'';
buildInputs = [ xmpppy ];
postPatch = ''
substituteInPlace jabber.py \
--replace "__NIX_OUTPUT__" "${xmpppy}/lib/python2.7/site-packages"
'';
patches = [
./libpath.patch
(substituteAll {
src = ./libpath.patch;
env = "${buildEnv {
name = "weechat-xmpp-env";
paths = [ pydns xmpppy ];
}}/lib/python2.7/site-packages";
})
];
meta = with stdenv.lib; {

View file

@ -8,7 +8,7 @@ index 27006a3..e53c2c0 100644
+import sys
+
+sys.path.append('__NIX_OUTPUT__')
+sys.path.append('@env@')
+
+
import_ok = True

View file

@ -18982,7 +18982,9 @@ with pkgs;
inherit (luaPackages) cjson;
};
weechat-xmpp = callPackage ../applications/networking/instant-messengers/weechat-xmpp {};
weechat-xmpp = callPackage ../applications/networking/instant-messengers/weechat-xmpp {
inherit (pythonPackages) pydns;
};
westonLite = weston.override {
pango = null;