2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, buildDotnetModule
|
2021-01-05 17:05:55 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
2021-10-17 09:34:42 +00:00
|
|
|
, dotnetCorePackages
|
2021-01-05 17:05:55 +00:00
|
|
|
, gtk3
|
|
|
|
, libX11
|
|
|
|
, libXrandr
|
|
|
|
, libappindicator
|
|
|
|
, libevdev
|
|
|
|
, libnotify
|
|
|
|
, udev
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2021-01-09 10:05:03 +00:00
|
|
|
, nixosTests
|
2021-01-05 17:05:55 +00:00
|
|
|
, wrapGAppsHook
|
2021-12-06 16:07:01 +00:00
|
|
|
, dpkg
|
2021-01-05 17:05:55 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildDotnetModule rec {
|
2021-01-05 17:05:55 +00:00
|
|
|
pname = "OpenTabletDriver";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.5.3.3";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "InfinityGhost";
|
|
|
|
repo = "OpenTabletDriver";
|
|
|
|
rev = "v${version}";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "k4SoOMKAwHeYSQ80M8Af1DiiDSZIi3gS7lGr2ZrXrEI=";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
debPkg = fetchurl {
|
|
|
|
url = "https://github.com/InfinityGhost/OpenTabletDriver/releases/download/v${version}/OpenTabletDriver.deb";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "0v03qiiz28k1yzgxf5qc1mdg2n7kjx6h8vpx9dxz342wwbgqg6ic";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00: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" ];
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
copyDesktopItems
|
|
|
|
wrapGAppsHook
|
2021-12-06 16:07:01 +00:00
|
|
|
dpkg
|
2021-01-05 17:05:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDeps = [
|
|
|
|
gtk3
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libappindicator
|
|
|
|
libevdev
|
|
|
|
libnotify
|
|
|
|
udev
|
|
|
|
];
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
doCheck = true;
|
|
|
|
testProjectFile = "OpenTabletDriver.Tests/OpenTabletDriver.Tests.csproj";
|
|
|
|
|
|
|
|
# Require networking
|
|
|
|
disabledTests = [
|
|
|
|
"OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarballFork"
|
|
|
|
"OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarball"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postInstall = ''
|
2021-01-05 17:05:55 +00:00
|
|
|
# Give a more "*nix" name to the binaries
|
2021-12-06 16:07:01 +00: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-05 17:05:55 +00:00
|
|
|
install -Dm644 $src/OpenTabletDriver.UX/Assets/otd.png -t $out/share/pixmaps
|
|
|
|
|
|
|
|
# TODO: Ideally this should be build from OpenTabletDriver/OpenTabletDriver-udev instead
|
2021-02-05 17:12:51 +00: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-05 17:05:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
desktopName = "OpenTabletDriver";
|
|
|
|
name = "OpenTabletDriver";
|
|
|
|
exec = "otd-gui";
|
|
|
|
icon = "otd";
|
|
|
|
comment = meta.description;
|
|
|
|
type = "Application";
|
|
|
|
categories = "Utility;";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
tests = {
|
|
|
|
otd-runs = nixosTests.opentabletdriver;
|
|
|
|
};
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Open source, cross-platform, user-mode tablet driver";
|
|
|
|
homepage = "https://github.com/InfinityGhost/OpenTabletDriver";
|
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
maintainers = with maintainers; [ thiagokokada ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|