Log: Update to build21

switch to python3
patched install and fixed build against gcc-10.
spec clean
This commit is contained in:
abfonly 2021-01-06 19:35:27 +01:00
parent b8ab62e199
commit 2fb50fdd01
3 changed files with 367 additions and 17 deletions

View file

@ -1,3 +1,4 @@
sources:
widelands-build18-src.tar.bz2: 369d765671bcbf1d7156c1ed0f914ceec0e814bb
widelands-build20.tar.bz2: a2fdedf81c08fd08809b8556c955a6a7f32c1eed
widelands-build21-source.tar.gz: 6e759c187db71afb6c4ea5e0d4d896a032f09696

342
widelamds_bld21-rosa.patch Normal file
View file

@ -0,0 +1,342 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 018d9ea..5fedee1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -300,7 +300,6 @@ endif()
wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=format-security")
wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=return-type")
wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=shadow")
-wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=uninitialized")
IF (WIN32)
add_definitions(-DMINGW_HAS_SECURE_API -DWIN32_LEAN_AND_MEAN -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO)
diff --git a/cmake/WlFunctions.cmake b/cmake/WlFunctions.cmake
index 21a59bc..89244d7 100644
--- a/cmake/WlFunctions.cmake
+++ b/cmake/WlFunctions.cmake
@@ -289,5 +289,5 @@ function(wl_binary NAME)
#Quoting the CMake documentation on DESTINATION:
#"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
- install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
+ install(TARGETS ${NAME} DESTINATION games COMPONENT ExecutableFiles)
endfunction()
diff --git a/cmake/codecheck/CodeCheck.py b/cmake/codecheck/CodeCheck.py
index 672ae80..3711184 100755
--- a/cmake/codecheck/CodeCheck.py
+++ b/cmake/codecheck/CodeCheck.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
diff --git a/cmake/codecheck/rules/assert0.py b/cmake/codecheck/rules/assert0.py
index 5afabcc..f1a1c1a 100644
--- a/cmake/codecheck/rules/assert0.py
+++ b/cmake/codecheck/rules/assert0.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python -tt
+#!/usr/bin/python3 -tt
# encoding: utf-8
#
diff --git a/cmake/codecheck/rules/garbage_after_include.py b/cmake/codecheck/rules/garbage_after_include.py
index cab17bc..7f2b56b 100644
--- a/cmake/codecheck/rules/garbage_after_include.py
+++ b/cmake/codecheck/rules/garbage_after_include.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python -tt
+#!/usr/bin/python3 -tt
# encoding: utf-8
#
diff --git a/cmake/codecheck/rules/increment_decrement.py b/cmake/codecheck/rules/increment_decrement.py
index ae4f222..a0fe4d0 100644
--- a/cmake/codecheck/rules/increment_decrement.py
+++ b/cmake/codecheck/rules/increment_decrement.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python -tt
+#!/usr/bin/python3 -tt
# encoding: utf-8
#
diff --git a/cmake/codecheck/run_tests.py b/cmake/codecheck/run_tests.py
index 6c47456..217da2a 100755
--- a/cmake/codecheck/run_tests.py
+++ b/cmake/codecheck/run_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
#
diff --git a/doc/sphinx/extract_rst.py b/doc/sphinx/extract_rst.py
index ee3094d..2250f49 100755
--- a/doc/sphinx/extract_rst.py
+++ b/doc/sphinx/extract_rst.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
from glob import glob
diff --git a/regression_test.py b/regression_test.py
index d7ae42b..9d6099e 100755
--- a/regression_test.py
+++ b/regression_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
from glob import glob
diff --git a/utils/build_deps.py b/utils/build_deps.py
index acf9aa2..c375600 100755
--- a/utils/build_deps.py
+++ b/utils/build_deps.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
"""Simple script to check that the build dependencies in the CMakeLists.txt
diff --git a/utils/buildcat.py b/utils/buildcat.py
index 2568a5f..c08004b 100755
--- a/utils/buildcat.py
+++ b/utils/buildcat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
##############################################################################
diff --git a/utils/crop_animation.py b/utils/crop_animation.py
index 2265b8e..eee20a0 100755
--- a/utils/crop_animation.py
+++ b/utils/crop_animation.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (C) 2010 by the Widelands Development Team
diff --git a/utils/detect_revision.py b/utils/detect_revision.py
index 0357897..958f9dd 100755
--- a/utils/detect_revision.py
+++ b/utils/detect_revision.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Tries to find out the repository revision of the current working directory
diff --git a/utils/file_utils.py b/utils/file_utils.py
index b2047a1..183f715 100755
--- a/utils/file_utils.py
+++ b/utils/file_utils.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
diff --git a/utils/find_unused_includes.py b/utils/find_unused_includes.py
index 75e7baf..f71d182 100755
--- a/utils/find_unused_includes.py
+++ b/utils/find_unused_includes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
# encoding: utf-8
"""Script to find unused includes.
diff --git a/utils/fix_formatting.py b/utils/fix_formatting.py
index 02f6059..c9b1483 100755
--- a/utils/fix_formatting.py
+++ b/utils/fix_formatting.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
diff --git a/utils/generate_glossary.py b/utils/generate_glossary.py
index 753b7fc..ee40580 100755
--- a/utils/generate_glossary.py
+++ b/utils/generate_glossary.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
diff --git a/utils/glossary_checks.py b/utils/glossary_checks.py
index ddbf2cb..b2228e0 100755
--- a/utils/glossary_checks.py
+++ b/utils/glossary_checks.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
"""Runs a glossary check on all po files and writes the check results to
diff --git a/utils/macos/fix_dependencies.py b/utils/macos/fix_dependencies.py
index f8a47c1..122fb85 100755
--- a/utils/macos/fix_dependencies.py
+++ b/utils/macos/fix_dependencies.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""This tool was written out of frustration with
diff --git a/utils/make_spritemap.py b/utils/make_spritemap.py
index be919b4..ee4f781 100755
--- a/utils/make_spritemap.py
+++ b/utils/make_spritemap.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
import argparse
diff --git a/utils/optimize_pngs.py b/utils/optimize_pngs.py
index 0717493..a5f7d2f 100755
--- a/utils/optimize_pngs.py
+++ b/utils/optimize_pngs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
from glob import glob
diff --git a/utils/pywi/tests.py b/utils/pywi/tests.py
index 1e81535..12159a3 100755
--- a/utils/pywi/tests.py
+++ b/utils/pywi/tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import config
import animation
"""Tests for various pywi modules."""
diff --git a/utils/rename_animation.py b/utils/rename_animation.py
index b25d437..06552c2 100755
--- a/utils/rename_animation.py
+++ b/utils/rename_animation.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
"""Tool to rename all files for a widelands animation in bulk."""
diff --git a/utils/run-clang-tidy.py b/utils/run-clang-tidy.py
index 5bbc444..6b9b01a 100755
--- a/utils/run-clang-tidy.py
+++ b/utils/run-clang-tidy.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
#
#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
#
diff --git a/utils/syncstream/syncexcerpt-to-text.py b/utils/syncstream/syncexcerpt-to-text.py
index e2c05e3..adec2be 100755
--- a/utils/syncstream/syncexcerpt-to-text.py
+++ b/utils/syncstream/syncexcerpt-to-text.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
import struct
import sys
diff --git a/utils/test/test_lua-xgettext.py b/utils/test/test_lua-xgettext.py
index 24798c6..3b592f7 100644
--- a/utils/test/test_lua-xgettext.py
+++ b/utils/test/test_lua-xgettext.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
from lua_xgettext import gettext, Lua_GetText, head
diff --git a/utils/test/test_make_spritemap.py b/utils/test/test_make_spritemap.py
index 28e9042..a494a1f 100644
--- a/utils/test/test_make_spritemap.py
+++ b/utils/test/test_make_spritemap.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import make_spritemap
import numpy as np
diff --git a/utils/update_appdata.py b/utils/update_appdata.py
index fdbcfcc..bda0544 100755
--- a/utils/update_appdata.py
+++ b/utils/update_appdata.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
from subprocess import call, Popen, PIPE
diff --git a/utils/update_authors.py b/utils/update_authors.py
index f09656e..56fb318 100755
--- a/utils/update_authors.py
+++ b/utils/update_authors.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
import codecs
diff --git a/utils/update_copyright.py b/utils/update_copyright.py
index 760949f..ba1ae8c 100755
--- a/utils/update_copyright.py
+++ b/utils/update_copyright.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
import os.path
diff --git a/utils/validate_json.py b/utils/validate_json.py
index cbe02a6..b3726c2 100755
--- a/utils/validate_json.py
+++ b/utils/validate_json.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# encoding: utf-8
import codecs
diff --git a/xdg/CMakeLists.txt b/xdg/CMakeLists.txt
index 889ef2d..f54e009 100644
--- a/xdg/CMakeLists.txt
+++ b/xdg/CMakeLists.txt
@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Widelands")
list(APPEND icon_sizes "16" "32" "48" "64" "128")
foreach (icon_size ${icon_sizes})
#install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
- install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
endforeach (icon_size ${icon_sizes})
#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6 DESTINATION ../share/man/man6)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6 DESTINATION share/man/man6)
#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop DESTINATION ../share/applications)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop DESTINATION share/applications)
#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
if (GTK_UPDATE_ICON_CACHE)
#install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
- install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
+ install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
else (GTK_UPDATE_ICON_CACHE)
message(WARNING "gtk-update-icon-cache not found!")
endif (GTK_UPDATE_ICON_CACHE)

View file

@ -1,13 +1,17 @@
%define bld 21
Summary: Settlers II clone
Name: widelands
Version: 20
Version: %{bld}
Release: 1
License: GPLv2+
Group: Games/Strategy
Url: http://www.widelands.org/
Source0: https://launchpad.net/widelands/build20/build20/+download/%{name}-build%{version}.tar.bz2
Source0: https://launchpad.net/widelands/build20/build21/+download/%{name}-build%{bld}-source.tar.gz
Source1: %{name}.desktop
Source100: widelands.rpmlintrc
# gcc flags and python3.Sflo
Patch0: widelamds_bld21-rosa.patch
BuildRequires: cmake
BuildRequires: ctags
BuildRequires: doxygen
@ -30,7 +34,7 @@ BuildRequires: pkgconfig(SDL2_net)
BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: python
BuildRequires: python3
Requires: %{name}-basic-data = %{EVRD}
Requires: %{name}-maps = %{EVRD}
@ -47,9 +51,9 @@ idea what Widelands is about.
%doc ChangeLog COPYING CREDITS
%{_gamesbindir}/%{name}
%{_gamesbindir}/wl*
%{_appdatadir}/org.widelands.%{name}.appdata.xml
%{_appdatadir}/org.widelands.Widelands.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_iconsdir}/hicolor/*/apps/%{name}.png
%{_iconsdir}/hicolor/*/apps/*.png
%{_mandir}/man6/%{name}.*
#------------------------------------------------
@ -129,13 +133,18 @@ These are not needed, but may improve fun while playing.
%prep
%setup -qn %{name}-build%{version}
%setup -qn %{name}-build%{bld}
%patch0 -p1
%build
%build
%cmake -DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DWL_INSTALL_BASEDIR=%{_prefix} \
-DWL_INSTALL_DATADIR=%{_gamesdatadir}/%{name}
-DWL_INSTALL_PREFIX=%{_prefix} \
-DWL_INSTALL_BINDIR=%{_gamesbindir} \
-DWL_INSTALL_DATADIR=%{_gamesdatadir}/%{name} \
-DWL_INSTALL_LOCALEDIR=%{_datadir}/%{name}/locale \
-DBoost_USE_STATIC_LIBS=OFF
%make
%install
@ -147,18 +156,16 @@ for size in 16 32 48 64 128; do
done
# appdata
install -D -m0644 debian/widelands.appdata.xml \
%{buildroot}%{_appdatadir}/org.widelands.%{name}.appdata.xml
install -D -m0644 xdg/org.widelands.Widelands.appdata.xml \
%{buildroot}%{_appdatadir}/org.widelands.Widelands.appdata.xml
# man
install -D -m0644 debian/widelands.6 \
install -D -m0644 xdg/widelands.6 \
%{buildroot}%{_mandir}/man6/widelands.6
# menu entry
install -m644 %{SOURCE1} -D %{buildroot}/%{_datadir}/applications/%{name}.desktop
# executables
mkdir -p %{buildroot}%{_gamesbindir}
mv %{buildroot}/usr/{widelands,wl_map_object_info,wl_map_info} %{buildroot}%{_gamesbindir}
# use our desktop
rm -fr %{buildroot}/%{_datadir}/applications/org.widelands.Widelands.desktop
# docs
mv %{buildroot}/usr/{VERSION,ChangeLog,CREDITS,COPYING} %{buildroot}%{_gamesdatadir}/%{name}