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

Contents of /cauldron/0ad/current/SPECS/0ad.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2030512 - (show annotations) (download)
Fri Jan 12 19:53:05 2024 UTC (3 months, 1 week ago) by wally
File size: 7031 byte(s)
- rebuild for boost 1.84.0
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.26
27 Release: %mkrel 5
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 at 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 # Patches to bundled mozjs for Python 3.11 and setuptools 60+ compatibility
41 Source3: 0001-Bug-1654457-Update-virtualenv-to-20.0.31.-r-mhentges.patch
42 Source4: 0001-Python-Build-Use-r-instead-of-rU-file-read-modes.patch
43
44 BuildRequires: boost-devel
45 BuildRequires: cmake
46 BuildRequires: icu-devel
47 BuildRequires: miniupnpc-devel
48 BuildRequires: pkgconfig(gloox)
49 BuildRequires: pkgconfig(fmt)
50 BuildRequires: pkgconfig(libcurl)
51 BuildRequires: pkgconfig(libenet)
52 BuildRequires: pkgconfig(libjpeg)
53 BuildRequires: pkgconfig(libpng)
54 BuildRequires: pkgconfig(libsodium)
55 BuildRequires: pkgconfig(libxml-2.0)
56 BuildRequires: pkgconfig(openal)
57 BuildRequires: pkgconfig(sdl2)
58 BuildRequires: pkgconfig(valgrind)
59 BuildRequires: pkgconfig(vorbisfile)
60 BuildRequires: pkgconfig(xcursor)
61 BuildRequires: wxgtk-devel
62
63 %if %{without system_mozjs78}
64 # bundled mozjs
65 BuildRequires: pkgconfig(nspr)
66 BuildRequires: pkgconfig(libffi)
67 BuildRequires: pkgconfig(zlib)
68 BuildRequires: readline-devel
69 BuildRequires: rustc
70 BuildRequires: cargo
71 BuildRequires: zip
72 # for patching bundled mozjs
73 BuildRequires: git-core
74 %else
75 BuildRequires: pkgconfig(mozjs-78)
76 %endif
77
78 # bundled mozjs: For build time tests only
79 BuildRequires: python3-devel
80 BuildRequires: python3-setuptools
81 BuildRequires: perl-devel
82
83 ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
84
85 %if %{without system_mozjs78}
86 Provides: bundled(mozjs) = 78
87 %endif
88
89 Requires: %{name}-data = %{epoch}:%{version}
90
91 # Fedora patches
92
93 # Only do fcollada debug build with enabling debug maintainer mode
94 # It also prevents assumption there that it is building in x86
95 Patch1: %{name}-debug.patch
96 Patch2: %{name}-check.patch
97 Patch3: %{name}-python311.patch
98
99 # Mageia patches
100
101 # Fix support for i586 host (same patch as in mozjs78 system package).
102 Patch10: 0ad-0.0.25b-fix-mozjs78-i586-build.patch
103 # Skip debug build for mozjs78, we only care about release.
104 Patch12: 0ad-0.0.25b-mozjs78-skip-debug.patch
105
106 %description
107 0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
108 real-time strategy (RTS) game of ancient warfare. In short, it is a
109 historically-based war/economy game that allows players to relive or rewrite
110 the history of Western civilizations, focusing on the years between 500 B.C.
111 and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D
112 graphics, detailed artwork, sound, and a flexible and powerful custom-built
113 game engine.
114
115 The game has been in development by Wildfire Games (WFG), a group of volunteer,
116 hobbyist game developers, since 2001.
117
118 %prep
119 %setup -q -n %{name}-%{version}-alpha
120
121 %patch1 -p0
122 %patch2 -p0
123
124 # Patch bundled mozjs for Python 3.11 and setuptools 60+ compatibility
125 %patch3 -p1
126 sed -e 's|__SOURCE3__|%{SOURCE3}|' \
127 -e 's|__SOURCE4__|%{SOURCE4}|' \
128 -i libraries/source/spidermonkey/patch.sh
129
130 %patch10 -p1
131 %patch12 -p1
132
133 rm -fr libraries/source/nvtt
134 rm -fr libraries/source/valgrind
135 # (tv) prevent underlinking
136 sed -i 's!-Wl,--no-undefined!!' build/premake/premake5.lua
137
138 %build
139 %set_build_flags
140
141 %ifarch i586
142 # Make sure we use the proper arch for mozjs78's build.sh.
143 export CHOST=i586-mageia-linux-gnu
144 export CTARGET=i586-mageia-linux-gnu
145 %endif
146
147 build/workspaces/update-workspaces.sh \
148 --bindir=%{_bindir} \
149 --datadir=%{_gamesdatadir}/%{name} \
150 --libdir=%{_libdir}/%{name} \
151 %if %{with system_mozjs78}
152 --with-system-mozjs \
153 %endif
154 --without-nvtt
155
156 %make_build -C build/workspaces/gcc config=release verbose=1
157
158 %install
159 install -d %{buildroot}%{_bindir}
160 install -m755 binaries/system/pyrogenesis %{buildroot}%{_bindir}/pyrogenesis
161 install -m755 build/resources/0ad.sh %{buildroot}%{_bindir}/%{name}
162
163 install -d %{buildroot}%{_libdir}/%{name}
164 for name in AtlasUI Collada; do
165 install -p -m 755 binaries/system/lib${name}.so %{buildroot}%{_libdir}/%{name}/lib${name}.so
166 done
167
168 %if %{without system_mozjs78}
169 name=mozjs78-ps-release
170 install -p -m 755 binaries/system/lib${name}.so %{buildroot}%{_libdir}/%{name}/lib${name}.so
171 %endif
172
173 install -D -m644 build/resources/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
174 install -D -m644 build/resources/%{name}.appdata.xml %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
175 install -D -m644 build/resources/%{name}.png %{buildroot}%{_iconsdir}/hicolor/128x128/apps/%{name}.png
176
177 install -d %{buildroot}%{_gamesdatadir}/%{name}
178 cp -a binaries/data/* %{buildroot}%{_gamesdatadir}/%{name}
179
180 install -D -m644 %{_sourcedir}/%{name}.6 %{buildroot}%{_mandir}/man6/%{name}.6
181 ln -sf %{name}.6 %{buildroot}%{_mandir}/man6/pyrogenesis.6
182
183 %files
184 %doc README.txt LICENSE.txt
185 %{_bindir}/%{name}
186 %{_bindir}/pyrogenesis
187 %{_gamesdatadir}/%{name}/
188 %{_libdir}/%{name}/
189 %{_datadir}/appdata/%{name}.appdata.xml
190 %{_datadir}/applications/%{name}.desktop
191 %{_iconsdir}/hicolor/128x128/apps/%{name}.png
192 %{_mandir}/man6/*.6*

  ViewVC Help
Powered by ViewVC 1.1.30