2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
2023-02-22 10:55:15 +00:00
|
|
|
, copyDesktopItems
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchFromGitHub
|
2023-03-04 12:14:45 +00:00
|
|
|
, gettext
|
2023-02-22 10:55:15 +00:00
|
|
|
, glib
|
|
|
|
, gtk3
|
2023-03-04 12:14:45 +00:00
|
|
|
, libGLU
|
|
|
|
, libdrm
|
2023-02-22 10:55:15 +00:00
|
|
|
, libepoxy
|
2023-03-04 12:14:45 +00:00
|
|
|
, libpcap
|
2023-02-22 10:55:15 +00:00
|
|
|
, libsamplerate
|
2023-08-04 22:07:22 +00:00
|
|
|
, libslirp
|
2023-03-04 12:14:45 +00:00
|
|
|
, makeDesktopItem
|
2023-02-22 10:55:15 +00:00
|
|
|
, mesa
|
2023-03-04 12:14:45 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
2024-04-21 15:54:59 +00:00
|
|
|
, python3Packages
|
|
|
|
, stdenv
|
2023-02-22 10:55:15 +00:00
|
|
|
, vte
|
2023-03-04 12:14:45 +00:00
|
|
|
, which
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2023-02-22 10:55:15 +00:00
|
|
|
}:
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-02-22 10:55:15 +00:00
|
|
|
pname = "xemu";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.7.121";
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xemu-project";
|
|
|
|
repo = "xemu";
|
2023-04-29 16:46:19 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2023-03-04 12:14:45 +00:00
|
|
|
fetchSubmodules = true;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-VcztVzG/IN9N0SVKj6BipyqnhxXC2nTTuMjKMtFKzGw=";
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-03-04 12:14:45 +00:00
|
|
|
copyDesktopItems
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
perl
|
2023-02-22 10:55:15 +00:00
|
|
|
pkg-config
|
|
|
|
which
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ (with python3Packages; [
|
|
|
|
python
|
|
|
|
pyyaml
|
|
|
|
]);
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-03-04 12:14:45 +00:00
|
|
|
SDL2
|
|
|
|
SDL2_image
|
|
|
|
gettext
|
2023-02-22 10:55:15 +00:00
|
|
|
glib
|
|
|
|
gtk3
|
2023-03-04 12:14:45 +00:00
|
|
|
libGLU
|
2023-02-22 10:55:15 +00:00
|
|
|
libdrm
|
2023-03-04 12:14:45 +00:00
|
|
|
libepoxy
|
2023-02-22 10:55:15 +00:00
|
|
|
libpcap
|
|
|
|
libsamplerate
|
2023-08-04 22:07:22 +00:00
|
|
|
libslirp
|
2023-03-04 12:14:45 +00:00
|
|
|
mesa
|
|
|
|
openssl
|
2023-02-22 10:55:15 +00:00
|
|
|
vte
|
|
|
|
];
|
|
|
|
|
|
|
|
separateDebugInfo = true;
|
|
|
|
|
|
|
|
dontUseMesonConfigure = true;
|
|
|
|
|
|
|
|
setOutputFlags = false;
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-strip"
|
|
|
|
"--meson=meson"
|
|
|
|
"--target-list=i386-softmmu"
|
|
|
|
"--disable-werror"
|
|
|
|
];
|
|
|
|
|
|
|
|
buildFlags = [ "qemu-system-i386" ];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "xemu";
|
|
|
|
desktopName = "xemu";
|
|
|
|
exec = "xemu";
|
|
|
|
icon = "xemu";
|
|
|
|
})
|
|
|
|
];
|
2023-02-22 10:55:15 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
2023-02-22 10:55:15 +00:00
|
|
|
patchShebangs .
|
|
|
|
substituteInPlace ./scripts/xemu-version.sh \
|
|
|
|
--replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'"
|
2024-04-21 15:54:59 +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)
|
|
|
|
''
|
2023-05-24 13:37:59 +00:00
|
|
|
echo '${finalAttrs.version}' > XEMU_VERSION
|
2023-02-22 10:55:15 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd build
|
|
|
|
substituteInPlace ./build.ninja --replace /usr/bin/env $(which env)
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
installPhase = let
|
|
|
|
installIcon = resolution: ''
|
|
|
|
install -Dm644 -T ../ui/icons/xemu_${resolution}.png \
|
|
|
|
$out/share/icons/hicolor/${resolution}/apps/xemu.png
|
|
|
|
'';
|
|
|
|
in ''
|
2023-02-22 10:55:15 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
install -Dm755 -T qemu-system-i386 $out/bin/xemu
|
|
|
|
'' +
|
2024-04-21 15:54:59 +00:00
|
|
|
(lib.concatMapStringsSep "\n" installIcon
|
|
|
|
[ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) + "\n" +
|
2023-03-04 12:14:45 +00:00
|
|
|
''
|
2023-02-22 10:55:15 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
meta = {
|
2023-02-22 10:55:15 +00:00
|
|
|
homepage = "https://xemu.app/";
|
|
|
|
description = "Original Xbox emulator";
|
2023-03-04 12:14:45 +00:00
|
|
|
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-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/xemu-project/xemu/releases/tag/v${finalAttrs.version}";
|
2023-03-04 12:14:45 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "xemu";
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.linux;
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
2023-03-04 12:14:45 +00:00
|
|
|
})
|