2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, xorg, boost, cmake, gtest }:
|
2019-01-29 13:07:53 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-04-26 21:11:03 +00:00
|
|
|
pname = "xlayoutdisplay";
|
2020-05-27 20:33:36 +00:00
|
|
|
version = "1.1.2";
|
2019-01-29 13:07:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alex-courtis";
|
2019-04-26 21:11:03 +00:00
|
|
|
repo = pname;
|
2019-01-29 13:07:53 +00:00
|
|
|
rev = "v${version}";
|
2020-05-27 20:33:36 +00:00
|
|
|
sha256 = "0n3vg25gzwn1pcg6caxyyd1xf2w6n98m6jpxc70kqpxfqldxwl0m";
|
2019-01-29 13:07:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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);'
|
|
|
|
|
2019-04-26 21:11:03 +00:00
|
|
|
substituteInPlace CMakeLists.txt --replace "set(Boost_USE_STATIC_LIBS ON)" ""
|
2019-01-29 13:07:53 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-01-29 13:07:53 +00:00
|
|
|
description = "Detects and arranges linux display outputs, using XRandR for detection and xrandr for arrangement";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/alex-courtis/xlayoutdisplay";
|
2019-01-29 13:07:53 +00:00
|
|
|
maintainers = with maintainers; [ dtzWill ];
|
|
|
|
license = licenses.asl20;
|
2019-04-28 00:46:54 +00:00
|
|
|
platforms = platforms.linux;
|
2019-01-29 13:07:53 +00:00
|
|
|
};
|
|
|
|
}
|