about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/brltty/default.nix
blob: b71740c325a50d3151cd37883cb287ad6ba168b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib, stdenv, fetchurl, pkg-config, python3, bluez
, alsaSupport ? stdenv.isLinux, alsaLib ? null
, systemdSupport ? stdenv.isLinux, systemd ? null }:

assert alsaSupport -> alsaLib != null;
assert systemdSupport -> systemd != null;

stdenv.mkDerivation rec {
  name = "brltty-6.1";

  src = fetchurl {
    url = "http://brltty.com/archive/${name}.tar.gz";
    sha256 = "0nk54chr7z2w579vyiak9xk2avhnvrx7x2l5sk8nyw2zplchkx9q";
  };

  nativeBuildInputs = [ pkg-config python3.pkgs.cython ];
  buildInputs = [ bluez ]
    ++ lib.optional alsaSupport alsaLib
    ++ lib.optional systemdSupport systemd;

  meta = {
    description = "Access software for a blind person using a braille display";
    longDescription = ''
      BRLTTY is a background process (daemon) which provides access to the Linux/Unix
      console (when in text mode) for a blind person using a refreshable braille display.
      It drives the braille display, and provides complete screen review functionality.
      Some speech capability has also been incorporated.
    '';
    homepage = "http://www.brltty.com/";
    license = lib.licenses.gpl2;
    maintainers = [ lib.maintainers.bramd ];
    platforms = lib.platforms.all;
  };

  makeFlags = [ "PYTHON_PREFIX=$(out)" ];

  preConfigurePhases = [ "preConfigure" ];

  preConfigure = ''
    substituteInPlace configure --replace /sbin/ldconfig ldconfig
  '';
}