diff --git a/0ad.changes b/0ad.changes index 4b042af..edf9553 100644 --- a/0ad.changes +++ b/0ad.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Aug 30 14:13:52 UTC 2016 - rpm@fthiessen.de + +- Added system-tinygettext.patch +- Removed code for other distributions from spec file, sine we just + build for openSUSE. + ------------------------------------------------------------------- Fri Jul 29 09:22:25 UTC 2016 - jengelh@inai.de diff --git a/0ad.spec b/0ad.spec index a1db5c0..6915f4c 100644 --- a/0ad.spec +++ b/0ad.spec @@ -19,81 +19,42 @@ Name: 0ad Version: 0.0.20 Release: 0 +Summary: A real-time strategy game of ancient warfare +License: GPL-2.0+ and LGPL-3.0+ and CC-BY-SA-3.0 and MIT and ISC and MPL-2.0 and BSD-3-Clause +Group: Amusements/Games/Strategy/Real Time Url: http://play0ad.com/ Source: http://sourceforge.net/projects/zero-ad/files/releases/%{name}-%{version}-alpha-unix-build.tar.xz Source99: %{name}.changes # PATCH-FIX-UPSTREAM fix-c++14-compat.patch - http://trac.wildfiregames.com/ticket/4073 Patch0: fix-c++14-compat.patch +# PATCH-FEATURE-UPSTREAM system-tinygettext.patch -- http://trac.wildfiregames.com/ticket/4192 +Patch1: system-tinygettext.patch BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gcc-c++ -BuildRequires: mozilla-nspr-devel -BuildRequires: xz -BuildRequires: pkgconfig(IL) -BuildRequires: pkgconfig(icu-i18n) -BuildRequires: pkgconfig(zlib) -%if 0%{?suse_version} >= 1220 BuildRequires: libXcursor-devel -%endif BuildRequires: libjpeg-devel BuildRequires: libminiupnpc-devel BuildRequires: libpng-devel +BuildRequires: mozilla-nspr-devel BuildRequires: nasm -BuildRequires: python -BuildRequires: subversion -BuildRequires: zip -BuildRequires: pkgconfig(gloox) -BuildRequires: pkgconfig(libcurl) -BuildRequires: pkgconfig(libxml-2.0) -BuildRequires: pkgconfig(vorbis) -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%if 0%{?suse_version} -BuildRequires: pkg-config -BuildRequires: update-desktop-files -BuildRequires: pkgconfig(libenet) -BuildRequires: pkgconfig(openal) - -%if 0%{?suse_version} -BuildRequires: wxWidgets-3_0-devel -%endif - -%if 0%{?suse_version} == 1110 -BuildRequires: SDL-devel -%else -BuildRequires: libSDL2-devel -%endif - -%endif - -%if 0%{?fedora_version} -BuildRequires: SDL-devel -BuildRequires: desktop-file-utils -BuildRequires: libenet-devel -BuildRequires: openal-soft-devel BuildRequires: pkgconfig -BuildRequires: wxGTK-devel -%endif - -%if 0%{?mandriva_version} -BuildRequires: libenet-devel -BuildRequires: libwxgtku2.8-devel - -%if 0%{?mandriva_version} < 201000 -BuildRequires: libopenal-devel -BuildRequires: openal-soft-devel -%endif - -%if 0%{?mandriva_version} == 201000 -BuildRequires: libopenal1-soft -%endif - -%endif - -Summary: A real-time strategy game of ancient warfare -License: GPL-2.0+ and LGPL-3.0+ and CC-BY-SA-3.0 and MIT and ISC and MPL-2.0 and BSD-3-Clause and Zlib and CPL-1.0 -Group: Amusements/Games/Strategy/Real Time -Requires: 0ad-data = %version +BuildRequires: python +BuildRequires: update-desktop-files +BuildRequires: wxWidgets-3_0-devel +BuildRequires: pkgconfig(IL) +BuildRequires: pkgconfig(gloox) +BuildRequires: pkgconfig(icu-i18n) +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(libenet) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(openal) +BuildRequires: pkgconfig(sdl2) +BuildRequires: pkgconfig(tinygettext) +BuildRequires: pkgconfig(vorbis) +BuildRequires: pkgconfig(zlib) +Requires: 0ad-data = %{version} +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description 0 A.D. (pronounced "zero ey-dee") is a real-time strategy (RTS) game @@ -106,15 +67,24 @@ flexible game engine. %prep %setup -q -n %{name}-%{version}-alpha %patch0 -p1 +%patch1 -p1 + +# Fix usage of __DATE__ and __TIME__ macros modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE99}")" DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" TIME="\"$(date -d "${modified}" "+%%T")\"" -find . -name '*.[ch]' -o -name '*.cpp' | xargs sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" +find . "(" -name '*.[ch]' -o -name '*.cpp' ")" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" \{\} + %build export CFLAGS="%{optflags}" export CPPFLAGS="%{optflags} -fpermissive" -build/workspaces/update-workspaces.sh %{?_smp_mflags} --bindir=%{_bindir} --datadir=%{_datadir}/%{name} --libdir=%{_libdir}/%{name} +build/workspaces/update-workspaces.sh \ + %{?_smp_mflags} \ + --bindir=%{_bindir} \ + --datadir=%{_datadir}/%{name} \ + --libdir=%{_libdir}/%{name} \ + --with-system-tinygettext + pushd build/workspaces/gcc make verbose=1 %{?_smp_mflags} popd @@ -132,13 +102,7 @@ install -Dm 0755 binaries/system/libnvtt.so %{buildroot}%{_libdir}/%{name}/libnv install -Dm 0644 build/resources/0ad.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop install -Dm 0644 build/resources/0ad.png %{buildroot}%{_datadir}/pixmaps/%{name}.png -%if 0%{?suse_version} %suse_update_desktop_file %{name} -%endif - -%if 0%{?fedora_version} -desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop -%endif install -Dm 0755 build/resources/0ad.sh %{buildroot}%{_bindir}/0ad @@ -148,6 +112,11 @@ mkdir -p %{buildroot}%{_datadir}/%{name} %files %defattr(-,root,root) %doc README.txt +%if 0%{?suse_version} > 1320 +%license LICENSE.txt +%else +%doc LICENSE.txt +%endif %{_bindir}/0ad %{_bindir}/pyrogenesis %{_libdir}/%{name}/libCollada.so diff --git a/system-tinygettext.patch b/system-tinygettext.patch new file mode 100644 index 0000000..332eeee --- /dev/null +++ b/system-tinygettext.patch @@ -0,0 +1,84 @@ +diff -Nur 0ad-0.0.20-alpha/build/premake/extern_libs4.lua new/build/premake/extern_libs4.lua +--- 0ad-0.0.20-alpha/build/premake/extern_libs4.lua 2016-03-12 19:15:04.000000000 +0100 ++++ new/build/premake/extern_libs4.lua 2016-08-30 16:09:37.759431993 +0200 +@@ -634,7 +634,16 @@ + }, + tinygettext = { + compile_settings = function() +- add_third_party_include_paths("tinygettext") ++ if _OPTIONS["with-system-tinygettext"] then ++ pkgconfig_cflags("tinygettext") ++ else ++ add_third_party_include_paths("tinygettext") ++ end ++ end, ++ link_settings = function() ++ if _OPTIONS["with-system-tinygettext"] then ++ pkgconfig_libs("tinygettext") ++ end + end, + }, + valgrind = { +diff -Nur 0ad-0.0.20-alpha/build/premake/premake4.lua new/build/premake/premake4.lua +--- 0ad-0.0.20-alpha/build/premake/premake4.lua 2016-03-12 19:15:04.000000000 +0100 ++++ new/build/premake/premake4.lua 2016-08-30 16:08:19.490889266 +0200 +@@ -15,6 +15,7 @@ + newoption { trigger = "without-nvtt", description = "Disable use of NVTT" } + newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" } + newoption { trigger = "without-tests", description = "Disable generation of test projects" } ++newoption { trigger = "with-system-tinygettext", description = "Search standard paths for tinygettext, instead of using bundled copy" } + + -- OS X specific options + newoption { trigger = "macosx-bundle", description = "Enable OSX bundle, the argument is the bundle identifier string (e.g. com.wildfiregames.0ad)" } +@@ -599,28 +600,31 @@ + end + setup_static_lib_project("network", source_dirs, extern_libs, {}) + +- source_dirs = { +- "third_party/tinygettext/src", +- } +- extern_libs = { +- "iconv", +- "boost", +- } +- setup_third_party_static_lib_project("tinygettext", source_dirs, extern_libs, { } ) +- +- -- it's an external library and we don't want to modify its source to fix warnings, so we just disable them to avoid noise in the compile output +- if _ACTION == "vs2013" then +- buildoptions { +- "/wd4127", +- "/wd4309", +- "/wd4800", +- "/wd4100", +- "/wd4996", +- "/wd4099", +- "/wd4503" ++ if _OPTIONS["with-system-tinygettext"] then ++ table.insert(extern_libs, "tinygettext") ++ else ++ source_dirs = { ++ "third_party/tinygettext/src", + } +- end ++ extern_libs = { ++ "iconv", ++ "boost", ++ } ++ setup_third_party_static_lib_project("tinygettext", source_dirs, extern_libs, { } ) + ++ -- it's an external library and we don't want to modify its source to fix warnings, so we just disable them to avoid noise in the compile output ++ if _ACTION == "vs2013" then ++ buildoptions { ++ "/wd4127", ++ "/wd4309", ++ "/wd4800", ++ "/wd4100", ++ "/wd4996", ++ "/wd4099", ++ "/wd4503" ++ } ++ end ++ end + + if not _OPTIONS["without-lobby"] then + source_dirs = {