nixpkgs/pkgs/by-name/xe/xemu/package.nix

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

155 lines
3.0 KiB
Nix
Raw Normal View History

2024-05-15 23:35:47 +00:00
{
lib,
SDL2,
SDL2_image,
fetchFromGitHub,
gettext,
glib,
gtk3,
libGLU,
libdrm,
libepoxy,
libpcap,
libsamplerate,
libslirp,
mesa,
meson,
ninja,
openssl,
perl,
pkg-config,
python3Packages,
stdenv,
vte,
which,
wrapGAppsHook3,
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";
2024-08-21 16:31:19 +00:00
version = "0.7.132";
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}";
fetchSubmodules = true;
2024-08-21 16:31:19 +00:00
hash = "sha256-C9g2IXuI2eQjt04viat0ESOTeKCvQ3CUdjLpZ92NFDs=";
2023-02-15 13:01:55 +00:00
};
2024-05-15 23:35:47 +00:00
nativeBuildInputs =
[
2024-05-16 00:00:13 +00:00
SDL2
2024-05-15 23:35:47 +00:00
meson
ninja
perl
pkg-config
which
wrapGAppsHook3
]
++ (with python3Packages; [
python
pyyaml
]);
2023-02-15 13:01:55 +00:00
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
];
configureFlags = [
"--disable-strip"
"--meson=meson"
"--target-list=i386-softmmu"
"--disable-werror"
];
buildFlags = [ "qemu-system-i386" ];
2024-05-16 00:00:13 +00:00
separateDebugInfo = true;
dontUseMesonConfigure = true;
setOutputFlags = false;
strictDeps = true;
2023-02-15 13:01:55 +00:00
postPatch = ''
2023-02-15 13:01:55 +00:00
patchShebangs .
substituteInPlace ./scripts/xemu-version.sh \
--replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'"
'';
2024-05-15 23:35:47 +00:00
preConfigure =
''
configureFlagsArray+=("--extra-cflags=-DXBOX=1 -Wno-error=redundant-decls")
''
+
# 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)
'';
2024-05-15 23:35:47 +00:00
installPhase =
let
installIcon = resolution: ''
install -Dm644 -T ../ui/icons/xemu_${resolution}.png \
$out/share/icons/hicolor/${resolution}/apps/xemu.png
'';
in
''
runHook preInstall
install -Dm755 -T qemu-system-i386 $out/bin/xemu
''
+ (lib.concatMapStringsSep "\n" installIcon [
"16x16"
"24x24"
"32x32"
"48x48"
"128x128"
"256x256"
"512x512"
])
+ "\n"
+ ''
2024-05-16 00:00:13 +00:00
install -Dm644 -T ../ui/xemu.desktop $out/share/applications/xemu.desktop
2024-05-15 23:35:47 +00:00
runHook postInstall
'';
2023-02-15 13:01:55 +00:00
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;
mainProgram = "xemu";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.linux;
2023-02-15 13:01:55 +00:00
};
})
2024-05-16 00:00:13 +00:00
# TODO: investigate failure when using __structuredAttrs