nixpkgs/pkgs/by-name/li/libpinyin/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

52 lines
999 B
Nix

{ lib
, stdenv
, fetchurl
, fetchFromGitHub
, autoreconfHook
, glib
, db
, pkg-config
}:
let
modelData = fetchurl {
url = "mirror://sourceforge/libpinyin/models/model19.text.tar.gz";
sha256 = "02zml6m8sj5q97ibpvaj9s9yz3gfj0jnjrfhkn02qv4nwm72lhjn";
};
in
stdenv.mkDerivation rec {
pname = "libpinyin";
version = "2.8.1";
src = fetchFromGitHub {
owner = "libpinyin";
repo = "libpinyin";
rev = version;
hash = "sha256-3+CBbjCaY0Ubyphf0uCfYvF2rtc9fF1eEAM1doonjHg=";
};
postUnpack = ''
tar -xzf ${modelData} -C $sourceRoot/data
'';
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
glib
db
];
meta = with lib; {
description = "Library for intelligent sentence-based Chinese pinyin input method";
homepage = "https://github.com/libpinyin/libpinyin";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ linsui ericsagnes ];
platforms = platforms.linux;
};
}