blob: 59b952522dffb8be027d7110b2c90793d1dd967b [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 \
Brad Bishop19323692019-04-05 15:28:33 -040016 file://0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch \
17 file://fix-ki-uninitialized.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019
Brad Bishop316dfdd2018-06-25 12:45:53 -040020UPSTREAM_CHECK_COMMITS = "1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021SRCREV = "c6e0161dd475415316ed66dc82794d68e52f0025"
Brad Bishop316dfdd2018-06-25 12:45:53 -040022PE = "2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023PV = "0.0+git${SRCPV}"
24
25S = "${WORKDIR}/git"
26
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027inherit autotools distro_features_check pkgconfig
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028
Patrick Williamsc0f7c042017-02-23 20:41:17 -060029PACKAGECONFIG ??= "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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033CFLAGS_append = " -Wno-deprecated-declarations"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060034
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035ASNEEDED = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
Patrick Williamsc0f7c042017-02-23 20:41:17 -060037do_configure_prepend () {
38 cd ${S}
39 ./mkfiles.pl
40 cd ${B}
41}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042
Patrick Williamsc0f7c042017-02-23 20:41:17 -060043do_install_append () {
44 # net conflicts with Samba, so rename it
45 mv ${D}${bindir}/net ${D}${bindir}/puzzles-net
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046
47 # Create desktop shortcuts
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048 install -d ${D}/${datadir}/applications/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 cd ${D}/${prefix}/bin
50 for prog in *; do
51 if [ -x $prog ]; then
52 # Convert prog to Title Case
Patrick Williamsc0f7c042017-02-23 20:41:17 -060053 title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054 echo "making ${D}/${datadir}/applications/$prog.desktop"
55 cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
56[Desktop Entry]
57Name=$title
Patrick Williamsc0f7c042017-02-23 20:41:17 -060058Exec=${bindir}/$prog
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059Icon=applications-games
60Terminal=false
61Type=Application
62Categories=Game;
63StartupNotify=true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050064STOP
65 fi
66 done
67}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080068
69PACKAGES += "${PN}-extra"
70
71FILES_${PN} = ""
72FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications"
73
74python __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}