1 { lib, stdenv, fetchurl, autoreconfHook, intltool, pkg-config, gtk3, SDL2, xorg
2 , wrapGAppsHook, libcdio, nasm, ffmpeg_4, file
5 stdenv.mkDerivation rec {
9 # codeplex does not support direct downloading
11 url = "mirror://debian/pool/main/p/pcsxr/pcsxr_${version}.orig.tar.xz";
12 sha256 = "0q7nj0z687lmss7sgr93ij6my4dmhkm2nhjvlwx48dn2lxl6ndla";
17 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/01_fix-i386-exec-stack.patch";
18 sha256 = "17497wjxd6b92bj458s2769d9bpp68ydbvmfs9gp51yhnq4zl81x";
21 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/02_disable-ppc-auto-dynarec.patch";
22 sha256 = "0v8n79z034w6cqdrzhgd9fkdpri42mzvkdjm19x4asz94gg2i2kf";
25 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/03_fix-plugin-dir.patch";
26 sha256 = "0vkl0mv6whqaz79kvvvlmlmjpynyq4lh352j3bbxcr0vjqffxvsy";
29 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/04_update-homedir-symlinks.patch";
30 sha256 = "18r6n025ybr8fljfsaqm4ap31wp8838j73lrsffi49fkis60dp4j";
33 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/05_format-security.patch";
34 sha256 = "03m4kfc9bk5669hf7ji1anild08diliapx634f9cigyxh72jcvni";
37 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/06_warnings.patch";
38 sha256 = "0iz3g9ihnhisfgrzma9l74y4lhh57na9h41bmiam1millb796g71";
41 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/07_non-linux-ip-addr.patch";
42 sha256 = "14vb9l0l4nzxcymhjjs4q57nmsncmby9qpdr7c19rly5wavm4k77";
45 url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/08_reproducible.patch";
46 sha256 = "1cx9q59drsk9h6l31097lg4aanaj93ysdz5p88pg9c7wvxk1qz06";
50 ./0001-libpcsxcore-fix-build-with-ffmpeg-4.patch
53 nativeBuildInputs = [ autoreconfHook intltool pkg-config wrapGAppsHook ];
55 gtk3 SDL2 xorg.libXv xorg.libXtst libcdio nasm ffmpeg_4 file
59 # Workaround build failure on -fno-common toolchains like upstream
60 # gcc-10. Otherwise build fails as:
61 # ld: AboutDlg.o:/build/pcsxr/gui/Linux.h:42: multiple definition of `cfgfile';
62 # LnxMain.o:/build/pcsxr/gui/Linux.h:42: first defined here
63 env.NIX_CFLAGS_COMPILE = "-fcommon";
66 if stdenv.isx86_64 then "x86_64"
67 else if stdenv.isi686 then "x86"
68 else "no"; #debian patch 2 says ppc doesn't work
74 "--enable-dynarec=${dynarecTarget}"
78 mkdir -p "$out/share/doc/${pname}-${version}"
85 "$out/share/doc/${pname}-${version}"
89 broken = stdenv.isDarwin;
90 description = "Playstation 1 emulator";
91 homepage = "https://github.com/iCatButler/pcsxr";
92 maintainers = with maintainers; [ rardiol ];
93 license = licenses.gpl2Plus;
94 platforms = platforms.all;
95 mainProgram = "pcsxr";