Skip to content

Instantly share code, notes, and snippets.

@laMudri
Created May 19, 2019 11:28
Show Gist options
  • Save laMudri/4712bfe20985c0f3636e21f35911ad2e to your computer and use it in GitHub Desktop.
Save laMudri/4712bfe20985c0f3636e21f35911ad2e to your computer and use it in GitHub Desktop.
{ stdenv, fetchFromGitHub
, autoreconfHook, docbook2x, pkgconfig
, gtk3, dconf, gobject-introspection
, ibus, python3, wrapGAppsHook }:
stdenv.mkDerivation rec {
name = "ibus-table-${version}";
version = "1.9.21";
src = fetchFromGitHub {
owner = "kaio";
repo = "ibus-table";
rev = version;
sha256 = "1rswbhbfvir443mw3p7xw6calkpfss4fcgn8nhfnrbin49q6w1vm";
};
postPatch = ''
# Data paths will be set at run-time.
sed -e "/export IBUS_TABLE_LIB_LOCATION=/ s/^.*$//" \
-e "/export IBUS_TABLE_LOCATION=/ s/^.*$//" \
-i "engine/ibus-engine-table.in"
sed -e "/export IBUS_TABLE_BIN_PATH=/ s/^.*$//" \
-e "/export IBUS_TABLE_DATA_DIR=/ s/^.*$//" \
-i "engine/ibus-table-createdb.in"
sed -e "/export IBUS_PREFIX=/ s/^.*$//" \
-e "/export IBUS_DATAROOTDIR=/ s/^.$//" \
-e "/export IBUS_LOCALEDIR=/ s/^.$//" \
-i "setup/ibus-setup-table.in"
'';
buildInputs = [
dconf gtk3 gobject-introspection ibus (python3.withPackages (pypkgs: with pypkgs; [ pygobject3 ]))
];
nativeBuildInputs = [
autoreconfHook
docbook2x
pkgconfig
python3.pkgs.wrapPython
wrapGAppsHook
];
postUnpack = ''
substituteInPlace $sourceRoot/engine/Makefile.am \
--replace "docbook2man" "docbook2man --sgml"
'';
postFixup = ''
wrapPythonPrograms
sed -e 's/LookupTable/LookupTable.new/' \
-i "$out/share/ibus-table/engine/table.py"
'';
meta = with stdenv.lib; {
isIbusEngine = true;
description = "An IBus framework for table-based input methods";
homepage = https://github.com/kaio/ibus-table/wiki;
license = licenses.lgpl21;
platforms = platforms.linux;
maintainers = with maintainers; [ mudri ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment