mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-30 08:44:31 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
95 lines
1.9 KiB
Nix
95 lines
1.9 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, gitUpdater
|
|
, boost
|
|
, cmake
|
|
, discord-rpc
|
|
, freetype
|
|
, hidapi
|
|
, libpng
|
|
, libsamplerate
|
|
, minizip
|
|
, nasm
|
|
, pkg-config
|
|
, qt6Packages
|
|
, SDL2
|
|
, speexdsp
|
|
, vulkan-headers
|
|
, vulkan-loader
|
|
, which
|
|
, xdg-user-dirs
|
|
, zlib
|
|
, withWayland ? false
|
|
# Affects final license
|
|
, withAngrylionRdpPlus ? false
|
|
}:
|
|
|
|
let
|
|
inherit (qt6Packages) qtbase qtsvg qtwayland wrapQtAppsHook;
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "rmg";
|
|
version = "0.6.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Rosalie241";
|
|
repo = "RMG";
|
|
rev = "v${version}";
|
|
hash = "sha256-mgb9Ed11fBQVnhhU5w1958a19dbTOL0ADczUOxKAnqA=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
nasm
|
|
pkg-config
|
|
wrapQtAppsHook
|
|
which
|
|
];
|
|
|
|
buildInputs = [
|
|
boost
|
|
discord-rpc
|
|
freetype
|
|
hidapi
|
|
libpng
|
|
libsamplerate
|
|
minizip
|
|
qtbase
|
|
qtsvg
|
|
SDL2
|
|
speexdsp
|
|
vulkan-headers
|
|
vulkan-loader
|
|
xdg-user-dirs
|
|
zlib
|
|
] ++ lib.optional withWayland qtwayland;
|
|
|
|
cmakeFlags = [
|
|
"-DPORTABLE_INSTALL=OFF"
|
|
# mupen64plus-input-gca is written in Rust, so we can't build it with
|
|
# everything else.
|
|
"-DNO_RUST=ON"
|
|
"-DUSE_ANGRYLION=${lib.boolToString withAngrylionRdpPlus}"
|
|
];
|
|
|
|
qtWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [
|
|
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}"
|
|
] ++ lib.optional withWayland "--set RMG_WAYLAND 1";
|
|
|
|
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/Rosalie241/RMG";
|
|
description = "Rosalie's Mupen GUI";
|
|
longDescription = ''
|
|
Rosalie's Mupen GUI is a free and open-source mupen64plus front-end
|
|
written in C++. It offers a simple-to-use user interface.
|
|
'';
|
|
license = if withAngrylionRdpPlus then licenses.unfree else licenses.gpl3Only;
|
|
platforms = platforms.linux;
|
|
mainProgram = "RMG";
|
|
maintainers = with maintainers; [ slam-bert ];
|
|
};
|
|
}
|