uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
11
pkgs/tools/inputmethods/fcitx/default.nix
Normal file
11
pkgs/tools/inputmethods/fcitx/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ callPackage, plugins ? [] }:
|
||||
|
||||
let
|
||||
unwrapped = callPackage ./unwrapped.nix { };
|
||||
wrapped = callPackage ./wrapper.nix {
|
||||
plugins = plugins;
|
||||
fcitx = unwrapped;
|
||||
};
|
||||
in if plugins == []
|
||||
then unwrapped
|
||||
else wrapped
|
||||
34
pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix
Normal file
34
pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, stdenv, fetchurl, makeWrapper, pkg-config, cmake, fcitx, gtk3, isocodes, gnome }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fcitx-configtool";
|
||||
version = "0.4.10";
|
||||
|
||||
meta = with lib; {
|
||||
description = "GTK-based config tool for Fcitx";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ cdepillabout ];
|
||||
};
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.fcitx-im.org/fcitx-configtool/fcitx-configtool-${version}.tar.xz";
|
||||
sha256 = "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
|
||||
buildInputs = [ fcitx isocodes gtk3 gnome.adwaita-icon-theme ];
|
||||
|
||||
# Patch paths to `fcitx-remote`
|
||||
prePatch = ''
|
||||
for f in gtk{3,}/config_widget.c; do
|
||||
substituteInPlace $f \
|
||||
--replace 'EXEC_PREFIX "/bin/fcitx-remote"' '"${fcitx}/bin/fcitx-remote"'
|
||||
done
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
wrapProgram $out/bin/fcitx-config-gtk3 \
|
||||
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS";
|
||||
'';
|
||||
}
|
||||
38
pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix
Normal file
38
pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, mkDerivation, fetchFromGitLab
|
||||
, cmake
|
||||
, extra-cmake-modules
|
||||
, fcitx
|
||||
, pkg-config
|
||||
, qtbase
|
||||
}:
|
||||
|
||||
mkDerivation rec {
|
||||
pname = "fcitx-qt5";
|
||||
version = "1.2.3";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "fcitx";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "0860v3rxsh054wkkbawvyin5mk0flp4cwfcpmcpq147lvdm5lq2i";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake extra-cmake-modules pkg-config ];
|
||||
|
||||
buildInputs = [ fcitx qtbase ];
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace platforminputcontext/CMakeLists.txt \
|
||||
--replace \$"{CMAKE_INSTALL_QTPLUGINDIR}" $out/${qtbase.qtPluginPrefix}
|
||||
substituteInPlace quickphrase-editor/CMakeLists.txt \
|
||||
--replace \$"{FCITX4_ADDON_INSTALL_DIR}" $out/lib/fcitx
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://gitlab.com/fcitx/fcitx-qt5";
|
||||
description = "Qt5 IM Module for Fcitx";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ ericsagnes ];
|
||||
};
|
||||
}
|
||||
42
pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch
Normal file
42
pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
diff --git a/cmake/FindEnchant.cmake b/cmake/FindEnchant.cmake
|
||||
index 7c182e6a..5537595e 100644
|
||||
--- a/cmake/FindEnchant.cmake
|
||||
+++ b/cmake/FindEnchant.cmake
|
||||
@@ -16,7 +16,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
|
||||
endif(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
|
||||
|
||||
find_package(PkgConfig)
|
||||
-pkg_check_modules(PC_ENCHANT enchant)
|
||||
+pkg_check_modules(PC_ENCHANT enchant-2)
|
||||
|
||||
find_path(ENCHANT_INCLUDE_DIR
|
||||
NAMES enchant.h
|
||||
@@ -24,7 +24,7 @@ find_path(ENCHANT_INCLUDE_DIR
|
||||
PATH_SUFFIXES "enchant")
|
||||
|
||||
find_library(ENCHANT_LIBRARIES
|
||||
- NAMES enchant
|
||||
+ NAMES enchant-2
|
||||
HINTS ${PC_ENCHANT_LIBRARY_DIRS})
|
||||
|
||||
if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
|
||||
@@ -39,7 +39,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
- #include <enchant/enchant.h>
|
||||
+ #include <enchant-2/enchant.h>
|
||||
|
||||
EnchantBroker *enchant_broker_init();
|
||||
char **enchant_dict_suggest(EnchantDict *dict, const char *str,
|
||||
@@ -78,6 +78,10 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
|
||||
endif()
|
||||
|
||||
+if(ENCHANT_API_COMPATIBLE)
|
||||
+ set(ENCHANT_LIBRARY_FILENAME ${ENCHANT_LIBRARIES})
|
||||
+endif(ENCHANT_API_COMPATIBLE)
|
||||
+
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Enchant DEFAULT_MSG ENCHANT_LIBRARIES
|
||||
ENCHANT_INCLUDE_DIR ENCHANT_API_COMPATIBLE)
|
||||
105
pkgs/tools/inputmethods/fcitx/unwrapped.nix
Normal file
105
pkgs/tools/inputmethods/fcitx/unwrapped.nix
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{ lib, stdenv, fetchurl, pkg-config, cmake, intltool, gettext
|
||||
, libxml2, enchant2, isocodes, icu, libpthreadstubs
|
||||
, pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon
|
||||
, dbus, gtk2, gtk3, qt4, extra-cmake-modules
|
||||
, xkeyboard_config, pcre, libuuid, xorg, makeWrapper
|
||||
, withPinyin ? true
|
||||
, fetchFromGitLab
|
||||
}:
|
||||
|
||||
let
|
||||
# releases at http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz
|
||||
# contains all data but if we want to compile from source, we need to
|
||||
# fetch them ourselves
|
||||
# to update the urls and where to unpack these, look into the
|
||||
# src/module/*/data/CMakeLists.txt files
|
||||
# fcitx_download tgt_name url output)
|
||||
dicts = let SPELL_EN_DICT_VER="20121020"; in fetchurl {
|
||||
url = "http://download.fcitx-im.org/data/en_dict-${SPELL_EN_DICT_VER}.tar.gz";
|
||||
sha256 = "1svcb97sq7nrywp5f2ws57cqvlic8j6p811d9ngflplj8xw5sjn4";
|
||||
};
|
||||
table = fetchurl {
|
||||
url = "http://download.fcitx-im.org/data/table.tar.gz";
|
||||
sha256 = "1dw7mgbaidv3vqy0sh8dbfv8631d2zwv5mlb7npf69a1f8y0b5k1";
|
||||
};
|
||||
pystroke-data = let PY_STROKE_VER="20121124"; in fetchurl {
|
||||
url = "http://download.fcitx-im.org/data/py_stroke-${PY_STROKE_VER}.tar.gz";
|
||||
sha256 = "0j72ckmza5d671n2zg0psg7z9iils4gyxz7jgkk54fd4pyljiccf";
|
||||
};
|
||||
pytable-data = let PY_TABLE_VER="20121124"; in fetchurl {
|
||||
url = "http://download.fcitx-im.org/data/py_table-${PY_TABLE_VER}.tar.gz";
|
||||
sha256 = "011cg7wssssm6hm564cwkrrnck2zj5rxi7p9z5akvhg6gp4nl522";
|
||||
};
|
||||
pinyin-data = fetchurl {
|
||||
url = "http://download.fcitx-im.org/data/pinyin.tar.gz";
|
||||
sha256 = "1qfq5dy4czvd1lvdnxzyaiir9x8b1m46jjny11y0i33m9ar2jf2q";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fcitx";
|
||||
version = "4.2.9.6";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "fcitx";
|
||||
repo = "fcitx";
|
||||
rev = version;
|
||||
sha256 = "0j5vaf930lb21gx4h7z6mksh1fazqw32gajjjkyir94wbmml9n3s";
|
||||
};
|
||||
|
||||
# put data at the correct locations else cmake tries to fetch them,
|
||||
# which fails in sandboxed mode
|
||||
prePatch = ''
|
||||
cp ${dicts} src/module/spell/dict/$(stripHash ${dicts})
|
||||
cp ${table} src/im/table/data/$(stripHash ${table})
|
||||
''
|
||||
+ lib.optionalString withPinyin ''
|
||||
cp ${pystroke-data} src/module/pinyin-enhance/data/$(stripHash ${pystroke-data})
|
||||
cp ${pytable-data} src/module/pinyin-enhance/data/$(stripHash ${pytable-data})
|
||||
cp ${pinyin-data} src/im/pinyin/data/$(stripHash ${pinyin-data})
|
||||
''
|
||||
;
|
||||
|
||||
patches = [ ./find-enchant-lib.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/frontend/qt/CMakeLists.txt \
|
||||
--replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins
|
||||
|
||||
patchShebangs cmake/
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/fcitx \
|
||||
--prefix PATH : "${xorg.xmodmap}/bin"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake extra-cmake-modules intltool pkg-config pcre makeWrapper ];
|
||||
|
||||
buildInputs = [
|
||||
xkeyboard_config enchant2 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile
|
||||
libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DENABLE_QT_IM_MODULE=ON"
|
||||
"-DENABLE_GTK2_IM_MODULE=ON"
|
||||
"-DENABLE_GTK3_IM_MODULE=ON"
|
||||
"-DENABLE_GIR=OFF"
|
||||
"-DENABLE_OPENCC=OFF"
|
||||
"-DENABLE_PRESAGE=OFF"
|
||||
"-DENABLE_XDGAUTOSTART=OFF"
|
||||
"-DENABLE_PINYIN=${if withPinyin then "ON" else "OFF"}"
|
||||
"-DENABLE_TABLE=ON"
|
||||
"-DENABLE_SPELL=ON"
|
||||
"-DENABLE_QT_GUI=ON"
|
||||
"-DXKB_RULES_XML_FILE='${xkeyboard_config}/share/X11/xkb/rules/evdev.xml'"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/fcitx/fcitx";
|
||||
description = "A Flexible Input Method Framework";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ ericsagnes ];
|
||||
};
|
||||
}
|
||||
14
pkgs/tools/inputmethods/fcitx/wrapper.nix
Normal file
14
pkgs/tools/inputmethods/fcitx/wrapper.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ symlinkJoin, fcitx, fcitx-configtool, makeWrapper, plugins, libsForQt5 }:
|
||||
|
||||
symlinkJoin {
|
||||
name = "fcitx-with-plugins-${fcitx.version}";
|
||||
|
||||
paths = [ fcitx fcitx-configtool libsForQt5.fcitx-qt5 ] ++ plugins;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/fcitx \
|
||||
--set FCITXDIR "$out/"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue