Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Simon Tatham's Portable Puzzle Collection" |
| 2 | HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/" |
| 3 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 4 | DEPENDS = "libxt" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
| 6 | # The libxt requires x11 in DISTRO_FEATURES |
| 7 | REQUIRED_DISTRO_FEATURES = "x11" |
| 8 | |
| 9 | LICENSE = "MIT" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 10 | LIC_FILES_CHKSUM = "file://LICENCE;md5=da6110d4ed1225a287eab2bf0ac0193b" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | |
| 12 | SRC_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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 15 | file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 16 | file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \ |
| 17 | " |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | UPSTREAM_CHECK_COMMITS = "1" |
| 19 | SRCREV = "2adf0052d66eae88c7a5e55e67fe16e13f7018b5" |
| 20 | PE = "2" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | PV = "0.0+git${SRCPV}" |
| 22 | |
| 23 | S = "${WORKDIR}/git" |
| 24 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 25 | inherit autotools distro_features_check pkgconfig |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 27 | CFLAGS_append = " -Wno-deprecated-declarations" |
| 28 | |
| 29 | PACKAGECONFIG ??= "gtk3" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 30 | PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+," |
| 31 | PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3," |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 33 | PACKAGES += "${PN}-extra" |
| 34 | FILES_${PN} = "" |
| 35 | FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications" |
| 36 | |
| 37 | python __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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | } |
| 45 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 46 | do_configure_prepend () { |
| 47 | cd ${S} |
| 48 | ./mkfiles.pl |
| 49 | cd ${B} |
| 50 | } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 52 | do_install_append () { |
| 53 | # net conflicts with Samba, so rename it |
| 54 | mv ${D}${bindir}/net ${D}${bindir}/puzzles-net |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | |
| 56 | # Create desktop shortcuts |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 57 | install -d ${D}/${datadir}/applications/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | cd ${D}/${prefix}/bin |
| 59 | for prog in *; do |
| 60 | if [ -x $prog ]; then |
| 61 | # Convert prog to Title Case |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 62 | title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | echo "making ${D}/${datadir}/applications/$prog.desktop" |
| 64 | cat <<STOP > ${D}/${datadir}/applications/$prog.desktop |
| 65 | [Desktop Entry] |
| 66 | Name=$title |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 67 | Exec=${bindir}/$prog |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 68 | Icon=applications-games |
| 69 | Terminal=false |
| 70 | Type=Application |
| 71 | Categories=Game; |
| 72 | StartupNotify=true |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | STOP |
| 74 | fi |
| 75 | done |
| 76 | } |