Unverified Commit 9dda9273 authored by superherointj's avatar superherointj Committed by GitHub
Browse files

Merge pull request #320604 from atorres1985-contrib/cemu

 cemu: 2.0-85 -> 2.0-86 
parents d41a3935 e3ff7723
Loading
Loading
Loading
Loading
+69 −56
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub
, addOpenGLRunpath
, wrapGAppsHook3
, cmake
, glslang
, nasm
, pkg-config

, SDL2
, boost
, cubeb
, curl
, fmt_9
, glm
, gtk3
, hidapi
, imgui
, libpng
, libusb1
, libzip
, libXrender
, pugixml
, rapidjson
, vulkan-headers
, wayland
, wxGTK32
, zarchive
, gamemode
, vulkan-loader

, nix-update-script
{
  lib,
  SDL2,
  addOpenGLRunpath,
  boost,
  cmake,
  cubeb,
  curl,
  fetchFromGitHub,
  fmt_9,
  gamemode,
  glm,
  glslang,
  gtk3,
  hidapi,
  imgui,
  libXrender,
  libpng,
  libusb1,
  libzip,
  nasm,
  ninja,
  nix-update-script,
  pkg-config,
  pugixml,
  rapidjson,
  stdenv,
  testers,
  vulkan-headers,
  vulkan-loader,
  wayland,
  wrapGAppsHook3,
  wxGTK32,
  zarchive,
}:

let
@@ -43,31 +46,32 @@ let
      sha256 = "sha256-gf47uLeNiXQic43buB5ZnMqiotlUfIyAsP+3H7yJuFg=";
    };
  };

in stdenv.mkDerivation rec {
in stdenv.mkDerivation (finalAttrs: {
  pname = "cemu";
  version = "2.0-85";
  version = "2.0-86";

  src = fetchFromGitHub {
    owner = "cemu-project";
    repo = "Cemu";
    rev = "v${version}";
    hash = "sha256-uMVbKJhdHLLKsJnj7YFIG+S5pm7rSZfBSWebhTP01Y8=";
    rev = "v${finalAttrs.version}";
    hash = "sha256-AS5Qo4J0U1MeTYWl4jiJMi879bhBuioU1BikxGKtUrE=";
  };

  patches = [
    # glslangTargets want SPIRV-Tools-opt to be defined:
    # > The following imported targets are referenced, but are missing:
    # > SPIRV-Tools-opt
    ./cmakelists.patch
    ./0000-spirv-tools-opt-cmakelists.patch
  ];

  nativeBuildInputs = [
    SDL2
    addOpenGLRunpath
    wrapGAppsHook3
    cmake
    glslang
    nasm
    ninja
    pkg-config
  ];

@@ -94,24 +98,26 @@ in stdenv.mkDerivation rec {
  ];

  cmakeFlags = [
    "-DCMAKE_C_FLAGS_RELEASE=-DNDEBUG"
    "-DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG"
    "-DENABLE_VCPKG=OFF"
    "-DENABLE_FERAL_GAMEMODE=ON"

    # PORTABLE:
    # "All data created and maintained by Cemu will be in the directory where the executable file is located"
    "-DPORTABLE=OFF"
    (lib.cmakeFeature "CMAKE_C_FLAGS_RELEASE" "-DNDEBUG")
    (lib.cmakeFeature "CMAKE_CXX_FLAGS_RELEASE" "-DNDEBUG")
    (lib.cmakeBool "ENABLE_VCPKG" false)
    (lib.cmakeBool "ENABLE_FERAL_GAMEMODE" true)

    # PORTABLE: "All data created and maintained by Cemu will be in
    # the directory where the executable file is located"
    (lib.cmakeBool "PORTABLE" false)
  ];

  preConfigure = with lib; let
    tag = last (splitString "-" version);
  strictDeps = true;

  preConfigure = let
    tag = lib.last (lib.splitString "-" finalAttrs.version);
  in ''
    rm -rf dependencies/imgui
    # cemu expects imgui source code, not just header files
    ln -s ${imgui'.src} dependencies/imgui
    substituteInPlace src/Common/version.h --replace " (experimental)" "-${tag} (experimental)"
    substituteInPlace dependencies/gamemode/lib/gamemode_client.h --replace "libgamemode.so.0" "${gamemode.lib}/lib/libgamemode.so.0"
    substituteInPlace src/Common/version.h --replace-fail " (experimental)" "-${tag} (experimental)"
    substituteInPlace dependencies/gamemode/lib/gamemode_client.h --replace-fail "libgamemode.so.0" "${gamemode.lib}/lib/libgamemode.so.0"
  '';

  installPhase = ''
@@ -138,14 +144,21 @@ in stdenv.mkDerivation rec {
    )
  '';

  passthru.updateScript = nix-update-script { };
  passthru = {
    updateScript = nix-update-script { };
    tests = {
      version = testers.testVersion {
        package = finalAttrs.finalPackage;
      };
    };
  };

  meta = with lib; {
    description = "Cemu is a Wii U emulator";
  meta = {
    description = "Software to emulate Wii U games and applications on PC";
    homepage = "https://cemu.info";
    license = licenses.mpl20;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ zhaofengli baduhai ];
    license = lib.licenses.mpl20;
    mainProgram = "cemu";
    maintainers = with lib.maintainers; [ zhaofengli baduhai AndersonTorres ];
    platforms = [ "x86_64-linux" ];
  };
}
})
+0 −2
Original line number Diff line number Diff line
@@ -2595,8 +2595,6 @@ with pkgs;
  cdemu-daemon = callPackage ../applications/emulators/cdemu/daemon.nix { };
  cemu = callPackage ../applications/emulators/cemu { };
  cen64 = callPackage ../applications/emulators/cen64 { };
  citations = callPackage ../applications/misc/citations { };