Unverified Commit 6035e60b authored by r-vdp's avatar r-vdp
Browse files

brscan5: use udevCheckHook and fix permissions of udev rules file

parent 6246ea0e
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -48,10 +48,6 @@ import ./make-test-python.nix (
      print(scanimage)
      assert """device `brother5:net1;dev0' is a Brother b ADS-1200""" in scanimage
      assert """device `brother5:net1;dev1' is a Brother a ADS-1200""" in scanimage

      # Confirm systemd-udevd no longer logs errors about SYSFS
      logs = machine.succeed('journalctl --unit systemd-udevd')
      assert "Invalid key 'SYSFS'" not in logs
    '';
  }
)
+6 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
  glib,
  libredirect,
  nixosTests,
  udevCheckHook,
}:
let
  myPatchElf = file: ''
@@ -43,6 +44,7 @@ stdenv.mkDerivation rec {
  nativeBuildInputs = [
    makeWrapper
    patchelf
    udevCheckHook
  ];
  buildInputs = [
    libusb1
@@ -114,7 +116,7 @@ stdenv.mkDerivation rec {
    echo "brother5" > $out/etc/sane.d/dll.d/brother5.conf

    mkdir -p $out/etc/udev/rules.d
    cp -p $PATH_TO_BRSCAN5/udev-rules/NN-brother-mfp-brscan5-1.0.2-2.rules \
    install -m 0444 $PATH_TO_BRSCAN5/udev-rules/NN-brother-mfp-brscan5-1.0.2-2.rules \
      $out/etc/udev/rules.d/49-brother-mfp-brscan5-1.0.2-2.rules

    ETCDIR=$out/etc/opt/brother/scanner/brscan5
@@ -124,6 +126,9 @@ stdenv.mkDerivation rec {
    runHook postInstall
  '';

  # We want to run the udevCheckHook
  doInstallCheck = true;

  dontPatchELF = true;

  passthru.tests = { inherit (nixosTests) brscan5; };