LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File pcsx2.spec of Package pcsx2 (Project home:linux4humans:games)

#
# spec file for package pcsx2
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.links2linux.org/
#

%define with_lto 1
#%%define with_gtk3 1

Name:          pcsx2
License:       GPL-3.0
Group:         System/Emulators
Version:       1.4.0+git20170221.0955
Release:       3.12
URL:           http://pcsx2.net/
ExclusiveArch: %ix86
%ifarch x86_64
Summary:       Use i586 package!
%else
Summary:       Sony PlayStation 2 Emulator
%endif
Group:         System/Emulators/Other
Source:        %{name}.tar.xz
Source1:       baselibs.conf
Patch0:        pcsx2.os-release.patch
%if 0%{?sles_version} && 0%{?suse_version} == 1110
BuildRequires:  gcc48
BuildRequires:  gcc48-c++
%else
BuildRequires:  gcc-c++ >= 4.7
%endif
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: libaio-devel
# non-free library
#BuildRequires: libCg-devel
BuildRequires: libjpeg-devel
%if 0%{?suse_version} >= 1130
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(glesv2)
%endif
BuildRequires: Mesa-devel
%if 0%{?suse_version} > 1230
BuildRequires: Mesa-libGLESv3-devel
%endif
BuildRequires: alsa-devel
BuildRequires: glew-devel
%if %{with gtk3}
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: wxGTK3-devel
%else
BuildRequires: gtk2-devel
BuildRequires: wxWidgets-3_2-devel
%endif
BuildRequires: xz-devel
BuildRequires: libudev-devel
%if 0%{?suse_version} < 1120
BuildRequires: SDL-devel
%else
BuildRequires: libSDL-devel
%endif
#BuildRequires: pkgconfig(sdl2)
BuildRequires: soundtouch-devel
BuildRequires: portaudio-devel
BuildRequires: xz
BuildRequires: update-desktop-files
BuildRoot:     %{_tmppath}/%{name}-%{version}-build

%description
Sony PlayStation 2 emulator. Requires a BIOS image in %_libdir/%name/bios
or in .%name/bios in your HOME directory (will be created when you first run
PCSX2). Check http://www.pcsx2.net/guide.php#Bios for details on which files
you need and how to obtain them.

%prep
%setup -q -n %{name}
%patch0 -p1

# Make experimental things possible
sed -i -e "s:FATAL_ERROR:WARNING:g" cmake/BuildParameters.cmake

# zerogs doesn't build and source dir must be removed without libCg-devel
rm -rf plugins/zerogs/

%build
%if 0%{?sles_version} && 0%{?suse_version} == 1110
export CC=gcc-4.8
export CXX=g++-4.8
%endif
tee os-release <<_EOF_
NAME="SLED"
PRETTY_NAME="SUSE Linux Enterprise Desktop 11 SP4"
ID=sled
ANSI_COLOR="0;32"
_EOF_

mkdir build
cd build
cmake \
  -DUSER_CMAKE_C_FLAGS='%{optflags}' \
  -DUSER_CMAKE_CXX_FLAGS='%{optflags}' \
%if %{with lto}
  -DLTO_FLAGS='-fuse-linker-plugin -fuse-ld=gold' \
  -DUSER_CMAKE_LD_FLAGS='--plugin %(gcc --print-file-name=liblto_plugin.so)' \
%endif
%if %{with gtk3}
  -DGTK3_API='TRUE' \
%endif
%if 0%{?suse_version} < 1130
  -DEGL_API='FALSE' \
%endif
  -DCMAKE_INSTALL_PREFIX='%{_prefix}' \
  -DCMAKE_BUILD_TYPE='Release' \
  -DPACKAGE_MODE='TRUE' \
  -DXDG_STD='TRUE' \
  -DREBUILD_SHADER='TRUE' \
  -DPLUGIN_DIR='%{_libdir}/pcsx2' \
  -DGAMEINDEX_DIR='%{_datadir}/pcsx2' \
  -DDOC_DIR='%{_datadir}/doc/pcsx2' \
  -DBIN_DIR='%{_bindir}' \
  -DGLSL_API='TRUE' \
  -DEXTRA_PLUGINS='TRUE' \
  -DDISABLE_PCSX2_WRAPPER='TRUE' \
  -DSDL2_API='FALSE' \
  ..
make %{?jobs:-j%{jobs}}
cd ..

%install
cd build
%makeinstall
cd ..

mkdir -p %{buildroot}/%{_docdir}/
mv %{buildroot}/%{_datadir}/doc/pcsx2/ %{buildroot}/%{_docdir}/

# move translations to main language dir if there isn't a sublang or delete
# translations not supported by distro at all
for i in $(ls %{buildroot}%{_datadir}/locale | grep _); do
  new=$(echo $i | sed "s:_.*::g")
  if [ ! -d %{_datadir}/locale/$i ]; then
    if [ -d %{_datadir}/locale/$new ]; then
      mv %{buildroot}%{_datadir}/locale/$i %{buildroot}%{_datadir}/locale/$new
    else
      rm -rf %{buildroot}%{_datadir}/locale/$i
    fi
  fi
done

%fdupes -s %{buildroot}
%suse_update_desktop_file -r PCSX2 System Emulator

%post
%if 0%{?sles_version} && 0%{?suse_version} == 1110
update-desktop-database &> /dev/null || :
%else
%desktop_database_post
%endif

%postun
%if 0%{?sles_version} && 0%{?suse_version} == 1110
update-desktop-database &> /dev/null || :
%else
%desktop_database_postun
%endif

%files
%defattr(-,root,root)
%{_bindir}/PCSX2*
%{_libdir}/pcsx2
%{_docdir}/pcsx2
%{_datadir}/pcsx2
%{_mandir}/man1/PCSX2.1.gz
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_datadir}/applications/PCSX2.desktop
%{_datadir}/pixmaps/PCSX2.xpm

%changelog
* Tue Feb  7 2017 olaf@aepfle.de
- Provide package as pcsx2-32bit
* Tue Jan 10 2017 olaf@aepfle.de
- Enforce 32bit builds
* Sun Aug 31 2014 johannesobermayr@gmx.de
- Update to git master
- Fix RPATH/RUNPATH issue the right way
* Fri Mar 21 2014 p.seiler@linuxmail.org
- fixed typo
* Thu Mar 20 2014 p.seiler@linuxmail.org
- changed the way of creating of script file
* Mon Mar  3 2014 p.seiler@linuxmail.org
- add variable to pass through command line parameters to the binary
* Thu Feb  6 2014 p.seiler@linuxmail.org
- removed libegl dependency (not working correctly)
* Thu Feb  6 2014 p.seiler@linuxmail.org
- added libegl dependency
* Thu Feb  6 2014 p.seiler@linuxmail.org
- removed libCg dependency. Used glsl shaders instead
* Wed Feb  5 2014 p.seiler@linuxmail.org
- changed binary name
- added shell script to run binary correctly
* Wed Feb  5 2014 p.seiler@linuxmail.org
- added dependencies for base system and pcsx2 binary
- cleanup -> used cmake to compile
- removed unneeded patch
* Tue Feb  4 2014 p.seiler@linuxmail.org
- initial commit