1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils gnome2-utils toolchain-funcs autotools
8 if [[ ${PV} == "99999999" ]] ; then
10 EGIT_REPO_URI="https://git.tartarus.org/simon/puzzles.git"
11 GENTOO_ICONS="20160315"
12 SRC_URI="https://dev.gentoo.org/~np-hardass/distfiles/${PN}/${PN}-icons-${GENTOO_ICONS}.tar.xz"
16 SRC_URI="https://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles-${PV}.${MAGIC}.tar.gz"
17 S=${WORKDIR}/puzzles-${PV}.${MAGIC}
18 KEYWORDS="~amd64 ~x86"
21 DESCRIPTION="Simon Tatham's Portable Puzzle Collection"
22 HOMEPAGE="https://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
29 !gtk3? ( x11-libs/gtk+:2 )
30 gtk3? ( x11-libs/gtk+:3 )"
32 RDEPEND="${COMMON_DEPEND}
33 x11-misc/xdg-utils" # Used by builtin help patch
35 DEPEND="${COMMON_DEPEND}
38 doc? ( >=app-doc/halibut-1.2 )"
40 PATCHES=( "${FILESDIR}/${PN}-20161207-builtin-help.patch" )
44 if [[ ${PV} == "99999999" ]]; then
56 -e 's/-O2 -Wall .* -g/-Wall/' \
57 -e "s/libstr =/libstr = '\$(LDFLAGS) ' ./" \
62 # Import icons from latest Gentoo tarball for live
63 if [[ ${PV} == "99999999" ]]; then
64 cp -R ../${PN}-icons/icons . || die
70 --program-prefix="${PN}_" \
71 --with-gtk=$(usex gtk3 3 2)
75 emake CC="$(tc-getCC)"
77 halibut --text --html --info --pdf --ps puzzles.but || die
86 [[ ${file} == "nullgame.R" ]] && continue
87 name=$(awk -F: '/exe:/ { print $3 }' "${file}")
89 newicon -s 48 icons/${file}-48d24.png ${PN}_${file}.png
90 make_desktop_entry "${PN}_${file}" "${name}" "${PN}_${file}" "Game;LogicGame;X-${PN};"
94 DOCS=( puzzles.{pdf,ps,txt} )
97 doinfo puzzles.info{,-1,-2,-3}
100 insinto /etc/xdg/menus/applications-merged
101 doins "${FILESDIR}/${PN}.menu"
102 insinto /usr/share/desktop-directories
103 doins "${FILESDIR}/${PN}.directory"
111 gnome2_icon_cache_update
115 gnome2_icon_cache_update