ares: refactor

- migrate patches to a directory
- nixfmt-rfc-style
- hammer
This commit is contained in:
Anderson Torres
2024-12-09 20:05:50 -03:00
parent 5e67300be4
commit 7448a92e30
4 changed files with 77 additions and 64 deletions
+77 -64
View File
@@ -1,25 +1,26 @@
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, alsa-lib
, gtk3
, gtksourceview3
, libGL
, libGLU
, libX11
, libXv
, libao
, libicns
, libpulseaudio
, openal
, pkg-config
, udev
, which
, wrapGAppsHook3
, apple-sdk_11
, vulkan-loader
, autoPatchelfHook
{
lib,
SDL2,
alsa-lib,
apple-sdk_11,
autoPatchelfHook,
fetchFromGitHub,
gtk3,
gtksourceview3,
libGL,
libGLU,
libX11,
libXv,
libao,
libicns,
libpulseaudio,
openal,
pkg-config,
stdenv,
udev,
vulkan-loader,
which,
wrapGAppsHook3,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -34,64 +35,76 @@ stdenv.mkDerivation (finalAttrs: {
};
patches = [
./001-dont-rebuild-on-install.patch
./002-fix-ruby.diff
./003-darwin-specific.patch
./patches/001-dont-rebuild-on-install.patch
./patches/002-fix-ruby.diff
./patches/003-darwin-specific.patch
];
nativeBuildInputs = [
autoPatchelfHook
pkg-config
which
wrapGAppsHook3
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
libicns
];
nativeBuildInputs =
[
autoPatchelfHook
pkg-config
which
wrapGAppsHook3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libicns
];
buildInputs = [
SDL2
libao
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
gtk3
gtksourceview3
libGL
libGLU
libX11
libXv
libpulseaudio
openal
udev
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_11
];
buildInputs =
[
SDL2
libao
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
gtk3
gtksourceview3
libGL
libGLU
libX11
libXv
libpulseaudio
openal
udev
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_11
];
appendRunpaths = [ (lib.makeLibraryPath [ vulkan-loader ]) ];
enableParallelBuilding = true;
makeFlags =
lib.optionals stdenv.hostPlatform.isLinux [
"hiro=gtk3"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"hiro=cocoa"
"lto=false"
"vulkan=false"
]
++ [
"local=false"
"openmp=true"
"prefix=$(out)"
];
makeFlags = lib.optionals stdenv.hostPlatform.isLinux [
"hiro=gtk3"
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
"hiro=cocoa"
"lto=false"
"vulkan=false"
] ++ [
"local=false"
"openmp=true"
"prefix=$(out)"
];
enableParallelBuilding = true;
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-mmacosx-version-min=10.14";
meta = {
homepage = "https://ares-emu.net";
description = "Open-source multi-system emulator with a focus on accuracy and preservation";
mainProgram = "ares";
license = lib.licenses.isc;
maintainers = with lib.maintainers; [ Madouura AndersonTorres ];
mainProgram = "ares";
maintainers = with lib.maintainers; [
Madouura
AndersonTorres
];
platforms = lib.platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
};
})
# TODO: select between Qt and GTK3
# TODO: call Darwin hackers to deal with specific errors