2021-01-17 02:30:45 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook, intltool, pkg-config, gtk3, SDL2, xorg
|
2023-03-03 18:41:10 +00:00
|
|
|
, wrapGAppsHook, libcdio, nasm, ffmpeg_4, file
|
2016-05-19 20:41:38 +00:00
|
|
|
, fetchpatch }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "pcsxr";
|
2016-05-19 20:41:38 +00:00
|
|
|
version = "1.9.94";
|
|
|
|
|
|
|
|
# codeplex does not support direct downloading
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://debian/pool/main/p/pcsxr/pcsxr_${version}.orig.tar.xz";
|
|
|
|
sha256 = "0q7nj0z687lmss7sgr93ij6my4dmhkm2nhjvlwx48dn2lxl6ndla";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/01_fix-i386-exec-stack.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "17497wjxd6b92bj458s2769d9bpp68ydbvmfs9gp51yhnq4zl81x";
|
|
|
|
})
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/02_disable-ppc-auto-dynarec.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "0v8n79z034w6cqdrzhgd9fkdpri42mzvkdjm19x4asz94gg2i2kf";
|
|
|
|
})
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/03_fix-plugin-dir.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "0vkl0mv6whqaz79kvvvlmlmjpynyq4lh352j3bbxcr0vjqffxvsy";
|
|
|
|
})
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/04_update-homedir-symlinks.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "18r6n025ybr8fljfsaqm4ap31wp8838j73lrsffi49fkis60dp4j";
|
|
|
|
})
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/05_format-security.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "03m4kfc9bk5669hf7ji1anild08diliapx634f9cigyxh72jcvni";
|
|
|
|
})
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/06_warnings.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "0iz3g9ihnhisfgrzma9l74y4lhh57na9h41bmiam1millb796g71";
|
|
|
|
})
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/07_non-linux-ip-addr.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "14vb9l0l4nzxcymhjjs4q57nmsncmby9qpdr7c19rly5wavm4k77";
|
|
|
|
})
|
|
|
|
( fetchpatch {
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/games-team/pcsxr/raw/315e56d16e36ef3011f72d0fe86190728d2ba596/debian/patches/08_reproducible.patch";
|
2016-05-19 20:41:38 +00:00
|
|
|
sha256 = "1cx9q59drsk9h6l31097lg4aanaj93ysdz5p88pg9c7wvxk1qz06";
|
|
|
|
})
|
2017-03-04 11:36:06 +00:00
|
|
|
|
|
|
|
./uncompress2.patch
|
2021-11-07 05:28:12 +00:00
|
|
|
./0001-libpcsxcore-fix-build-with-ffmpeg-4.patch
|
2016-05-19 20:41:38 +00:00
|
|
|
];
|
|
|
|
|
2021-01-17 02:30:45 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook intltool pkg-config wrapGAppsHook ];
|
2016-05-19 20:41:38 +00:00
|
|
|
buildInputs = [
|
2023-03-03 18:41:10 +00:00
|
|
|
gtk3 SDL2 xorg.libXv xorg.libXtst libcdio nasm ffmpeg_4 file
|
2021-04-08 21:06:12 +00:00
|
|
|
xorg.libXxf86vm
|
2016-05-19 20:41:38 +00:00
|
|
|
];
|
|
|
|
|
2022-05-22 19:35:39 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: AboutDlg.o:/build/pcsxr/gui/Linux.h:42: multiple definition of `cfgfile';
|
|
|
|
# LnxMain.o:/build/pcsxr/gui/Linux.h:42: first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-05-22 19:35:39 +00:00
|
|
|
|
2016-05-19 20:41:38 +00:00
|
|
|
dynarecTarget =
|
|
|
|
if stdenv.isx86_64 then "x86_64"
|
|
|
|
else if stdenv.isi686 then "x86"
|
|
|
|
else "no"; #debian patch 2 says ppc doesn't work
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-opengl"
|
|
|
|
"--enable-ccdda"
|
|
|
|
"--enable-libcdio"
|
|
|
|
"--enable-dynarec=${dynarecTarget}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2019-08-15 12:41:18 +00:00
|
|
|
mkdir -p "$out/share/doc/${pname}-${version}"
|
2016-05-19 20:41:38 +00:00
|
|
|
cp README \
|
|
|
|
AUTHORS \
|
|
|
|
doc/keys.txt \
|
|
|
|
doc/tweaks.txt \
|
|
|
|
ChangeLog.df \
|
|
|
|
ChangeLog \
|
2019-08-15 12:41:18 +00:00
|
|
|
"$out/share/doc/${pname}-${version}"
|
2016-05-19 20:41:38 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-05-28 13:28:44 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2016-05-19 20:41:38 +00:00
|
|
|
description = "Playstation 1 emulator";
|
2022-05-22 19:35:39 +00:00
|
|
|
homepage = "https://github.com/iCatButler/pcsxr";
|
2016-05-19 20:41:38 +00:00
|
|
|
maintainers = with maintainers; [ rardiol ];
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|