nixpkgs/pkgs/by-name/me/melonDS/package.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
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"
```
2024-09-25 00:04:37 +03:00

114 lines
2.3 KiB
Nix

{
lib,
SDL2,
cmake,
enet,
extra-cmake-modules,
fetchFromGitHub,
libGL,
libarchive,
libpcap,
libslirp,
pkg-config,
qt6,
stdenv,
unstableGitUpdater,
wayland,
zstd,
}:
let
inherit (qt6)
qtbase
qtmultimedia
qtwayland
wrapQtAppsHook
;
in
stdenv.mkDerivation (finalAttrs: {
pname = "melonDS";
version = "0.9.5-unstable-2024-09-18";
src = fetchFromGitHub {
owner = "melonDS-emu";
repo = "melonDS";
rev = "2179ca2a417e356f23a09cd88707b20c1bcaf66f";
hash = "sha256-93KbpRlVVZc8JoaZiVLKOsTezLqY2Y7J2bFL7RkCcxM=";
};
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
];
buildInputs =
[
SDL2
enet
extra-cmake-modules
libarchive
libslirp
libGL
qtbase
qtmultimedia
zstd
]
++ lib.optionals stdenv.hostPlatform.isLinux [
wayland
qtwayland
];
cmakeFlags = [ (lib.cmakeBool "USE_QT6" true) ];
strictDeps = true;
qtWrapperArgs =
lib.optionals stdenv.hostPlatform.isLinux [
"--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
libpcap
wayland
]
}"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"--prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpcap ]}"
];
passthru = {
updateScript = unstableGitUpdater { };
};
meta = {
homepage = "https://melonds.kuribo64.net/";
description = "Work in progress Nintendo DS emulator";
longDescription = ''
melonDS aims at providing fast and accurate Nintendo DS emulation. While
it is still a work in progress, it has a pretty solid set of features:
- Nearly complete core (CPU, video, audio, ...)
- JIT recompiler for fast emulation
- OpenGL renderer, 3D upscaling
- RTC, microphone, lid close/open
- Joystick support
- Savestates
- Various display position/sizing/rotation modes
- (WIP) Wifi: local multiplayer, online connectivity
- (WIP) DSi emulation
- DLDI
- (WIP) GBA slot add-ons
- and more are planned!
'';
license = with lib.licenses; [ gpl3Plus ];
mainProgram = "melonDS";
maintainers = with lib.maintainers; [
AndersonTorres
artemist
benley
shamilton
];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
})