diff options
Diffstat (limited to 'pkgs/by-name/xe/xemu/package.nix')
-rw-r--r-- | pkgs/by-name/xe/xemu/package.nix | 161 |
1 files changed, 85 insertions, 76 deletions
diff --git a/pkgs/by-name/xe/xemu/package.nix b/pkgs/by-name/xe/xemu/package.nix index e8e4a66dddcc3..9d9500d507d0e 100644 --- a/pkgs/by-name/xe/xemu/package.nix +++ b/pkgs/by-name/xe/xemu/package.nix @@ -1,55 +1,56 @@ -{ lib -, SDL2 -, SDL2_image -, copyDesktopItems -, fetchFromGitHub -, gettext -, glib -, gtk3 -, libGLU -, libdrm -, libepoxy -, libpcap -, libsamplerate -, libslirp -, makeDesktopItem -, mesa -, meson -, ninja -, openssl -, perl -, pkg-config -, python3Packages -, stdenv -, vte -, which -, wrapGAppsHook3 +{ + 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, }: stdenv.mkDerivation (finalAttrs: { pname = "xemu"; - version = "0.7.120"; + version = "0.7.122"; src = fetchFromGitHub { owner = "xemu-project"; repo = "xemu"; rev = "v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-FFxYp53LLDOPZ1Inr70oyQXhNjJO23G+gNmXd/lvrYs="; + hash = "sha256-TxtkLdUSIbDu9uqPq4s64HtXFyT3ntN8Su9bEGPS3f0="; }; - nativeBuildInputs = [ - copyDesktopItems - meson - ninja - perl - pkg-config - which - wrapGAppsHook3 - ] ++ (with python3Packages; [ - python - pyyaml - ]); + nativeBuildInputs = + [ + SDL2 + meson + ninja + perl + pkg-config + which + wrapGAppsHook3 + ] + ++ (with python3Packages; [ + python + pyyaml + ]); buildInputs = [ SDL2 @@ -68,12 +69,6 @@ stdenv.mkDerivation (finalAttrs: { vte ]; - separateDebugInfo = true; - - dontUseMesonConfigure = true; - - setOutputFlags = false; - configureFlags = [ "--disable-strip" "--meson=meson" @@ -83,14 +78,13 @@ stdenv.mkDerivation (finalAttrs: { buildFlags = [ "qemu-system-i386" ]; - desktopItems = [ - (makeDesktopItem { - name = "xemu"; - desktopName = "xemu"; - exec = "xemu"; - icon = "xemu"; - }) - ]; + separateDebugInfo = true; + + dontUseMesonConfigure = true; + + setOutputFlags = false; + + strictDeps = true; postPatch = '' patchShebangs . @@ -98,35 +92,49 @@ stdenv.mkDerivation (finalAttrs: { --replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'" ''; - 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 - ''; + 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 + ''; preBuild = '' cd build substituteInPlace ./build.ninja --replace /usr/bin/env $(which env) ''; - installPhase = let - installIcon = resolution: '' - install -Dm644 -T ../ui/icons/xemu_${resolution}.png \ - $out/share/icons/hicolor/${resolution}/apps/xemu.png + 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" + + '' + install -Dm644 -T ../ui/xemu.desktop $out/share/applications/xemu.desktop + + runHook postInstall ''; - in '' - runHook preInstall - - install -Dm755 -T qemu-system-i386 $out/bin/xemu - '' + - (lib.concatMapStringsSep "\n" installIcon - [ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) + "\n" + - '' - runHook postInstall - ''; meta = { homepage = "https://xemu.app/"; @@ -143,3 +151,4 @@ stdenv.mkDerivation (finalAttrs: { platforms = lib.platforms.linux; }; }) +# TODO: investigate failure when using __structuredAttrs |