[meta-games] neverball: Add neverball

Message ID 20211119210515.131769-1-marex@denx.de
State New
Headers show
Series [meta-games] neverball: Add neverball | expand

Commit Message

Marek Vasut Nov. 19, 2021, 9:05 p.m. UTC
This is an interactive game with a rolling ball, useful for
testing whether point sprites work correctly in GPU drivers.

The user should install both neverball neverball-data packages.

Signed-off-by: Marek Vasut <marex@denx.de>
---
 recipes-games/neverball/neverball-data_git.bb | 16 ++++++++++++
 recipes-games/neverball/neverball.inc         | 26 +++++++++++++++++++
 recipes-games/neverball/neverball_git.bb      | 16 ++++++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 recipes-games/neverball/neverball-data_git.bb
 create mode 100644 recipes-games/neverball/neverball.inc
 create mode 100644 recipes-games/neverball/neverball_git.bb

Comments

Khem Raj Nov. 19, 2021, 9:08 p.m. UTC | #1
On Fri, Nov 19, 2021 at 1:05 PM Marek Vasut <marex@denx.de> wrote:
>
> This is an interactive game with a rolling ball, useful for
> testing whether point sprites work correctly in GPU drivers.
>
> The user should install both neverball neverball-data packages.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
>  recipes-games/neverball/neverball-data_git.bb | 16 ++++++++++++
>  recipes-games/neverball/neverball.inc         | 26 +++++++++++++++++++
>  recipes-games/neverball/neverball_git.bb      | 16 ++++++++++++
>  3 files changed, 58 insertions(+)
>  create mode 100644 recipes-games/neverball/neverball-data_git.bb
>  create mode 100644 recipes-games/neverball/neverball.inc
>  create mode 100644 recipes-games/neverball/neverball_git.bb
>
> diff --git a/recipes-games/neverball/neverball-data_git.bb b/recipes-games/neverball/neverball-data_git.bb
> new file mode 100644
> index 0000000..c09a5ee
> --- /dev/null
> +++ b/recipes-games/neverball/neverball-data_git.bb
> @@ -0,0 +1,16 @@
> +require neverball.inc
> +
> +inherit allarch
> +
> +DEPENDS:append = " jpeg-native libpng-native libsdl2-native"
> +
> +do_compile() {
> +       oe_runmake CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS} -I${STAGING_INCDIR_NATIVE}/SDL2/" LDFLAGS="${BUILD_LDFLAGS} -lpng" mapc sols
> +}
> +
> +do_install() {
> +       install -d -m 755 ${D}${datadir}/neverball
> +       cp -r ${B}/data ${D}${datadir}/neverball/
> +}
> +
> +FILES:${PN}:append = " ${datadir}/neverball"
> diff --git a/recipes-games/neverball/neverball.inc b/recipes-games/neverball/neverball.inc
> new file mode 100644
> index 0000000..1ef2ec4
> --- /dev/null
> +++ b/recipes-games/neverball/neverball.inc
> @@ -0,0 +1,26 @@
> +SUMMARY = "Tilt the floor to roll a ball through an obstacle course before time runs out. Neverball is part puzzle game, part action game, and entirely a test of skill."
> +SECTION = "graphics"
> +HOMEPAGE = "https://neverball.org/"
> +
> +LICENSE = "GPLv2+"
> +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=200ddba3b50e856bfb681a2b13dfb523"
> +
> +SRC_URI = "git://github.com/Neverball/neverball.git;protocol=https"
> +SRCREV = "bb6a99b14b1f81d071efd54cc0effdc517704b95"
> +PV = "1.6.0+git${SRCPV}"
> +
> +S = "${WORKDIR}/git"
> +
> +inherit pkgconfig
> +
> +EXTRA_OEMAKE:append = " \
> +       ENABLE_FETCH=0 \
> +       ENABLE_OPENGLES=1 \
> +       DATADIR=/usr/share/neverball/data \
> +       LOCALEDIR=/usr/share/neverball/locale \
> +       "
> +
> +do_configure:append() {
> +       sed -i "s@sdl2-config@pkg-config sdl2@" ${S}/Makefile
> +       sed -i "s@libpng-config@pkg-config libpng@" ${S}/Makefile
> +}
> diff --git a/recipes-games/neverball/neverball_git.bb b/recipes-games/neverball/neverball_git.bb
> new file mode 100644
> index 0000000..18e02bd
> --- /dev/null
> +++ b/recipes-games/neverball/neverball_git.bb
> @@ -0,0 +1,16 @@
> +require neverball.inc
> +
> +DEPENDS:append = " gettext-native virtual/libgles1 virtual/libintl libvorbis jpeg libpng libsdl2 libsdl2-ttf"
> +
> +do_compile() {
> +       oe_runmake neverball neverputt locales desktops
> +}
> +
> +do_install() {
> +       install -d -m 755 ${D}${bindir}
> +       install -m 755 ${B}/neverball ${D}/${bindir}/
> +       install -m 755 ${B}/neverputt ${D}/${bindir}/
> +
> +       install -d -m 755 ${D}${datadir}/neverball
> +       cp -r ${B}/locale ${D}${datadir}/neverball/

perhap use

cp -R --no-dereference --preserve=mode,links

here

> +}
> --
> 2.33.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#94067): https://lists.openembedded.org/g/openembedded-devel/message/94067
> Mute This Topic: https://lists.openembedded.org/mt/87178399/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Marek Vasut Nov. 19, 2021, 9:14 p.m. UTC | #2
On 11/19/21 10:08 PM, Khem Raj wrote:

[...]

