2022-02-20 05:27:41 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, zlib
|
|
|
|
, libusb1
|
|
|
|
, libGL
|
|
|
|
, qmake
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2022-02-20 05:27:41 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, mkDerivation
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
, qttools
|
|
|
|
, qtbase
|
|
|
|
, qt3d
|
|
|
|
, qtsvg
|
|
|
|
, qtserialport
|
|
|
|
, qtdeclarative
|
|
|
|
, qtquickcontrols
|
|
|
|
, qtquickcontrols2
|
|
|
|
, qtgraphicaleffects
|
|
|
|
, qtwayland
|
2022-05-18 14:49:53 +00:00
|
|
|
, nix-update-script
|
2022-02-20 05:27:41 +00:00
|
|
|
}:
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
2022-05-18 14:49:53 +00:00
|
|
|
pname = "qFlipper";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.3.3";
|
|
|
|
sha256 = "sha256-/Xzy+OA0Nl/UlSkOOZW2YsOHdJvS/7X3Z3ITkPByAOc=";
|
2022-02-20 05:27:41 +00:00
|
|
|
timestamp = "99999999999";
|
|
|
|
commit = "nix-${version}";
|
|
|
|
|
|
|
|
in
|
|
|
|
mkDerivation {
|
2022-05-18 14:49:53 +00:00
|
|
|
inherit pname version;
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "flipperdevices";
|
|
|
|
repo = "qFlipper";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2022-05-18 14:49:53 +00:00
|
|
|
inherit sha256;
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
qmake
|
|
|
|
qttools
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2022-04-15 01:41:22 +00:00
|
|
|
wrapQtAppsHook
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
zlib
|
|
|
|
libusb1
|
|
|
|
libGL
|
|
|
|
|
|
|
|
qtbase
|
|
|
|
qt3d
|
|
|
|
qtsvg
|
|
|
|
qtserialport
|
|
|
|
qtdeclarative
|
|
|
|
qtquickcontrols
|
|
|
|
qtquickcontrols2
|
|
|
|
qtgraphicaleffects
|
|
|
|
] ++ lib.optionals (stdenv.isLinux) [
|
|
|
|
qtwayland
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
qmakeFlags = [
|
|
|
|
"DEFINES+=DISABLE_APPLICATION_UPDATES"
|
|
|
|
"CONFIG+=qtquickcompiler"
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
postPatch = ''
|
2022-02-20 05:27:41 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
postInstall = ''
|
2022-02-20 05:27:41 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
${lib.optionalString stdenv.isDarwin ''
|
2022-04-15 01:41:22 +00:00
|
|
|
cp qFlipper.app/Contents/MacOS/qFlipper $out/bin
|
2022-02-20 05:27:41 +00:00
|
|
|
''}
|
2022-04-15 01:41:22 +00:00
|
|
|
cp qFlipper-cli $out/bin
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
mkdir -p $out/etc/udev/rules.d
|
2022-09-14 18:05:37 +00:00
|
|
|
cp installer-assets/udev/42-flipperzero.rules $out/etc/udev/rules.d/
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Cross-platform desktop tool to manage your flipper device";
|
|
|
|
homepage = "https://flipperzero.one/";
|
2022-02-20 05:27:41 +00:00
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ cab404 ];
|
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ]; # qtbase doesn't build yet on aarch64-darwin
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|