Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 245bde3f8d6e
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f1d3b04c0422
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Jan 19, 2021

  1. opentabletdriver: improve update.sh script

    Allow it to update deb package sha256 automatically.
    thiagokokada committed Jan 19, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    samueljsb Samuel Searles-Bryant
    Copy the full SHA
    9887302 View commit details
  2. Copy the full SHA
    313ee6b View commit details

Commits on Jan 20, 2021

  1. Merge pull request #109966 from thiagokokada/bump-opentabletdriver

    opentabletdriver: 0.4.2 -> 0.5.0
    kevincox authored Jan 20, 2021
    Copy the full SHA
    f1d3b04 View commit details
Showing with 40 additions and 31 deletions.
  1. +8 −5 nixos/tests/opentabletdriver.nix
  2. +10 −7 pkgs/tools/X11/opentabletdriver/default.nix
  3. +14 −19 pkgs/tools/X11/opentabletdriver/deps.nix
  4. +8 −0 pkgs/tools/X11/opentabletdriver/update.sh
13 changes: 8 additions & 5 deletions nixos/tests/opentabletdriver.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import ./make-test-python.nix ( { pkgs, ... }: {
import ./make-test-python.nix ( { pkgs, ... }: let
testUser = "alice";
in {
name = "opentabletdriver";
meta = {
maintainers = with pkgs.lib.maintainers; [ thiagokokada ];
@@ -10,18 +12,19 @@ import ./make-test-python.nix ( { pkgs, ... }: {
./common/user-account.nix
./common/x11.nix
];
test-support.displayManager.auto.user = "alice";
test-support.displayManager.auto.user = testUser;
hardware.opentabletdriver.enable = true;
};

testScript =
''
machine.start()
machine.wait_for_x()
machine.wait_for_unit("opentabletdriver.service", "alice")
machine.wait_for_unit("opentabletdriver.service", "${testUser}")
machine.succeed("cat /etc/udev/rules.d/30-opentabletdriver.rules")
machine.succeed("cat /etc/udev/rules.d/99-opentabletdriver.rules")
# Will fail if service is not running
machine.succeed("otd detect")
# Needs to run as the same user that started the service
machine.succeed("su - ${testUser} -c 'otd detect'")
'';
})
17 changes: 10 additions & 7 deletions pkgs/tools/X11/opentabletdriver/default.nix
Original file line number Diff line number Diff line change
@@ -23,18 +23,18 @@

stdenv.mkDerivation rec {
pname = "OpenTabletDriver";
version = "0.4.2";
version = "0.5.0";

src = fetchFromGitHub {
owner = "InfinityGhost";
repo = "OpenTabletDriver";
rev = "v${version}";
sha256 = "048y7gjlk2yw4vh62px1d9w0va6ap1a0cndcpbirlyj9q6b8jxax";
sha256 = "1xi97nn5zb4fs3pyyqznvxnz07j30j3p967s7jigjmlm9321vkqp";
};

debPkg = fetchurl {
url = "https://github.com/InfinityGhost/OpenTabletDriver/releases/download/v${version}/OpenTabletDriver.deb";
sha256 = "13gg0dhvjy88h9lhcrp30fjiwgb9dzjsgk1k760pi1ki71a5vz2r";
sha256 = "06m2g5qvc02ga9f98f2ssa7wr2b7b2qm90qwaf17fz5z8rr0qmp0";
};

nativeBuildInputs = [
@@ -134,8 +134,8 @@ stdenv.mkDerivation rec {
install -Dm644 $src/OpenTabletDriver.UX/Assets/otd.png -t $out/share/pixmaps
# TODO: Ideally this should be build from OpenTabletDriver/OpenTabletDriver-udev instead
dpkg-deb --fsys-tarfile ${debPkg} | tar xf - ./usr/lib/udev/rules.d/30-opentabletdriver.rules
install -Dm644 ./usr/lib/udev/rules.d/30-opentabletdriver.rules -t $out/lib/udev/rules.d
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
runHook postInstall
'';
@@ -155,8 +155,11 @@ stdenv.mkDerivation rec {
dontWrapGApps = true;
dontStrip = true;

passthru.tests = {
otd-runs = nixosTests.opentabletdriver;
passthru = {
updateScript = ./update.sh;
tests = {
otd-runs = nixosTests.opentabletdriver;
};
};

meta = with lib; {
33 changes: 14 additions & 19 deletions pkgs/tools/X11/opentabletdriver/deps.nix

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

8 changes: 8 additions & 0 deletions pkgs/tools/X11/opentabletdriver/update.sh
Original file line number Diff line number Diff line change
@@ -14,6 +14,14 @@ if [[ "$new_version" == "$old_version" ]]; then
[[ "${1}" != "--force" ]] && exit 0
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 ../../../..
update-source-version opentabletdriver "$new_version"
store_src="$(nix-build . -A opentabletdriver.src --no-out-link)"