ares: 141 -> 143, switch to CMake build system (#379702)
This commit is contained in:
commit
6a63e52b84
25
pkgs/by-name/ar/ares/darwin-build-fixes.patch
Normal file
25
pkgs/by-name/ar/ares/darwin-build-fixes.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
diff --git a/cmake/macos/compilerconfig.cmake b/cmake/macos/compilerconfig.cmake
|
||||||
|
index 99272c662..50f94db37 100644
|
||||||
|
--- a/cmake/macos/compilerconfig.cmake
|
||||||
|
+++ b/cmake/macos/compilerconfig.cmake
|
||||||
|
@@ -27,7 +27,7 @@ message(DEBUG "macOS SDK Path: ${CMAKE_OSX_SYSROOT}")
|
||||||
|
string(REGEX MATCH ".+/SDKs/MacOSX([0-9]+\\.[0-9])+\\.sdk$" _ ${CMAKE_OSX_SYSROOT})
|
||||||
|
set(_ares_macos_current_sdk ${CMAKE_MATCH_1})
|
||||||
|
message(DEBUG "macOS SDK version: ${_ares_macos_current_sdk}")
|
||||||
|
-if(_ares_macos_current_sdk VERSION_LESS _ares_macos_minimum_sdk)
|
||||||
|
+if(FALSE)
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Your macOS SDK version (${_ares_macos_current_sdk}) is too low. "
|
||||||
|
diff --git a/cmake/macos/helpers.cmake b/cmake/macos/helpers.cmake
|
||||||
|
index 864a629f0..f455345bf 100644
|
||||||
|
--- a/cmake/macos/helpers.cmake
|
||||||
|
+++ b/cmake/macos/helpers.cmake
|
||||||
|
@@ -35,7 +35,6 @@ function(ares_configure_executable target)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
- _bundle_dependencies(${target})
|
||||||
|
|
||||||
|
install(TARGETS ${target} BUNDLE DESTINATION "." COMPONENT Application)
|
||||||
|
endif()
|
||||||
@ -2,7 +2,8 @@
|
|||||||
lib,
|
lib,
|
||||||
SDL2,
|
SDL2,
|
||||||
alsa-lib,
|
alsa-lib,
|
||||||
autoPatchelfHook,
|
apple-sdk_14,
|
||||||
|
cmake,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
gtk3,
|
gtk3,
|
||||||
gtksourceview3,
|
gtksourceview3,
|
||||||
@ -11,42 +12,39 @@
|
|||||||
libX11,
|
libX11,
|
||||||
libXv,
|
libXv,
|
||||||
libao,
|
libao,
|
||||||
libicns,
|
|
||||||
libpulseaudio,
|
libpulseaudio,
|
||||||
|
libretro-shaders-slang,
|
||||||
librashader,
|
librashader,
|
||||||
|
ninja,
|
||||||
|
moltenvk,
|
||||||
openal,
|
openal,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
stdenv,
|
stdenv,
|
||||||
udev,
|
udev,
|
||||||
vulkan-loader,
|
vulkan-loader,
|
||||||
which,
|
|
||||||
wrapGAppsHook3,
|
wrapGAppsHook3,
|
||||||
|
zlib,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "ares";
|
pname = "ares";
|
||||||
version = "141";
|
version = "143";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "ares-emulator";
|
owner = "ares-emulator";
|
||||||
repo = "ares";
|
repo = "ares";
|
||||||
rev = "v${finalAttrs.version}";
|
tag = "v${finalAttrs.version}";
|
||||||
hash = "sha256-iNcoNdGw/DfYc9tsOGsPYoZLhVwNzJe8bVotx6Rl0j4=";
|
hash = "sha256-uuFKbS7WvxkTyyQfuQ6iKPvRt+54zUPdjUlQ/ohBAr8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
|
||||||
./patches/001-dont-rebuild-on-install.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
[
|
[
|
||||||
autoPatchelfHook
|
cmake
|
||||||
|
ninja
|
||||||
pkg-config
|
pkg-config
|
||||||
which
|
|
||||||
wrapGAppsHook3
|
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
libicns
|
wrapGAppsHook3
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
@ -54,6 +52,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
SDL2
|
SDL2
|
||||||
libao
|
libao
|
||||||
librashader
|
librashader
|
||||||
|
vulkan-loader
|
||||||
|
zlib
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||||
|
apple-sdk_14
|
||||||
|
moltenvk
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
alsa-lib
|
alsa-lib
|
||||||
@ -68,31 +72,48 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
udev
|
udev
|
||||||
];
|
];
|
||||||
|
|
||||||
appendRunpaths = [
|
patches = [
|
||||||
(lib.makeLibraryPath [
|
./darwin-build-fixes.patch
|
||||||
librashader
|
|
||||||
vulkan-loader
|
|
||||||
])
|
|
||||||
];
|
];
|
||||||
|
|
||||||
makeFlags =
|
cmakeFlags = [
|
||||||
lib.optionals stdenv.hostPlatform.isLinux [
|
(lib.cmakeBool "ARES_BUILD_LOCAL" false)
|
||||||
"hiro=gtk3"
|
(lib.cmakeBool "ARES_SKIP_DEPS" true)
|
||||||
]
|
];
|
||||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
||||||
"hiro=cocoa"
|
|
||||||
"lto=false"
|
|
||||||
"vulkan=false"
|
|
||||||
]
|
|
||||||
++ [
|
|
||||||
"local=false"
|
|
||||||
"openmp=true"
|
|
||||||
"prefix=$(out)"
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
postInstall =
|
||||||
|
if stdenv.hostPlatform.isDarwin then
|
||||||
|
''
|
||||||
|
mkdir $out/Applications
|
||||||
|
cp -a desktop-ui/ares.app $out/Applications/ares.app
|
||||||
|
# Shaders directory is already populated with Metal shaders, so can't simply symlink the slang shaders directory itself
|
||||||
|
for f in ${libretro-shaders-slang}/share/libretro/shaders/shaders_slang/*; do
|
||||||
|
ln -s "$f" $out/Applications/ares.app/Contents/Resources/Shaders/
|
||||||
|
done
|
||||||
|
''
|
||||||
|
else
|
||||||
|
''
|
||||||
|
ln -s ${libretro-shaders-slang}/share/libretro $out/share/libretro
|
||||||
|
'';
|
||||||
|
|
||||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-mmacosx-version-min=10.14";
|
postFixup =
|
||||||
|
if stdenv.hostPlatform.isDarwin then
|
||||||
|
''
|
||||||
|
install_name_tool \
|
||||||
|
-add_rpath ${librashader}/lib \
|
||||||
|
-add_rpath ${moltenvk}/lib \
|
||||||
|
$out/Applications/ares.app/Contents/MacOS/ares
|
||||||
|
''
|
||||||
|
else
|
||||||
|
''
|
||||||
|
patchelf $out/bin/.ares-wrapped \
|
||||||
|
--add-rpath ${
|
||||||
|
lib.makeLibraryPath [
|
||||||
|
librashader
|
||||||
|
vulkan-loader
|
||||||
|
]
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://ares-emu.net";
|
homepage = "https://ares-emu.net";
|
||||||
@ -103,8 +124,5 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
Madouura
|
Madouura
|
||||||
];
|
];
|
||||||
platforms = lib.platforms.unix;
|
platforms = lib.platforms.unix;
|
||||||
broken = stdenv.hostPlatform.isDarwin;
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
# TODO: select between Qt and GTK3
|
|
||||||
# TODO: call Darwin hackers to deal with specific errors
|
|
||||||
|
|||||||
@ -1,22 +0,0 @@
|
|||||||
From 65cc7647110edd768e7baa7991143014316e655a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Madoura <93990818+Madouura@users.noreply.github.com>
|
|
||||||
Date: Mon, 9 May 2022 10:17:06 -0500
|
|
||||||
Subject: [PATCH] Update GNUmakefile
|
|
||||||
|
|
||||||
---
|
|
||||||
desktop-ui/GNUmakefile | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/desktop-ui/GNUmakefile b/desktop-ui/GNUmakefile
|
|
||||||
index 8e27b11d3..0bee561fb 100644
|
|
||||||
--- a/desktop-ui/GNUmakefile
|
|
||||||
+++ b/desktop-ui/GNUmakefile
|
|
||||||
@@ -106,7 +106,7 @@ endif
|
|
||||||
$(call rdelete,$(object.path))
|
|
||||||
$(call rdelete,$(output.path))
|
|
||||||
|
|
||||||
-install: all
|
|
||||||
+install:
|
|
||||||
ifeq ($(platform),windows)
|
|
||||||
$(call mkdir,$(prefix)/$(name)/)
|
|
||||||
else ifeq ($(shell id -un),root)
|
|
||||||
32
pkgs/by-name/li/libretro-shaders-slang/package.nix
Normal file
32
pkgs/by-name/li/libretro-shaders-slang/package.nix
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenvNoCC,
|
||||||
|
unstableGitUpdater,
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
pname = "libretro-shaders-slang";
|
||||||
|
version = "0-unstable-2025-02-14";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "libretro";
|
||||||
|
repo = "slang-shaders";
|
||||||
|
rev = "130f589cd5a2f3e5df1d6607b82b6771bc8b8446";
|
||||||
|
hash = "sha256-ig+cE6MZNeY1Rx6ciSvLuxU0UyLPQLP5c5+lKpq4skA=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontConfigure = true;
|
||||||
|
dontBuild = true;
|
||||||
|
installFlags = "PREFIX=${placeholder "out"}";
|
||||||
|
|
||||||
|
passthru.updateScript = unstableGitUpdater { };
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Slang shaders for use with RetroArch's shader system";
|
||||||
|
homepage = "https://github.com/libretro/slang-shaders";
|
||||||
|
license = lib.licenses.gpl3Only;
|
||||||
|
maintainers = [ lib.maintainers.nadiaholmquist ];
|
||||||
|
platforms = lib.platforms.all;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user