about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/X11/xlayoutdisplay
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/X11/xlayoutdisplay')
-rw-r--r--nixpkgs/pkgs/tools/X11/xlayoutdisplay/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/X11/xlayoutdisplay/default.nix b/nixpkgs/pkgs/tools/X11/xlayoutdisplay/default.nix
new file mode 100644
index 000000000000..30903e448563
--- /dev/null
+++ b/nixpkgs/pkgs/tools/X11/xlayoutdisplay/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, xorg, boost, cmake, gtest }:
+
+stdenv.mkDerivation rec {
+  pname = "xlayoutdisplay";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "alex-courtis";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0wm6a48ym0wn2w0872mfq40ghajfrg1bccj1g342w899qh5x3bc4";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = with xorg; [ libX11 libXrandr libXcursor boost ];
+  checkInputs = [ gtest ];
+
+  doCheck = true;
+
+  # format security fixup
+  postPatch = ''
+    substituteInPlace test/test-Monitors.cpp \
+      --replace 'fprintf(lidStateFile, contents);' \
+                'fputs(contents, lidStateFile);'
+
+    substituteInPlace CMakeLists.txt --replace "set(Boost_USE_STATIC_LIBS ON)" ""
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Detects and arranges linux display outputs, using XRandR for detection and xrandr for arrangement";
+    homepage = https://github.com/alex-courtis/xlayoutdisplay;
+    maintainers = with maintainers; [ dtzWill ];
+    license = licenses.asl20;
+    platforms = platforms.linux;
+  };
+}