@@ -0,0 +1,53 @@
1+{ stdenv, fetchFromGitHub, gtk3, rgbds, SDL2, wrapGAppsHook, glib }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "sameboy";
5+ version = "0.13.6";
6+
7+ src = fetchFromGitHub {
8+ owner = "LIJI32";
9+ repo = "SameBoy";
10+ rev = "v${version}";
11+ sha256 = "04w8lybi7ssnax37ka4qw7pmcm7cgnmk90p9m73zbyp5chgpqqzc";
12+ };
13+
14+ enableParallelBuilding = true;
15+ # glib and wrapGAppsHook are needed to make the Open ROM menu work.
16+ nativeBuildInputs = [ rgbds glib wrapGAppsHook ];
17+ buildInputs = [ SDL2 ];
18+
19+ makeFlags = "CONF=release DATA_DIR=$(out)/share/sameboy/";
20+
21+ patchPhase = ''
22+ sed 's/-Werror //g' -i Makefile
23+ sed 's@"libgtk-3.so"@"${gtk3}/lib/libgtk-3.so"@g' -i OpenDialog/gtk.c
24+ '';
25+
26+ installPhase = ''
27+ pushd build/bin/SDL
28+ install -Dm755 sameboy $out/bin/sameboy
29+ rm sameboy
30+ mkdir -p $out/share/sameboy
31+ cp -r * $out/share/sameboy
32+ popd
33+ '';
34+
35+ meta = with stdenv.lib; {
36+ homepage = "https://sameboy.github.io";
37+ description = "Game Boy, Game Boy Color, and Super Game Boy emulator";
38+
39+ longDescription = ''
40+ SameBoy is a user friendly Game Boy, Game Boy Color and Super
41+ Game Boy emulator for macOS, Windows and Unix-like platforms.
42+ SameBoy is extremely accurate and includes a wide range of
43+ powerful debugging features, making it ideal for both casual
44+ players and developers. In addition to accuracy and developer
45+ capabilities, SameBoy has all the features one would expect from
46+ an emulator – from save states to scaling filters.
47+ '';
48+
49+ license = licenses.mit;
50+ maintainers = with maintainers; [ NieDzejkob ];
51+ platforms = platforms.linux;
52+ };
53+}