presenterm: 0.9.0 -> 0.10.0 (#378946)
[NixPkgs.git] / pkgs / by-name / li / liblouis / package.nix
blob7cdcfdd680fc6d754dacc8a2579c45ec30430cf1
1 { fetchFromGitHub
2 , lib
3 , stdenv
4 , autoreconfHook
5 , pkg-config
6 , gettext
7 , python3
8 , texinfo
9 , help2man
10 , libyaml
11 , perl
14 stdenv.mkDerivation (finalAttrs: {
15   pname = "liblouis";
16   version = "3.32.0";
18   outputs = [ "out" "dev" "info" "doc" ]
19     # configure: WARNING: cannot generate manual pages while cross compiling
20     ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "man" ];
22   src = fetchFromGitHub {
23     owner = "liblouis";
24     repo = "liblouis";
25     rev = "v${finalAttrs.version}";
26     hash = "sha256-gub/XUwbM7wzeQ0eXtpqaWxPDhlksVW7xSnFB6oXNyQ=";
27   };
29   strictDeps = true;
30   nativeBuildInputs = [
31     autoreconfHook
32     pkg-config
33     gettext
34     python3
35     python3.pkgs.build
36     python3.pkgs.installer
37     python3.pkgs.setuptools
38     python3.pkgs.wheel
39     # Docs, man, info
40     texinfo
41     help2man
42   ];
44   buildInputs = [
45     # lou_checkYaml
46     libyaml
47   ];
49   nativeCheckInputs = [
50     perl
51   ];
53   configureFlags = [
54     # Required by Python bindings
55     "--enable-ucs4"
56   ];
58   postPatch = ''
59     patchShebangs tests
60     substituteInPlace python/louis/__init__.py.in --replace "###LIBLOUIS_SONAME###" "$out/lib/liblouis.so"
61   '';
63   postInstall = ''
64     pushd python
65     python -m build --no-isolation --outdir dist/ --wheel
66     python -m installer --prefix $out dist/*.whl
67     popd
68   '';
70   doCheck = true;
72   meta = with lib; {
73     description = "Open-source braille translator and back-translator";
74     homepage = "https://liblouis.io/";
75     license = with licenses; [
76       lgpl21Plus # library
77       gpl3Plus # tools
78     ];
79     maintainers = with maintainers; [ jtojnar ];
80     platforms = platforms.unix;
81   };