brscan5: use udevCheckHook and fix permissions of udev rules file

r-vdp 6035e60b 6246ea0e

+6 -5
-4
nixos/tests/brscan5.nix
··· 48 48 print(scanimage) 49 49 assert """device `brother5:net1;dev0' is a Brother b ADS-1200""" in scanimage 50 50 assert """device `brother5:net1;dev1' is a Brother a ADS-1200""" in scanimage 51 - 52 - # Confirm systemd-udevd no longer logs errors about SYSFS 53 - logs = machine.succeed('journalctl --unit systemd-udevd') 54 - assert "Invalid key 'SYSFS'" not in logs 55 51 ''; 56 52 } 57 53 )
+6 -1
pkgs/by-name/br/brscan5/package.nix
··· 9 9 glib, 10 10 libredirect, 11 11 nixosTests, 12 + udevCheckHook, 12 13 }: 13 14 let 14 15 myPatchElf = file: '' ··· 43 44 nativeBuildInputs = [ 44 45 makeWrapper 45 46 patchelf 47 + udevCheckHook 46 48 ]; 47 49 buildInputs = [ 48 50 libusb1 ··· 114 116 echo "brother5" > $out/etc/sane.d/dll.d/brother5.conf 115 117 116 118 mkdir -p $out/etc/udev/rules.d 117 - cp -p $PATH_TO_BRSCAN5/udev-rules/NN-brother-mfp-brscan5-1.0.2-2.rules \ 119 + install -m 0444 $PATH_TO_BRSCAN5/udev-rules/NN-brother-mfp-brscan5-1.0.2-2.rules \ 118 120 $out/etc/udev/rules.d/49-brother-mfp-brscan5-1.0.2-2.rules 119 121 120 122 ETCDIR=$out/etc/opt/brother/scanner/brscan5 ··· 123 125 124 126 runHook postInstall 125 127 ''; 128 + 129 + # We want to run the udevCheckHook 130 + doInstallCheck = true; 126 131 127 132 dontPatchELF = true; 128 133