Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xemu: refactor #294762

Merged
merged 2 commits into from Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,9 +1,8 @@
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, SDL2_image
, copyDesktopItems
, fetchFromGitHub
, gettext
, glib
, gtk3
Expand All @@ -20,7 +19,8 @@
, openssl
, perl
, pkg-config
, python3
, python3Packages
, stdenv
, vte
, which
, wrapGAppsHook
Expand All @@ -34,8 +34,8 @@ stdenv.mkDerivation (finalAttrs: {
owner = "xemu-project";
repo = "xemu";
rev = "v${finalAttrs.version}";
hash = "sha256-FFxYp53LLDOPZ1Inr70oyQXhNjJO23G+gNmXd/lvrYs=";
fetchSubmodules = true;
hash = "sha256-FFxYp53LLDOPZ1Inr70oyQXhNjJO23G+gNmXd/lvrYs=";
};

nativeBuildInputs = [
Expand All @@ -44,11 +44,12 @@ stdenv.mkDerivation (finalAttrs: {
ninja
perl
pkg-config
python3
python3.pkgs.pyyaml
which
wrapGAppsHook
];
] ++ (with python3Packages; [
python
pyyaml
]);

buildInputs = [
SDL2
Expand Down Expand Up @@ -91,13 +92,18 @@ stdenv.mkDerivation (finalAttrs: {
})
];

preConfigure = ''
postPatch = ''
patchShebangs .
AndersonTorres marked this conversation as resolved.
Show resolved Hide resolved
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'"
# When the data below can't be obtained through git, the build process tries
# to run `XEMU_COMMIT=$(cat XEMU_COMMIT)` (and similar)
'';

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
'';

Expand All @@ -106,18 +112,19 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace ./build.ninja --replace /usr/bin/env $(which env)
'';

installPhase = ''
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
'' +
# 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" ]) +
(lib.concatMapStringsSep "\n" installIcon
[ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) + "\n" +
''

runHook postInstall
'';

Expand All @@ -131,8 +138,8 @@ stdenv.mkDerivation (finalAttrs: {
'';
changelog = "https://github.com/xemu-project/xemu/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ AndersonTorres genericnerdyusername ];
platforms = lib.platforms.linux;
mainProgram = "xemu";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.linux;
};
})
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -2833,8 +2833,6 @@ with pkgs;

xcpc = callPackage ../applications/emulators/xcpc { };

xemu = callPackage ../applications/emulators/xemu { };

yapesdl = callPackage ../applications/emulators/yapesdl { };

zsnes = pkgsi686Linux.callPackage ../applications/emulators/zsnes { };
Expand Down