tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
i810switch: modernize
Moraxyc
1 year ago
39a2802a
9469c20c
+28
-14
1 changed file
expand all
collapse all
unified
split
pkgs
by-name
i8
i810switch
package.nix
+28
-14
pkgs/by-name/i8/i810switch/package.nix
···
2
2
lib,
3
3
stdenv,
4
4
fetchurl,
5
5
+
installShellFiles,
5
6
pciutils,
6
7
}:
7
8
8
8
-
stdenv.mkDerivation {
9
9
+
stdenv.mkDerivation (finalAttrs: {
9
10
pname = "i810switch";
10
11
version = "0.6.5";
11
12
12
12
-
installPhase = "
13
13
-
sed -i -e 's+/usr++' Makefile
14
14
-
sed -i -e 's+^\\(.*putenv(\"PATH=\\).*$+\\1${pciutils}/sbin\");+' i810switch.c
15
15
-
make clean
16
16
-
make install DESTDIR=\${out}
17
17
-
";
18
18
-
19
13
src = fetchurl {
20
20
-
url = "http://www16.plala.or.jp/mano-a-mano/i810switch/i810switch-0.6.5.tar.gz";
21
21
-
sha256 = "d714840e3b14e1fa9c432c4be0044b7c008d904dece0d611554655b979cad4c3";
14
14
+
url = "http://www16.plala.or.jp/mano-a-mano/i810switch/i810switch-${finalAttrs.version}.tar.gz";
15
15
+
hash = "sha256-1xSEDjsU4fqcQyxL4ARLfACNkE3s4NYRVUZVuXnK1MM=";
22
16
};
23
17
18
18
+
nativeBuildInputs = [ installShellFiles ];
19
19
+
20
20
+
preBuild = ''
21
21
+
make clean
22
22
+
23
23
+
substituteInPlace i810switch.c \
24
24
+
--replace-fail 'define CMD_LSPCI "lspci"' 'define CMD_LSPCI "${lib.getExe' pciutils "lspci"}"'
25
25
+
'';
26
26
+
27
27
+
installPhase = "
28
28
+
runHook preInstall
29
29
+
30
30
+
install -Dm755 -t $out/bin i810switch i810rotate
31
31
+
32
32
+
installManPage i810switch.1.gz i810rotate.1.gz
33
33
+
34
34
+
runHook postInstall
35
35
+
";
36
36
+
24
37
# Ignore errors since gcc-14.
25
38
# i810switch.c:251:34: error: passing argument 2 of 'getline' from incompatible pointer type [-Wincompatible-pointer-types]
26
39
# i810switch.c:296:34: error: passing argument 2 of 'getline' from incompatible pointer type [-Wincompatible-pointer-types]
27
40
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
28
41
29
29
-
meta = with lib; {
42
42
+
meta = {
30
43
description = "Utility for switching between the LCD and external VGA display on Intel graphics cards";
31
44
homepage = "http://www16.plala.or.jp/mano-a-mano/i810switch.html";
32
45
maintainers = [ ];
33
33
-
license = licenses.gpl2Only;
34
34
-
platforms = platforms.linux;
46
46
+
license = lib.licenses.gpl2Only;
47
47
+
platforms = lib.platforms.linux;
48
48
+
mainProgram = "i810switch";
35
49
};
36
36
-
}
50
50
+
})