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/" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 3 | LICENSE = "MIT" |
| 4 | LIC_FILES_CHKSUM = "file://LICENCE;md5=da6110d4ed1225a287eab2bf0ac0193b" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 6 | DEPENDS = "libxt" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | |
| 8 | # The libxt requires x11 in DISTRO_FEATURES |
| 9 | REQUIRED_DISTRO_FEATURES = "x11" |
| 10 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | SRC_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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 14 | file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 15 | file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | file://0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch \ |
| 17 | file://fix-ki-uninitialized.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 18 | " |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 19 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | UPSTREAM_CHECK_COMMITS = "1" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 21 | SRCREV = "c6e0161dd475415316ed66dc82794d68e52f0025" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 22 | PE = "2" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | PV = "0.0+git${SRCPV}" |
| 24 | |
| 25 | S = "${WORKDIR}/git" |
| 26 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 27 | inherit autotools distro_features_check pkgconfig |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 28 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 33 | CFLAGS_append = " -Wno-deprecated-declarations" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 34 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | ASNEEDED = "" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 37 | do_configure_prepend () { |
| 38 | cd ${S} |
| 39 | ./mkfiles.pl |
| 40 | cd ${B} |
| 41 | } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 43 | do_install_append () { |
| 44 | # net conflicts with Samba, so rename it |
| 45 | mv ${D}${bindir}/net ${D}${bindir}/puzzles-net |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | |
| 47 | # Create desktop shortcuts |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 48 | install -d ${D}/${datadir}/applications/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | cd ${D}/${prefix}/bin |
| 50 | for prog in *; do |
| 51 | if [ -x $prog ]; then |
| 52 | # Convert prog to Title Case |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 53 | title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | echo "making ${D}/${datadir}/applications/$prog.desktop" |
| 55 | cat <<STOP > ${D}/${datadir}/applications/$prog.desktop |
| 56 | [Desktop Entry] |
| 57 | Name=$title |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 58 | Exec=${bindir}/$prog |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 59 | Icon=applications-games |
| 60 | Terminal=false |
| 61 | Type=Application |
| 62 | Categories=Game; |
| 63 | StartupNotify=true |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 64 | STOP |
| 65 | fi |
| 66 | done |
| 67 | } |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 68 | |
| 69 | PACKAGES += "${PN}-extra" |
| 70 | |
| 71 | FILES_${PN} = "" |
| 72 | FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications" |
| 73 | |
| 74 | python __anonymous () { |
| 75 | var = d.expand("FILES_${PN}") |
| 76 | data = d.getVar(var, False) |
| 77 | for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"): |
| 78 | data = data + " ${bindir}/%s" % name |
| 79 | data = data + " ${datadir}/applications/%s.desktop" % name |
| 80 | d.setVar(var, data) |
| 81 | } |