opentabletdriver: improve update.sh script
Allow it to update deb package sha256 automatically.
This commit is contained in:
parent
f920653ba0
commit
98873022d4
@ -155,9 +155,12 @@ stdenv.mkDerivation rec {
|
|||||||
dontWrapGApps = true;
|
dontWrapGApps = true;
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
|
|
||||||
passthru.tests = {
|
passthru = {
|
||||||
|
updateScript = ./update.sh;
|
||||||
|
tests = {
|
||||||
otd-runs = nixosTests.opentabletdriver;
|
otd-runs = nixosTests.opentabletdriver;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Open source, cross-platform, user-mode tablet driver";
|
description = "Open source, cross-platform, user-mode tablet driver";
|
||||||
|
@ -14,6 +14,14 @@ if [[ "$new_version" == "$old_version" ]]; then
|
|||||||
[[ "${1}" != "--force" ]] && exit 0
|
[[ "${1}" != "--force" ]] && exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Updating the hash of deb package manually since there seems to be no way to do it automatically
|
||||||
|
oldDebPkgUrl="https://github.com/InfinityGhost/OpenTabletDriver/releases/download/v${old_version}/OpenTabletDriver.deb";
|
||||||
|
newDebPkgUrl="https://github.com/InfinityGhost/OpenTabletDriver/releases/download/v${new_version}/OpenTabletDriver.deb";
|
||||||
|
oldDebSha256=$(nix-prefetch-url "$oldDebPkgUrl")
|
||||||
|
newDebSha256=$(nix-prefetch-url "$newDebPkgUrl")
|
||||||
|
echo "oldDebSha256: $oldDebSha256 newDebSha256: $newDebSha256"
|
||||||
|
sed -i ./default.nix -re "s|\"$oldDebSha256\"|\"$newDebSha256\"|"
|
||||||
|
|
||||||
cd ../../../..
|
cd ../../../..
|
||||||
update-source-version opentabletdriver "$new_version"
|
update-source-version opentabletdriver "$new_version"
|
||||||
store_src="$(nix-build . -A opentabletdriver.src --no-out-link)"
|
store_src="$(nix-build . -A opentabletdriver.src --no-out-link)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user