4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
50 lines
1.5 KiB
Nix
50 lines
1.5 KiB
Nix
{ lib, stdenv, mkDerivation, fetchFromGitHub
|
|
, cmake, gcc-arm-embedded, python3Packages
|
|
, qtbase, qtmultimedia, qttranslations, SDL, gtest
|
|
, dfu-util, avrdude
|
|
}:
|
|
|
|
mkDerivation rec {
|
|
pname = "opentx";
|
|
version = "2.3.10";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "opentx";
|
|
repo = "opentx";
|
|
rev = "release/${version}";
|
|
sha256 = "1pp3k1802gl1rji98clv17wj0619dliq821mpi4446lk22q692yq";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake gcc-arm-embedded python3Packages.pillow ];
|
|
|
|
buildInputs = [ qtbase qtmultimedia qttranslations SDL ];
|
|
|
|
postPatch = ''
|
|
sed -i companion/src/burnconfigdialog.cpp \
|
|
-e 's|/usr/.*bin/dfu-util|${dfu-util}/bin/dfu-util|' \
|
|
-e 's|/usr/.*bin/avrdude|${avrdude}/bin/avrdude|'
|
|
'';
|
|
|
|
cmakeFlags = [
|
|
"-DGTEST_ROOT=${gtest.src}/googletest"
|
|
"-DQT_TRANSLATIONS_DIR=${qttranslations}/translations"
|
|
# XXX I would prefer to include these here, though we will need to file a bug upstream to get that changed.
|
|
#"-DDFU_UTIL_PATH=${dfu-util}/bin/dfu-util"
|
|
#"-DAVRDUDE_PATH=${avrdude}/bin/avrdude"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "OpenTX Companion transmitter support software";
|
|
longDescription = ''
|
|
OpenTX Companion is used for many different tasks like loading OpenTX
|
|
firmware to the radio, backing up model settings, editing settings and
|
|
running radio simulators.
|
|
'';
|
|
homepage = "https://www.open-tx.org/";
|
|
license = licenses.gpl2;
|
|
platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
|
|
maintainers = with maintainers; [ elitak lopsided98 ];
|
|
};
|
|
|
|
}
|