|
4 | 4 | fetchFromGitHub, |
5 | 5 | cmake, |
6 | 6 | sqlite, |
| 7 | + corrosion, |
| 8 | + rustPlatform, |
| 9 | + cargo, |
| 10 | + rustc, |
7 | 11 | }: |
8 | 12 |
|
9 | 13 | stdenv.mkDerivation (finalAttrs: { |
10 | 14 | pname = "libchewing"; |
11 | | - version = "0.6.0"; |
| 15 | + version = "0.9.1"; |
12 | 16 |
|
13 | 17 | src = fetchFromGitHub { |
14 | 18 | owner = "chewing"; |
15 | 19 | repo = "libchewing"; |
16 | | - rev = "v${finalAttrs.version}"; |
17 | | - sha256 = "sha256-X+4Rr5Mfc4qeJxmHczu4MKgHBvQN1rhqUrJSx8SFnDk="; |
| 20 | + tag = "v${finalAttrs.version}"; |
| 21 | + hash = "sha256-5aeAsvTiUMTm+ibNfJI57rzSUpJB7luhA/aWmTcnBj4="; |
18 | 22 | }; |
19 | 23 |
|
20 | | - buildInputs = [ sqlite ]; |
| 24 | + # ld: unknown option: -version-script |
| 25 | + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' |
| 26 | + substituteInPlace CMakeLists.txt \ |
| 27 | + --replace-fail "if(CMAKE_C_COMPILER_ID MATCHES GNU|^Clang)" "if((CMAKE_C_COMPILER_ID MATCHES GNU|^Clang) AND NOT APPLE)" |
| 28 | + ''; |
21 | 29 |
|
22 | | - nativeBuildInputs = [ cmake ]; |
| 30 | + cargoDeps = rustPlatform.fetchCargoVendor { |
| 31 | + inherit (finalAttrs) src; |
| 32 | + hash = "sha256-LTuUhQ0ZeyGloNvVs+6OGjFvPdBsQNZupwC8QTjUfyk="; |
| 33 | + }; |
| 34 | + |
| 35 | + nativeBuildInputs = [ |
| 36 | + cmake |
| 37 | + rustPlatform.cargoSetupHook |
| 38 | + cargo |
| 39 | + rustc |
| 40 | + ]; |
| 41 | + |
| 42 | + buildInputs = [ |
| 43 | + sqlite |
| 44 | + corrosion |
| 45 | + ]; |
23 | 46 |
|
24 | | - meta = with lib; { |
| 47 | + meta = { |
25 | 48 | description = "Intelligent Chinese phonetic input method"; |
26 | 49 | homepage = "https://chewing.im/"; |
27 | | - license = licenses.lgpl21Only; |
28 | | - maintainers = with maintainers; [ |
29 | | - ShamrockLee |
30 | | - ]; |
31 | | - platforms = platforms.all; |
| 50 | + license = lib.licenses.lgpl21Only; |
| 51 | + maintainers = with lib.maintainers; [ ShamrockLee ]; |
| 52 | + platforms = lib.platforms.all; |
32 | 53 | # compile time tools init_database, dump_database are built for host |
33 | 54 | broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform; |
34 | 55 | }; |
|
0 commit comments