Skip to content

Commit

Permalink
opentabletdriver: 0.6.4.0-unstable-2024-11-25 -> 0.6.5.0 (NixOS#366791)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada authored Dec 20, 2024
2 parents de0a5d8 + a1e6b47 commit c57e953
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 41 deletions.
5 changes: 5 additions & 0 deletions pkgs/by-name/op/opentabletdriver/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 22 additions & 20 deletions pkgs/by-name/op/opentabletdriver/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -120,6 +115,12 @@ buildDotnetModule rec {
})
];

doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgram = "${placeholder "out"}/bin/otd-daemon";

passthru = {
updateScript = ./update.sh;
tests = {
Expand All @@ -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
Expand All @@ -139,6 +142,5 @@ buildDotnetModule rec {
"x86_64-linux"
"aarch64-linux"
];
mainProgram = "otd";
};
}
})
27 changes: 6 additions & 21 deletions pkgs/by-name/op/opentabletdriver/update.sh
Original file line number Diff line number Diff line change
@@ -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)"

0 comments on commit c57e953

Please sign in to comment.