1 { lib, stdenv, fetchFromGitHub, desktop-file-utils, libpng
2 , pkg-config, SDL, freetype, zlib }:
4 stdenv.mkDerivation rec {
8 # NOTE: When bumping version beyond 4.6.0, you likely need to remove
9 # string.patch below. The fix of this patch has already been
10 # done upstream but is not yet part of a release
12 src = fetchFromGitHub {
15 owner = "ColinPitrat";
16 sha256 = "0hng5krwgc1h9bz1xlkp2hwnvas965nd7sb3z9mb2m6x9ghxlacz";
19 nativeBuildInputs = [ desktop-file-utils pkg-config ];
20 buildInputs = [ libpng SDL freetype zlib ];
22 patches = [ ./string.patch ];
25 "APP_PATH=${placeholder "out"}/share/caprice32"
27 "DESTDIR=${placeholder "out"}"
32 mkdir -p $out/share/icons/
33 mv $out/share/caprice32/resources/freedesktop/caprice32.png $out/share/icons/
34 mv $out/share/caprice32/resources/freedesktop/emulators.png $out/share/icons/
36 desktop-file-install --dir $out/share/applications \
37 $out/share/caprice32/resources/freedesktop/caprice32.desktop
39 desktop-file-install --dir $out/share/desktop-directories \
40 $out/share/caprice32/resources/freedesktop/Emulators.directory
42 install -Dm644 $out/share/caprice32/resources/freedesktop/caprice32.menu -t $out/etc/xdg/menus/applications-merged/
46 description = "Complete emulation of CPC464, CPC664 and CPC6128";
47 homepage = "https://github.com/ColinPitrat/caprice32";
48 license = licenses.gpl2;
50 platforms = platforms.linux;
51 mainProgram = "cap32";