input-remapper: decouple routine install checks from upstream checks and use versionCheckHook (#471966)
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
gtksourceview4,
|
||||
bash,
|
||||
udevCheckHook,
|
||||
versionCheckHook,
|
||||
nixosTests,
|
||||
# Change the default log level to debug for easier debugging of package issues
|
||||
withDebugLogLevel ? false,
|
||||
@@ -66,7 +67,6 @@ in
|
||||
glib
|
||||
gobject-introspection
|
||||
pygobject3
|
||||
udevCheckHook
|
||||
]
|
||||
++ maybeXmodmap;
|
||||
|
||||
@@ -81,9 +81,14 @@ in
|
||||
psutil
|
||||
];
|
||||
|
||||
doCheck = withDoCheck;
|
||||
# buildPythonApplication maps nativeCheckInputs to nativeInstallCheckInputs.
|
||||
nativeCheckInputs = [
|
||||
udevCheckHook
|
||||
versionCheckHook
|
||||
]
|
||||
++ lib.optionals withDoCheck [ psutil ];
|
||||
|
||||
nativeCheckInputs = [ psutil ];
|
||||
versionCheckProgram = "${placeholder "out"}/bin/input-remapper-control";
|
||||
|
||||
pythonImportsCheck = [
|
||||
"evdev"
|
||||
@@ -115,9 +120,7 @@ in
|
||||
# We only run tests in the unit folder, integration tests require UI
|
||||
# To allow tests which access the system and session DBUS to run, we start a dbus session
|
||||
# and bind it to both the system and session buses
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
upstreamCheck = lib.optionalString withDoCheck ''
|
||||
echo "<busconfig>
|
||||
<type>session</type>
|
||||
<listen>unix:tmpdir=$TMPDIR</listen>
|
||||
@@ -145,7 +148,11 @@ in
|
||||
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/build/system_bus_socket \
|
||||
${dbus}/bin/dbus-run-session --config-file dbus.cfg \
|
||||
python tests/test.py --start-dir unit
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
eval "$upstreamCheck"
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user