Diff fortune-mod-1.99.1-r3 with a fortune-mod-3.12.0

/usr/portage/games-misc/fortune-mod/fortune-mod-3.12.0.ebuild 2023-10-09 14:52:31.108368391 +0300
1 1
# Copyright 1999-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=7
4
EAPI=8
5 5

  
6
inherit toolchain-funcs
6
inherit cmake
7 7

  
8 8
DESCRIPTION="The notorious fortune program"
9 9
HOMEPAGE="https://www.shlomifish.org/open-source/projects/fortune-mod/"
10
SRC_URI="http://www.redellipse.net/code/downloads/${P}.tar.gz"
10
SRC_URI="https://github.com/shlomif/fortune-mod/releases/download/${P}/${P}.tar.xz"
11 11

  
12 12
LICENSE="BSD"
13 13
SLOT="0"
14
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc64 ~riscv x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
14
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc64 ~riscv ~sparc x86"
15 15
IUSE="offensive"
16 16

  
17
DEPEND="app-text/recode:0="
17
DEPEND="app-text/recode:=
18
	!games-misc/fortune-mod-tao"
18 19
RDEPEND="${DEPEND}"
20
BDEPEND="app-text/App-XML-DocBook-Builder"
19 21

  
20
PATCHES=(
21
	"${FILESDIR}"/${P}-gentoo.patch
22
	"${FILESDIR}"/01_all_fortune_all-fix.patch
23
)
24

  
25
src_prepare() {
26
	default
27

  
28
	sed -i \
29
		-e 's:/games::' \
30
		-e 's:/fortunes:/fortune:' \
31
		-e '/^FORTDIR=/s:=.*:=$(prefix)/usr/bin:' \
32
		-e '/^all:/s:$: fortune/fortune.man:' \
33
		-e "/^OFFENSIVE=/s:=.*:=`use offensive && echo 1 || echo 0`:" \
34
		Makefile || die "sed Makefile failed"
35

  
36
	if ! use elibc_glibc ; then
37
		[[ ${CHOST} == *-darwin* ]] && local reglibs="-lc"
38
		has_version "app-text/recode[nls]" && reglibs="${reglibs} -lintl"
39
		sed -i \
40
			-e "/^REGEXLIBS=/s:=.*:= ${reglibs}:" \
41
			Makefile \
42
			|| die "sed REGEXLIBS failed"
43
	fi
44

  
45
	if [[ ${CHOST} == *-solaris* ]] ; then
46
		sed -i -e 's:u_int:uint:g' util/strfile.h || die "sed strfile.h failed"
47
	fi
48

  
49
	if [[ ${CHOST} == *-darwin* ]] ; then
50
		sed -i -e 's/-DBSD_REGEX/-DPOSIX_REGEX/' Makefile || die "sed Makefile failed"
51
	fi
52
}
22
# TODO: Get tests running?
23

  
24
src_configure() {
25
	local mycmakeargs=(
26
		-DNO_OFFENSIVE=$(usex !offensive)
27
		-DLOCALDIR="/usr/share/fortune"
28
		-DCOOKIEDIR="/usr/share/fortune"
29
	)
53 30

  
54
src_compile() {
55
	local myrex=
56
	emake prefix="${EPREFIX}" CC="$(tc-getCC)" ${myrex}
31
	cmake_src_configure
57 32
}
58 33

  
59 34
src_install() {
60
	emake prefix="${ED}" install
35
	cmake_src_install
36

  
37
	mkdir -p "${ED}"/usr/bin || die
38
	mv "${ED}"/usr/games/fortune "${ED}"/usr/bin/fortune || die
39
	rm -rf "${ED}"/usr/games || die
40

  
61 41
	dodoc ChangeLog INDEX Notes Offensive README TODO cookie-files
62 42
}
Thank you!