opentrack: 2.1.3 → 2022.3.0

Fixes #185520
This commit is contained in:
Francesco Zanini 2022-08-09 22:14:13 +02:00
parent 97dfd0e253
commit f38a47d64a

View file

@ -1,58 +1,79 @@
{ mkDerivation, lib, callPackage, fetchzip, fetchFromGitHub, cmake, pkg-config {
, ninja, copyDesktopItems, qtbase, qttools, opencv4, procps, eigen, libXdmcp mkDerivation,
, libevdev, makeDesktopItem, fetchurl }: lib,
callPackage,
fetchzip,
fetchFromGitHub,
cmake,
pkg-config,
ninja,
copyDesktopItems,
qtbase,
qttools,
opencv4,
procps,
eigen,
libXdmcp,
libevdev,
makeDesktopItem,
fetchurl,
}: let
version = "2022.3.0";
let aruco = callPackage ./aruco.nix {};
version = "2.3.13";
aruco = callPackage ./aruco.nix { };
# license.txt inside the zip file is MIT # license.txt inside the zip file is MIT
xplaneSdk = fetchzip { xplaneSdk = fetchzip {
url = "https://developer.x-plane.com/wp-content/plugins/code-sample-generation/sample_templates/XPSDK303.zip"; url = "https://developer.x-plane.com/wp-content/plugins/code-sample-generation/sample_templates/XPSDK303.zip";
sha256 = "11wqjsr996c5qhiv2djsd55gc373a9qcq30dvc6rhzm0fys42zba"; sha256 = "11wqjsr996c5qhiv2djsd55gc373a9qcq30dvc6rhzm0fys42zba";
}; };
in
mkDerivation {
pname = "opentrack";
inherit version;
in mkDerivation { src = fetchFromGitHub {
pname = "opentrack"; owner = "opentrack";
inherit version; repo = "opentrack";
rev = "opentrack-${version}";
sha256 = "sha256-8gpNORTJclYUYp57Vw/0YO3XC9Idurt0a79fhqx0+mo=";
};
src = fetchFromGitHub { nativeBuildInputs = [cmake pkg-config ninja copyDesktopItems];
owner = "opentrack"; buildInputs = [qtbase qttools opencv4 procps eigen libXdmcp libevdev aruco];
repo = "opentrack";
rev = "opentrack-${version}";
sha256 = "1s986lmm5l1pwbwvd1pfiq84n32s1q1dav7a0cbga4d1vcf0v1ay";
};
nativeBuildInputs = [ cmake pkg-config ninja copyDesktopItems ]; NIX_CFLAGS_COMPILE = "-Wall -Wextra -Wpedantic -ffast-math -march=native -O3";
buildInputs = [ qtbase qttools opencv4 procps eigen libXdmcp libevdev aruco ]; dontWrapQtApps = true;
NIX_CFLAGS_COMPILE = "-Wall -Wextra -Wpedantic -ffast-math -march=native -O3"; cmakeFlags = [
"-DCMAKE_BUILD_TYPE=RELEASE"
"-DSDK_ARUCO_LIBPATH=${aruco}/lib/libaruco.a"
"-DSDK_XPLANE=${xplaneSdk}"
];
cmakeFlags = [ postInstall = ''
"-DCMAKE_BUILD_TYPE=RELEASE" wrapQtApp $out/bin/opentrack
"-DSDK_ARUCO_LIBPATH=${aruco}/lib/libaruco.a" '';
"-DSDK_XPLANE=${xplaneSdk}"
];
desktopItems = [ desktopItems = [
(makeDesktopItem rec { (makeDesktopItem rec {
name = "opentrack"; name = "opentrack";
exec = "opentrack"; exec = "opentrack";
icon = fetchurl { icon = fetchurl {
url = "https://github.com/opentrack/opentrack/raw/opentrack-${version}/gui/images/opentrack.png"; url = "https://github.com/opentrack/opentrack/raw/opentrack-${version}/gui/images/opentrack.png";
sha256 = "0d114zk78f7nnrk89mz4gqn7yk3k71riikdn29w6sx99h57f6kgn"; sha256 = "0d114zk78f7nnrk89mz4gqn7yk3k71riikdn29w6sx99h57f6kgn";
}; };
desktopName = name; desktopName = name;
genericName = "Head tracking software"; genericName = "Head tracking software";
categories = [ "Utility" ]; categories = ["Utility"];
}) })
]; ];
meta = with lib; { meta = with lib; {
homepage = "https://github.com/opentrack/opentrack"; homepage = "https://github.com/opentrack/opentrack";
description = "Head tracking software for MS Windows, Linux, and Apple OSX"; description = "Head tracking software for MS Windows, Linux, and Apple OSX";
license = licenses.isc; changelog = "https://github.com/opentrack/opentrack/releases/tag/${version}";
maintainers = with maintainers; [ zaninime ]; license = licenses.isc;
}; maintainers = with maintainers; [zaninime];
} };
}