2023-02-20 01:16:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-02-15 13:01:55 +00:00
|
|
|
, fetchFromGitHub
|
2023-02-20 01:16:02 +00:00
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
2023-02-15 13:01:55 +00:00
|
|
|
, copyDesktopItems
|
2023-02-20 01:16:02 +00:00
|
|
|
, gettext
|
2023-02-15 13:01:55 +00:00
|
|
|
, glib
|
|
|
|
, gtk3
|
2023-02-20 01:16:02 +00:00
|
|
|
, libGLU
|
|
|
|
, libdrm
|
2023-02-15 13:01:55 +00:00
|
|
|
, libepoxy
|
2023-02-20 01:16:02 +00:00
|
|
|
, libpcap
|
2023-02-15 13:01:55 +00:00
|
|
|
, libsamplerate
|
2023-02-20 01:16:02 +00:00
|
|
|
, makeDesktopItem
|
2023-02-15 13:01:55 +00:00
|
|
|
, mesa
|
2023-02-20 01:16:02 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2023-02-15 13:01:55 +00:00
|
|
|
, vte
|
2023-02-20 01:16:02 +00:00
|
|
|
, which
|
|
|
|
, wrapGAppsHook
|
2023-02-15 13:01:55 +00:00
|
|
|
}:
|
|
|
|
|
2023-02-20 01:16:02 +00:00
|
|
|
stdenv.mkDerivation (self: {
|
2023-02-15 13:01:55 +00:00
|
|
|
pname = "xemu";
|
|
|
|
version = "0.7.84";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xemu-project";
|
|
|
|
repo = "xemu";
|
2023-02-20 01:16:02 +00:00
|
|
|
rev = "v${self.version}";
|
2023-02-15 13:01:55 +00:00
|
|
|
hash = "sha256-pEXjwoQKbMmVNYCnh5nqP7k0acYOAp8SqxYZwPzVwDY=";
|
2023-02-20 01:16:02 +00:00
|
|
|
fetchSubmodules = true;
|
2023-02-15 13:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-02-20 01:16:02 +00:00
|
|
|
copyDesktopItems
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
perl
|
2023-02-15 13:01:55 +00:00
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
python3.pkgs.pyyaml
|
|
|
|
which
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-02-20 01:16:02 +00:00
|
|
|
SDL2
|
|
|
|
SDL2_image
|
|
|
|
gettext
|
2023-02-15 13:01:55 +00:00
|
|
|
glib
|
|
|
|
gtk3
|
2023-02-20 01:16:02 +00:00
|
|
|
libGLU
|
2023-02-15 13:01:55 +00:00
|
|
|
libdrm
|
2023-02-20 01:16:02 +00:00
|
|
|
libepoxy
|
2023-02-15 13:01:55 +00:00
|
|
|
libpcap
|
|
|
|
libsamplerate
|
2023-02-20 01:16:02 +00:00
|
|
|
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" ];
|
|
|
|
|
2023-02-20 01:16:02 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "xemu";
|
|
|
|
desktopName = "xemu";
|
|
|
|
exec = "xemu";
|
|
|
|
icon = "xemu";
|
|
|
|
})
|
|
|
|
];
|
2023-02-15 13:01:55 +00:00
|
|
|
|
|
|
|
preConfigure = let
|
2023-02-20 01:16:02 +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)
|
2023-02-15 13:01:55 +00:00
|
|
|
branch = "master";
|
|
|
|
commit = "d8fa50e524c22f85ecb2e43108fd6a5501744351";
|
2023-02-20 01:16:02 +00:00
|
|
|
inherit (self) version;
|
2023-02-15 13:01:55 +00:00
|
|
|
in ''
|
|
|
|
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'"
|
|
|
|
echo '${commit}' > XEMU_COMMIT
|
|
|
|
echo '${branch}' > XEMU_BRANCH
|
|
|
|
echo '${version}' > XEMU_VERSION
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd build
|
|
|
|
substituteInPlace ./build.ninja --replace /usr/bin/env $(which env)
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,share}
|
|
|
|
cp qemu-system-i386 $out/bin/xemu
|
|
|
|
|
|
|
|
for RES in 16x16 24x24 32x32 48x48 128x128 256x256 512x512
|
|
|
|
do
|
|
|
|
mkdir -p $out/share/icons/hicolor/$RES/apps/
|
|
|
|
cp ../ui/icons/xemu_$RES.png $out/share/icons/hicolor/$RES/apps/xemu.png
|
|
|
|
done
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://xemu.app/";
|
|
|
|
description = "Original Xbox emulator";
|
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
};
|
2023-02-20 01:16:02 +00:00
|
|
|
})
|