biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / emulators / dosbox / default.nix
blobf17d3a783ba9d1d3668b30722a50734e285ffc0b
1 { lib
2 , stdenv
3 , fetchurl
4 , fetchpatch
5 , autoreconfHook
6 , SDL
7 , SDL_net
8 , SDL_sound
9 , copyDesktopItems
10 , graphicsmagick
11 , libGL
12 , libGLU
13 , OpenGL
14 , libpng
15 , makeDesktopItem
18 stdenv.mkDerivation rec {
19   pname = "dosbox";
20   version = "0.74-3";
22   src = fetchurl {
23     url = "mirror://sourceforge/dosbox/dosbox-${version}.tar.gz";
24     hash = "sha256-wNE91+0u02O2jeYVR1eB6JHNWC6BYrXDZpE3UCIiJgo=";
25   };
27   patches = [
28     (fetchpatch {
29       url = "https://github.com/joncampbell123/dosbox-x/commit/006d5727d36d1ec598e387f2f1a3c521e3673dcb.patch";
30       includes = [ "src/gui/render_templates_sai.h" ];
31       hash = "sha256-HSO29/LgZRKQ3HQBA0QF5henG8pCSoe1R2joYNPcUcE=";
32     })
33   ];
35   nativeBuildInputs = [
36     autoreconfHook
37     copyDesktopItems
38     graphicsmagick
39   ];
41   buildInputs = [
42     SDL
43     SDL_net
44     SDL_sound
45     libpng
46   ] ++ (if stdenv.hostPlatform.isDarwin then [
47     OpenGL
48   ] else [
49     libGL
50     libGLU
51   ]);
53   # Tests for SDL_net.h for modem & IPX support, not automatically picked up due to being in SDL subdirectory
54   env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL_net}/include/SDL";
56   hardeningDisable = [ "format" ];
58   configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
60   desktopItems = [
61     (makeDesktopItem {
62       name = "dosbox";
63       exec = "dosbox";
64       icon = "dosbox";
65       comment = "x86 dos emulator";
66       desktopName = "DOSBox";
67       genericName = "DOS emulator";
68       categories = [ "Emulator" "Game" ];
69     })
70   ];
72   postInstall = ''
73      mkdir -p $out/share/icons/hicolor/256x256/apps
74      gm convert src/dosbox.ico $out/share/icons/hicolor/256x256/apps/dosbox.png
75   '';
77   enableParallelBuilding = true;
79   meta = with lib; {
80     homepage = "http://www.dosbox.com/";
81     description = "A DOS emulator";
82     longDescription = ''
83       DOSBox is an emulator that recreates a MS-DOS compatible environment
84       (complete with Sound, Input, Graphics and even basic networking). This
85       environment is complete enough to run many classic MS-DOS games completely
86       unmodified. In order to utilize all of DOSBox's features you need to first
87       understand some basic concepts about the MS-DOS environment.
88     '';
89     license = licenses.gpl2Plus;
90     maintainers = with maintainers; [ matthewbauer ];
91     platforms = platforms.unix;
92     mainProgram = "dosbox";
93   };