mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-22 00:20:58 +00:00
nuspell: Add withDict wrapper to bring in line with hunspell
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
ctestCheckHook,
|
||||
@@ -49,7 +50,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
passthru = {
|
||||
withDicts = callPackage ./wrapper.nix { nuspell = finalAttrs.finalPackage; };
|
||||
|
||||
tests = {
|
||||
wrapper = testers.testVersion {
|
||||
package = finalAttrs.finalPackage.withDicts (d: [ d.en_US ]);
|
||||
};
|
||||
|
||||
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
||||
|
||||
cmake = testers.hasCmakeConfigModules {
|
||||
|
||||
@@ -1,19 +1,38 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
buildEnv,
|
||||
nuspell,
|
||||
makeWrapper,
|
||||
dicts ? [ ],
|
||||
hunspellDicts,
|
||||
makeBinaryWrapper,
|
||||
}:
|
||||
|
||||
let
|
||||
searchPath = lib.makeSearchPath "share/hunspell" dicts;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = (lib.appendToName "with-dicts" nuspell).name;
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildCommand = ''
|
||||
makeWrapper ${nuspell}/bin/nuspell $out/bin/nuspell --prefix DICPATH : ${lib.escapeShellArg searchPath}
|
||||
'';
|
||||
meta = removeAttrs nuspell.meta [ "outputsToInstall" ];
|
||||
}
|
||||
lib.makeOverridable (
|
||||
dicts: f:
|
||||
buildEnv {
|
||||
inherit (lib.appendToName "with-dicts" nuspell) name version;
|
||||
|
||||
paths = f dicts;
|
||||
|
||||
pathsToLink = [ "/share/hunspell" ];
|
||||
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
makeWrapper ${lib.getExe nuspell} $out/bin/nuspell \
|
||||
--prefix DICPATH : $out/share/hunspell
|
||||
'';
|
||||
|
||||
meta = {
|
||||
inherit (nuspell.meta)
|
||||
description
|
||||
longDescription
|
||||
homepage
|
||||
changelog
|
||||
license
|
||||
maintainers
|
||||
mainProgram
|
||||
platforms
|
||||
;
|
||||
};
|
||||
}
|
||||
) hunspellDicts
|
||||
|
||||
@@ -8529,7 +8529,10 @@ with pkgs;
|
||||
nssTools = nss.tools;
|
||||
|
||||
nuspellWithDicts =
|
||||
dicts: callPackage ../by-name/nu/nuspell/wrapper.nix { inherit dicts; };
|
||||
dicts:
|
||||
lib.warn "nuspellWithDicts is deprecated, please use nuspell.withDicts instead." nuspell.withDicts (
|
||||
_: dicts
|
||||
);
|
||||
|
||||
nv-codec-headers-9 = nv-codec-headers.override { majorVersion = "9"; };
|
||||
nv-codec-headers-10 = nv-codec-headers.override { majorVersion = "10"; };
|
||||
|
||||
Reference in New Issue
Block a user