blob: bfd817719fe260d7d62add8efe23a4f7346d7cb8 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Simon Tatham's Portable Puzzle Collection"
2HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
3
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05004DEPENDS = "libxt"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
6# The libxt requires x11 in DISTRO_FEATURES
7REQUIRED_DISTRO_FEATURES = "x11"
8
9LICENSE = "MIT"
Brad Bishop316dfdd2018-06-25 12:45:53 -040010LIC_FILES_CHKSUM = "file://LICENCE;md5=da6110d4ed1225a287eab2bf0ac0193b"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011
12SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
13 file://fix-compiling-failure-with-option-g-O.patch \
14 file://0001-Use-labs-instead-of-abs.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050015 file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016 file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \
17 "
Brad Bishop316dfdd2018-06-25 12:45:53 -040018UPSTREAM_CHECK_COMMITS = "1"
19SRCREV = "2adf0052d66eae88c7a5e55e67fe16e13f7018b5"
20PE = "2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021PV = "0.0+git${SRCPV}"
22
23S = "${WORKDIR}/git"
24
Patrick Williamsc0f7c042017-02-23 20:41:17 -060025inherit autotools distro_features_check pkgconfig
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027CFLAGS_append = " -Wno-deprecated-declarations"
28
29PACKAGECONFIG ??= "gtk3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+,"
31PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032
Patrick Williamsc0f7c042017-02-23 20:41:17 -060033PACKAGES += "${PN}-extra"
34FILES_${PN} = ""
35FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications"
36
37python __anonymous () {
38 var = d.expand("FILES_${PN}")
39 data = d.getVar(var, False)
40 for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
41 data = data + " ${bindir}/%s" % name
42 data = data + " ${datadir}/applications/%s.desktop" % name
43 d.setVar(var, data)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044}
45
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046do_configure_prepend () {
47 cd ${S}
48 ./mkfiles.pl
49 cd ${B}
50}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051
Patrick Williamsc0f7c042017-02-23 20:41:17 -060052do_install_append () {
53 # net conflicts with Samba, so rename it
54 mv ${D}${bindir}/net ${D}${bindir}/puzzles-net
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055
56 # Create desktop shortcuts
Patrick Williamsc0f7c042017-02-23 20:41:17 -060057 install -d ${D}/${datadir}/applications/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058 cd ${D}/${prefix}/bin
59 for prog in *; do
60 if [ -x $prog ]; then
61 # Convert prog to Title Case
Patrick Williamsc0f7c042017-02-23 20:41:17 -060062 title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063 echo "making ${D}/${datadir}/applications/$prog.desktop"
64 cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
65[Desktop Entry]
66Name=$title
Patrick Williamsc0f7c042017-02-23 20:41:17 -060067Exec=${bindir}/$prog
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068Icon=applications-games
69Terminal=false
70Type=Application
71Categories=Game;
72StartupNotify=true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073STOP
74 fi
75 done
76}