btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / do / dosbox-staging / package.nix
blob43d4377d614a1ab9cf2f0d9733285768ae1281f0
2   lib,
3   SDL2,
4   SDL2_image,
5   SDL2_net,
6   alsa-lib,
7   fetchFromGitHub,
8   fetchpatch,
9   fluidsynth,
10   gitUpdater,
11   glib,
12   gtest,
13   iir1,
14   libGL,
15   libGLU,
16   libjack2,
17   libmt32emu,
18   libogg,
19   libpng,
20   libpulseaudio,
21   libslirp,
22   libsndfile,
23   makeWrapper,
24   meson,
25   ninja,
26   opusfile,
27   pkg-config,
28   speexdsp,
29   stdenv,
30   testers,
31   zlib-ng,
32   apple-sdk_15,
33   darwinMinVersionHook,
36 stdenv.mkDerivation (finalAttrs: {
37   pname = "dosbox-staging";
38   version = "0.81.1";
40   src = fetchFromGitHub {
41     owner = "dosbox-staging";
42     repo = "dosbox-staging";
43     rev = "v${finalAttrs.version}";
44     hash = "sha256-XGssEyX+AVv7/ixgGTRtPFjsUSX0FT0fhP+TXsFl2fY=";
45   };
47   patches = [
48     (fetchpatch {
49       name = "darwin-allow-bypass-wraps.patch";
50       url = "https://github.com/dosbox-staging/dosbox-staging/commit/9f0fc1dc762010e5f7471d01c504d817a066cae3.patch";
51       hash = "sha256-IzxRE1Vr+M8I5hdy80UwebjJ5R1IlH9ymaYgs6VwAO4=";
52     })
53   ];
55   nativeBuildInputs = [
56     gtest
57     makeWrapper
58     meson
59     ninja
60     pkg-config
61   ];
63   buildInputs =
64     [
65       SDL2
66       SDL2_image
67       SDL2_net
68       fluidsynth
69       glib
70       iir1
71       libGL
72       libGLU
73       libjack2
74       libmt32emu
75       libogg
76       libpng
77       libpulseaudio
78       libslirp
79       libsndfile
80       opusfile
81       speexdsp
82       zlib-ng
83     ]
84     ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]
85     ++ lib.optionals stdenv.hostPlatform.isDarwin [
86       apple-sdk_15
87       (darwinMinVersionHook "10.15") # from https://www.dosbox-staging.org/releases/macos/
88     ];
90   outputs = [ "out" "man" ];
92   postInstall = ''
93     install -Dm644 $src/contrib/linux/dosbox-staging.desktop $out/share/applications/
94   '';
96   # Rename binary, add a wrapper, and copy manual to avoid conflict with
97   # original dosbox. Doing it this way allows us to work with frontends and
98   # launchers that expect the binary to be named dosbox, but get out of the way
99   # of vanilla dosbox if the user desires to install that as well.
100   postFixup = ''
101     mv $out/bin/dosbox $out/bin/dosbox-staging
102     makeWrapper $out/bin/dosbox-staging $out/bin/dosbox
104     pushd $man/share/man/man1/
105     ln -s dosbox.1.gz dosbox-staging.1.gz
106     popd
107   '';
109   passthru = {
110     tests = {
111       version = testers.testVersion {
112         package = finalAttrs.finalPackage;
113         command = "dosbox --version";
114       };
115     };
116     updateScript = gitUpdater {
117       rev-prefix = "v";
118     };
119   };
121   meta = {
122     homepage = "https://dosbox-staging.github.io/";
123     description = "Modernized DOS emulator; DOSBox fork";
124     longDescription = ''
125       DOSBox Staging is an attempt to revitalize DOSBox's development
126       process. It's not a rewrite, but a continuation and improvement on the
127       existing DOSBox codebase while leveraging modern development tools and
128       practices.
129     '';
130     license = lib.licenses.gpl2Plus;
131     maintainers = with lib.maintainers; [
132       joshuafern
133       AndersonTorres
134     ];
135     platforms = lib.platforms.unix;
136     priority = 101;
137   };