lol

fcitx5-mozc: init at 2.26.4220.102

authored by

Potato Hatsue and committed by
Sandro Jäckel
596e02c6 d3b7a30e

+121 -2
+1 -1
pkgs/development/misc/breakpad/default.nix
··· 25 25 homepage = "https://chromium.googlesource.com/breakpad"; 26 26 license = licenses.bsd3; 27 27 maintainers = with maintainers; [ berberman ]; 28 - platforms = with platforms; linux ++ darwin ++ windows; 28 + platforms = platforms.all; 29 29 }; 30 30 }
+117
pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix
··· 1 + { lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, fetchgit 2 + , python3Packages, mesa, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5 3 + , jsoncpp, gtest, which, gtk2, unzip, abseil-cpp, breakpad }: 4 + let 5 + inherit (python3Packages) python gyp six; 6 + japanese_usage_dictionary = fetchFromGitHub { 7 + owner = "hiroyuki-komatsu"; 8 + repo = "japanese-usage-dictionary"; 9 + rev = "e5b3425575734c323e1d947009dd74709437b684"; 10 + sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm"; 11 + }; 12 + # abseil-cpp in nixpkgs is too old 13 + abseil-cpp_2020923 = abseil-cpp.overrideAttrs (old: rec { 14 + version = "20200923.2"; 15 + src = fetchFromGitHub { 16 + owner = "abseil"; 17 + repo = "abseil-cpp"; 18 + rev = version; 19 + sha256 = "G+wkaC4IPtyc/xCUyVFJOcHppPFU7KkhIHjv6uhVKGU="; 20 + }; 21 + cmakeFlags = [ "-DCMAKE_CXX_STANDARD=17" "-DBUILD_SHARED_LIBS=ON" ]; 22 + }); 23 + zipcode_rel = "202011"; 24 + jigyosyo = fetchurl { 25 + url = "https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${zipcode_rel}.zip"; 26 + sha256 = "j7MkNtd4+QTi91EreVig4/OV0o5y1+KIjEJBEmLK/mY="; 27 + }; 28 + x-ken-all = fetchurl { 29 + url = 30 + "https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${zipcode_rel}.zip"; 31 + sha256 = "ExS0Cg3rs0I9IOVbZHLt8UEfk8/LmY9oAHPVVlYuTPw="; 32 + }; 33 + 34 + in clangStdenv.mkDerivation rec { 35 + pname = "fcitx5-mozc"; 36 + version = "2.26.4220.102"; 37 + 38 + src = fetchFromGitHub { 39 + owner = "fcitx"; 40 + repo = "mozc"; 41 + rev = "1882e33b61673b66d63277f82b4c80ae4e506c10"; 42 + sha256 = "R+w0slVFpqtt7PIr1pyupJjRoQsABVZiMdZ9fKGKAqw="; 43 + }; 44 + 45 + nativeBuildInputs = [ gyp ninja mesa python pkg-config qt5.wrapQtAppsHook six which unzip ]; 46 + 47 + buildInputs = [ protobuf zinnia qt5.qtbase fcitx5 abseil-cpp_2020923 jsoncpp gtest gtk2 ]; 48 + 49 + patches = [ 50 + # Support linking system abseil-cpp 51 + (fetchpatch { 52 + url = "https://salsa.debian.org/debian/mozc/-/raw/debian/sid/debian/patches/0007-Update-src-base-absl.gyp.patch"; 53 + sha256 = "UiS0UScDKyAusXOhc7Bg8dF8ARQQiVTylEhAOxqaZt8="; 54 + }) 55 + 56 + ]; 57 + 58 + postUnpack = '' 59 + unzip ${x-ken-all} -d $sourceRoot/src/ 60 + unzip ${jigyosyo} -d $sourceRoot/src/ 61 + 62 + rmdir $sourceRoot/src/third_party/breakpad/ 63 + ln -s ${breakpad} $sourceRoot/src/third_party/breakpad 64 + rmdir $sourceRoot/src/third_party/gtest/ 65 + ln -s ${gtest} $sourceRoot/src/third_party/gtest 66 + rmdir $sourceRoot/src/third_party/gyp/ 67 + ln -s ${gyp} $sourceRoot/src/third_party/gyp 68 + rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/ 69 + ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary 70 + ''; 71 + 72 + # Copied from https://github.com/archlinux/svntogit-community/blob/packages/fcitx5-mozc/trunk/PKGBUILD 73 + configurePhase = '' 74 + cd src 75 + export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_libabseil=1" 76 + 77 + # disable fcitx4 78 + rm unix/fcitx/fcitx.gyp 79 + 80 + # gen zip code seed 81 + PYTHONPATH="$PWD:$PYTHONPATH" python dictionary/gen_zip_code_seed.py --zip_code="x-ken-all.csv" --jigyosyo="JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt 82 + 83 + # use libstdc++ instead of libc++ 84 + sed "/stdlib=libc++/d;/-lc++/d" -i gyp/common.gypi 85 + 86 + # run gyp 87 + python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc 88 + ''; 89 + 90 + buildPhase = '' 91 + python build_mozc.py build -c Release \ 92 + server/server.gyp:mozc_server \ 93 + gui/gui.gyp:mozc_tool \ 94 + unix/fcitx5/fcitx5.gyp:fcitx5-mozc 95 + ''; 96 + 97 + installPhase = '' 98 + export PREFIX=$out 99 + export _bldtype=Release 100 + ../scripts/install_server 101 + install -d $out/share/licenses/fcitx5-mozc 102 + head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx5-mozc/LICENSE 103 + install -m644 data/installer/*.html $out/share/licenses/fcitx5-mozc/ 104 + install -d $out/share/fcitx5/addon 105 + install -d $out/share/fcitx5/inputmethod 106 + install -d $out/lib/fcitx5 107 + ../scripts/install_fcitx5 108 + ''; 109 + 110 + meta = with lib; { 111 + description = "Fcitx5 Module of A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)"; 112 + homepage = "https://github.com/fcitx/mozc"; 113 + license = licenses.bsd3; 114 + maintainers = with maintainers; [ berberman ]; 115 + platforms = platforms.linux; 116 + }; 117 + }
+3 -1
pkgs/top-level/all-packages.nix
··· 156 156 157 157 bacnet-stack = callPackage ../tools/networking/bacnet-stack {}; 158 158 159 - breakpad = callPackage ../development/misc/breakpad {}; 159 + breakpad = callPackage ../development/misc/breakpad { }; 160 160 161 161 # Zip file format only allows times after year 1980, which makes e.g. Python wheel building fail with: 162 162 # ValueError: ZIP does not support timestamps before 1980 ··· 4016 4016 fcitx5-with-addons = libsForQt5.callPackage ../tools/inputmethods/fcitx5/with-addons.nix { }; 4017 4017 4018 4018 fcitx5-chinese-addons = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; 4019 + 4020 + fcitx5-mozc = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { }; 4019 4021 4020 4022 fcitx5-configtool = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-configtool.nix { }; 4021 4023