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