nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 mkDerivation,
4 fetchFromGitHub,
5 cmake,
6 gcc-arm-embedded,
7 python3Packages,
8 qtbase,
9 qtmultimedia,
10 qttools,
11 SDL,
12 gtest,
13 dfu-util,
14 avrdude,
15 udevCheckHook,
16}:
17
18mkDerivation rec {
19 pname = "opentx";
20 version = "2.3.15";
21
22 src = fetchFromGitHub {
23 owner = "opentx";
24 repo = "opentx";
25 rev = "release/${version}";
26 sha256 = "sha256-F3zykJhKuIpLQSTjn7mcdjEmgRAlwCZpkTaKQR9ve3g=";
27 };
28
29 nativeBuildInputs = [
30 cmake
31 gcc-arm-embedded
32 python3Packages.pillow
33 qttools
34 udevCheckHook
35 ];
36
37 buildInputs = [
38 qtbase
39 qtmultimedia
40 SDL
41 ];
42
43 postPatch = ''
44 sed -i companion/src/burnconfigdialog.cpp \
45 -e 's|/usr/.*bin/dfu-util|${dfu-util}/bin/dfu-util|' \
46 -e 's|/usr/.*bin/avrdude|${avrdude}/bin/avrdude|'
47 '';
48
49 cmakeFlags = [
50 "-DGTEST_ROOT=${gtest.src}/googletest"
51 # XXX I would prefer to include these here, though we will need to file a bug upstream to get that changed.
52 #"-DDFU_UTIL_PATH=${dfu-util}/bin/dfu-util"
53 #"-DAVRDUDE_PATH=${avrdude}/bin/avrdude"
54
55 # file RPATH_CHANGE could not write new RPATH
56 "-DCMAKE_SKIP_BUILD_RPATH=ON"
57 ];
58
59 doInstallCheck = true;
60
61 meta = with lib; {
62 description = "OpenTX Companion transmitter support software";
63 longDescription = ''
64 OpenTX Companion is used for many different tasks like loading OpenTX
65 firmware to the radio, backing up model settings, editing settings and
66 running radio simulators.
67 '';
68 mainProgram = "companion" + lib.concatStrings (lib.take 2 (lib.splitVersion version));
69 homepage = "https://www.open-tx.org/";
70 license = licenses.gpl2Only;
71 platforms = [
72 "i686-linux"
73 "x86_64-linux"
74 "aarch64-linux"
75 ];
76 maintainers = with maintainers; [
77 elitak
78 lopsided98
79 ];
80 };
81
82}