summary refs log tree commit diff
path: root/pkgs/applications/emulators/dosbox/default.nix
blob: 383e943ff2466c2a8ef56be768c7ff1dd8a0635b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ lib
, stdenv
, fetchurl
, SDL
, SDL_net
, SDL_sound
, copyDesktopItems
, graphicsmagick
, libGL
, libGLU
, libpng
, makeDesktopItem
}:

stdenv.mkDerivation rec {
  pname = "dosbox";
  version = "0.74-3";

  src = fetchurl {
    url = "mirror://sourceforge/dosbox/dosbox-${version}.tar.gz";
    hash = "sha256-wNE91+0u02O2jeYVR1eB6JHNWC6BYrXDZpE3UCIiJgo=";
  };

  nativeBuildInputs = [
    copyDesktopItems
    graphicsmagick
  ];

  buildInputs = [
    SDL
    SDL_net
    SDL_sound
    libGL
    libGLU
    libpng
  ];

  hardeningDisable = [ "format" ];

  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";

  desktopItems = [
    (makeDesktopItem {
      name = "dosbox";
      exec = "dosbox";
      icon = "dosbox";
      comment = "x86 dos emulator";
      desktopName = "DOSBox";
      genericName = "DOS emulator";
      categories = "Emulator;Game;";
    })
  ];

  postInstall = ''
     mkdir -p $out/share/icons/hicolor/256x256/apps
     gm convert src/dosbox.ico $out/share/icons/hicolor/256x256/apps/dosbox.png
  '';

  enableParallelBuilding = true;

  meta = with lib; {
    homepage = "http://www.dosbox.com/";
    description = "A DOS emulator";
    longDescription = ''
      DOSBox is an emulator that recreates a MS-DOS compatible environment
      (complete with Sound, Input, Graphics and even basic networking). This
      environment is complete enough to run many classic MS-DOS games completely
      unmodified. In order to utilize all of DOSBox's features you need to first
      understand some basic concepts about the MS-DOS environment.
    '';
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ matthewbauer ];
    platforms = platforms.unix;
  };
}