mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-14 16:14:50 +00:00
![Artturin](/assets/img/avatar_default.png)
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
84 lines
1.7 KiB
Nix
84 lines
1.7 KiB
Nix
{ stdenv
|
|
, lib
|
|
, fetchurl
|
|
, aspell
|
|
, groff
|
|
, pkg-config
|
|
, glib
|
|
, hunspell
|
|
, hspell
|
|
, nuspell
|
|
, unittest-cpp
|
|
|
|
, withHspell ? true
|
|
, withAspell ? true
|
|
, withHunspell ? true
|
|
, withNuspell ? true
|
|
, withAppleSpell ? stdenv.hostPlatform.isDarwin
|
|
|
|
, Cocoa
|
|
}:
|
|
|
|
assert withAppleSpell -> stdenv.hostPlatform.isDarwin;
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "enchant";
|
|
version = "2.6.9";
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/AbiWord/${pname}/releases/download/v${version}/${pname}-${version}.tar.gz";
|
|
hash = "sha256-2aWhDcmzikOzoPoix27W67fgnrU1r/YpVK/NvUDv/2s=";
|
|
};
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [
|
|
groff
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
glib
|
|
] ++ lib.optionals withHunspell [
|
|
hunspell
|
|
] ++ lib.optionals withNuspell [
|
|
nuspell
|
|
] ++ lib.optionals withAppleSpell [
|
|
Cocoa
|
|
];
|
|
|
|
checkInputs = [
|
|
unittest-cpp
|
|
];
|
|
|
|
# libtool puts these to .la files
|
|
propagatedBuildInputs = lib.optionals withHspell [
|
|
hspell
|
|
] ++ lib.optionals withAspell [
|
|
aspell
|
|
];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
doCheck = true;
|
|
|
|
configureFlags = [
|
|
"--enable-relocatable" # needed for tests
|
|
(lib.withFeature withAspell "aspell")
|
|
(lib.withFeature withHspell "hspell")
|
|
(lib.withFeature withHunspell "hunspell")
|
|
(lib.withFeature withNuspell "nuspell")
|
|
(lib.withFeature withAppleSpell "applespell")
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Generic spell checking library";
|
|
homepage = "https://abiword.github.io/enchant/";
|
|
license = licenses.lgpl21Plus; # with extra provision for non-free checkers
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|