about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/alienfx
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/alienfx')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/alienfx/default.nix39
-rw-r--r--nixpkgs/pkgs/os-specific/linux/alienfx/unistd.patch12
2 files changed, 51 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/alienfx/default.nix b/nixpkgs/pkgs/os-specific/linux/alienfx/default.nix
new file mode 100644
index 000000000000..d04e7b8fbeb0
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/alienfx/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, libusb1, fetchgit}:
+
+
+let
+  rev = "85ee5eeaca59a1c92659c3f49b148b0447d78f16";
+in
+
+stdenv.mkDerivation {
+  name = "alienfx-1.0.0";
+  src = fetchgit {
+    inherit rev;
+    url = https://github.com/tibz/alienfx.git;
+
+    sha256 = "47501a3b4e08d39edee4cd829ae24259a7e740b9798db76b846fa872989f8fb1";
+  };
+
+  prePatch = ''
+    substituteInPlace Makefile --replace /usr/ $out/
+    substituteInPlace Makefile --replace "install -o root -g root -m 4755" "install -m 555"
+  '';
+
+  patches = [./unistd.patch];
+  buildInputs = [ libusb1 ];
+  makeFlags = "build";
+  preInstall = ''
+    mkdir -p $out/bin
+    mkdir -p $out/man/man1
+  '';
+  installTargets = "install";
+  postInstall = ''cp alienfx.1 $out/man/man1'';
+
+  meta = {
+    description = "Controls AlienFX lighting";
+    homepage = https://github.com/tibz/alienfx;
+    maintainers = [stdenv.lib.maintainers.tomberek];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/os-specific/linux/alienfx/unistd.patch b/nixpkgs/pkgs/os-specific/linux/alienfx/unistd.patch
new file mode 100644
index 000000000000..546a27892f0d
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/alienfx/unistd.patch
@@ -0,0 +1,12 @@
+diff --git a/alienfx.cpp b/alienfx.cpp
+index 5981039..aea8992 100644
+--- a/alienfx.cpp
++++ b/alienfx.cpp
+@@ -13,6 +13,7 @@
+ #include <string.h>
+ #include <iostream>
+ #include <libusb-1.0/libusb.h>
++#include <unistd.h>
+ 
+ using namespace std;
+