Skip to content

Commit

Permalink
lcdproc: init at 0.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Jul 26, 2017
1 parent 175c352 commit b23b134
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
47 changes: 47 additions & 0 deletions pkgs/servers/monitoring/lcdproc/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ stdenv, fetchFromGitHub, autoreconfHook, makeWrapper, pkgconfig
, doxygen, freetype, libX11, libftdi, libftdi1, libusb, libusb1, ncurses, perl }:

stdenv.mkDerivation rec {
name = "lcdproc-${version}";
version = "0.5.9";

src = fetchFromGitHub {
owner = "lcdproc";
repo = "lcdproc";
rev = "v${version}";
sha256 = "1r885zv1gsh88j43x6fvzbdgfkh712a227d369h4fdcbnnfd0kpm";
};

patches = [
./hardcode_mtab.patch
];

configureFlags = [
"--enable-lcdproc-menus"
"--enable-drivers=all"
"--with-pidfile-dir=/run"
];

buildInputs = [ freetype libX11 libftdi libusb libusb1 ncurses ];
nativeBuildInputs = [ autoreconfHook doxygen makeWrapper pkgconfig ];
enableParallelBuilding = true;

postFixup = ''
for f in $out/bin/*.pl ; do
substituteInPlace $f \
--replace /usr/bin/perl ${stdenv.lib.getBin perl}/bin/perl
done
# NixOS will not use this file anyway but at least we can now execute LCDd
substituteInPlace $out/etc/LCDd.conf \
--replace server/drivers/ $out/lib/lcdproc/
'';

meta = with stdenv.lib; {
description = "Client/server suite for controlling a wide variety of LCD devices";
homepage = http://lcdproc.org/;
license = licenses.gpl2;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.unix;
};
}
17 changes: 17 additions & 0 deletions pkgs/servers/monitoring/lcdproc/hardcode_mtab.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/clients/lcdproc/machine_Linux.c b/clients/lcdproc/machine_Linux.c
index 7bb7266..a629674 100644
--- a/clients/lcdproc/machine_Linux.c
+++ b/clients/lcdproc/machine_Linux.c
@@ -259,11 +259,7 @@ machine_get_fs(mounts_type fs[], int *cnt)
char line[256];
int x = 0, err;

-#ifdef MTAB_FILE
- mtab_fd = fopen(MTAB_FILE, "r");
-#else
-#error "Can't find your mounted filesystem table file."
-#endif
+ mtab_fd = fopen("/etc/mtab", "r");

/* Get rid of old, unmounted filesystems... */
memset(fs, 0, sizeof(mounts_type) * 256);
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,8 @@ with pkgs;

kapacitor = callPackage ../servers/monitoring/kapacitor { };

lcdproc = callPackage ../servers/monitoring/lcdproc { };

languagetool = callPackage ../tools/text/languagetool { };

loccount = callPackage ../development/tools/misc/loccount { };
Expand Down

0 comments on commit b23b134

Please sign in to comment.