Jan Tojnar ad3be3261e hspell: Add zlib
As mentioned by the configure script output, hspell will fall back
on using `gzip` program when not linked against `zlib`:

    No Zlib library, defaulting to using pipes

It has been removed in 67f0a216e5c8cec5a1d1787c57dbf8b4fb56ccf9 for some reason.

Without this patch, Geary is stuck loading messages, even though I can interact
with the rest of its UI. I am also getting the following in the log so broken
piping might be breaking webkitgtk for some reason:

    Hspell: can't run gzip -dc '/nix/store/14qk9r9ywvpqn0a24fvw1iwjv302d04j-hspell-1.4/share/hspell/hebrew.wgz.prefixes'.
    Could not create GBM EGL display: EGL_NOT_INITIALIZED. Aborting...

And after quitting Geary:

    *[wrn] 18:29:13.0226 geary:application-client.vala:464: Forcing shutdown of Geary, 7s passed...
    gzip:
    gzip: stdout: Broken pipe
    stdout: Broken pipe

Co-authored-by: Colin <colin@uninsane.org>
2024-12-31 20:00:58 +01:00

58 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchurl,
perl,
zlib,
buildPackages,
}:
stdenv.mkDerivation rec {
name = "${passthru.pname}-${passthru.version}";
passthru = {
pname = "hspell";
version = "1.4";
};
PERL_USE_UNSAFE_INC = "1";
src = fetchurl {
url = "${meta.homepage}${name}.tar.gz";
hash = "sha256-cxD11YdA0h1tIVwReWWGAu99qXqBa8FJfIdkvpeqvqM=";
};
patches = [ ./remove-shared-library-checks.patch ];
postPatch = "patchShebangs .";
preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
make CC='${buildPackages.stdenv.cc}/bin/cc -I${lib.getDev buildPackages.zlib}/include -L${buildPackages.zlib}/lib' find_sizes
mv find_sizes find_sizes_build
make clean
substituteInPlace Makefile --replace "./find_sizes" "./find_sizes_build"
substituteInPlace Makefile --replace "ar cr" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar cr"
substituteInPlace Makefile --replace "ranlib" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
substituteInPlace Makefile --replace "STRIP=strip" "STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
'';
postInstall = ''
patchShebangs --update $out/bin/multispell
'';
nativeBuildInputs = [
perl
zlib
];
buildInputs = [
perl
zlib
];
strictDeps = true;
meta = with lib; {
description = "Hebrew spell checker";
homepage = "http://hspell.ivrix.org.il/";
platforms = platforms.all;
license = licenses.gpl2;
};
}