uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
113
pkgs/tools/misc/qflipper/default.nix
Normal file
113
pkgs/tools/misc/qflipper/default.nix
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, zlib
|
||||
, libusb1
|
||||
, libGL
|
||||
, qmake
|
||||
, wrapQtAppsHook
|
||||
, mkDerivation
|
||||
|
||||
, qttools
|
||||
, qtbase
|
||||
, qt3d
|
||||
, qtsvg
|
||||
, qtserialport
|
||||
, qtdeclarative
|
||||
, qtquickcontrols
|
||||
, qtquickcontrols2
|
||||
, qtgraphicaleffects
|
||||
, qtwayland
|
||||
, nix-update-script
|
||||
}:
|
||||
let
|
||||
pname = "qFlipper";
|
||||
version = "1.0.2";
|
||||
sha256 = "sha256-CJQOEUwYPNd4x+uBINrxeYVITtYrsEFaYLHQh2l12kA=";
|
||||
timestamp = "99999999999";
|
||||
commit = "nix-${version}";
|
||||
|
||||
udev_rules = ''
|
||||
#Flipper Zero serial port
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ATTRS{manufacturer}=="Flipper Devices Inc.", TAG+="uaccess"
|
||||
#Flipper Zero DFU
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", ATTRS{manufacturer}=="STMicroelectronics", TAG+="uaccess"
|
||||
'';
|
||||
|
||||
in
|
||||
mkDerivation {
|
||||
inherit pname version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "flipperdevices";
|
||||
repo = "qFlipper";
|
||||
rev = version;
|
||||
fetchSubmodules = true;
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
qmake
|
||||
qttools
|
||||
wrapQtAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
zlib
|
||||
libusb1
|
||||
libGL
|
||||
|
||||
qtbase
|
||||
qt3d
|
||||
qtsvg
|
||||
qtserialport
|
||||
qtdeclarative
|
||||
qtquickcontrols
|
||||
qtquickcontrols2
|
||||
qtgraphicaleffects
|
||||
] ++ lib.optionals (stdenv.isLinux) [
|
||||
qtwayland
|
||||
];
|
||||
|
||||
qmakeFlags = [
|
||||
"DEFINES+=DISABLE_APPLICATION_UPDATES"
|
||||
"CONFIG+=qtquickcompiler"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace qflipper_common.pri \
|
||||
--replace 'GIT_VERSION = unknown' 'GIT_VERSION = "${version}"' \
|
||||
--replace 'GIT_TIMESTAMP = 0' 'GIT_TIMESTAMP = ${timestamp}' \
|
||||
--replace 'GIT_COMMIT = unknown' 'GIT_COMMIT = "${commit}"'
|
||||
cat qflipper_common.pri
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/bin
|
||||
${lib.optionalString stdenv.isDarwin ''
|
||||
cp qFlipper.app/Contents/MacOS/qFlipper $out/bin
|
||||
''}
|
||||
cp qFlipper-cli $out/bin
|
||||
|
||||
mkdir -p $out/etc/udev/rules.d
|
||||
tee $out/etc/udev/rules.d/42-flipperzero.rules << EOF
|
||||
${udev_rules}
|
||||
EOF
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script {
|
||||
attrPath = pname;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isDarwin;
|
||||
description = "Cross-platform desktop tool to manage your flipper device";
|
||||
homepage = "https://flipperzero.one/";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ cab404 ];
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ]; # qtbase doesn't build yet on aarch64-darwin
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue