2021-11-21 22:49:07 +01:00
|
|
|
{ lib
|
|
|
|
, buildDotnetModule
|
2020-12-26 16:59:38 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, gtk3
|
|
|
|
, libX11
|
|
|
|
, libXrandr
|
|
|
|
, libappindicator
|
|
|
|
, libevdev
|
|
|
|
, libnotify
|
|
|
|
, udev
|
2021-01-01 15:29:24 +01:00
|
|
|
, copyDesktopItems
|
2020-12-26 16:59:38 +01:00
|
|
|
, makeDesktopItem
|
2021-01-08 17:48:00 +01:00
|
|
|
, nixosTests
|
2024-04-26 22:24:03 +02:00
|
|
|
, wrapGAppsHook3
|
2023-12-23 10:36:32 +01:00
|
|
|
, jq
|
|
|
|
, coreutils
|
2020-12-26 16:59:38 +01:00
|
|
|
}:
|
|
|
|
|
2021-11-21 22:49:07 +01:00
|
|
|
buildDotnetModule rec {
|
2020-12-26 16:59:38 +01:00
|
|
|
pname = "OpenTabletDriver";
|
2023-12-23 10:36:32 +01:00
|
|
|
version = "0.6.4.0";
|
2020-12-26 16:59:38 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-01-04 19:29:12 +01:00
|
|
|
owner = "OpenTabletDriver";
|
2020-12-26 16:59:38 +01:00
|
|
|
repo = "OpenTabletDriver";
|
|
|
|
rev = "v${version}";
|
2023-12-23 10:36:32 +01:00
|
|
|
hash = "sha256-zK+feU96JOXjmkTndM9VyUid3z+MZFxJGH+MXaB6kzk=";
|
2020-12-26 16:59:38 +01:00
|
|
|
};
|
|
|
|
|
2023-12-23 10:36:32 +01:00
|
|
|
patches = [
|
|
|
|
./remove-git-from-generate-rules.patch
|
|
|
|
];
|
2020-12-26 16:59:38 +01:00
|
|
|
|
2022-01-17 02:03:16 +01:00
|
|
|
dotnetInstallFlags = [ "--framework=net6.0" ];
|
2021-11-21 22:49:07 +01:00
|
|
|
|
|
|
|
projectFile = [ "OpenTabletDriver.Console" "OpenTabletDriver.Daemon" "OpenTabletDriver.UX.Gtk" ];
|
|
|
|
nugetDeps = ./deps.nix;
|
|
|
|
|
|
|
|
executables = [ "OpenTabletDriver.Console" "OpenTabletDriver.Daemon" "OpenTabletDriver.UX.Gtk" ];
|
|
|
|
|
2020-12-26 16:59:38 +01:00
|
|
|
nativeBuildInputs = [
|
2021-01-01 15:29:24 +01:00
|
|
|
copyDesktopItems
|
2024-04-26 22:24:03 +02:00
|
|
|
wrapGAppsHook3
|
2023-12-23 10:36:32 +01:00
|
|
|
# Dependency of generate-rules.sh
|
|
|
|
jq
|
2020-12-26 16:59:38 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDeps = [
|
|
|
|
gtk3
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libappindicator
|
|
|
|
libevdev
|
|
|
|
libnotify
|
|
|
|
udev
|
|
|
|
];
|
|
|
|
|
2022-08-02 17:57:01 +02:00
|
|
|
buildInputs = runtimeDeps;
|
|
|
|
|
2021-12-20 22:56:32 +01:00
|
|
|
doCheck = true;
|
|
|
|
testProjectFile = "OpenTabletDriver.Tests/OpenTabletDriver.Tests.csproj";
|
|
|
|
|
|
|
|
disabledTests = [
|
2022-01-17 02:03:16 +01:00
|
|
|
# Require networking
|
2021-12-20 22:56:32 +01:00
|
|
|
"OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarballFork"
|
|
|
|
"OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarball"
|
2022-01-17 02:03:16 +01:00
|
|
|
# Require networking & unused in Linux build
|
|
|
|
"OpenTabletDriver.Tests.UpdaterTests.UpdaterBase_ProperlyChecks_Version_Async"
|
|
|
|
"OpenTabletDriver.Tests.UpdaterTests.Updater_PreventsUpdate_WhenAlreadyUpToDate_Async"
|
|
|
|
"OpenTabletDriver.Tests.UpdaterTests.Updater_AllowsReupdate_WhenInstallFailed_Async"
|
|
|
|
"OpenTabletDriver.Tests.UpdaterTests.Updater_HasUpdateReturnsFalse_During_UpdateInstall_Async"
|
|
|
|
"OpenTabletDriver.Tests.UpdaterTests.Updater_HasUpdateReturnsFalse_After_UpdateInstall_Async"
|
|
|
|
"OpenTabletDriver.Tests.UpdaterTests.Updater_Prevents_ConcurrentAndConsecutive_Updates_Async"
|
|
|
|
"OpenTabletDriver.Tests.UpdaterTests.Updater_ProperlyBackups_BinAndAppDataDirectory_Async"
|
|
|
|
# Intended only to be run in continuous integration, unnecessary for functionality
|
|
|
|
"OpenTabletDriver.Tests.ConfigurationTest.Configurations_DeviceIdentifier_IsNotConflicting"
|
|
|
|
# Depends on processor load
|
|
|
|
"OpenTabletDriver.Tests.TimerTests.TimerAccuracy"
|
2023-12-23 10:36:32 +01:00
|
|
|
# Can't find Configurations directory
|
|
|
|
"OpenTabletDriver.Tests.ConfigurationTest.Configurations_Verify_Configs_With_Schema"
|
2021-12-20 22:56:32 +01:00
|
|
|
];
|
|
|
|
|
2023-12-23 10:36:32 +01:00
|
|
|
preBuild = ''
|
|
|
|
patchShebangs generate-rules.sh
|
|
|
|
'';
|
|
|
|
|
2022-01-12 00:20:19 +01:00
|
|
|
postFixup = ''
|
2020-12-26 16:59:38 +01:00
|
|
|
# Give a more "*nix" name to the binaries
|
2021-11-21 22:49:07 +01:00
|
|
|
mv $out/bin/OpenTabletDriver.Console $out/bin/otd
|
|
|
|
mv $out/bin/OpenTabletDriver.Daemon $out/bin/otd-daemon
|
|
|
|
mv $out/bin/OpenTabletDriver.UX.Gtk $out/bin/otd-gui
|
|
|
|
|
2021-01-01 15:29:24 +01:00
|
|
|
install -Dm644 $src/OpenTabletDriver.UX/Assets/otd.png -t $out/share/pixmaps
|
2020-12-26 16:59:38 +01:00
|
|
|
|
2023-12-23 10:36:32 +01:00
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
./generate-rules.sh \
|
|
|
|
| sed 's@/usr/bin/env rm@${lib.getExe' coreutils "rm"}@' \
|
|
|
|
> $out/lib/udev/rules.d/70-opentabletdriver.rules
|
2021-01-01 15:29:24 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
2020-12-26 16:59:38 +01:00
|
|
|
desktopName = "OpenTabletDriver";
|
|
|
|
name = "OpenTabletDriver";
|
|
|
|
exec = "otd-gui";
|
|
|
|
icon = "otd";
|
|
|
|
comment = meta.description;
|
2022-02-22 15:56:15 +01:00
|
|
|
categories = [ "Utility" ];
|
2021-01-01 15:29:24 +01:00
|
|
|
})
|
|
|
|
];
|
2020-12-26 16:59:38 +01:00
|
|
|
|
2021-01-19 15:18:21 +01:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
tests = {
|
|
|
|
otd-runs = nixosTests.opentabletdriver;
|
|
|
|
};
|
2021-01-08 17:48:00 +01:00
|
|
|
};
|
|
|
|
|
2020-12-26 16:59:38 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Open source, cross-platform, user-mode tablet driver";
|
2022-01-04 19:29:12 +01:00
|
|
|
homepage = "https://github.com/OpenTabletDriver/OpenTabletDriver";
|
2020-12-26 16:59:38 +01:00
|
|
|
license = licenses.lgpl3Plus;
|
2023-12-23 10:36:32 +01:00
|
|
|
maintainers = with maintainers; [ gepbird thiagokokada ];
|
2022-08-18 23:50:18 +02:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2022-01-04 19:29:12 +01:00
|
|
|
mainProgram = "otd";
|
2020-12-26 16:59:38 +01:00
|
|
|
};
|
|
|
|
}
|