nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchzip,
5 libtommath,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "convertlit";
10 version = "1.8";
11
12 src = fetchzip {
13 url = "http://www.convertlit.com/convertlit${
14 lib.replaceStrings [ "." ] [ "" ] finalAttrs.version
15 }src.zip";
16 sha256 = "182nsin7qscgbw2h92m0zadh3h8q410h5cza6v486yjfvla3dxjx";
17 stripRoot = false;
18 };
19
20 buildInputs = [ libtommath ];
21
22 hardeningDisable = [ "format" ];
23
24 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
25
26 postPatch = ''
27 substituteInPlace clit18/Makefile --replace gcc \$\(CC\)
28 substituteInPlace clit18/Makefile --replace ../libtommath-0.30/libtommath.a -ltommath
29 '';
30
31 buildPhase = ''
32 cd lib
33 make
34 cd ../clit18
35 make
36 '';
37
38 installPhase = ''
39 install -Dm755 clit $out/bin/clit
40 '';
41
42 meta = {
43 homepage = "http://www.convertlit.com/";
44 description = "Tool for converting Microsoft Reader ebooks to more open formats";
45 mainProgram = "clit";
46 license = lib.licenses.gpl2Plus;
47 platforms = lib.platforms.linux;
48 };
49})