commit: 9ac2cea9de72c665652eac0003347a37d4262256 Author: Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org> AuthorDate: Sun Feb 9 01:19:53 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Feb 9 01:38:48 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ac2cea9
games-board/xscrabble: fix build with gcc 15 Closes: https://bugs.gentoo.org/884779 Closes: https://bugs.gentoo.org/870793 Closes: https://bugs.gentoo.org/944266 Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org> Signed-off-by: Sam James <sam <AT> gentoo.org> games-board/xscrabble/Manifest | 1 + .../xscrabble/files/xscrabble-2.10-ranlib.patch | 13 +++ games-board/xscrabble/xscrabble-2.10-r5.ebuild | 111 +++++++++++++++++++++ 3 files changed, 125 insertions(+) diff --git a/games-board/xscrabble/Manifest b/games-board/xscrabble/Manifest index 2bdb5459065c..21ab5eec2890 100644 --- a/games-board/xscrabble/Manifest +++ b/games-board/xscrabble/Manifest @@ -1,3 +1,4 @@ +DIST xscrabble-2.10-gcc15.patch 32518 BLAKE2B 6f548b1195ceb58bee0317d59ed3a72abec858d42ca59828c2dc64d10cc9504c2b00a8df093c4789ed35f40b5f7c413ed7bf781483d9de76a3a38b7c9b145f4c SHA512 d20a04e6ba036b9f69af315ef3c0ae160967a2fc66c71b6921967097de7dbffe77f8da1014ad37d81a3a58bdb8805f428db659c572e751fd8802373df0a60870 DIST xscrabble-2.10.tgz 83575 BLAKE2B 0a7ac0713e8b48eaf770d11d8ddf5fc383f870437dbc12b6e90df3fb4c28559e28523f46461e306dde59a68cebf58e854959e58ec688201223eec9825e3c5e7a SHA512 38137b3dfd3156c3748719136a30fbc7f04910538bdbdec3e9d50e3efe326ab7119a45171e0fa2cd95cd81f0642070e2e011c165284766eb7a14bd7d2aa660db DIST xscrabble_en.tgz 393527 BLAKE2B 3f5b9d8030ba2711e64b2cc015f8662bdcfc2d3155d34b17be243a57e8c7dc3e4ad5fc6414c745654a8ea5771a9914d38bf5ce95b42e9b7daa70907bd9105b06 SHA512 05e4bca6ec2a9b7698f5c266bf5cede574cbef87883d7cac6dc35084fa2976dcd23f3a2215b674b9f36d7c170e6af021c3ec0884f06c9803cd67ec300651ac41 DIST xscrabble_fr.tgz 810737 BLAKE2B 26f5601f5d09232a5145c66d1d359c7a6b389a83f10c1ebcddc7579160d417e0b0b9e5bccf7322128451f3941cdeb2177b26f4ddf9a8224ffd551d95f4a83d72 SHA512 f5425fa8bffec57e6eff16a3d33ae4569fc00343e0ed5e4f4e1e189ed02a5be7416c1549b1978042e030efbfb3a484abcac9479e7fe43de929b11d8ccf8ea3e1 diff --git a/games-board/xscrabble/files/xscrabble-2.10-ranlib.patch b/games-board/xscrabble/files/xscrabble-2.10-ranlib.patch new file mode 100644 index 000000000000..95bdc85262db --- /dev/null +++ b/games-board/xscrabble/files/xscrabble-2.10-ranlib.patch @@ -0,0 +1,13 @@ +Fail build if compilation failed, use ranlib + +--- a/build ++++ b/build +@@ -36,7 +36,7 @@ if test "$1" = "bin" ; then + #define RULES_FILE \"$LIBDIR/en/scrabble_rules\" + " > src/config.h + xmkmf -a +- make CC="${CC}" CCOPTIONS="${CFLAGS}" LOCAL_LDFLAGS="${LDFLAGS}" ++ make CC="${CC}" AR="${AR} cq" RANLIB="${RANLIB}" CCOPTIONS="${CFLAGS}" LOCAL_LDFLAGS="${LDFLAGS}" || exit 1 + echo " + Now, type './build install' to install programs in $BINDIR + " diff --git a/games-board/xscrabble/xscrabble-2.10-r5.ebuild b/games-board/xscrabble/xscrabble-2.10-r5.ebuild new file mode 100644 index 000000000000..d5451b99b18c --- /dev/null +++ b/games-board/xscrabble/xscrabble-2.10-r5.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="An X11 clone of the well-known Scrabble" +HOMEPAGE="http://freshmeat.net/projects/xscrabble/?topic_id=80" +SRC_URI="ftp://ftp.ac-grenoble.fr/ge/educational_games/${P}.tgz + l10n_fr? ( ftp://ftp.ac-grenoble.fr/ge/educational_games/xscrabble_fr.tgz ) + ftp://ftp.ac-grenoble.fr/ge/educational_games/xscrabble_en.tgz + https://files.asokolov.org/gentoo/${P}-gcc15.patch +" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="l10n_fr" + +DEPEND=" + x11-libs/libX11 + x11-libs/libXaw + x11-libs/libXpm + x11-libs/libXt +" +RDEPEND=" + ${DEPEND} + acct-group/gamestat + media-fonts/font-misc-misc + !<x11-terms/kterm-6.2.0-r7 +" +BDEPEND=" + sys-devel/gcc + x11-misc/gccmakedep + >=x11-misc/imake-1.0.8-r1 +" + +PATCHES=( + "${FILESDIR}"/${P}-path-fixes.patch + "${FILESDIR}"/${P}-build.patch + "${FILESDIR}"/${P}-implicit-declaration.patch + "${DISTDIR}"/${P}-gcc15.patch + "${FILESDIR}"/${P}-ranlib.patch +) + +src_unpack() { + unpack ${P}.tgz + cp "${DISTDIR}"/xscrabble_en.tgz . || die + + if use l10n_fr ; then + cp "${DISTDIR}"/xscrabble_fr.tgz . || die + fi +} + +src_prepare() { + default + + # Don't strip binaries + sed -i '/install/s/-s //' build || die + + sed -i "s|REAL_APPDEFAULTS=|REAL_APPDEFAULTS=${EPREFIX}|" build || die +} + +src_configure() { + # bug #858623 + filter-lto + + tc-export AR CC LD RANLIB + export IMAKECPP=${IMAKECPP:-${CHOST}-gcc -E} +} + +src_compile() { + ./build bin || die "build failed" +} + +src_install() { + export DESTDIR="${ED}" LIBDIR="$(get_libdir)" + + ./build install || die "install failed" + + if use l10n_fr ; then + ./build lang fr || die "fr failed" + fi + + ./build lang en || die "en failed" + + local f + for f in "${ED}/usr/$(get_libdir)"/X11/app-defaults/* ; do + [[ -L ${f} ]] && continue + sed -i \ + -e "s:/usr/games/lib/scrabble/:${EPREFIX}/usr/share/${PN}/:" \ + -e "s:fr/eng:fr/en:" \ + ${f} || die "sed ${f} failed" + done + + dodoc CHANGES README + + local paths=( /usr/share/${PN}/en/scrabble_scores ) + if use l10n_fr ; then + paths+=( /usr/share/${PN}/fr/scrabble_scores ) + fi + + local path + for path in ${paths[@]} ; do + fowners root:gamestat ${path} + fperms 660 ${path} + done + + fperms g+s /usr/bin/${PN} +}
