Merge pull request #294762 from atorres1985-contrib/xemu

xemu: refactor
This commit is contained in:
Sandro 2024-03-25 21:30:12 +01:00 committed by GitHub
commit 5b5f24497f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 22 deletions

View File

@ -1,9 +1,8 @@
{ lib { lib
, stdenv
, fetchFromGitHub
, SDL2 , SDL2
, SDL2_image , SDL2_image
, copyDesktopItems , copyDesktopItems
, fetchFromGitHub
, gettext , gettext
, glib , glib
, gtk3 , gtk3
@ -20,7 +19,8 @@
, openssl , openssl
, perl , perl
, pkg-config , pkg-config
, python3 , python3Packages
, stdenv
, vte , vte
, which , which
, wrapGAppsHook , wrapGAppsHook
@ -34,8 +34,8 @@ stdenv.mkDerivation (finalAttrs: {
owner = "xemu-project"; owner = "xemu-project";
repo = "xemu"; repo = "xemu";
rev = "v${finalAttrs.version}"; rev = "v${finalAttrs.version}";
hash = "sha256-FFxYp53LLDOPZ1Inr70oyQXhNjJO23G+gNmXd/lvrYs=";
fetchSubmodules = true; fetchSubmodules = true;
hash = "sha256-FFxYp53LLDOPZ1Inr70oyQXhNjJO23G+gNmXd/lvrYs=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -44,11 +44,12 @@ stdenv.mkDerivation (finalAttrs: {
ninja ninja
perl perl
pkg-config pkg-config
python3
python3.pkgs.pyyaml
which which
wrapGAppsHook wrapGAppsHook
]; ] ++ (with python3Packages; [
python
pyyaml
]);
buildInputs = [ buildInputs = [
SDL2 SDL2
@ -91,13 +92,18 @@ stdenv.mkDerivation (finalAttrs: {
}) })
]; ];
preConfigure = '' postPatch = ''
patchShebangs . patchShebangs .
configureFlagsArray+=("--extra-cflags=-DXBOX=1 -Wno-error=redundant-decls")
substituteInPlace ./scripts/xemu-version.sh \ substituteInPlace ./scripts/xemu-version.sh \
--replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'" --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 echo '${finalAttrs.version}' > XEMU_VERSION
''; '';
@ -106,18 +112,19 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace ./build.ninja --replace /usr/bin/env $(which env) 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 runHook preInstall
install -Dm755 -T qemu-system-i386 $out/bin/xemu install -Dm755 -T qemu-system-i386 $out/bin/xemu
'' + '' +
# Generate code to install the icons (lib.concatMapStringsSep "\n" installIcon
(lib.concatMapStringsSep ";\n" [ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) + "\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" ]) +
'' ''
runHook postInstall runHook postInstall
''; '';
@ -131,8 +138,8 @@ stdenv.mkDerivation (finalAttrs: {
''; '';
changelog = "https://github.com/xemu-project/xemu/releases/tag/v${finalAttrs.version}"; changelog = "https://github.com/xemu-project/xemu/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl2Plus; license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ AndersonTorres genericnerdyusername ];
platforms = lib.platforms.linux;
mainProgram = "xemu"; mainProgram = "xemu";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.linux;
}; };
}) })

View File

@ -2834,8 +2834,6 @@ with pkgs;
xcpc = callPackage ../applications/emulators/xcpc { }; xcpc = callPackage ../applications/emulators/xcpc { };
xemu = callPackage ../applications/emulators/xemu { };
yapesdl = callPackage ../applications/emulators/yapesdl { }; yapesdl = callPackage ../applications/emulators/yapesdl { };
zsnes = pkgsi686Linux.callPackage ../applications/emulators/zsnes { }; zsnes = pkgsi686Linux.callPackage ../applications/emulators/zsnes { };