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