summaryrefslogtreecommitdiff
blob: c82139d3203169186dbb3a98f246640728bc9ec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python3_{7,8} )
inherit desktop edos2unix toolchain-funcs gnome2-utils python-any-r1

DESCRIPTION="a free chess database application"
HOMEPAGE="http://scid.sourceforge.net/"
SRC_URI="mirror://sourceforge/scid/${P}.zip
	mirror://sourceforge/scid/spelling.zip
	mirror://sourceforge/scid/ratings.zip
	mirror://sourceforge/scid/photos.zip
	mirror://sourceforge/scid/scidlet40k.zip"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"

CDEPEND="dev-lang/tk:0
	dev-tcltk/tkimg
	>=sys-libs/zlib-1.1.3"
RDEPEND="${CDEPEND}
	!games-board/chessdb"
DEPEND="${CDEPEND}
	${PYTHON_DEPS}
	app-arch/unzip"

pkg_setup() {
	python-any-r1_pkg_setup
}

src_unpack() {
	default
	mv scid-src ${P} || die
}

PATCHES=(
	"${FILESDIR}"/${P}-gentoo.patch
	"${FILESDIR}"/${P}-pgnfix-python3.patch
)

src_prepare() {
	default
	edos2unix engines/togaII1.2.1a/src/Makefile
	sed -i \
		-e "s:@GENTOO_DATADIR@:/usr/share/${PN}:" \
		tcl/start.tcl || die
	sed -i \
		-e "/COMPILE.*testzlib/s:\$var(COMPILE):$(tc-getCXX):" \
		configure || die
	gzip ../ratings.ssp || die
	python_fix_shebang .
}

src_configure() {
	# configure is not an autotools script
	./configure \
		COMPILE="$(tc-getCXX)" \
		LINK="$(tc-getCXX) ${CXXFLAGS} ${LDFLAGS}" \
		CC="$(tc-getCC)" \
		OPTIMIZE="${CXXFLAGS}" \
		TCL_INCLUDE="" \
		BINDIR="/usr/bin" \
		SHAREDIR="/usr/share/${PN}" || die
}

src_compile() {
	emake all_scid
}

src_install() {
	emake DESTDIR="${D}" install_scid
	insinto /usr/share/${PN}
	doins -r sounds

	dodoc ChangeLog TODO help/*.html

	newicon -s scalable svg/scid_app.svg ${PN}.svg
	make_desktop_entry scid Scid

	doins ../spelling.ssp ../ratings.ssp.gz ../*.spf
	newins ../scidlet40k.sbk scidlet.sbk
}

pkg_preinst() {
	gnome2_icon_savelist
}

pkg_postinst() {
	gnome2_icon_cache_update
	elog "To enable speech, emerge dev-tcltk/snack"
	elog "To enable Xfcc support, emerge dev-tcltk/tdom"
}

pkg_postrm() {
	gnome2_icon_cache_update
}