/[packages]/updates/8/0ad/current/SPECS/0ad.spec
ViewVC logotype

Contents of /updates/8/0ad/current/SPECS/0ad.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1790973 - (show annotations) (download)
Mon Mar 14 13:21:51 2022 UTC (2 years, 1 month ago) by akien
File size: 6805 byte(s)
- Re-enable build on i586
- More fixes for mozjs78 on i586 (backported from mozjs78 system package)
- Patch mozj78 build.sh to skip debug build
1 # (akien) Partially synced with Fedora (patches, license checks, manpage).
2
3 # "fix" underlinking:
4 %define _disable_ld_no_undefined 1
5
6
7 # http://trac.wildfiregames.com/wiki/BuildInstructions#Linux
8
9 # (akien) Can't use system mozjs78 for now due to two linking issues:
10 # * https://bugzilla.mozilla.org/show_bug.cgi?id=1644600
11 # * https://code.wildfiregames.com/D3127
12 # + needs some trivial fixes to upgrade usage to 78.7, see Patch11 and
13 # https://trac.wildfiregames.com/ticket/5986#comment:1
14
15 # Does not build with mozjs-78
16 # source/scriptinterface/ScriptTypes.h:85:2: error: #error Your compiler is trying to use an untested minor version of the SpiderMonkey library. If you are a package maintainer, please make sure to check very carefully that this version does not change the behaviour of the code executed by SpiderMonkey. Different parts of the game (e.g. the multiplayer mode) rely on deterministic behaviour of the JavaScript engine. A simple way for testing this would be playing a network game with one player using the old version and one player using the new version. Another way for testing is running replays and comparing the final hash (check trac.wildfiregames.com/wiki/Debugging#Replaymode). For more information check this link: trac.wildfiregames.com/wiki/Debugging#Outofsync
17 # Check source/scriptinterface/ScriptTypes.h for mozjs version requirement.
18 %bcond_with system_mozjs78
19
20 # Exclude private libraries from autogenerated provides and requires
21 %global __provides_exclude_from ^%{_libdir}/0ad/
22 %global __requires_exclude ^(libAtlasUI.*\.so|libCollada.*\.so|libmozjs78.*\.so)
23
24 Name: 0ad
25 Epoch: 1
26 Version: 0.0.25b
27 Release: %mkrel 1
28 License: GPLv2+ and BSD and MIT and IBM and MPLv2.0
29 Group: Games/Strategy
30 Summary: Cross-Platform RTS Game of Ancient Warfare
31 Url: https://play0ad.com/
32 Source0: https://releases.wildfiregames.com/%{name}-%{version}-alpha-unix-build.tar.xz
33 Source1: https://releases.wildfiregames.com/%{name}-%{version}-alpha-unix-build.tar.xz.sha1sum
34 # adapted from binaries/system/readme.txt
35 # It is advisable to review this file on newer versions, to update the
36 # version field and check for extra options. Note that windows specific,
37 # and disabled options were not added to the manual page.
38 Source2: %{name}.6
39
40 BuildRequires: boost-devel
41 BuildRequires: cmake
42 BuildRequires: icu-devel
43 BuildRequires: miniupnpc-devel
44 BuildRequires: pkgconfig(gloox)
45 BuildRequires: pkgconfig(fmt)
46 BuildRequires: pkgconfig(libcurl)
47 BuildRequires: pkgconfig(libenet)
48 BuildRequires: pkgconfig(libjpeg)
49 BuildRequires: pkgconfig(libpng)
50 BuildRequires: pkgconfig(libsodium)
51 BuildRequires: pkgconfig(libxml-2.0)
52 BuildRequires: pkgconfig(openal)
53 BuildRequires: pkgconfig(sdl2)
54 BuildRequires: pkgconfig(valgrind)
55 BuildRequires: pkgconfig(vorbisfile)
56 BuildRequires: pkgconfig(xcursor)
57 BuildRequires: python2
58 BuildRequires: wxgtk-devel
59
60 %if %{without system_mozjs78}
61 # bundled mozjs
62 BuildRequires: pkgconfig(nspr)
63 BuildRequires: pkgconfig(libffi)
64 BuildRequires: pkgconfig(zlib)
65 BuildRequires: readline-devel
66 BuildRequires: rustc
67 BuildRequires: cargo
68 BuildRequires: zip
69 %else
70 BuildRequires: pkgconfig(mozjs-78)
71 %endif
72
73 # bundled mozjs: For build time tests only
74 BuildRequires: python-devel
75 BuildRequires: python-setuptools
76 BuildRequires: perl-devel
77
78 ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
79
80 %if %{without system_mozjs78}
81 Provides: bundled(mozjs) = 78
82 %endif
83
84 Requires: %{name}-data = %{epoch}:%{version}
85
86 # Only do fcollada debug build with enabling debug maintainer mode
87 # It also prevents assumption there that it is building in x86
88 Patch1: %{name}-debug.patch
89 # https://bugzilla.redhat.com/show_bug.cgi?id=1141464
90 Patch2: %{name}-valgrind.patch
91 # Based on similar patch for the system mozjs78
92 Patch3: Fixup-compatibility-of-mozbuild-with-Python-3.10.patch
93
94 # Mageia patches
95
96 # Fix support for i586 host (same patch as in mozjs78 system package).
97 Patch10: 0ad-0.0.25b-fix-mozjs78-i586-build.patch
98 # Fix GCC 12 compat (fixed in upstream SVN).
99 Patch11: 0ad-0.0.25b-fix-gcc12-M_PIf.patch
100 # Skip debug build for mozjs78, we only care about release.
101 Patch12: 0ad-0.0.25b-mozjs78-skip-debug.patch
102
103 %description
104 0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
105 real-time strategy (RTS) game of ancient warfare. In short, it is a
106 historically-based war/economy game that allows players to relive or rewrite
107 the history of Western civilizations, focusing on the years between 500 B.C.
108 and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D
109 graphics, detailed artwork, sound, and a flexible and powerful custom-built
110 game engine.
111
112 The game has been in development by Wildfire Games (WFG), a group of volunteer,
113 hobbyist game developers, since 2001.
114
115 %prep
116 %setup -q -n %{name}-%{version}-alpha
117
118 %patch1 -p0
119 %patch2 -p0
120 %patch3 -p0
121
122 %patch10 -p1
123 %patch11 -p1
124 %patch12 -p1
125
126 rm -fr libraries/source/nvtt
127 rm -fr libraries/source/valgrind
128 # (tv) prevent underlinking
129 sed -i 's!-Wl,--no-undefined!!' build/premake/premake5.lua
130
131 %build
132 %set_build_flags
133
134 %ifarch i586
135 # Make sure we use the proper arch for mozjs78's build.sh.
136 export CHOST=i586-mageia-linux-gnu
137 export CTARGET=i586-mageia-linux-gnu
138 %endif
139
140 build/workspaces/update-workspaces.sh \
141 --bindir=%{_bindir} \
142 --datadir=%{_gamesdatadir}/%{name} \
143 --libdir=%{_libdir}/%{name} \
144 %if %{with system_mozjs78}
145 --with-system-mozjs \
146 %endif
147 --without-nvtt
148
149 %make_build -C build/workspaces/gcc config=release verbose=1
150
151 %install
152 install -d %{buildroot}%{_bindir}
153 install -m755 binaries/system/pyrogenesis %{buildroot}%{_bindir}/pyrogenesis
154 install -m755 build/resources/0ad.sh %{buildroot}%{_bindir}/%{name}
155
156 install -d %{buildroot}%{_libdir}/%{name}
157 for name in AtlasUI Collada; do
158 install -p -m 755 binaries/system/lib${name}.so %{buildroot}%{_libdir}/%{name}/lib${name}.so
159 done
160
161 %if %{without system_mozjs78}
162 name=mozjs78-ps-release
163 install -p -m 755 binaries/system/lib${name}.so %{buildroot}%{_libdir}/%{name}/lib${name}.so
164 %endif
165
166 install -D -m644 build/resources/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
167 install -D -m644 build/resources/%{name}.appdata.xml %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
168 install -D -m644 build/resources/%{name}.png %{buildroot}%{_iconsdir}/hicolor/128x128/apps/%{name}.png
169
170 install -d %{buildroot}%{_gamesdatadir}/%{name}
171 cp -a binaries/data/* %{buildroot}%{_gamesdatadir}/%{name}
172
173 install -D -m644 %{_sourcedir}/%{name}.6 %{buildroot}%{_mandir}/man6/%{name}.6
174 ln -sf %{name}.6 %{buildroot}%{_mandir}/man6/pyrogenesis.6
175
176 %files
177 %doc README.txt LICENSE.txt
178 %{_bindir}/%{name}
179 %{_bindir}/pyrogenesis
180 %{_gamesdatadir}/%{name}/
181 %{_libdir}/%{name}/
182 %{_datadir}/appdata/%{name}.appdata.xml
183 %{_datadir}/applications/%{name}.desktop
184 %{_iconsdir}/hicolor/128x128/apps/%{name}.png
185 %{_mandir}/man6/*.6*

  ViewVC Help
Powered by ViewVC 1.1.30