mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 03:10:15 -04:00
games-strategy/hedgewars: new package, add 1.1.0_pre20260124
Bug: https://bugs.gentoo.org/949881 Link: https://github.com/gentoo/gentoo/pull/45675 Signed-off-by: Alexander Tsoy <alexander@tsoy.me>
This commit is contained in:
2
games-strategy/hedgewars/Manifest
Normal file
2
games-strategy/hedgewars/Manifest
Normal file
@@ -0,0 +1,2 @@
|
||||
DIST hedgewars-1.1.0_pre20260124-crates.tar.xz 2079072 BLAKE2B ddb93dbfe6521043daf34a1ff1cda9a9657712f94cacf398cebbbec64741d04419e42995848c49b25c96da0e703c1cd004ca1d81754d103b3d88ddd45fc1276f SHA512 5ca06f51573880a01f174c8e3008cc9011515c34ea559bd4e12f1ee0a5b0895b606548d203115a45a0d7f2401e4f1cd490319058915bbddd00d8add66ee95057
|
||||
DIST hedgewars-1.1.0_pre20260124.tar.gz 225206170 BLAKE2B 993cfd2e95a710d60945292e72be4e39bf603abdad34e34991e2e975db0c0ccf8265dd10d1ec8def204127df48f58416547f0444329f53aac0a12c9554825029 SHA512 eac4c8fc08e188befb4aaa68b5144602c320fe4f7db4ea191e3c34e8cfba8d7ea10c90de115a261890a5cee3f86b43d0a46b2419299b9cc6df9dfb96fdc69d85
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -202,7 +202,7 @@
|
||||
#lua discovery
|
||||
if(LUA_SYSTEM)
|
||||
if(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
|
||||
- find_package(Lua)
|
||||
+ find_package(Lua ${LUA_VERSION} EXACT REQUIRED)
|
||||
endif()
|
||||
|
||||
if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
|
||||
@@ -0,0 +1,36 @@
|
||||
Do not fallback to pas2c. FPC alignment bug has been fixed:
|
||||
https://gitlab.com/freepascal.org/fpc/source/-/commit/fb918994574fec69e44b9868e0147510473b5aae
|
||||
|
||||
--- a/CMakeLists.txt 2022-09-13 01:33:59.000000000 +0300
|
||||
+++ b/CMakeLists.txt 2025-04-28 23:43:49.771904474 +0300
|
||||
@@ -79,10 +79,6 @@ if(BUILD_ENGINE_JS)
|
||||
set(target_library_install_dir "lib" CACHE PATH "install dest for libs")
|
||||
endif()
|
||||
|
||||
-if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4" AND UNIX AND NOT APPLE)
|
||||
- set(BUILD_ENGINE_C ON CACHE STRING "PAS2C force-enabled due to a freepascal 32 bit alignment bug" FORCE)
|
||||
-endif()
|
||||
-
|
||||
#system paths for finding required fonts (see share/hedgewars/Data/fonts)
|
||||
#subdirectories will NOT be searched.
|
||||
#all fonts that can't be found will be bundled with hedgewars
|
||||
@@ -180,19 +176,6 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
-#build engine without freepascal
|
||||
-if(BUILD_ENGINE_C AND NOT BUILD_ENGINE_JS)
|
||||
- find_package(Clang REQUIRED)
|
||||
-
|
||||
- if(${CLANG_VERSION} VERSION_LESS "3.0")
|
||||
- message(FATAL_ERROR "LLVM/Clang compiler required version is 3.0 but version ${CLANG_VERSION} was found!")
|
||||
- endif()
|
||||
-
|
||||
- set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})
|
||||
- set(CMAKE_CXX_COMPILER ${CLANG_EXECUTABLE})
|
||||
-endif()
|
||||
-
|
||||
-
|
||||
#server
|
||||
if(NOT NOSERVER)
|
||||
add_subdirectory(gameServer)
|
||||
@@ -0,0 +1,23 @@
|
||||
Qt deploy script installs all dependant dynamic libraries from the system
|
||||
and strips all binaries. Disable it.
|
||||
|
||||
--- a/frontend-qt6/CMakeLists.txt
|
||||
+++ b/frontend-qt6/CMakeLists.txt
|
||||
@@ -348,10 +348,10 @@ install(TARGETS hedgewars
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
-qt_generate_deploy_app_script(
|
||||
- TARGET hedgewars
|
||||
- OUTPUT_SCRIPT deploy_script
|
||||
- NO_UNSUPPORTED_PLATFORM_ERROR
|
||||
- NO_TRANSLATIONS
|
||||
-)
|
||||
-install(SCRIPT ${deploy_script})
|
||||
+#qt_generate_deploy_app_script(
|
||||
+# TARGET hedgewars
|
||||
+# OUTPUT_SCRIPT deploy_script
|
||||
+# NO_UNSUPPORTED_PLATFORM_ERROR
|
||||
+# NO_TRANSLATIONS
|
||||
+#)
|
||||
+#install(SCRIPT ${deploy_script})
|
||||
125
games-strategy/hedgewars/hedgewars-1.1.0_pre20260124.ebuild
Normal file
125
games-strategy/hedgewars/hedgewars-1.1.0_pre20260124.ebuild
Normal file
@@ -0,0 +1,125 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
CMAKE_MAKEFILE_GENERATOR=emake
|
||||
LUA_COMPAT=( lua5-1 )
|
||||
RUST_MIN_VER="1.87.0"
|
||||
|
||||
inherit cargo cmake lua-single xdg-utils
|
||||
|
||||
DESCRIPTION="A turn-based strategy, artillery, action and comedy game"
|
||||
HOMEPAGE="https://www.hedgewars.org/"
|
||||
if [[ ${PV} == *_p* ]]; then
|
||||
MY_COMMIT="1bbc396d3123702ee9445c5c6bdafdfa6d43d327"
|
||||
SRC_URI="https://github.com/${PN}/hw/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||
S="${WORKDIR}"/hw-${MY_COMMIT}
|
||||
else
|
||||
MY_P=${PN}-src-${PV}
|
||||
SRC_URI="https://www.hedgewars.org/download/releases/${MY_P}.tar.bz2"
|
||||
S="${WORKDIR}"/${MY_P}
|
||||
fi
|
||||
SRC_URI+=" https://github.com/puleglot/hw/releases/download/${PV}/${P}-crates.tar.xz"
|
||||
|
||||
LICENSE="GPL-2 Apache-2.0 FDL-1.3"
|
||||
# Dependent crate licenses
|
||||
LICENSE+="
|
||||
MIT Unicode-3.0
|
||||
|| ( Apache-2.0 Boost-1.0 )
|
||||
"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE="ffmpeg"
|
||||
|
||||
REQUIRED_USE="${LUA_REQUIRED_USE}"
|
||||
|
||||
QA_FLAGS_IGNORED="/usr/bin/hwengine" # pascal sucks
|
||||
QA_PRESTRIPPED="/usr/bin/hwengine" # pascal sucks
|
||||
|
||||
DEPEND="${LUA_DEPS}
|
||||
>=dev-games/physfs-3.0.1
|
||||
dev-qt/qtbase:6[network,widgets]
|
||||
media-libs/libpng:0=
|
||||
media-libs/libsdl2:=[opengl]
|
||||
media-libs/sdl2-image:=[png]
|
||||
media-libs/sdl2-mixer:=[vorbis]
|
||||
media-libs/sdl2-net:=
|
||||
media-libs/sdl2-ttf:=
|
||||
virtual/zlib:=
|
||||
ffmpeg? ( media-video/ffmpeg:= )
|
||||
"
|
||||
RDEPEND="${DEPEND}
|
||||
app-arch/xz-utils
|
||||
>=media-fonts/dejavu-2.28
|
||||
media-fonts/wqy-zenhei
|
||||
"
|
||||
BDEPEND="
|
||||
dev-qt/qttools:6
|
||||
dev-lang/fpc
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-1.0.0-cmake_lua_version.patch"
|
||||
"${FILESDIR}/${PN}-1.0.2-no-pas2c.patch"
|
||||
"${FILESDIR}/${PN}-1.1.0-no-qt-deploy.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
if [[ ${PV} == *_p* ]]; then
|
||||
cat <<-EOF > share/version_info.txt || die
|
||||
Hedgewars versioning information, do not modify
|
||||
rev GIT
|
||||
hash ${MY_COMMIT}
|
||||
EOF
|
||||
fi
|
||||
|
||||
cmake_src_prepare
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DBUILD_ENGINE_C=OFF
|
||||
-DBUILD_OFFLINE=ON
|
||||
-DMINIMAL_FLAGS=ON
|
||||
-DNOSERVER=ON
|
||||
-DDATA_INSTALL_DIR="${EPREFIX}/usr/share/${PN}"
|
||||
-Dtarget_binary_install_dir="${EPREFIX}/usr/bin"
|
||||
-Dtarget_library_install_dir="${EPREFIX}/usr/$(get_libdir)"
|
||||
-DCMAKE_VERBOSE_MAKEFILE=TRUE
|
||||
# Need to tell the build system where the fonts are located
|
||||
# as it uses PhysFS' symbolic link protection mode which
|
||||
# prevents us from symlinking the fonts into the right directory
|
||||
# https://hg.hedgewars.org/hedgewars/rev/76ad55807c24
|
||||
# https://icculus.org/physfs/docs/html/physfs_8h.html#aad451d9b3f46f627a1be8caee2eef9b7
|
||||
-DFONTS_DIRS="${EPREFIX}/usr/share/fonts/wqy-zenhei;${EPREFIX}/usr/share/fonts/dejavu"
|
||||
# upstream sets RPATH that leads to weird breakage
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1200193
|
||||
-DCMAKE_SKIP_RPATH=ON
|
||||
-DLUA_VERSION=$(lua_get_version)
|
||||
-DNOVIDEOREC=$(usex ffmpeg OFF ON)
|
||||
)
|
||||
|
||||
CMAKE_BUILD_TYPE=$(usex debug Debug)
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
doman man/${PN}.6
|
||||
|
||||
rm -f "${ED}"/usr/bin/hwengine_future_install_target.cmake || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
xdg_desktop_database_update
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
xdg_desktop_database_update
|
||||
}
|
||||
14
games-strategy/hedgewars/metadata.xml
Normal file
14
games-strategy/hedgewars/metadata.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>alexander@tsoy.me</email>
|
||||
<name>Alexander Tsoy</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="ffmpeg">Enable video recording feature</flag>
|
||||
</use>
|
||||
<upstream>
|
||||
<remote-id type="github">hedgewars/hw</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
Reference in New Issue
Block a user