From 7448a92e3079515ea53e772147a7f29eaf6c19d8 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 2 Nov 2024 23:57:06 -0300 Subject: [PATCH] ares: refactor - migrate patches to a directory - nixfmt-rfc-style - hammer --- pkgs/by-name/ar/ares/package.nix | 141 ++++++++++-------- .../001-dont-rebuild-on-install.patch | 0 .../ar/ares/{ => patches}/002-fix-ruby.diff | 0 .../{ => patches}/003-darwin-specific.patch | 0 4 files changed, 77 insertions(+), 64 deletions(-) rename pkgs/by-name/ar/ares/{ => patches}/001-dont-rebuild-on-install.patch (100%) rename pkgs/by-name/ar/ares/{ => patches}/002-fix-ruby.diff (100%) rename pkgs/by-name/ar/ares/{ => patches}/003-darwin-specific.patch (100%) diff --git a/pkgs/by-name/ar/ares/package.nix b/pkgs/by-name/ar/ares/package.nix index d6f09996a8db..6af1cb6d4e50 100644 --- a/pkgs/by-name/ar/ares/package.nix +++ b/pkgs/by-name/ar/ares/package.nix @@ -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 diff --git a/pkgs/by-name/ar/ares/001-dont-rebuild-on-install.patch b/pkgs/by-name/ar/ares/patches/001-dont-rebuild-on-install.patch similarity index 100% rename from pkgs/by-name/ar/ares/001-dont-rebuild-on-install.patch rename to pkgs/by-name/ar/ares/patches/001-dont-rebuild-on-install.patch diff --git a/pkgs/by-name/ar/ares/002-fix-ruby.diff b/pkgs/by-name/ar/ares/patches/002-fix-ruby.diff similarity index 100% rename from pkgs/by-name/ar/ares/002-fix-ruby.diff rename to pkgs/by-name/ar/ares/patches/002-fix-ruby.diff diff --git a/pkgs/by-name/ar/ares/003-darwin-specific.patch b/pkgs/by-name/ar/ares/patches/003-darwin-specific.patch similarity index 100% rename from pkgs/by-name/ar/ares/003-darwin-specific.patch rename to pkgs/by-name/ar/ares/patches/003-darwin-specific.patch