Skip to content

Commit 8f259c9

Browse files
authored
libchewing: 0.6.0 -> 0.9.1 (#403791)
2 parents c94b309 + 16c816d commit 8f259c9

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

pkgs/by-name/li/libchewing/package.nix

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,52 @@
44
fetchFromGitHub,
55
cmake,
66
sqlite,
7+
corrosion,
8+
rustPlatform,
9+
cargo,
10+
rustc,
711
}:
812

913
stdenv.mkDerivation (finalAttrs: {
1014
pname = "libchewing";
11-
version = "0.6.0";
15+
version = "0.9.1";
1216

1317
src = fetchFromGitHub {
1418
owner = "chewing";
1519
repo = "libchewing";
16-
rev = "v${finalAttrs.version}";
17-
sha256 = "sha256-X+4Rr5Mfc4qeJxmHczu4MKgHBvQN1rhqUrJSx8SFnDk=";
20+
tag = "v${finalAttrs.version}";
21+
hash = "sha256-5aeAsvTiUMTm+ibNfJI57rzSUpJB7luhA/aWmTcnBj4=";
1822
};
1923

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+
'';
2129

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+
];
2346

24-
meta = with lib; {
47+
meta = {
2548
description = "Intelligent Chinese phonetic input method";
2649
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;
3253
# compile time tools init_database, dump_database are built for host
3354
broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
3455
};

0 commit comments

Comments
 (0)