2021-11-21 22:49:07 +01:00
|
|
|
{ lib
|
|
|
|
, buildDotnetModule
|
2020-12-26 16:59:38 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
2021-09-26 23:06:38 +02:00
|
|
|
, dotnetCorePackages
|
2020-12-26 16:59:38 +01:00
|
|
|
, 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
|
2020-12-26 16:59:38 +01:00
|
|
|
, wrapGAppsHook
|
2021-11-21 22:49:07 +01:00
|
|
|
, dpkg
|
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";
|
2021-09-13 00:39:34 +02:00
|
|
|
version = "0.5.3.3";
|
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}";
|
2022-01-04 19:29:12 +01:00
|
|
|
sha256 = "sha256-k4SoOMKAwHeYSQ80M8Af1DiiDSZIi3gS7lGr2ZrXrEI=";
|
2020-12-26 16:59:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
debPkg = fetchurl {
|
2022-01-04 19:29:12 +01:00
|
|
|
url = "https://github.com/OpenTabletDriver/OpenTabletDriver/releases/download/v${version}/OpenTabletDriver.deb";
|
|
|
|
sha256 = "sha256-LJqH3+JckPF7S/1uBE2X81jxWg0MF9ff92Ei8WPEA2w=";
|
2020-12-26 16:59:38 +01:00
|
|
|
};
|
|
|
|
|
2021-11-21 22:49:07 +01:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_5_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.runtime_5_0;
|
|
|
|
|
|
|
|
dotnetInstallFlags = [ "--framework=net5" ];
|
|
|
|
|
|
|
|
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
|
2020-12-26 16:59:38 +01:00
|
|
|
wrapGAppsHook
|
2021-11-21 22:49:07 +01:00
|
|
|
dpkg
|
2020-12-26 16:59:38 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDeps = [
|
|
|
|
gtk3
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libappindicator
|
|
|
|
libevdev
|
|
|
|
libnotify
|
|
|
|
udev
|
|
|
|
];
|
|
|
|
|
2021-12-20 22:56:32 +01:00
|
|
|
doCheck = true;
|
|
|
|
testProjectFile = "OpenTabletDriver.Tests/OpenTabletDriver.Tests.csproj";
|
|
|
|
|
|
|
|
# Require networking
|
|
|
|
disabledTests = [
|
|
|
|
"OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarballFork"
|
|
|
|
"OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarball"
|
|
|
|
];
|
|
|
|
|
2021-11-21 22:49:07 +01:00
|
|
|
postInstall = ''
|
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
|
|
|
|
|
|
|
|
cp -r ./OpenTabletDriver/Configurations $out/lib/${pname}
|
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
|
|
|
|
2021-01-01 15:29:24 +01:00
|
|
|
# TODO: Ideally this should be build from OpenTabletDriver/OpenTabletDriver-udev instead
|
2021-01-19 15:33:01 +01:00
|
|
|
dpkg-deb --fsys-tarfile ${debPkg} | tar xf - ./usr/lib/udev/rules.d/99-opentabletdriver.rules
|
|
|
|
install -Dm644 ./usr/lib/udev/rules.d/99-opentabletdriver.rules -t $out/lib/udev/rules.d
|
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;
|
|
|
|
type = "Application";
|
|
|
|
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;
|
|
|
|
maintainers = with maintainers; [ thiagokokada ];
|
|
|
|
platforms = platforms.linux;
|
2022-01-04 19:29:12 +01:00
|
|
|
mainProgram = "otd";
|
2020-12-26 16:59:38 +01:00
|
|
|
};
|
|
|
|
}
|