blob: 7d08b964f84783c93d03c6f604ce143fdd10cc3c [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/"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08003LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://LICENCE;md5=da6110d4ed1225a287eab2bf0ac0193b"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05006DEPENDS = "libxt"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007
8# The libxt requires x11 in DISTRO_FEATURES
9REQUIRED_DISTRO_FEATURES = "x11"
10
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
12 file://fix-compiling-failure-with-option-g-O.patch \
13 file://0001-Use-labs-instead-of-abs.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050014 file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015 file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \
16 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017
Brad Bishop316dfdd2018-06-25 12:45:53 -040018UPSTREAM_CHECK_COMMITS = "1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019SRCREV = "c6e0161dd475415316ed66dc82794d68e52f0025"
Brad Bishop316dfdd2018-06-25 12:45:53 -040020PE = "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 -060027PACKAGECONFIG ??= "gtk3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+,"
29PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080031CFLAGS_append = " -Wno-deprecated-declarations"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060032
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033ASNEEDED = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
Patrick Williamsc0f7c042017-02-23 20:41:17 -060035do_configure_prepend () {
36 cd ${S}
37 ./mkfiles.pl
38 cd ${B}
39}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040
Patrick Williamsc0f7c042017-02-23 20:41:17 -060041do_install_append () {
42 # net conflicts with Samba, so rename it
43 mv ${D}${bindir}/net ${D}${bindir}/puzzles-net
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044
45 # Create desktop shortcuts
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 install -d ${D}/${datadir}/applications/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047 cd ${D}/${prefix}/bin
48 for prog in *; do
49 if [ -x $prog ]; then
50 # Convert prog to Title Case
Patrick Williamsc0f7c042017-02-23 20:41:17 -060051 title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 echo "making ${D}/${datadir}/applications/$prog.desktop"
53 cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
54[Desktop Entry]
55Name=$title
Patrick Williamsc0f7c042017-02-23 20:41:17 -060056Exec=${bindir}/$prog
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057Icon=applications-games
58Terminal=false
59Type=Application
60Categories=Game;
61StartupNotify=true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062STOP
63 fi
64 done
65}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066
67PACKAGES += "${PN}-extra"
68
69FILES_${PN} = ""
70FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications"
71
72python __anonymous () {
73 var = d.expand("FILES_${PN}")
74 data = d.getVar(var, False)
75 for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
76 data = data + " ${bindir}/%s" % name
77 data = data + " ${datadir}/applications/%s.desktop" % name
78 d.setVar(var, data)
79}