diff options
author | Doron Behar <doron.behar@gmail.com> | 2024-03-27 12:57:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-27 12:57:09 +0200 |
commit | 285d456c6d97742a4fae58280776502f4e652699 (patch) | |
tree | 6da08b847634a3e2235889582f401760a4c0dbb4 /pkgs | |
parent | f6bd4c34a946da061cfd6c0ed2121fbf30d81045 (diff) | |
parent | f27f538533135d0ec6cb49fc5613c250bbb96b9a (diff) |
Merge pull request #288072 from lucasew/86box-roms
_86Box: bring roms together
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/emulators/86box/default.nix | 37 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 5 |
2 files changed, 28 insertions, 14 deletions
diff --git a/pkgs/applications/emulators/86box/default.nix b/pkgs/applications/emulators/86box/default.nix index 1fceee8182ed1..4e2cb85412056 100644 --- a/pkgs/applications/emulators/86box/default.nix +++ b/pkgs/applications/emulators/86box/default.nix @@ -6,16 +6,17 @@ , enableNewDynarec ? enableDynarec && stdenv.hostPlatform.isAarch , enableVncRenderer ? false , unfreeEnableDiscord ? false +, unfreeEnableRoms ? false }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "86Box"; version = "4.1"; src = fetchFromGitHub { owner = "86Box"; repo = "86Box"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-JYOJFXiUTLRs6AEMYNx88PwcVw13ChQzV1ZE5OtX6Ds="; }; @@ -48,38 +49,46 @@ stdenv.mkDerivation rec { ++ lib.optional (!enableDynarec) "-DDYNAREC=OFF" ++ lib.optional (!unfreeEnableDiscord) "-DDISCORD=OFF"; - postInstall = lib.optional stdenv.isLinux '' + postInstall = lib.optionalString stdenv.isLinux '' install -Dm644 -t $out/share/applications $src/src/unix/assets/net.86box.86Box.desktop for size in 48 64 72 96 128 192 256 512; do install -Dm644 -t $out/share/icons/hicolor/"$size"x"$size"/apps \ $src/src/unix/assets/"$size"x"$size"/net.86box.86Box.png done; + '' + + lib.optionalString unfreeEnableRoms '' + mkdir -p $out/share/86Box + ln -s ${finalAttrs.passthru.roms} $out/share/86Box/roms ''; + passthru = { + roms = fetchFromGitHub { + owner = "86Box"; + repo = "roms"; + rev = "v${finalAttrs.version}"; + hash = "sha256-1HtoizO0QIGNjQTW0clzRp40h1ulw55+iTYz12UJSms="; + }; + }; + # Some libraries are loaded dynamically, but QLibrary doesn't seem to search # the runpath, so use a wrapper instead. - postFixup = let + preFixup = let libPath = lib.makeLibraryPath ([ libpcap ] ++ lib.optional unfreeEnableDiscord discord-gamesdk); libPathVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; - in - '' - wrapProgram $out/bin/86Box \ - "''${qtWrapperArgs[@]}" \ - --prefix ${libPathVar} : "${libPath}" + in '' + makeWrapperArgs+=(--prefix ${libPathVar} : "${libPath}") ''; - # Do not wrap twice. - dontWrapQtApps = true; - meta = with lib; { description = "Emulator of x86-based machines based on PCem."; mainProgram = "86Box"; homepage = "https://86box.net/"; - license = with licenses; [ gpl2Only ] ++ optional unfreeEnableDiscord unfree; + license = with licenses; [ gpl2Only ] + ++ optional (unfreeEnableDiscord || unfreeEnableRoms) unfree; maintainers = [ maintainers.jchw ]; platforms = platforms.linux; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dfa74365675b6..b92751cf6120a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2621,6 +2621,11 @@ with pkgs; _86Box = callPackage ../applications/emulators/86box { }; + _86Box-with-roms = _86Box.override { + unfreeEnableRoms = true; + unfreeEnableDiscord = true; + }; + attract-mode = callPackage ../applications/emulators/attract-mode { }; basiliskii = callPackage ../applications/emulators/basiliskii { }; |