mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 22:53:42 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
48 lines
1.8 KiB
Nix
48 lines
1.8 KiB
Nix
{ lib, stdenv, fetchFromGitHub
|
|
, cmake, pkgconfig, wrapQtAppsHook
|
|
, boost173, catch2, fmt, lz4, nlohmann_json, rapidjson, zlib, zstd, SDL2
|
|
, udev, libusb1, libzip, qtbase, qtwebengine, qttools, ffmpeg
|
|
, libpulseaudio, libjack2, alsaLib, sndio, ecasound
|
|
, useVulkan ? true, vulkan-loader, vulkan-headers
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "yuzu";
|
|
version = "482";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "yuzu-emu";
|
|
repo = "yuzu-mainline"; # They use a separate repo for mainline “branch”
|
|
rev = "mainline-0-${version}";
|
|
sha256 = "1bhkdbhj1dv33qv0np26gzsw65p4z88whjmd6bc7mh2b5lvrjwxm";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ];
|
|
buildInputs = [ qtbase qtwebengine qttools boost173 catch2 fmt lz4 nlohmann_json rapidjson zlib zstd SDL2 udev libusb1 libpulseaudio alsaLib sndio ecasound libjack2 libzip ffmpeg ]
|
|
++ stdenv.lib.optionals useVulkan [ vulkan-loader vulkan-headers ];
|
|
cmakeFlags = [ "-DENABLE_QT_TRANSLATION=ON" "-DYUZU_USE_QT_WEB_ENGINE=ON" "-DUSE_DISCORD_PRESENCE=ON" ]
|
|
++ stdenv.lib.optionals (!useVulkan) [ "-DENABLE_VULKAN=No" ];
|
|
|
|
# Trick the configure system. This prevents a check for submodule directories.
|
|
preConfigure = "rm .gitmodules";
|
|
|
|
# Fix vulkan detection
|
|
postFixup = stdenv.lib.optionals useVulkan ''
|
|
wrapProgram $out/bin/yuzu --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
|
|
wrapProgram $out/bin/yuzu-cmd --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://yuzu-emu.org";
|
|
description = "An experimental Nintendo Switch emulator written in C++";
|
|
license = with licenses; [
|
|
gpl2Plus
|
|
# Icons
|
|
cc-by-nd-30 cc0
|
|
];
|
|
maintainers = with maintainers; [ ivar joshuafern ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|