# Copyright 2023-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DOTNET_PKG_COMPAT=8.0 # !!! REPLACE THIS LIST !!! # This was the 0.6.6.2 list. v0.6.7 changed dependencies (PR #4235 updated all # NuGets except Eto, PR #4371 replaced moq with NSubstitute). # See the comment block at the bottom of this file for how to regenerate. NUGETS=" atksharp@3.24.24.34 benchmarkdotnet@0.15.8 benchmarkdotnet.annotations@0.15.8 cairosharp@3.24.24.34 castle.core@5.1.1 commandlineparser@2.9.1 coverlet.collector@6.0.4 diffplex@1.9.0 eto.forms@2.5.10 eto.forms@2.5.11 eto.platform.gtk@2.5.11 eto.platform.mac64@2.5.10 eto.platform.wpf@2.5.6 gdksharp@3.24.24.34 gee.external.capstone@2.3.0 giosharp@3.24.24.34 glibsharp@3.24.24.34 gtksharp@3.24.24.34 hidsharpcore@1.3.0 iced@1.21.0 jetbrains.annotations@2025.2.4 messagepack@2.5.192 messagepack.annotations@2.5.192 microsoft.codeanalysis.analyzers@3.11.0 microsoft.codeanalysis.common@4.14.0 microsoft.codeanalysis.csharp@4.14.0 microsoft.codecoverage@18.0.1 microsoft.diagnostics.netcore.client@0.2.510501 microsoft.diagnostics.runtime@3.1.512801 microsoft.diagnostics.tracing.traceevent@3.1.21 microsoft.dotnet.platformabstractions@3.1.6 microsoft.extensions.dependencyinjection@10.0.1 microsoft.extensions.dependencyinjection.abstractions@10.0.1 microsoft.extensions.logging@6.0.0 microsoft.extensions.logging.abstractions@6.0.0 microsoft.extensions.options@6.0.0 microsoft.extensions.primitives@6.0.0 microsoft.netcore.platforms@5.0.0 microsoft.net.stringtools@17.6.3 microsoft.net.test.sdk@18.0.1 microsoft.testplatform.objectmodel@18.0.1 microsoft.testplatform.testhost@18.0.1 microsoft.visualstudio.threading.only@17.13.61 microsoft.visualstudio.validation@17.8.8 microsoft.win32.registry@5.0.0 nerdbank.streams@2.12.87 newtonsoft.json@13.0.4 newtonsoft.json.schema@4.0.1 nsubstitute@5.3.0 nsubstitute.analyzers.csharp@1.0.17 octokit@14.0.0 pangosharp@3.24.24.34 perfolizer@0.6.1 pragmastat@3.2.4 sharpziplib@1.4.2 streamjsonrpc@2.22.23 system.codedom@9.0.5 system.collections.immutable@8.0.0 system.collections.immutable@9.0.0 system.commandline@2.0.1 system.componentmodel.annotations@5.0.0 system.diagnostics.diagnosticsource@6.0.0 system.diagnostics.eventlog@6.0.0 system.io.pipelines@8.0.0 system.management@9.0.5 system.reflection.metadata@8.0.0 system.reflection.metadata@9.0.0 system.reflection.typeextensions@4.7.0 system.runtime.compilerservices.unsafe@6.0.0 system.security.accesscontrol@5.0.0 system.security.principal.windows@5.0.0 system.text.json@8.0.5 validation@2.5.51 waylandnet@0.2.0 xunit@2.9.3 xunit.abstractions@2.0.3 xunit.analyzers@1.18.0 xunit.assert@2.9.3 xunit.core@2.9.3 xunit.extensibility.core@2.9.3 xunit.extensibility.execution@2.9.3 xunit.runner.visualstudio@3.1.5 xunit.skippablefact@1.5.23 " inherit desktop dotnet-pkg linux-info systemd udev xdg DESCRIPTION="A cross-platform open-source tablet driver" HOMEPAGE="https://opentabletdriver.net/" SRC_URI=" https://github.com/OpenTabletDriver/OpenTabletDriver/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz ${NUGET_URIS} " LICENSE="LGPL-3+" # nuget licenses LICENSE+=" Apache-2.0 ISC MIT" SLOT="0" KEYWORDS="~amd64" RDEPEND=" dev-libs/libevdev virtual/udev x11-libs/gtk+:3 x11-libs/libX11 x11-libs/libXrandr x11-libs/libnotify !x11-drivers/OpenTabletDriver-bin " BDEPEND="app-misc/jq" CONFIG_CHECK="~INPUT_UINPUT" DOTNET_PKG_PROJECTS=( "${S}/OpenTabletDriver.Console/OpenTabletDriver.Console.csproj" "${S}/OpenTabletDriver.Daemon/OpenTabletDriver.Daemon.csproj" "${S}/OpenTabletDriver.UX.Gtk/OpenTabletDriver.UX.Gtk.csproj" ) pkg_setup() { linux-info_pkg_setup dotnet-pkg_pkg_setup } src_prepare() { # Build doesn't need the solution file but eclass tries to use it. rm -f OpenTabletDriver.sln || die dotnet-pkg_src_prepare } src_configure() { dotnet-pkg_src_configure # These projects are only used at build time, should not be installed. dotnet-pkg-base_restore OpenTabletDriver.Tests } src_compile() { dotnet-pkg_src_compile ./generate-rules.sh > 70-opentabletdriver.rules || die } src_install() { dotnet-pkg_src_install dotnet-pkg-base_dolauncher "/usr/share/${P}/${PN}.Console" otd dotnet-pkg-base_dolauncher "/usr/share/${P}/${PN}.Daemon" otd-daemon dotnet-pkg-base_dolauncher "/usr/share/${P}/${PN}.UX.Gtk" otd-gui doicon OpenTabletDriver.UX/Assets/otd.png doman docs/manpages/opentabletdriver.8 make_desktop_entry otd-gui OpenTabletDriver otd Settings udev_dorules 70-opentabletdriver.rules # !!! VERIFY PATH !!! # v0.6.7 reworked the build system (PR #4179). The path below may have # moved. If `cd` fails, check eng/ for the new layout - it may now be # eng/linux/ or somewhere under eng/bash/. Adjust accordingly. cd "${S}/eng/bash/Generic/usr" || die insinto /lib/modprobe.d doins lib/modprobe.d/99-opentabletdriver.conf insinto /usr/lib/modules-load.d doins lib/modules-load.d/opentabletdriver.conf insinto /usr/share/libinput doins share/libinput/30-vendor-opentabletdriver.quirks systemd_douserunit lib/systemd/user/opentabletdriver.service } src_test() { dotnet-pkg-base_test OpenTabletDriver.Tests } pkg_postinst() { udev_reload xdg_pkg_postinst if [[ -z ${REPLACING_VERSIONS} ]]; then elog "Please replug your tablet before attempting to use the driver" fi } pkg_postrm() { udev_reload xdg_pkg_postrm } # ============================================================================ # How to regenerate the NUGETS list: # ============================================================================ # # 1. Download and extract the source: # wget https://github.com/OpenTabletDriver/OpenTabletDriver/archive/refs/tags/v0.6.7.tar.gz # tar xf v0.6.7.tar.gz # cd OpenTabletDriver-0.6.7 # # 2. Generate or update the lock files (requires .NET 8 SDK installed): # dotnet restore --force-evaluate # # This regenerates packages.lock.json in each project directory. # # 3. Extract the NUGETS list from all lock files: # find . -name 'packages.lock.json' -exec jq -r ' # .dependencies | to_entries[] | .value | to_entries[] | # "\(.key | ascii_downcase)@\(.value.resolved // .value.requested)" # ' {} + | sort -u # # Replace the PLACEHOLDER line in the NUGETS variable above with this # output. Each line must be `name@version`, no quotes, no commas. # # 4. Verify the build path changes from PR #4179. Check that the linux # packaging files still live at eng/linux/Generic/usr - they may have # moved. If they did, update the cd line in src_install accordingly. # # 5. Generate the manifest: # pkgdev manifest # or: ebuild ./OpenTabletDriver-0.6.7.ebuild manifest # # 6. Test the build in a clean environment before submitting upstream: # ebuild ./OpenTabletDriver-0.6.7.ebuild clean compile # # ============================================================================