1{ lib, stdenv, fetchurl, perl, zlib, buildPackages }:
2
3stdenv.mkDerivation rec {
4 name = "${passthru.pname}-${passthru.version}";
5
6 passthru = {
7 pname = "hspell";
8 version = "1.1";
9 };
10
11 PERL_USE_UNSAFE_INC = "1";
12
13 src = fetchurl {
14 url = "${meta.homepage}${name}.tar.gz";
15 sha256 = "08x7rigq5pa1pfpl30qp353hbdkpadr1zc49slpczhsn0sg36pd6";
16 };
17
18 patchPhase = "patchShebangs .";
19 preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
20 make CC=${buildPackages.stdenv.cc}/bin/cc find_sizes
21 mv find_sizes find_sizes_build
22 make clean
23
24 substituteInPlace Makefile --replace "./find_sizes" "./find_sizes_build"
25 substituteInPlace Makefile --replace "ar cr" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar cr"
26 substituteInPlace Makefile --replace "ranlib" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
27 substituteInPlace Makefile --replace "STRIP=strip" "STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
28 '';
29 nativeBuildInputs = [ perl zlib ];
30# buildInputs = [ zlib ];
31
32 meta = with lib; {
33 description = "Hebrew spell checker";
34 homepage = "http://hspell.ivrix.org.il/";
35 platforms = platforms.all;
36 license = licenses.gpl2;
37 };
38}