1SUMMARY = "Simon Tatham's Portable Puzzle Collection"
2DESCRIPTION = "Collection of small computer programs which implement one-player puzzle games."
3HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENCE;md5=6e7d24cf1c949887ee9447a1e2a4a24c"
6
7# gtk support includes a bunch of x11 headers
8REQUIRED_DISTRO_FEATURES = "x11"
9
10SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main"
11
12UPSTREAM_CHECK_COMMITS = "1"
13SRCREV = "c43a34fbfe430d235bafc379595761880a19ed9f"
14PE = "2"
15PV = "0.0+git${SRCPV}"
16
17S = "${WORKDIR}/git"
18
19inherit cmake features_check pkgconfig
20
21DEPENDS += "gtk+3"
22
23do_install:append () {
24    # net conflicts with Samba, so rename it
25    mv ${D}${bindir}/net ${D}${bindir}/puzzles-net
26
27    # Create desktop shortcuts
28    install -d ${D}/${datadir}/applications/
29    cd ${D}/${prefix}/bin
30    for prog in *; do
31	if [ -x $prog ]; then
32            # Convert prog to Title Case
33            title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g')
34	    echo "making ${D}/${datadir}/applications/$prog.desktop"
35	    cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
36[Desktop Entry]
37Name=$title
38Exec=${bindir}/$prog
39Icon=applications-games
40Terminal=false
41Type=Application
42Categories=Game;
43StartupNotify=true
44STOP
45        fi
46    done
47}
48
49