@@ -1,4 +1,7 @@
1−{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gtk2, mednafen }:
1+{ stdenv, fetchFromGitHub, makeWrapper, autoreconfHook, pkgconfig, wrapGAppsHook
2+, gtk2 ? null, gtk3 ? null, mednafen }:
3+
4+with stdenv.lib;
25
36stdenv.mkDerivation rec {
47 name = "mednaffe-${version}";
@@ -11,19 +14,17 @@ stdenv.mkDerivation rec {
1114 sha256 = "13l7gls430dcslpan39k0ymdnib2v6crdsmn6bs9k9g30nfnqi6m";
1215 };
1316
14− patchPhase = ''
15− substituteInPlace src/mednaffe.c \
16− --replace 'binpath = NULL' 'binpath = "${mednafen}/bin/mednafen"'
17− '';
17+ nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig wrapGAppsHook ];
18+ buildInputs = [ gtk2 gtk3 mednafen ];
1819
19− nativeBuildInputs = [ autoreconfHook pkgconfig ];
20− buildInputs = [ gtk2 mednafen ];
20+ configureFlags = [ (enableFeature (gtk3 != null) "gtk3") ];
21+ postInstall = "wrapProgram $out/bin/mednaffe --set PATH ${mednafen}/bin";
2122
22− meta = with stdenv.lib; {
23− description = "A GTK based frontend for mednafen";
23+ meta = {
24+ description = "GTK-based frontend for mednafen emulator";
2425 homepage = https://github.com/AmatCoder/mednaffe;
25− license = licenses.gpl3;
26− maintainers = with maintainers; [ sheenobu ];
26+ license = licenses.gpl3Plus;
27+ maintainers = with maintainers; [ sheenobu yegortimoshenko ];
2728 platforms = platforms.linux;
2829 };
2930}