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