nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 169 lines 4.0 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 shared-mime-info, 6 autoconf, 7 automake116x, 8 intltool, 9 libtool, 10 pkg-config, 11 cmake, 12 ruby, 13 librsvg, 14 ncurses, 15 m17n_lib, 16 m17n_db, 17 expat, 18 withAnthy ? true, 19 anthy ? null, 20 withGtk ? true, 21 withGtk2 ? withGtk, 22 gtk2 ? null, 23 withGtk3 ? withGtk, 24 gtk3 ? null, 25 # Was never enabled in the history of this package and is not needed by any 26 # dependent package, hence disabled to save up closure size. 27 withQt ? false, 28 withQt5 ? withQt, 29 qt5 ? null, 30 withLibnotify ? true, 31 libnotify ? null, 32 withSqlite ? true, 33 sqlite ? null, 34 withNetworking ? true, 35 curl ? null, 36 openssl ? null, 37 withFFI ? true, 38 libffi ? null, 39 40 # Things that are clearly an overkill to be enabled by default 41 withMisc ? false, 42 libeb ? null, 43}: 44 45let 46 automake = automake116x; 47in 48 49assert withGtk2 -> gtk2 != null; 50assert withGtk3 -> gtk3 != null; 51 52assert withAnthy -> anthy != null; 53assert withLibnotify -> libnotify != null; 54assert withSqlite -> sqlite != null; 55assert withNetworking -> curl != null && openssl != null; 56assert withFFI -> libffi != null; 57assert withMisc -> libeb != null; 58 59stdenv.mkDerivation (finalAttrs: { 60 version = "1.9.6"; 61 pname = "uim"; 62 63 src = fetchurl { 64 url = "https://github.com/uim/uim/releases/download/${finalAttrs.version}/uim-${finalAttrs.version}.tar.bz2"; 65 hash = "sha256-Z/Dl+kKSpTPtxvmLhC32DFMaic+C0DNqThq3IgKrjIM="; 66 meta = { 67 homepage = "https://github.com/uim/uim/"; 68 }; 69 }; 70 71 nativeBuildInputs = [ 72 autoconf 73 automake 74 intltool 75 libtool 76 pkg-config 77 cmake 78 79 ruby # used by sigscheme build to generate function tables 80 librsvg # used by uim build to generate png pixmaps from svg 81 ] 82 ++ lib.optionals withQt5 [ 83 qt5.wrapQtAppsHook 84 ]; 85 86 buildInputs = [ 87 ncurses 88 m17n_lib 89 m17n_db 90 expat 91 ] 92 ++ lib.optional withAnthy anthy 93 ++ lib.optional withGtk2 gtk2 94 ++ lib.optional withGtk3 gtk3 95 ++ lib.optionals withQt5 [ 96 qt5.qtbase 97 qt5.qtx11extras 98 ] 99 ++ lib.optional withLibnotify libnotify 100 ++ lib.optional withSqlite sqlite 101 ++ lib.optionals withNetworking [ 102 curl 103 openssl 104 ] 105 ++ lib.optional withFFI libffi 106 ++ lib.optional withMisc libeb; 107 108 postPatch = '' 109 patchShebangs *.sh */*.sh */*/*.sh 110 cp replace/*.h uim 111 ''; 112 113 patches = [ 114 ./data-hook.patch 115 ]; 116 117 configureFlags = [ 118 # configure in maintainer mode or else some pixmaps won't get autogenerated 119 # this should imply the above `--enable-maintainer-mode`, but it does not 120 "--enable-maintainer-mode" 121 122 "--enable-pref" 123 "--with-skk" 124 "--with-x" 125 "--with-xft" 126 "--with-expat=${expat.dev}" 127 ] 128 ++ lib.optional withAnthy "--with-anthy-utf8" 129 ++ lib.optional withGtk2 "--with-gtk2" 130 ++ lib.optional withGtk3 "--with-gtk3" 131 ++ lib.optionals withQt5 [ 132 "--with-qt5" 133 "--with-qt5-immodule" 134 ] 135 ++ lib.optional withLibnotify "--enable-notify=libnotify" 136 ++ lib.optional withSqlite "--with-sqlite3" 137 ++ lib.optionals withNetworking [ 138 "--with-curl" 139 "--with-openssl-dir=${openssl.dev}" 140 ] 141 ++ lib.optional withFFI "--with-ffi" 142 ++ lib.optional withMisc "--with-eb"; 143 144 # TODO: things in `./configure --help`, but not in nixpkgs 145 #--with-canna Use Canna [default=no] 146 #--with-wnn Build with libwnn [default=no] 147 #--with-mana Build a plugin for Mana [default=yes] 148 #--with-prime Build a plugin for PRIME [default=yes] 149 #--with-sj3 Use SJ3 [default=no] 150 #--with-osx-dcs Build with OS X Dictionary Services [default=no] 151 152 # TODO: fix this in librsvg/glib later 153 # https://github.com/NixOS/nixpkgs/pull/57027#issuecomment-475461733 154 preBuild = '' 155 export XDG_DATA_DIRS="${shared-mime-info}/share" 156 ''; 157 158 dontUseCmakeConfigure = true; 159 160 meta = { 161 inherit (finalAttrs.src.meta) homepage; 162 description = "Multilingual input method framework"; 163 license = lib.licenses.bsd3; 164 platforms = lib.platforms.unix; 165 maintainers = with lib.maintainers; [ 166 oxij 167 ]; 168 }; 169})