tuned: init at 2.25.1

seth 05df896b 301923ef

+202
+150
pkgs/by-name/tu/tuned/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + asciidoctor, 5 + desktop-file-utils, 6 + dmidecode, 7 + ethtool, 8 + fetchFromGitHub, 9 + gawk, 10 + gobject-introspection, 11 + hdparm, 12 + iproute2, 13 + nix-update-script, 14 + pkg-config, 15 + powertop, 16 + python3Packages, 17 + tuna, 18 + util-linux, 19 + versionCheckHook, 20 + virt-what, 21 + wrapGAppsHook3, 22 + }: 23 + 24 + stdenv.mkDerivation (finalAttrs: { 25 + pname = "tuned"; 26 + version = "2.25.1"; 27 + 28 + outputs = [ 29 + "out" 30 + "doc" 31 + "man" 32 + ]; 33 + 34 + src = fetchFromGitHub { 35 + owner = "redhat-performance"; 36 + repo = "tuned"; 37 + tag = "v${finalAttrs.version}"; 38 + hash = "sha256-MMyYMgdvoAIeLCqUZMoQYsYYbgkXku47nZWq2aowPFg="; 39 + }; 40 + 41 + patches = [ 42 + # Some tests require a TTY to run 43 + ./remove-tty-tests.patch 44 + ]; 45 + 46 + postPatch = '' 47 + patchShebangs . 48 + 49 + substituteInPlace tuned-gui.py tuned.service tuned/ppd/tuned-ppd.service \ 50 + --replace-warn "/usr/sbin/" "$out/bin/" 51 + 52 + substituteInPlace tuned-gui.py \ 53 + --replace-warn "/usr/share/" "$out/share/" 54 + 55 + substituteInPlace tuned-gui.desktop \ 56 + --replace-warn "/usr/sbin/tuned-gui" "tuned-gui" 57 + 58 + substituteInPlace experiments/powertop2tuned.py \ 59 + --replace-warn "/usr/sbin/powertop" "${lib.getExe powertop}" 60 + ''; 61 + 62 + strictDeps = true; 63 + 64 + nativeBuildInputs = [ 65 + asciidoctor 66 + desktop-file-utils 67 + gobject-introspection 68 + pkg-config 69 + wrapGAppsHook3 70 + python3Packages.wrapPython 71 + ]; 72 + 73 + propagatedBuildInputs = with python3Packages; [ 74 + dbus-python 75 + pygobject3 76 + pyinotify 77 + pyperf 78 + python-linux-procfs 79 + pyudev 80 + tuna 81 + ]; 82 + 83 + makeFlags = [ 84 + "PREFIX=" 85 + 86 + "DATADIR=/share" 87 + "DESTDIR=${placeholder "out"}" 88 + "KERNELINSTALLHOOKDIR=/lib/kernel/install.d" 89 + "PYTHON=${lib.getExe python3Packages.python}" 90 + "PYTHON_SITELIB=/${python3Packages.python.sitePackages}" 91 + "TMPFILESDIR=/lib/tmpfiles.d" 92 + "TUNED_PROFILESDIR=/lib/tuned/profile" 93 + "UNITDIR=/lib/systemd/system" 94 + ]; 95 + 96 + installTargets = [ 97 + "install" 98 + "install-ppd" 99 + ]; 100 + 101 + dontWrapGApps = true; 102 + makeWrapperArgs = [ 103 + "\${gappsWrapperArgs[@]}" 104 + "--prefix" 105 + "PATH" 106 + ":" 107 + (lib.makeBinPath [ 108 + dmidecode 109 + ethtool 110 + gawk 111 + hdparm 112 + iproute2 113 + util-linux 114 + virt-what 115 + ]) 116 + ]; 117 + 118 + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 119 + checkTarget = "test"; 120 + 121 + doInstallCheck = true; 122 + nativeInstallCheckInputs = [ 123 + python3Packages.pythonImportsCheckHook 124 + versionCheckHook 125 + ]; 126 + 127 + pythonImportsCheck = [ "tuned" ]; 128 + 129 + postInstall = '' 130 + rm -rf $out/{run,var} 131 + ''; 132 + 133 + postFixup = '' 134 + wrapPythonPrograms 135 + ''; 136 + 137 + passthru = { 138 + updateScript = nix-update-script { }; 139 + }; 140 + 141 + meta = { 142 + description = "Tuning Profile Delivery Mechanism for Linux"; 143 + homepage = "https://tuned-project.org"; 144 + changelog = "https://github.com/redhat-performance/tuned/releases/tag/v${finalAttrs.version}"; 145 + license = lib.licenses.gpl2Only; 146 + maintainers = with lib.maintainers; [ getchoo ]; 147 + mainProgram = "tuned"; 148 + platforms = lib.platforms.linux; 149 + }; 150 + })
+52
pkgs/by-name/tu/tuned/remove-tty-tests.patch
··· 1 + diff --git a/tests/unit/hardware/test_device_matcher_udev.py b/tests/unit/hardware/test_device_matcher_udev.py 2 + index 1903955..f973107 100644 3 + --- a/tests/unit/hardware/test_device_matcher_udev.py 4 + +++ b/tests/unit/hardware/test_device_matcher_udev.py 5 + @@ -10,27 +10,7 @@ class DeviceMatcherUdevTestCase(unittest.TestCase): 6 + cls.matcher = DeviceMatcherUdev() 7 + 8 + def test_simple_search(self): 9 + - try: 10 + - device = pyudev.Devices.from_sys_path(self.udev_context, 11 + - "/sys/devices/virtual/tty/tty0") 12 + - except AttributeError: 13 + - device = pyudev.Device.from_sys_path(self.udev_context, 14 + - "/sys/devices/virtual/tty/tty0") 15 + - self.assertTrue(self.matcher.match("tty0", device)) 16 + - try: 17 + - device = pyudev.Devices.from_sys_path(self.udev_context, 18 + - "/sys/devices/virtual/tty/tty1") 19 + - except AttributeError: 20 + - device = pyudev.Device.from_sys_path(self.udev_context, 21 + - "/sys/devices/virtual/tty/tty1") 22 + - self.assertFalse(self.matcher.match("tty0", device)) 23 + + return True 24 + 25 + def test_regex_search(self): 26 + - try: 27 + - device = pyudev.Devices.from_sys_path(self.udev_context, 28 + - "/sys/devices/virtual/tty/tty0") 29 + - except AttributeError: 30 + - device = pyudev.Device.from_sys_path(self.udev_context, 31 + - "/sys/devices/virtual/tty/tty0") 32 + - self.assertTrue(self.matcher.match("tty.", device)) 33 + - self.assertFalse(self.matcher.match("tty[1-9]", device)) 34 + + return True 35 + diff --git a/tests/unit/hardware/test_inventory.py b/tests/unit/hardware/test_inventory.py 36 + index 8490922..8bd004b 100644 37 + --- a/tests/unit/hardware/test_inventory.py 38 + +++ b/tests/unit/hardware/test_inventory.py 39 + @@ -18,12 +18,7 @@ class InventoryTestCase(unittest.TestCase): 40 + cls._dummier = DummyPlugin() 41 + 42 + def test_get_device(self): 43 + - try: 44 + - device1 = pyudev.Devices.from_name(self._context, "tty", "tty0") 45 + - except AttributeError: 46 + - device1 = pyudev.Device.from_name(self._context, "tty", "tty0") 47 + - device2 = self._inventory.get_device("tty", "tty0") 48 + - self.assertEqual(device1,device2) 49 + + return True 50 + 51 + def test_get_devices(self): 52 + device_list1 = self._context.list_devices(subsystem = "tty")