Files
nixpkgs/pkgs/by-name/li/libchewing/package.nix
Peder Bergebakken Sundt 48bad6fefb treewide: use pname and version in fetchCargoVendor cargoDeps
I grepped for `fetchCargoVendor` and `inherit (finalAttrs) src;`, and wrote this patch by hand.
I tested this with `nix-build --check` on the following attributes, derived from `.meta.position`s that match any of the touched files:

* `amberol.cargoDeps.vendorStaging`
* `atuin-desktop.cargoDeps.vendorStaging`
* `chance.cargoDeps.vendorStaging`
* `clapgrep.cargoDeps.vendorStaging`
* `cutecosmic.cargoDeps.vendorStaging`
* `delineate.cargoDeps.vendorStaging`
* `drawpile.cargoDeps.vendorStaging`
* `drawpile-server-headless.cargoDeps.vendorStaging`
* `field-monitor.cargoDeps.vendorStaging`
* `fractal.cargoDeps.vendorStaging`
* `geopard.cargoDeps.vendorStaging`
* `git-cinnabar.cargoDeps.vendorStaging`
* `gnome-robots.cargoDeps.vendorStaging`
* `insulator2.cargoDeps.vendorStaging`
* `kana.cargoDeps.vendorStaging`
* `key-rack.cargoDeps.vendorStaging`
* `kime.cargoDeps.vendorStaging`
* `krunkit.cargoDeps.vendorStaging`
* `krunvm.cargoDeps.vendorStaging`
* `ladybird.cargoDeps.vendorStaging`
* `libchewing.cargoDeps.vendorStaging`
* `loupe.cargoDeps.vendorStaging`
* `metronome.cargoDeps.vendorStaging`
* `pdns-recursor.cargoDeps.vendorStaging`
* `python314Packages.copykitten.cargoDeps.vendorStaging`
* `python314Packages.django-vcache.cargoDeps.vendorStaging`
* `python314Packages.pdoc-pyo3-sample-library.cargoDeps.vendorStaging`
* `python314Packages.pycambia.cargoDeps.vendorStaging`
* `python314Packages.python-kadmin-rs.cargoDeps.vendorStaging`
* `python314Packages.tlparse.cargoDeps.vendorStaging`
* `python313Packages.copykitten.cargoDeps.vendorStaging`
* `python313Packages.django-vcache.cargoDeps.vendorStaging`
* `python313Packages.pdoc-pyo3-sample-library.cargoDeps.vendorStaging`
* `python313Packages.pycambia.cargoDeps.vendorStaging`
* `python313Packages.python-kadmin-rs.cargoDeps.vendorStaging`
* `python313Packages.tlparse.cargoDeps.vendorStaging`
* `share-preview.cargoDeps.vendorStaging`
* `stratisd.cargoDeps.vendorStaging`
* `taskwarrior3.cargoDeps.vendorStaging`
* `tsukimi.cargoDeps.vendorStaging`
* `wildcard.cargoDeps.vendorStaging`
2026-08-12 15:08:47 +02:00

61 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromCodeberg,
cmake,
sqlite,
corrosion,
rustPlatform,
cargo,
rustc,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libchewing";
version = "0.13.1";
src = fetchFromCodeberg {
owner = "chewing";
repo = "libchewing";
tag = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-BiAQSaSOjzeRt+vw+b7JoTR1+mF+UYMIyx+5nuqk9Ko=";
};
# ld: unknown option: -version-script
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace CMakeLists.txt \
--replace-fail "if(CMAKE_C_COMPILER_ID MATCHES GNU|^Clang)" "if((CMAKE_C_COMPILER_ID MATCHES GNU|^Clang) AND NOT APPLE)"
'';
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-WPB1IIwKTF9lnkdcgNXcOP6kWIwQcUguUf8Nh5vDA5E=";
};
nativeBuildInputs = [
cmake
rustPlatform.cargoSetupHook
cargo
rustc
];
buildInputs = [
sqlite
corrosion
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Intelligent Chinese phonetic input method";
homepage = "https://chewing.im/";
license = lib.licenses.lgpl21Only;
maintainers = with lib.maintainers; [ ShamrockLee ];
platforms = lib.platforms.all;
# compile time tools init_database, dump_database are built for host
broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
};
})