nixpkgs/pkgs/applications/misc/opentrack/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

108 lines
2.5 KiB
Nix

{
pkgs,
mkDerivation,
lib,
callPackage,
fetchzip,
fetchFromGitHub,
cmake,
pkg-config,
ninja,
copyDesktopItems,
qtbase,
qttools,
opencv4,
procps,
eigen,
libXdmcp,
libevdev,
makeDesktopItem,
fetchurl,
fetchpatch,
wineWowPackages,
}:
let
version = "2023.3.0";
aruco = callPackage ./aruco.nix { };
# license.txt inside the zip file is MIT
xplaneSdk = fetchzip {
url = "https://developer.x-plane.com/wp-content/plugins/code-sample-generation/sdk_zip_files/XPSDK401.zip";
hash = "sha256-tUT9yV1949QVr5VebU/7esg7wwWkyak2TSA/kQSrbeo=";
};
in
mkDerivation {
pname = "opentrack";
inherit version;
src = fetchFromGitHub {
owner = "opentrack";
repo = "opentrack";
rev = "opentrack-${version}";
hash = "sha256-C0jLS55DcLJh/e5yM8kLG7fhhKvBNllv5HkfCWRIfc4=";
};
patches = [
# https://github.com/opentrack/opentrack/pull/1754
(fetchpatch {
url = "https://github.com/opentrack/opentrack/commit/d501d7e0b237ed0c305525788b423d842ffa356d.patch";
hash = "sha256-XMGHV78vt/Xn3hS+4V//pqtsdBQCfJPjIXxfwtdXX+Q=";
})
];
nativeBuildInputs = [
cmake
pkg-config
ninja
copyDesktopItems
];
buildInputs = [
qtbase
qttools
opencv4
procps
eigen
libXdmcp
libevdev
aruco
] ++ lib.optionals pkgs.stdenv.targetPlatform.isx86_64 [ wineWowPackages.stable ];
env.NIX_CFLAGS_COMPILE = "-Wall -Wextra -Wpedantic -ffast-math -O3";
dontWrapQtApps = true;
cmakeFlags = [
"-GNinja"
"-DCMAKE_BUILD_TYPE=Release"
"-DSDK_ARUCO_LIBPATH=${aruco}/lib/libaruco.a"
"-DSDK_XPLANE=${xplaneSdk}"
] ++ lib.optionals pkgs.stdenv.targetPlatform.isx86_64 [ "-DSDK_WINE=ON" ];
postInstall = ''
wrapQtApp $out/bin/opentrack
'';
desktopItems = [
(makeDesktopItem rec {
name = "opentrack";
exec = "opentrack";
icon = fetchurl {
url = "https://github.com/opentrack/opentrack/raw/opentrack-${version}/gui/images/opentrack.png";
hash = "sha256-9k3jToEpdW14ErbNGHM4c0x/LH7k14RmtvY4dOYnITQ=";
};
desktopName = name;
genericName = "Head tracking software";
categories = [ "Utility" ];
})
];
meta = with lib; {
homepage = "https://github.com/opentrack/opentrack";
description = "Head tracking software for MS Windows, Linux, and Apple OSX";
mainProgram = "opentrack";
changelog = "https://github.com/opentrack/opentrack/releases/tag/${version}";
license = licenses.isc;
maintainers = with maintainers; [ zaninime ];
};
}