nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitLab,
5 cmake,
6 pkg-config,
7 libusb1,
8 libftdi1,
9}:
10
11stdenv.mkDerivation {
12 pname = "fw-ectool";
13 version = "0-unstable-2024-04-23";
14
15 src = fetchFromGitLab {
16 domain = "gitlab.howett.net";
17 owner = "DHowett";
18 repo = "ectool";
19 rev = "abdd574ebe3640047988cb928bb6789a15dd1390";
20 hash = "sha256-j0Z2Uo1LBXlHZVHPm4Xjx3LZaI6Qq0nSdViyC/CjWC8=";
21 };
22
23 postPatch = ''
24 substituteInPlace CMakeLists.txt --replace-fail \
25 'cmake_minimum_required(VERSION 3.1)' \
26 'cmake_minimum_required(VERSION 4.0)'
27 '';
28
29 nativeBuildInputs = [
30 cmake
31 pkg-config
32 ];
33
34 buildInputs = [
35 libusb1
36 libftdi1
37 ];
38
39 installPhase = ''
40 runHook preInstall
41 install -Dm555 src/ectool "$out/bin/ectool"
42 runHook postInstall
43 '';
44
45 meta = {
46 description = "EC-Tool adjusted for usage with framework embedded controller";
47 homepage = "https://gitlab.howett.net/DHowett/ectool";
48 license = lib.licenses.bsd3;
49 maintainers = [ lib.maintainers.mkg20001 ];
50 platforms = lib.platforms.linux;
51 mainProgram = "ectool";
52 };
53}