From 5652c2561cfa196b90b3f5e815d63614cd4bbccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Sat, 4 Apr 2020 16:29:45 +0200 Subject: [PATCH] Add mangohud --- default.nix | 3 +-- pkgs/MangoHUD/default.nix | 42 +++++++++++++++++++++++++++++++++++++++ pkgs/av1an/default.nix | 36 --------------------------------- 3 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 pkgs/MangoHUD/default.nix delete mode 100644 pkgs/av1an/default.nix diff --git a/default.nix b/default.nix index 1d92882..7552414 100644 --- a/default.nix +++ b/default.nix @@ -20,12 +20,11 @@ rank_photos = pkgs.callPackage ./pkgs/rank_photos { }; JAVMovieScraper = pkgs.callPackage ./pkgs/JAVMovieScraper { }; - av1an = pkgs.callPackage ./pkgs/av1an { }; - janus = pkgs.libsForQt5.callPackage ./pkgs/JanusVR/client { }; radical-native = pkgs.callPackage ./pkgs/radical-native { }; photini = pkgs.libsForQt5.callPackage ./pkgs/photini { }; + mangohud = pkgs.callPackage ./pkgs/MangoHUD { }; } diff --git a/pkgs/MangoHUD/default.nix b/pkgs/MangoHUD/default.nix new file mode 100644 index 0000000..7c80f88 --- /dev/null +++ b/pkgs/MangoHUD/default.nix @@ -0,0 +1,42 @@ +{ stdenv, lib, fetchFromGitHub +, pkgconfig, ninja, meson +, python3Packages, glslang, libglvnd +, xorg, git, vulkan-loader, vulkan-headers}: + +let + version = "0.3.1"; +in + +stdenv.mkDerivation { + pname = "mangohud"; + inherit version; + + src = fetchFromGitHub { + fetchSubmodules = true; + owner = "flightlessmango"; + repo = "MangoHud"; + rev = "v${version}"; + sha256 = "0sh5kvx3ww0m30zcqc1zjhcw8sqdzv6ay41fb35m7p07f82n95ys"; + }; + + mesonFlags = [ + "-Dappend_libdir_mangohud=false" + ]; + + buildInputs = [ + libglvnd glslang python3Packages.Mako + xorg.libX11 vulkan-loader vulkan-headers + ]; + + nativeBuildInputs = [ + pkgconfig meson ninja + python3Packages.python python3Packages.Mako + git + ]; + + postConfigure = '' + ln -sf "${vulkan-headers}/share/vulkan/registry" ./modules/Vulkan-Headers/ + ln -sf "${vulkan-headers}/include" ./modules/Vulkan-Headers/ + ''; +} + diff --git a/pkgs/av1an/default.nix b/pkgs/av1an/default.nix deleted file mode 100644 index 0d89541..0000000 --- a/pkgs/av1an/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{lib, fetchFromGitHub, python3, python3Packages, stdenv, ffmpeg-full, libaom }: - -let - pythonEnv = python3.withPackages (pythonPackages: [ - pythonPackages.tqdm - pythonPackages.psutil - ]); - -in - stdenv.mkDerivation rec { - pname = "av1an"; - version = "1.6"; - - src = ./Av1an; - -# fetchFromGitHub { -# owner = "master-of-zen"; -# repo = "AV1an"; -# rev = "${version}"; -# sha256 = "19xm24vgfqis0bqrg5fc5jxf5yr1md5y49kb7q3792gihykl6yz3"; -# }; - - buildInputs = [ pythonEnv ffmpeg-full libaom ]; - - - installPhase = '' - mkdir -p $out/bin - sed "s!self.FFMPEG = 'ffmpeg -y -hide_banner -loglevel error'!self.FFMPEG = '${ffmpeg-full}/bin/ffmpeg -y -hide_banner -loglevel error'!g" ./av1an.py > $out/bin/av1an - sed -i "s!self.AOMENC_BINARY = 'aomenc'!self.AOMENC_BINARY = '${libaom}/bin/aomenc'!g" $out/bin/av1an - chmod +x $out/bin/av1an - ''; - - - meta.broken = false; - - }