Skip to content

Commit

Permalink
ibus-engines: use wrapPythonPrograms
Browse files Browse the repository at this point in the history
This is needed now that PYTHONPATH is not propagated. Also several packages
with additional dependencies are now properly wrapped.
  • Loading branch information
abbradar committed Mar 25, 2017
1 parent 99434ab commit 66b05cd
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 34 deletions.
9 changes: 5 additions & 4 deletions pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, intltool, pkgconfig
, anthy, ibus, glib, gobjectIntrospection, gtk3, python3, pygobject3
, anthy, ibus, glib, gobjectIntrospection, gtk3, python3
}:

stdenv.mkDerivation rec {
Expand All @@ -15,15 +15,16 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ gebner ericsagnes ];
};

configureFlags = "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t";
configureFlags = [ "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t" ];

buildInputs = [
anthy glib gobjectIntrospection gtk3 ibus python3 pygobject3
anthy glib gobjectIntrospection gtk3 ibus python3
];

nativeBuildInputs = [ intltool pkgconfig ];
nativeBuildInputs = [ intltool pkgconfig python3.pkgs.wrapPython ];

postFixup = ''
wrapPythonPrograms
substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out
'';

Expand Down
8 changes: 5 additions & 3 deletions pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, intltool, pkgconfig
, gtk3, ibus, libhangul, librsvg, python3, pygobject3
, gtk3, ibus, libhangul, librsvg, python3
}:

