Commit 87b380db authored by Anderson Torres's avatar Anderson Torres
Browse files

xemu: nixfmt

parent 68fcc906
Loading
Loading
Loading
Loading
+75 −60
Original line number Diff line number Diff line
{ 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,
  copyDesktopItems,
  fetchFromGitHub,
  gettext,
  glib,
  gtk3,
  libGLU,
  libdrm,
  libepoxy,
  libpcap,
  libsamplerate,
  libslirp,
  makeDesktopItem,
  mesa,
  meson,
  ninja,
  openssl,
  perl,
  pkg-config,
  python3Packages,
  stdenv,
  vte,
  which,
  wrapGAppsHook3,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -38,7 +39,8 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-VcztVzG/IN9N0SVKj6BipyqnhxXC2nTTuMjKMtFKzGw=";
  };

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      copyDesktopItems
      meson
      ninja
@@ -46,7 +48,8 @@ stdenv.mkDerivation (finalAttrs: {
      pkg-config
      which
      wrapGAppsHook3
  ] ++ (with python3Packages; [
    ]
    ++ (with python3Packages; [
      python
      pyyaml
    ]);
@@ -98,9 +101,11 @@ stdenv.mkDerivation (finalAttrs: {
      --replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'"
  '';

  preConfigure = ''
  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)
      ''
@@ -112,19 +117,29 @@ stdenv.mkDerivation (finalAttrs: {
    substituteInPlace ./build.ninja --replace /usr/bin/env $(which env)
  '';

  installPhase = let
  installPhase =
    let
      installIcon = resolution: ''
        install -Dm644 -T ../ui/icons/xemu_${resolution}.png \
          $out/share/icons/hicolor/${resolution}/apps/xemu.png
      '';
  in ''
    in
    ''
      runHook preInstall

      install -Dm755 -T qemu-system-i386 $out/bin/xemu
  '' +
  (lib.concatMapStringsSep "\n" installIcon
    [ "16x16" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512" ]) + "\n" +
    ''
    + (lib.concatMapStringsSep "\n" installIcon [
      "16x16"
      "24x24"
      "32x32"
      "48x48"
      "128x128"
      "256x256"
      "512x512"
    ])
    + "\n"
    + ''
      runHook postInstall
    '';