nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 dbus,
7 libconfuse,
8 libjpeg,
9 sane-backends,
10 systemd,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "scanbd";
15 version = "1.5.1";
16
17 src = fetchurl {
18 sha256 = "0pvy4qirfjdfm8aj6x5rkbgl7hk3jfa2s21qkk8ic5dqfjjab75n";
19 url = "mirror://sourceforge/scanbd/${pname}-${version}.tgz";
20 };
21
22 nativeBuildInputs = [ pkg-config ];
23 buildInputs = [
24 dbus
25 libconfuse
26 libjpeg
27 sane-backends
28 systemd
29 ];
30
31 configureFlags = [
32 "--disable-Werror"
33 "--enable-udev"
34 "--with-scanbdconfdir=/etc/scanbd"
35 "--with-systemdsystemunitdir=$out/lib/systemd/system"
36 ]
37 ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
38 # AC_FUNC_MALLOC is broken on cross builds.
39 "ac_cv_func_malloc_0_nonnull=yes"
40 "ac_cv_func_realloc_0_nonnull=yes"
41 ];
42
43 enableParallelBuilding = true;
44
45 installFlags = [
46 "scanbdconfdir=$(out)/etc/scanbd"
47 "scannerconfdir=$(scanbdconfdir)/scanner.d"
48 ];
49
50 doCheck = true;
51
52 meta = {
53 description = "Scanner button daemon";
54 longDescription = ''
55 scanbd polls a scanner's buttons, looking for button presses, function
56 knob changes, or other scanner events such as paper inserts and removals,
57 while at the same time allowing scan-applications to access the scanner.
58
59 Various actions can be submitted (scan, copy, email, ...) via action
60 scripts. The function knob values are passed to the action scripts as
61 well. Scan actions are also signaled via dbus. This can be useful for
62 foreign applications. Scans can also be triggered via dbus from foreign
63 applications.
64
65 On platforms which support signaling of dynamic device insertion/removal
66 (libudev, dbus, hal), scanbd supports this as well.
67
68 scanbd can use all sane-backends or some special backends from the (old)
69 scanbuttond project.
70 '';
71 homepage = "http://scanbd.sourceforge.net/";
72 downloadPage = "https://sourceforge.net/projects/scanbd/";
73 license = lib.licenses.gpl2Plus;
74 platforms = lib.platforms.linux;
75 };
76}