From aa5eac62ca2a1928438b0284313d8adb2d4bc0eb Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 2 Nov 2024 08:32:27 -0300 Subject: [PATCH 01/10] ares: use `apple-sdk_11` --- pkgs/applications/emulators/bsnes/ares/default.nix | 5 ++--- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/emulators/bsnes/ares/default.nix b/pkgs/applications/emulators/bsnes/ares/default.nix index df08235529e5..d6f09996a8db 100644 --- a/pkgs/applications/emulators/bsnes/ares/default.nix +++ b/pkgs/applications/emulators/bsnes/ares/default.nix @@ -17,7 +17,7 @@ , udev , which , wrapGAppsHook3 -, darwin +, apple-sdk_11 , vulkan-loader , autoPatchelfHook }: @@ -63,8 +63,7 @@ stdenv.mkDerivation (finalAttrs: { openal udev ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk_11_0.frameworks.Cocoa - darwin.apple_sdk_11_0.frameworks.OpenAL + apple-sdk_11 ]; appendRunpaths = [ (lib.makeLibraryPath [ vulkan-loader ]) ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1c0742d4aed5..1e585caef54a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1440,7 +1440,7 @@ with pkgs; ### APPLICATIONS/EMULATORS/BSNES - ares = darwin.apple_sdk_11_0.callPackage ../applications/emulators/bsnes/ares { }; + ares = callPackage ../applications/emulators/bsnes/ares { }; bsnes-hd = darwin.apple_sdk_11_0.callPackage ../applications/emulators/bsnes/bsnes-hd { }; From 5e67300be42384fabd96f5a71e3cbcd20794b833 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 2 Nov 2024 23:48:08 -0300 Subject: [PATCH 02/10] ares: migrate to by-name --- .../bsnes => by-name/ar}/ares/001-dont-rebuild-on-install.patch | 0 .../emulators/bsnes => by-name/ar}/ares/002-fix-ruby.diff | 0 .../bsnes => by-name/ar}/ares/003-darwin-specific.patch | 0 .../bsnes/ares/default.nix => by-name/ar/ares/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 5 files changed, 2 deletions(-) rename pkgs/{applications/emulators/bsnes => by-name/ar}/ares/001-dont-rebuild-on-install.patch (100%) rename pkgs/{applications/emulators/bsnes => by-name/ar}/ares/002-fix-ruby.diff (100%) rename pkgs/{applications/emulators/bsnes => by-name/ar}/ares/003-darwin-specific.patch (100%) rename pkgs/{applications/emulators/bsnes/ares/default.nix => by-name/ar/ares/package.nix} (100%) diff --git a/pkgs/applications/emulators/bsnes/ares/001-dont-rebuild-on-install.patch b/pkgs/by-name/ar/ares/001-dont-rebuild-on-install.patch similarity index 100% rename from pkgs/applications/emulators/bsnes/ares/001-dont-rebuild-on-install.patch rename to pkgs/by-name/ar/ares/001-dont-rebuild-on-install.patch diff --git a/pkgs/applications/emulators/bsnes/ares/002-fix-ruby.diff b/pkgs/by-name/ar/ares/002-fix-ruby.diff similarity index 100% rename from pkgs/applications/emulators/bsnes/ares/002-fix-ruby.diff rename to pkgs/by-name/ar/ares/002-fix-ruby.diff diff --git a/pkgs/applications/emulators/bsnes/ares/003-darwin-specific.patch b/pkgs/by-name/ar/ares/003-darwin-specific.patch similarity index 100% rename from pkgs/applications/emulators/bsnes/ares/003-darwin-specific.patch rename to pkgs/by-name/ar/ares/003-darwin-specific.patch diff --git a/pkgs/applications/emulators/bsnes/ares/default.nix b/pkgs/by-name/ar/ares/package.nix similarity index 100% rename from pkgs/applications/emulators/bsnes/ares/default.nix rename to pkgs/by-name/ar/ares/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1e585caef54a..0ad9d8ae468b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1440,8 +1440,6 @@ with pkgs; ### APPLICATIONS/EMULATORS/BSNES - ares = callPackage ../applications/emulators/bsnes/ares { }; - bsnes-hd = darwin.apple_sdk_11_0.callPackage ../applications/emulators/bsnes/bsnes-hd { }; ### APPLICATIONS/EMULATORS/DOLPHIN-EMU From 7448a92e3079515ea53e772147a7f29eaf6c19d8 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 2 Nov 2024 23:57:06 -0300 Subject: [PATCH 03/10] 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 From 700f9e5039cf0b90f0744233a36ede6c890dd680 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 3 Nov 2024 00:01:45 -0300 Subject: [PATCH 04/10] bsnes-hd: use `apple-sdk_11` --- pkgs/applications/emulators/bsnes/bsnes-hd/default.nix | 7 ++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/emulators/bsnes/bsnes-hd/default.nix b/pkgs/applications/emulators/bsnes/bsnes-hd/default.nix index 046192df920f..eeaa642f1c21 100644 --- a/pkgs/applications/emulators/bsnes/bsnes-hd/default.nix +++ b/pkgs/applications/emulators/bsnes/bsnes-hd/default.nix @@ -6,12 +6,9 @@ , SDL2 , gtk3, gtksourceview3 , alsa-lib, libao, openal, libpulseaudio -, libicns, makeWrapper, darwin +, libicns, makeWrapper, apple-sdk_11 }: -let - inherit (darwin.apple_sdk_11_0.frameworks) Cocoa OpenAL; -in stdenv.mkDerivation { pname = "bsnes-hd"; version = "10.6-beta"; @@ -52,7 +49,7 @@ stdenv.mkDerivation { buildInputs = [ SDL2 libao ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libXv udev gtk3 gtksourceview3 alsa-lib openal libpulseaudio ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa OpenAL ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]; enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0ad9d8ae468b..04ebdb0c4130 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1440,7 +1440,7 @@ with pkgs; ### APPLICATIONS/EMULATORS/BSNES - bsnes-hd = darwin.apple_sdk_11_0.callPackage ../applications/emulators/bsnes/bsnes-hd { }; + bsnes-hd = callPackage ../applications/emulators/bsnes/bsnes-hd { }; ### APPLICATIONS/EMULATORS/DOLPHIN-EMU From f5820ce82761b3ddda396ea238b57fd97d4f7d29 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Thu, 14 Nov 2024 21:39:20 -0300 Subject: [PATCH 05/10] bsnes-hd: migrate to by-name --- .../bs}/bsnes-hd/macos-copy-app-to-prefix.patch | 0 .../bs}/bsnes-hd/macos-replace-sips-with-png2icns.patch | 0 .../bsnes-hd/default.nix => by-name/bs/bsnes-hd/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 4 files changed, 2 deletions(-) rename pkgs/{applications/emulators/bsnes => by-name/bs}/bsnes-hd/macos-copy-app-to-prefix.patch (100%) rename pkgs/{applications/emulators/bsnes => by-name/bs}/bsnes-hd/macos-replace-sips-with-png2icns.patch (100%) rename pkgs/{applications/emulators/bsnes/bsnes-hd/default.nix => by-name/bs/bsnes-hd/package.nix} (100%) diff --git a/pkgs/applications/emulators/bsnes/bsnes-hd/macos-copy-app-to-prefix.patch b/pkgs/by-name/bs/bsnes-hd/macos-copy-app-to-prefix.patch similarity index 100% rename from pkgs/applications/emulators/bsnes/bsnes-hd/macos-copy-app-to-prefix.patch rename to pkgs/by-name/bs/bsnes-hd/macos-copy-app-to-prefix.patch diff --git a/pkgs/applications/emulators/bsnes/bsnes-hd/macos-replace-sips-with-png2icns.patch b/pkgs/by-name/bs/bsnes-hd/macos-replace-sips-with-png2icns.patch similarity index 100% rename from pkgs/applications/emulators/bsnes/bsnes-hd/macos-replace-sips-with-png2icns.patch rename to pkgs/by-name/bs/bsnes-hd/macos-replace-sips-with-png2icns.patch diff --git a/pkgs/applications/emulators/bsnes/bsnes-hd/default.nix b/pkgs/by-name/bs/bsnes-hd/package.nix similarity index 100% rename from pkgs/applications/emulators/bsnes/bsnes-hd/default.nix rename to pkgs/by-name/bs/bsnes-hd/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04ebdb0c4130..79cb0c847789 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1440,8 +1440,6 @@ with pkgs; ### APPLICATIONS/EMULATORS/BSNES - bsnes-hd = callPackage ../applications/emulators/bsnes/bsnes-hd { }; - ### APPLICATIONS/EMULATORS/DOLPHIN-EMU dolphin-emu = qt6Packages.callPackage ../applications/emulators/dolphin-emu { From 3a9d7f9567c7390e2be0cbc424ede57a69e5d08c Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 3 Nov 2024 11:37:10 -0300 Subject: [PATCH 06/10] bsnes-hd: refactor - nixfmt-rfc-style - get rid of nested with - extra maintainer AndersonTorres --- pkgs/by-name/bs/bsnes-hd/package.nix | 91 +++++++++++++------ ...00-macos-replace-sips-with-png2icns.patch} | 0 .../0001-macos-copy-app-to-prefix.patch} | 0 3 files changed, 63 insertions(+), 28 deletions(-) rename pkgs/by-name/bs/bsnes-hd/{macos-replace-sips-with-png2icns.patch => patches/0000-macos-replace-sips-with-png2icns.patch} (100%) rename pkgs/by-name/bs/bsnes-hd/{macos-copy-app-to-prefix.patch => patches/0001-macos-copy-app-to-prefix.patch} (100%) diff --git a/pkgs/by-name/bs/bsnes-hd/package.nix b/pkgs/by-name/bs/bsnes-hd/package.nix index eeaa642f1c21..bcfb52ecd472 100644 --- a/pkgs/by-name/bs/bsnes-hd/package.nix +++ b/pkgs/by-name/bs/bsnes-hd/package.nix @@ -1,12 +1,23 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch -, pkg-config -, wrapGAppsHook3 -, libX11, libXv -, udev -, SDL2 -, gtk3, gtksourceview3 -, alsa-lib, libao, openal, libpulseaudio -, libicns, makeWrapper, apple-sdk_11 +{ + lib, + SDL2, + alsa-lib, + apple-sdk_11, + fetchFromGitHub, + fetchpatch, + gtk3, + gtksourceview3, + libX11, + libXv, + libao, + libicns, + libpulseaudio, + makeWrapper, + openal, + pkg-config, + stdenv, + udev, + wrapGAppsHook3, }: stdenv.mkDerivation { @@ -17,7 +28,7 @@ stdenv.mkDerivation { owner = "DerKoun"; repo = "bsnes-hd"; rev = "beta_10_6"; - sha256 = "0f3cd89fd0lqskzj98cc1pzmdbscq0psdjckp86w94rbchx7iw4h"; + hash = "sha256-kPB4OmQrk8QNupPJpi/ATK9W/w2MoST/1JiC5hJqbDg="; }; patches = [ @@ -25,14 +36,14 @@ stdenv.mkDerivation { # while assembling the .app directory hierarchy in the macos build. The # `sips` executable isn't in our environment during the build, but # `png2icns` is available by way of the dependency on libicns. - ./macos-replace-sips-with-png2icns.patch + ./patches/0000-macos-replace-sips-with-png2icns.patch # During `make install` on macos the Makefile wants to move the .app into - # the current user's home directory. This patches the Makefile such that - # the .app ends up in $(prefix)/Applications. The $(prefix) variable will - # be set to $out, so this will result in the .app ending up in the - # Applications directory in the current nix profile. - ./macos-copy-app-to-prefix.patch + # the current user's home directory. This patches the Makefile such that the + # .app ends up in $(prefix)/Applications. The $(prefix) variable will be set + # to $out, so this will result in the .app ending up in the Applications + # directory in the current nix profile. + ./patches/0001-macos-copy-app-to-prefix.patch # Fix build against gcc-13: # https://github.com/DerKoun/bsnes-hd/pull/124 @@ -43,20 +54,41 @@ stdenv.mkDerivation { }) ]; - nativeBuildInputs = [ pkg-config ] + nativeBuildInputs = + [ pkg-config ] ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libicns makeWrapper ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libicns + makeWrapper + ]; - buildInputs = [ SDL2 libao ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libXv udev gtk3 gtksourceview3 alsa-lib openal libpulseaudio ] + buildInputs = + [ + SDL2 + libao + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXv + udev + gtk3 + gtksourceview3 + alsa-lib + openal + libpulseaudio + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]; - enableParallelBuilding = true; - - makeFlags = [ "-C" "bsnes" "prefix=$(out)" ] + makeFlags = + [ + "-C bsnes" + "prefix=$(out)" + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "hiro=gtk3" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "hiro=cocoa" ]; + enableParallelBuilding = true; + postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p $out/bin makeWrapper $out/{Applications/bsnes.app/Contents/MacOS,bin}/bsnes @@ -69,12 +101,15 @@ stdenv.mkDerivation { ) ''; - meta = with lib; { - description = "Fork of bsnes that adds HD video features"; + meta = { homepage = "https://github.com/DerKoun/bsnes-hd"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ stevebob ]; - platforms = platforms.unix; + description = "Fork of bsnes that adds HD video features"; + license = lib.licenses.gpl3Only; mainProgram = "bsnes"; + maintainers = with lib.maintainers; [ + AndersonTorres + stevebob + ]; + platforms = lib.platforms.unix; }; } diff --git a/pkgs/by-name/bs/bsnes-hd/macos-replace-sips-with-png2icns.patch b/pkgs/by-name/bs/bsnes-hd/patches/0000-macos-replace-sips-with-png2icns.patch similarity index 100% rename from pkgs/by-name/bs/bsnes-hd/macos-replace-sips-with-png2icns.patch rename to pkgs/by-name/bs/bsnes-hd/patches/0000-macos-replace-sips-with-png2icns.patch diff --git a/pkgs/by-name/bs/bsnes-hd/macos-copy-app-to-prefix.patch b/pkgs/by-name/bs/bsnes-hd/patches/0001-macos-copy-app-to-prefix.patch similarity index 100% rename from pkgs/by-name/bs/bsnes-hd/macos-copy-app-to-prefix.patch rename to pkgs/by-name/bs/bsnes-hd/patches/0001-macos-copy-app-to-prefix.patch From e9a373340f92c5591ba67adb1a72ccd131e35342 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 3 Nov 2024 12:14:25 -0300 Subject: [PATCH 07/10] bsnes-hd: 10.6-beta -> 10.6-unstable-2024-10-21 --- pkgs/by-name/bs/bsnes-hd/package.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/bs/bsnes-hd/package.nix b/pkgs/by-name/bs/bsnes-hd/package.nix index bcfb52ecd472..bc03d6bbce03 100644 --- a/pkgs/by-name/bs/bsnes-hd/package.nix +++ b/pkgs/by-name/bs/bsnes-hd/package.nix @@ -17,18 +17,19 @@ pkg-config, stdenv, udev, + unstableGitUpdater, wrapGAppsHook3, }: stdenv.mkDerivation { pname = "bsnes-hd"; - version = "10.6-beta"; + version = "10.6-unstable-2024-10-21"; src = fetchFromGitHub { owner = "DerKoun"; repo = "bsnes-hd"; - rev = "beta_10_6"; - hash = "sha256-kPB4OmQrk8QNupPJpi/ATK9W/w2MoST/1JiC5hJqbDg="; + rev = "0bb7b8645e22ea2476cabd58f32e987b14686601"; + hash = "sha256-YzWSZMn6v5hWIHnp6KmmpevCsf35Vi2BCcmFMnrFPH0="; }; patches = [ @@ -44,14 +45,6 @@ stdenv.mkDerivation { # to $out, so this will result in the .app ending up in the Applications # directory in the current nix profile. ./patches/0001-macos-copy-app-to-prefix.patch - - # Fix build against gcc-13: - # https://github.com/DerKoun/bsnes-hd/pull/124 - (fetchpatch { - name = "gcc-13.patch"; - url = "https://github.com/DerKoun/bsnes-hd/commit/587e496f667970d60b6ea29976c171da1681388e.patch"; - hash = "sha256-7KBXh8b4xGTzgV2Pt8B1eFZHOaXcCKXKzqGOf0rFG0c="; - }) ]; nativeBuildInputs = @@ -101,6 +94,10 @@ stdenv.mkDerivation { ) ''; + passthru = { + updateScript = unstableGitUpdater { }; + }; + meta = { homepage = "https://github.com/DerKoun/bsnes-hd"; description = "Fork of bsnes that adds HD video features"; From 6a1c2b2dbac42b0d7adc31c4c3d9a5a8d32189e0 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 2 Nov 2024 09:04:39 -0300 Subject: [PATCH 08/10] higan: remove darwin references Since `apple-sdk` is included by default on Darwin stdenv. --- pkgs/by-name/hi/higan/package.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkgs/by-name/hi/higan/package.nix b/pkgs/by-name/hi/higan/package.nix index 3eb9a9a310ec..e75d5615ccb1 100644 --- a/pkgs/by-name/hi/higan/package.nix +++ b/pkgs/by-name/hi/higan/package.nix @@ -1,7 +1,6 @@ { lib , SDL2 , alsa-lib -, darwin , fetchFromGitHub , gtk3 , gtksourceview3 @@ -51,13 +50,7 @@ stdenv.mkDerivation (finalAttrs: { libpulseaudio openal udev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ - Carbon - Cocoa - OpenAL - OpenGL - ]); + ]; patches = [ # Includes cmath header From ef169558cd630c4b7aa5b9ef4b86a13fb0628a3c Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 3 Nov 2024 12:55:20 -0300 Subject: [PATCH 09/10] higan: refactor - nixfmt-rfc-style --- pkgs/by-name/hi/higan/package.nix | 267 ++++++++++-------- .../0001-include-cmath.patch} | 0 .../0002-sips-to-png2icns.patch} | 0 3 files changed, 145 insertions(+), 122 deletions(-) rename pkgs/by-name/hi/higan/{001-include-cmath.patch => patches/0001-include-cmath.patch} (100%) rename pkgs/by-name/hi/higan/{002-sips-to-png2icns.patch => patches/0002-sips-to-png2icns.patch} (100%) diff --git a/pkgs/by-name/hi/higan/package.nix b/pkgs/by-name/hi/higan/package.nix index e75d5615ccb1..01cad29145c2 100644 --- a/pkgs/by-name/hi/higan/package.nix +++ b/pkgs/by-name/hi/higan/package.nix @@ -1,22 +1,24 @@ -{ lib -, SDL2 -, alsa-lib -, fetchFromGitHub -, gtk3 -, gtksourceview3 -, libGL -, libGLU -, libX11 -, libXv -, libao -, libicns -, libpulseaudio -, openal -, pkg-config -, runtimeShell -, stdenv -, udev -, unstableGitUpdater +{ + lib, + SDL2, + alsa-lib, + fetchFromGitHub, + gtk3, + gtksourceview3, + libGL, + libGLU, + libX11, + libXv, + libao, + libicns, + libpulseaudio, + openal, + installShellFiles, + pkg-config, + runtimeShell, + stdenv, + udev, + unstableGitUpdater, }: stdenv.mkDerivation (finalAttrs: { @@ -30,124 +32,144 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-M8WaPrOPSRKxhYcf6ffNkDzITkCltNF9c/zl0GmfJrI="; }; - nativeBuildInputs = [ - pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libicns - ]; + nativeBuildInputs = + [ + installShellFiles + pkg-config + ] + ++ 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 - ]; + buildInputs = + [ + SDL2 + libao + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + gtk3 + gtksourceview3 + libGL + libGLU + libX11 + libXv + libpulseaudio + openal + udev + ]; patches = [ # Includes cmath header - ./001-include-cmath.patch + ./patches/0001-include-cmath.patch # Uses png2icns instead of sips - ./002-sips-to-png2icns.patch + ./patches/0002-sips-to-png2icns.patch ]; dontConfigure = true; enableParallelBuilding = true; - buildPhase = let - platform = - if stdenv.hostPlatform.isLinux - then "linux" - else if stdenv.hostPlatform.isDarwin - then "macos" - else if stdenv.hostPlatform.isBSD - then "bsd" - else if stdenv.hostPlatform.isWindows - then "windows" - else throw "Unknown platform for higan: ${stdenv.hostPlatform.system}"; - in '' - runHook preBuild - - make -C higan-ui -j$NIX_BUILD_CORES \ - compiler=${stdenv.cc.targetPrefix}c++ \ - platform=${platform} \ - openmp=true \ - hiro=gtk3 \ - build=accuracy \ - local=false \ - cores="cv fc gb gba md ms msx ngp pce sfc sg ws" - - make -C icarus -j$NIX_BUILD_CORES \ - compiler=${stdenv.cc.targetPrefix}c++ \ - platform=${platform} \ - openmp=true \ - hiro=gtk3 - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - '' + (if stdenv.hostPlatform.isDarwin then '' - mkdir ${placeholder "out"} - mv higan/out/higan.app ${placeholder "out"}/ - mv icarus/out/icarus.app ${placeholder "out"}/ - '' else '' - install -d ${placeholder "out"}/bin - install higan-ui/out/higan -t ${placeholder "out"}/bin/ - install icarus/out/icarus -t ${placeholder "out"}/bin/ - - install -d ${placeholder "out"}/share/applications - install higan-ui/resource/higan.desktop -t ${placeholder "out"}/share/applications/ - install icarus/resource/icarus.desktop -t ${placeholder "out"}/share/applications/ - - install -d ${placeholder "out"}/share/pixmaps - install higan/higan/resource/higan.svg ${placeholder "out"}/share/pixmaps/higan-icon.svg - install higan/higan/resource/logo.png ${placeholder "out"}/share/pixmaps/higan-icon.png - install icarus/resource/icarus.svg ${placeholder "out"}/share/pixmaps/icarus-icon.svg - install icarus/resource/icarus.png ${placeholder "out"}/share/pixmaps/icarus-icon.png - '') + '' - install -d ${placeholder "out"}/share/higan - cp -rd extras/ higan/System/ ${placeholder "out"}/share/higan/ - - install -d ${placeholder "out"}/share/icarus - cp -rd icarus/Database icarus/Firmware ${placeholder "out"}/share/icarus/ - '' + ( - # A dirty workaround, suggested by @cpages: - # we create a first-run script to populate - # $HOME with all the stuff needed at runtime + buildPhase = let - dest = if stdenv.hostPlatform.isDarwin - then "\\$HOME/Library/Application Support/higan" - else "\\$HOME/higan"; - in '' - mkdir -p ${placeholder "out"}/bin - cat < ${placeholder "out"}/bin/higan-init.sh - #!${runtimeShell} + platform = + if stdenv.hostPlatform.isLinux then + "linux" + else if stdenv.hostPlatform.isDarwin then + "macos" + else if stdenv.hostPlatform.isBSD then + "bsd" + else if stdenv.hostPlatform.isWindows then + "windows" + else + throw "Unknown platform for higan: ${stdenv.hostPlatform.system}"; + in + '' + runHook preBuild - cp --recursive --update ${placeholder "out"}/share/higan/System/ "${dest}"/ + make -C higan-ui -j$NIX_BUILD_CORES \ + compiler=${stdenv.cc.targetPrefix}c++ \ + platform=${platform} \ + openmp=true \ + hiro=gtk3 \ + build=accuracy \ + local=false \ + cores="cv fc gb gba md ms msx ngp pce sfc sg ws" - EOF + make -C icarus -j$NIX_BUILD_CORES \ + compiler=${stdenv.cc.targetPrefix}c++ \ + platform=${platform} \ + openmp=true \ + hiro=gtk3 - chmod +x ${placeholder "out"}/bin/higan-init.sh - '') + '' + runHook postBuild + ''; - runHook postInstall - ''; + installPhase = + '' + runHook preInstall - passthru.updateScript = unstableGitUpdater {}; + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir $out + mv higan/out/higan.app $out/ + mv icarus/out/icarus.app $out/ + '' + else + '' + installBin higan-ui/out/higan icarus/out/icarus - meta = with lib; { + install -d $out/share/applications + install higan-ui/resource/higan.desktop -t $out/share/applications/ + install icarus/resource/icarus.desktop -t $out/share/applications/ + + install -d $out/share/pixmaps + install higan/higan/resource/higan.svg $out/share/pixmaps/higan-icon.svg + install higan/higan/resource/logo.png $out/share/pixmaps/higan-icon.png + install icarus/resource/icarus.svg $out/share/pixmaps/icarus-icon.svg + install icarus/resource/icarus.png $out/share/pixmaps/icarus-icon.png + '' + ) + + '' + install -d $out/share/higan + cp -rd extras/ higan/System/ $out/share/higan/ + + install -d $out/share/icarus + cp -rd icarus/Database icarus/Firmware $out/share/icarus/ + '' + + ( + # A dirty workaround, suggested by @cpages: + # we create a first-run script to populate + # $HOME with all the stuff needed at runtime + let + dest = + if stdenv.hostPlatform.isDarwin then + "\\$HOME/Library/Application Support/higan" + else + "\\$HOME/higan"; + in + '' + mkdir -p $out/bin + cat < $out/bin/higan-init.sh + #!${runtimeShell} + + cp --recursive --update $out/share/higan/System/ "${dest}"/ + + EOF + + chmod +x $out/bin/higan-init.sh + '' + ) + + '' + + runHook postInstall + ''; + + passthru.updateScript = unstableGitUpdater { }; + + meta = { homepage = "https://github.com/higan-emu/higan"; description = "Open-source, cycle-accurate multi-system emulator"; longDescription = '' @@ -161,10 +183,11 @@ stdenv.mkDerivation (finalAttrs: { Neo Geo Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge V2. ''; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ AndersonTorres ]; - platforms = platforms.unix; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.platforms.unix; broken = stdenv.hostPlatform.isDarwin; }; }) # TODO: select between Qt and GTK3 +# TODO: call Darwin hackers to deal with respective problems diff --git a/pkgs/by-name/hi/higan/001-include-cmath.patch b/pkgs/by-name/hi/higan/patches/0001-include-cmath.patch similarity index 100% rename from pkgs/by-name/hi/higan/001-include-cmath.patch rename to pkgs/by-name/hi/higan/patches/0001-include-cmath.patch diff --git a/pkgs/by-name/hi/higan/002-sips-to-png2icns.patch b/pkgs/by-name/hi/higan/patches/0002-sips-to-png2icns.patch similarity index 100% rename from pkgs/by-name/hi/higan/002-sips-to-png2icns.patch rename to pkgs/by-name/hi/higan/patches/0002-sips-to-png2icns.patch From ecaa6df0629c12222fb13e5ae67cf2b1b9312bf6 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 3 Nov 2024 13:01:34 -0300 Subject: [PATCH 10/10] higan: 115-unstable-2024-02-17 -> 115-unstable-2024-09-04 --- pkgs/by-name/hi/higan/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hi/higan/package.nix b/pkgs/by-name/hi/higan/package.nix index 01cad29145c2..59558b72e00c 100644 --- a/pkgs/by-name/hi/higan/package.nix +++ b/pkgs/by-name/hi/higan/package.nix @@ -23,13 +23,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "higan"; - version = "115-unstable-2024-02-17"; + version = "115-unstable-2024-09-04"; src = fetchFromGitHub { owner = "higan-emu"; repo = "higan"; - rev = "ba4b918c0bbcc302e0d5d2ed70f2c56214d62681"; - hash = "sha256-M8WaPrOPSRKxhYcf6ffNkDzITkCltNF9c/zl0GmfJrI="; + rev = "a03b2e94c620eb12ab6f9936aee50e4389bee2ff"; + hash = "sha256-VpwHjA0LufKDnGRAS906Qh3R2pVt4uUGXxsRcca9SyM="; }; nativeBuildInputs =