ibus-engines.uniemoji: modernize

* Rely on patchShebangsHook instead of wrapPython
* Format the expression
This commit is contained in:
Jan Tojnar 2019-10-27 16:07:33 +01:00
parent 6bc71fb30e
commit ed4ed5869a
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 54 additions and 16 deletions

@ -0,0 +1,13 @@
diff --git a/uniemoji.xml.in b/uniemoji.xml.in
index 5fbfd0f..6fb8ad3 100644
--- a/uniemoji.xml.in
+++ b/uniemoji.xml.in
@@ -7,7 +7,7 @@
<license>GPL</license>
<author>Lalo Martins &lt;lalo.martins@gmail.com&gt;</author>
<homepage>https://github.com/salty-horse/ibus-uniemoji</homepage>
- <exec>@PYTHON@ @DATADIR@/ibus-uniemoji/uniemoji.py --ibus</exec>
+ <exec>@DATADIR@/ibus-uniemoji/uniemoji.py --ibus</exec>
<textdomain>uniemoji</textdomain>
<engines>
<engine>

@ -1,8 +1,19 @@
{ stdenv, fetchFromGitHub
, python3Packages
{ stdenv
, fetchFromGitHub
, gobject-introspection
, wrapGAppsHook
, python3
, ibus
}:
stdenv.mkDerivation rec {
let
python = python3.withPackages (ps: with ps; [
pygobject3
(toPythonModule ibus)
pyxdg
python-Levenshtein
]);
in stdenv.mkDerivation rec {
pname = "ibus-uniemoji";
version = "0.6.0";
@ -13,25 +24,39 @@ stdenv.mkDerivation rec {
sha256 = "121zh3q0li1k537fcvbd4ns4jgl9bbb9gm9ihy8cfxgirv38lcfa";
};
propagatedBuildInputs = with python3Packages; [ pyxdg python-Levenshtein pygobject3 ];
patches = [
# Do not run wrapper script with Python,
# the wrapped script will have Python in shebang anyway.
./allow-wrapping.patch
];
nativeBuildInputs = [ python3Packages.wrapPython ];
nativeBuildInputs = [
wrapGAppsHook
gobject-introspection
];
buildInputs = [
python
ibus
];
makeFlags = [
"PREFIX=${placeholder ''out''}"
"SYSCONFDIR=${placeholder ''out''}/etc"
"PYTHON=${python.interpreter}"
];
postFixup = ''
buildPythonPath $out
patchPythonScript $out/share/ibus-uniemoji/uniemoji.py
wrapGApp $out/share/ibus-uniemoji/uniemoji.py
'';
makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc"
"PYTHON=${python3Packages.python.interpreter}"
];
meta = with stdenv.lib; {
isIbusEngine = true;
description = "Input method (ibus) for entering unicode symbols and emoji by name";
homepage = "https://github.com/salty-horse/ibus-uniemoji";
license = with licenses; [ gpl3 mit ];
platforms = platforms.linux;
maintainers = with maintainers; [ aske ];
description = "Input method (ibus) for entering unicode symbols and emoji by name";
homepage = "https://github.com/salty-horse/ibus-uniemoji";
license = with licenses; [ gpl3 mit ];
platforms = platforms.linux;
maintainers = with maintainers; [ aske ];
};
}