Commit f27f5385 authored by lucasew's avatar lucasew
Browse files

_86Box: add support for unfree roms as _86Box-with-roms



Signed-off-by: default avatarlucasew <lucas59356@gmail.com>
parent cae20d2b
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
, enableNewDynarec ? enableDynarec && stdenv.hostPlatform.isAarch
, enableVncRenderer ? false
, unfreeEnableDiscord ? false
, unfreeEnableRoms ? false
}:

stdenv.mkDerivation (finalAttrs: {
@@ -48,15 +49,28 @@ stdenv.mkDerivation (finalAttrs: {
    ++ 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.
  preFixup = let
@@ -72,7 +86,8 @@ stdenv.mkDerivation (finalAttrs: {
    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;
  };
+5 −0
Original line number Diff line number Diff line
@@ -2620,6 +2620,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 { };