blob: 16a08585cc9a1b08b21e3831b125c1179c95c473 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Simon Tatham's Portable Puzzle Collection"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "Collection of small computer programs which implement one-player puzzle games."
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004LICENSE = "MIT"
Andrew Geissler82c905d2020-04-13 13:39:40 -05005LIC_FILES_CHKSUM = "file://LICENCE;md5=6099f4981f9461d7f411091e69a7f07a"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05007DEPENDS = "libxt"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008
9# The libxt requires x11 in DISTRO_FEATURES
10REQUIRED_DISTRO_FEATURES = "x11"
11
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
13 file://fix-compiling-failure-with-option-g-O.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 \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060018 file://0001-malloc-Check-for-excessive-values-to-malloc.patch \
Andrew Geissler90fd73c2021-03-05 15:25:55 -060019 file://0001-map-Fix-stringop-overflow-warning.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021
Brad Bishop316dfdd2018-06-25 12:45:53 -040022UPSTREAM_CHECK_COMMITS = "1"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060023SRCREV = "84cb4c6701e027090ff3fd955ce08065e20121b2"
Brad Bishop316dfdd2018-06-25 12:45:53 -040024PE = "2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025PV = "0.0+git${SRCPV}"
26
27S = "${WORKDIR}/git"
28
Brad Bishop6dbb3162019-11-25 09:41:34 -050029inherit autotools features_check pkgconfig
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030
Patrick Williamsc0f7c042017-02-23 20:41:17 -060031PACKAGECONFIG ??= "gtk3"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+,"
33PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035CFLAGS_append = " -Wno-deprecated-declarations"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060036
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037ASNEEDED = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038
Patrick Williamsc0f7c042017-02-23 20:41:17 -060039do_configure_prepend () {
40 cd ${S}
41 ./mkfiles.pl
42 cd ${B}
43}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044
Patrick Williamsc0f7c042017-02-23 20:41:17 -060045do_install_append () {
46 # net conflicts with Samba, so rename it
47 mv ${D}${bindir}/net ${D}${bindir}/puzzles-net
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048
49 # Create desktop shortcuts
Patrick Williamsc0f7c042017-02-23 20:41:17 -060050 install -d ${D}/${datadir}/applications/
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 cd ${D}/${prefix}/bin
52 for prog in *; do
53 if [ -x $prog ]; then
54 # Convert prog to Title Case
Patrick Williamsc0f7c042017-02-23 20:41:17 -060055 title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056 echo "making ${D}/${datadir}/applications/$prog.desktop"
57 cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
58[Desktop Entry]
59Name=$title
Patrick Williamsc0f7c042017-02-23 20:41:17 -060060Exec=${bindir}/$prog
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061Icon=applications-games
62Terminal=false
63Type=Application
64Categories=Game;
65StartupNotify=true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066STOP
67 fi
68 done
69}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080070
71PACKAGES += "${PN}-extra"
72
73FILES_${PN} = ""
74FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications"
75
76python __anonymous () {
77 var = d.expand("FILES_${PN}")
78 data = d.getVar(var, False)
79 for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
80 data = data + " ${bindir}/%s" % name
81 data = data + " ${datadir}/applications/%s.desktop" % name
82 d.setVar(var, data)
83}