nixpkgs/pkgs/applications/emulators/xemu/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

139 lines
2.8 KiB
Nix
Raw Normal View History

{ lib
, stdenv
2023-02-15 13:01:55 +00:00
, fetchFromGitHub
, SDL2
, SDL2_image
2023-02-15 13:01:55 +00:00
, copyDesktopItems
, gettext
2023-02-15 13:01:55 +00:00
, glib
, gtk3
, libGLU
, libdrm
2023-02-15 13:01:55 +00:00
, libepoxy
, libpcap
2023-02-15 13:01:55 +00:00
, libsamplerate
2023-07-22 08:01:42 +00:00
, libslirp
, makeDesktopItem
2023-02-15 13:01:55 +00:00
, mesa
, meson
, ninja
, openssl
, perl
, pkg-config
, python3
2023-02-15 13:01:55 +00:00
, vte
, which
, wrapGAppsHook
2023-02-15 13:01:55 +00:00
}:
2023-04-16 20:09:01 +00:00
stdenv.mkDerivation (finalAttrs: {
2023-02-15 13:01:55 +00:00
pname = "xemu";
2023-08-07 05:49:34 +00:00
version = "0.7.111";
2023-02-15 13:01:55 +00:00
src = fetchFromGitHub {
owner = "xemu-project";
repo = "xemu";
2023-04-16 20:09:01 +00:00
rev = "v${finalAttrs.version}";
2023-08-07 05:49:34 +00:00
hash = "sha256-j7VNNKGm8mFEz+8779ylw1Yjd+jDuoL19Sw52kJll4s=";
fetchSubmodules = true;
2023-02-15 13:01:55 +00:00
};
nativeBuildInputs = [
copyDesktopItems
meson
ninja
perl
2023-02-15 13:01:55 +00:00
pkg-config
python3
python3.pkgs.pyyaml
which
wrapGAppsHook
];
buildInputs = [
SDL2
SDL2_image
gettext
2023-02-15 13:01:55 +00:00
glib
gtk3
libGLU
2023-02-15 13:01:55 +00:00
libdrm
libepoxy
2023-02-15 13:01:55 +00:00
libpcap
libsamplerate
2023-07-22 08:01:42 +00:00
libslirp
mesa
openssl
2023-02-15 13:01:55 +00:00
vte
];
separateDebugInfo = true;
dontUseMesonConfigure = true;
setOutputFlags = false;
configureFlags = [
"--disable-strip"
"--meson=meson"
"--target-list=i386-softmmu"
"--disable-werror"
];
buildFlags = [ "qemu-system-i386" ];
desktopItems = [
(makeDesktopItem {
name = "xemu";
desktopName = "xemu";
exec = "xemu";
icon = "xemu";
})
];
2023-02-15 13:01:55 +00:00
2023-04-16 19:22:40 +00:00
preConfigure = ''
2023-02-15 13:01:55 +00:00
patchShebangs .
configureFlagsArray+=("--extra-cflags=-DXBOX=1 -Wno-error=redundant-decls")
substituteInPlace ./scripts/xemu-version.sh \
--replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'"
2023-04-16 19:22:40 +00:00
# When the data below can't be obtained through git, the build process tries
# to run `XEMU_COMMIT=$(cat XEMU_COMMIT)` (and similar)
echo '${finalAttrs.version}' > XEMU_VERSION
2023-02-15 13:01:55 +00:00
'';
preBuild = ''
cd build
substituteInPlace ./build.ninja --replace /usr/bin/env $(which env)
'';
installPhase = ''
runHook preInstall
install -Dm755 -T qemu-system-i386 $out/bin/xemu
'' +
# Generate code to install the icons
(lib.concatMapStringsSep ";\n"
(res:
"install -Dm644 -T ../ui/icons/xemu_${res}.png $out/share/icons/hicolor/${res}/apps/xemu.png")
[ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) +
''
2023-02-15 13:01:55 +00:00
runHook postInstall
'';
meta = {
2023-02-15 13:01:55 +00:00
homepage = "https://xemu.app/";
description = "Original Xbox emulator";
longDescription = ''
A free and open-source application that emulates the original Microsoft
Xbox game console, enabling people to play their original Xbox games on
Windows, macOS, and Linux systems.
'';
2023-04-16 20:09:01 +00:00
changelog = "https://github.com/xemu-project/xemu/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ AndersonTorres genericnerdyusername ];
2023-07-09 22:57:31 +00:00
platforms = lib.platforms.linux;
mainProgram = "xemu";
2023-02-15 13:01:55 +00:00
};
})