>> +do_install() {
>> +       install -d -m 755 ${D}${bindir}
>> +       install -m 755 ${B}/neverball ${D}/${bindir}/
>> +       install -m 755 ${B}/neverputt ${D}/${bindir}/
>> +
>> +       install -d -m 755 ${D}${datadir}/neverball
>> +       cp -r ${B}/locale ${D}${datadir}/neverball/
> 
> perhap use
> 
> cp -R --no-dereference --preserve=mode,links
> 
> here

Will do in V2.

Is that some new recommended best practice ?
Khem Raj Nov. 19, 2021, 9:20 p.m. UTC | #3
On Fri, Nov 19, 2021 at 1:14 PM Marek Vasut <marex@denx.de> wrote:
>
> On 11/19/21 10:08 PM, Khem Raj wrote:
>
> [...]
>
> >> +do_install() {
> >> +       install -d -m 755 ${D}${bindir}
> >> +       install -m 755 ${B}/neverball ${D}/${bindir}/
> >> +       install -m 755 ${B}/neverputt ${D}/${bindir}/
> >> +
> >> +       install -d -m 755 ${D}${datadir}/neverball
> >> +       cp -r ${B}/locale ${D}${datadir}/neverball/
> >
> > perhap use
> >
> > cp -R --no-dereference --preserve=mode,links
> >
> > here
>
> Will do in V2.
>
> Is that some new recommended best practice ?

We need to have same username, sometimes username differs especially
when building in docker containers.
Marek Vasut Nov. 19, 2021, 9:58 p.m. UTC | #4
On 11/19/21 10:20 PM, Khem Raj wrote:
> On Fri, Nov 19, 2021 at 1:14 PM Marek Vasut <marex@denx.de> wrote:
>>
>> On 11/19/21 10:08 PM, Khem Raj wrote:
>>
>> [...]
>>
>>>> +do_install() {
>>>> +       install -d -m 755 ${D}${bindir}
>>>> +       install -m 755 ${B}/neverball ${D}/${bindir}/
>>>> +       install -m 755 ${B}/neverputt ${D}/${bindir}/
>>>> +
>>>> +       install -d -m 755 ${D}${datadir}/neverball
>>>> +       cp -r ${B}/locale ${D}${datadir}/neverball/
>>>
>>> perhap use
>>>
>>> cp -R --no-dereference --preserve=mode,links
>>>
>>> here
>>
>> Will do in V2.
>>
>> Is that some new recommended best practice ?
> 
> We need to have same username, sometimes username differs especially
> when building in docker containers.

Ahh, I see. Thanks

Patch

diff --git a/recipes-games/neverball/neverball-data_git.bb b/recipes-games/neverball/neverball-data_git.bb
new file mode 100644
index 0000000..c09a5ee
--- /dev/null
+++ b/recipes-games/neverball/neverball-data_git.bb
@@ -0,0 +1,16 @@ 
+require neverball.inc
+
+inherit allarch
+
+DEPENDS:append = " jpeg-native libpng-native libsdl2-native"
+
+do_compile() {
+	oe_runmake CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS} -I${STAGING_INCDIR_NATIVE}/SDL2/" LDFLAGS="${BUILD_LDFLAGS} -lpng" mapc sols
+}
+
+do_install() {
+	install -d -m 755 ${D}${datadir}/neverball
+	cp -r ${B}/data ${D}${datadir}/neverball/
+}
+
+FILES:${PN}:append = " ${datadir}/neverball"
diff --git a/recipes-games/neverball/neverball.inc b/recipes-games/neverball/neverball.inc
new file mode 100644
index 0000000..1ef2ec4
--- /dev/null
+++ b/recipes-games/neverball/neverball.inc
@@ -0,0 +1,26 @@ 
+SUMMARY = "Tilt the floor to roll a ball through an obstacle course before time runs out. Neverball is part puzzle game, part action game, and entirely a test of skill."
+SECTION = "graphics"
+HOMEPAGE = "https://neverball.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=200ddba3b50e856bfb681a2b13dfb523"
+
+SRC_URI = "git://github.com/Neverball/neverball.git;protocol=https"
+SRCREV = "bb6a99b14b1f81d071efd54cc0effdc517704b95"
+PV = "1.6.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE:append = " \
+	ENABLE_FETCH=0 \
+	ENABLE_OPENGLES=1 \
+	DATADIR=/usr/share/neverball/data \
+	LOCALEDIR=/usr/share/neverball/locale \
+	"
+
+do_configure:append() {
+	sed -i "s@sdl2-config@pkg-config sdl2@" ${S}/Makefile
+	sed -i "s@libpng-config@pkg-config libpng@" ${S}/Makefile
+}
diff --git a/recipes-games/neverball/neverball_git.bb b/recipes-games/neverball/neverball_git.bb
new file mode 100644
index 0000000..18e02bd
--- /dev/null
+++ b/recipes-games/neverball/neverball_git.bb
@@ -0,0 +1,16 @@ 
+require neverball.inc
+
+DEPENDS:append = " gettext-native virtual/libgles1 virtual/libintl libvorbis jpeg libpng libsdl2 libsdl2-ttf"
+
+do_compile() {
+	oe_runmake neverball neverputt locales desktops
+}
+
+do_install() {
+	install -d -m 755 ${D}${bindir}
+	install -m 755 ${B}/neverball ${D}/${bindir}/
+	install -m 755 ${B}/neverputt ${D}/${bindir}/
+
+	install -d -m 755 ${D}${datadir}/neverball
+	cp -r ${B}/locale ${D}${datadir}/neverball/
+}