stdenv.mkDerivation rec {
Expand All @@ -11,9 +11,11 @@ stdenv.mkDerivation rec {
sha256 = "120p9w7za6hi521hz8q235fkl4i3p1qqr8nqm4a3kxr0pcq40bd2";
};

buildInputs = [ gtk3 ibus libhangul python3 pygobject3 ];
buildInputs = [ gtk3 ibus libhangul ];

nativeBuildInputs = [ intltool pkgconfig ];
nativeBuildInputs = [ intltool pkgconfig python3.pkgs.wrapPython ];

postFixup = "wrapPythonPrograms";

meta = with stdenv.lib; {
isIbusEngine = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, autoreconfHook
, intltool, pkgconfig, sqlite, libpinyin, db
, ibus, glib, gtk3, python3, pygobject3
, ibus, glib, gtk3, python3
}:

stdenv.mkDerivation rec {
Expand All @@ -15,12 +15,14 @@ stdenv.mkDerivation rec {
};

buildInputs = [ ibus glib sqlite libpinyin python3 gtk3 db ];
nativeBuildInputs = [ autoreconfHook intltool pkgconfig ];
nativeBuildInputs = [ autoreconfHook intltool pkgconfig python3.pkgs.wrapPython ];

postAutoreconf = ''
intltoolize
'';

postFixup = "wrapPythonPrograms";

meta = with stdenv.lib; {
isIbusEngine = true;
description = "IBus interface to the libpinyin input method";
Expand Down
8 changes: 5 additions & 3 deletions pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub
, autoreconfHook, pkgconfig
, ibus, m17n_lib, m17n_db, gettext, python3, pygobject3
, ibus, m17n_lib, m17n_db, gettext, python3
}:

stdenv.mkDerivation rec {
Expand All @@ -16,10 +16,12 @@ stdenv.mkDerivation rec {

buildInputs = [
ibus m17n_lib m17n_db gettext
python3 pygobject3
python3
];

nativeBuildInputs = [ autoreconfHook pkgconfig ];
nativeBuildInputs = [ autoreconfHook pkgconfig python3.pkgs.wrapPython ];

postFixup = "wrapPythonPrograms";

meta = with stdenv.lib; {
isIbusEngine = true;
Expand Down
8 changes: 4 additions & 4 deletions pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ clangStdenv, fetchFromGitHub, fetchsvn, gyp, which, ninja, python, pkgconfig, protobuf, ibus, gtk2, zinnia, qt4, libxcb, tegaki-zinnia-japanese }:
{ clangStdenv, fetchFromGitHub, fetchsvn, which, ninja, python2, pkgconfig, protobuf, ibus, gtk2, zinnia, qt4, libxcb, tegaki-zinnia-japanese }:

let
japanese_usage_dictionary = fetchsvn {
Expand All @@ -19,7 +19,7 @@ in clangStdenv.mkDerivation rec {
maintainers = with maintainers; [ gebner ericsagnes ];
};

nativeBuildInputs = [ gyp which ninja python pkgconfig ];
nativeBuildInputs = [ which ninja python2 python2.pkgs.gyp pkgconfig ];
buildInputs = [ protobuf ibus gtk2 zinnia qt4 libxcb ];

src = fetchFromGitHub {
Expand All @@ -36,8 +36,8 @@ in clangStdenv.mkDerivation rec {

configurePhase = ''
export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 ibus_mozc_path=$out/lib/ibus-mozc/ibus-engine-mozc"
python src/build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc \
python src/unix/fcitx/fcitx.gyp gyp --gypdir=${gyp}/bin
python src/build_mozc.py gyp --gypdir=${python2.pkgs.gyp}/bin --server_dir=$out/lib/mozc \
python src/unix/fcitx/fcitx.gyp gyp --gypdir=${python2.pkgs.gyp}/bin
'';

preBuildPhase = ''
Expand Down
8 changes: 5 additions & 3 deletions pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub
, autoreconfHook, docbook2x, pkgconfig
, gtk3, dconf, gobjectIntrospection
, ibus, python3, pygobject3 }:
, ibus, python3 }:

stdenv.mkDerivation rec {
name = "ibus-table-${version}";
Expand Down Expand Up @@ -29,16 +29,18 @@ stdenv.mkDerivation rec {
'';

buildInputs = [
dconf gtk3 gobjectIntrospection ibus python3 pygobject3
dconf gtk3 gobjectIntrospection ibus python3
];

nativeBuildInputs = [ autoreconfHook docbook2x pkgconfig ];
nativeBuildInputs = [ autoreconfHook docbook2x pkgconfig python3.pkgs.wrapPython ];

postUnpack = ''
substituteInPlace $sourceRoot/engine/Makefile.am \
--replace "docbook2man" "docbook2man --sgml"
'';

postFixup = "wrapPythonPrograms";

meta = with stdenv.lib; {
isIbusEngine = true;
description = "An IBus framework for table-based input methods";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ stdenv.mkDerivation rec {

propagatedBuildInputs = with python3Packages; [ pyxdg python-Levenshtein ];

nativeBuildInputs = [ python3Packages.wrapPython ];

postFixup = ''
buildPythonPath $out
patchPythonScript $out/share/ibus-uniemoji/uniemoji.py
'';

makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc"
"PYTHON=${python3Packages.python.interpreter}"
];
Expand Down
19 changes: 4 additions & 15 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1272,30 +1272,19 @@ with pkgs;
ibus-qt = callPackage ../tools/inputmethods/ibus/ibus-qt.nix { };

ibus-engines = recurseIntoAttrs {
anthy = callPackage ../tools/inputmethods/ibus-engines/ibus-anthy { };

anthy = callPackage ../tools/inputmethods/ibus-engines/ibus-anthy {
inherit (python3Packages) pygobject3;
};

hangul = callPackage ../tools/inputmethods/ibus-engines/ibus-hangul {
inherit (python3Packages) pygobject3;
};
hangul = callPackage ../tools/inputmethods/ibus-engines/ibus-hangul { };

libpinyin = callPackage ../tools/inputmethods/ibus-engines/ibus-libpinyin {
inherit (python3Packages) pygobject3;
};
libpinyin = callPackage ../tools/inputmethods/ibus-engines/ibus-libpinyin { };

m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n {
inherit (python3Packages) pygobject3;
};
m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { };

mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc {
inherit (pythonPackages) gyp;
protobuf = protobuf.override { stdenv = clangStdenv; };
};

table = callPackage ../tools/inputmethods/ibus-engines/ibus-table {
inherit (python3Packages) pygobject3;
inherit (gnome3) dconf;
};

Expand Down

0 comments on commit 66b05cd

Please sign in to comment.