nixpkgs/pkgs/tools/misc/qflipper/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

106 lines
2.1 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, fetchFromGitHub
, pkg-config
, zlib
, libusb1
, libGL
, qmake
2022-12-31 00:24:40 +01:00
, wrapGAppsHook
, wrapQtAppsHook
, mkDerivation
2021-11-17 03:05:44 +01:00
, qttools
, qtbase
, qt3d
, qtsvg
, qtserialport
, qtdeclarative
, qtquickcontrols
, qtquickcontrols2
, qtgraphicaleffects
, qtwayland
, nix-update-script
}:
2021-11-17 03:05:44 +01:00
let
pname = "qFlipper";
2023-06-10 08:31:16 +02:00
version = "1.3.2";
sha256 = "sha256-n/vvLR4p7ZmQC+FuYOvarmgydfYwxRBRktzs7CfiNQg=";
timestamp = "99999999999";
commit = "nix-${version}";
in
mkDerivation {
inherit pname version;
src = fetchFromGitHub {
owner = "flipperdevices";
repo = "qFlipper";
rev = version;
fetchSubmodules = true;
inherit sha256;
2021-11-17 03:05:44 +01:00
};
nativeBuildInputs = [
pkg-config
qmake
qttools
2022-12-31 00:24:40 +01:00
wrapGAppsHook
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"
];
2022-12-31 00:24:40 +01:00
dontWrapGApps = true;
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
cp installer-assets/udev/42-flipperzero.rules $out/etc/udev/rules.d/
2021-11-17 03:05:44 +01:00
'';
passthru.updateScript = nix-update-script { };
2021-11-17 03:05:44 +01:00
meta = with lib; {
broken = stdenv.isDarwin;
2021-11-17 03:05:44 +01:00
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
2021-11-17 03:05:44 +01:00
};
}