diff --git a/pkgs/by-name/op/opentabletdriver/deps.json b/pkgs/by-name/op/opentabletdriver/deps.json index 89827461a22fe..3a9322d5d7fba 100644 --- a/pkgs/by-name/op/opentabletdriver/deps.json +++ b/pkgs/by-name/op/opentabletdriver/deps.json @@ -19,6 +19,11 @@ "version": "3.0.2", "hash": "sha256-b8LCEIZCLJdYcJXQqI3TGDmkLrmLhz84eoTq+qP5xvU=" }, + { + "pname": "DiffPlex", + "version": "1.7.2", + "hash": "sha256-Vsn81duAmPIPkR40h5bEz7hgtF5Kt5nAAGhQZrQbqxE=" + }, { "pname": "Eto.Forms", "version": "2.5.10", diff --git a/pkgs/by-name/op/opentabletdriver/package.nix b/pkgs/by-name/op/opentabletdriver/package.nix index 7293028faa14d..fcb0461de3070 100644 --- a/pkgs/by-name/op/opentabletdriver/package.nix +++ b/pkgs/by-name/op/opentabletdriver/package.nix @@ -16,23 +16,21 @@ nixosTests, udev, wrapGAppsHook3, + versionCheckHook, }: -buildDotnetModule rec { +buildDotnetModule (finalAttrs: { pname = "OpenTabletDriver"; - version = "0.6.4.0-unstable-2024-11-25"; + version = "0.6.5.0"; src = fetchFromGitHub { owner = "OpenTabletDriver"; repo = "OpenTabletDriver"; - rev = "8b88b8bdc5144391f10eb61ee77803ba0ee83718"; # 0.6.x branch - hash = "sha256-5JKkSqV9owkHgWXfjiyv5QRh86apDCPzpA6qha1i4D4="; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-ILnwHfcV/tW59TLDpAeDwJK708IQfMFBOYuqRtED0kw="; }; - dotnetInstallFlags = [ "--framework=net8.0" ]; - dotnet-sdk = dotnetCorePackages.sdk_8_0; - dotnet-runtime = dotnetCorePackages.runtime_8_0; projectFile = [ "OpenTabletDriver.Console" @@ -64,23 +62,20 @@ buildDotnetModule rec { udev ]; - buildInputs = runtimeDeps; + buildInputs = finalAttrs.runtimeDeps; doCheck = true; testProjectFile = "OpenTabletDriver.Tests/OpenTabletDriver.Tests.csproj"; disabledTests = [ - # Require networking - "OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarballFork" - "OpenTabletDriver.Tests.PluginRepositoryTest.ExpandRepositoryTarball" # 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" + "OpenTabletDriver.Tests.UpdaterTests.CheckForUpdates_Returns_Update_When_Available" + "OpenTabletDriver.Tests.UpdaterTests.Install_Throws_UpdateAlreadyInstalledException_When_AlreadyInstalled" + "OpenTabletDriver.Tests.UpdaterTests.Install_DoesNotThrow_UpdateAlreadyInstalledException_When_PreviousInstallFailed" + "OpenTabletDriver.Tests.UpdaterTests.Install_Throws_UpdateInProgressException_When_AnotherUpdate_Is_InProgress" + "OpenTabletDriver.Tests.UpdaterTests.Install_Moves_UpdatedBinaries_To_BinDirectory" + "OpenTabletDriver.Tests.UpdaterTests.Install_Moves_Only_ToBeUpdated_Binaries" + "OpenTabletDriver.Tests.UpdaterTests.Install_Copies_AppDataFiles" # Intended only to be run in continuous integration, unnecessary for functionality "OpenTabletDriver.Tests.ConfigurationTest.Configurations_DeviceIdentifier_IsNotConflicting" # Depends on processor load @@ -120,6 +115,12 @@ buildDotnetModule rec { }) ]; + doInstallCheck = true; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/otd-daemon"; + passthru = { updateScript = ./update.sh; tests = { @@ -128,9 +129,11 @@ buildDotnetModule rec { }; meta = { + changelog = "https://github.com/OpenTabletDriver/OpenTabletDriver/releases/tag/v${finalAttrs.version}"; description = "Open source, cross-platform, user-mode tablet driver"; homepage = "https://github.com/OpenTabletDriver/OpenTabletDriver"; license = lib.licenses.lgpl3Plus; + mainProgram = "otd"; maintainers = with lib.maintainers; [ gepbird thiagokokada @@ -139,6 +142,5 @@ buildDotnetModule rec { "x86_64-linux" "aarch64-linux" ]; - mainProgram = "otd"; }; -} +}) diff --git a/pkgs/by-name/op/opentabletdriver/update.sh b/pkgs/by-name/op/opentabletdriver/update.sh index 24f6ec1ffbc4f..61eac4b8b5da4 100755 --- a/pkgs/by-name/op/opentabletdriver/update.sh +++ b/pkgs/by-name/op/opentabletdriver/update.sh @@ -1,23 +1,8 @@ #!/usr/bin/env nix-shell -#!nix-shell -I nixpkgs=./. -i bash -p curl gnused jq common-updater-scripts nixfmt-rfc-style -set -eo pipefail +#!nix-shell --pure -i bash -p bash nix nix-update git cacert +set -euo pipefail -verlte() { - printf '%s\n' "$1" "$2" | sort -C -V -} - -new_version="$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} -s "https://api.github.com/repos/OpenTabletDriver/OpenTabletDriver/releases" | - jq -r 'map(select(.prerelease == false)) | .[0].tag_name' | - cut -c2-)" -old_version="$(nix --extra-experimental-features 'nix-command' eval --file default.nix opentabletdriver.version --raw)" - -if verlte "$new_version" "$old_version"; then - echo "Already up to date!" - [[ "${1}" != "--force" ]] && exit 0 -fi - -update-source-version opentabletdriver "$new_version" -eval "$(nix-build -A opentabletdriver.fetch-deps --no-out-link)" - -cd "$(dirname "${BASH_SOURCE[0]}")" -nixfmt deps.nix +prev_version=$(nix eval --raw -f. opentabletdriver.version) +nix-update opentabletdriver +[[ $(nix eval --raw -f. opentabletdriver.version) == "$prev_version" ]] || + "$(nix-build . -A opentabletdriver.fetch-deps --no-out-link)"