Ltris - a nice Tetris clone

This commit is contained in:
Norman Feske
2015-02-05 21:39:50 +01:00
parent 7dd0f21b42
commit 272fbc2c0c
4 changed files with 176 additions and 0 deletions

1
ports/ltris.hash Normal file
View File

@@ -0,0 +1 @@
847f5dccf16e2d2ddacfb784f75acb4ad40fb499

7
ports/ltris.port Normal file
View File

@@ -0,0 +1,7 @@
LICENSE := GPLv2
VERSION := 1.0.19
DOWNLOADS := ltris.archive
URL(ltris) := http://downloads.sourceforge.net/project/lgames/ltris/ltris-$(VERSION).tar.gz
SHA(ltris) := 6f9b0f3ff2de73e55d4e880b502c925f7168b2b6
DIR(ltris) := src/app/ltris

149
run/ltris.run Normal file
View File

@@ -0,0 +1,149 @@
#
# Build
#
set build_components {
core init
drivers/timer
app/ltris server/ram_fs
drivers/framebuffer drivers/pci drivers/input
}
lappend_if [have_spec usb] build_components drivers/usb
lappend_if [have_spec platform_rpi] build_components drivers/platform
build $build_components
create_boot_directory
#
# Generate config
#
append config {
<config prio_levels="4">
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="CAP"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="SIGNAL"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_if [have_spec sdl] config {
<start name="fb_sdl">
<resource name="RAM" quantum="4M"/>
<provides>
<service name="Input"/>
<service name="Framebuffer"/>
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv" priority="-1">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if [have_spec platform_rpi] config {
<start name="platform_drv" priority="-1">
<resource name="RAM" quantum="1M"/>
<provides><service name="Platform"/></provides>
<config/>
</start>}
append_if [have_spec framebuffer] config {
<start name="fb_drv" priority="-1">
<resource name="RAM" quantum="6M"/>
<provides><service name="Framebuffer"/></provides>
<config buffered="yes" width="640" height="480" />
</start>}
append_if [have_spec ps2] config {
<start name="ps2_drv" priority="-1">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start>}
append_if [expr ![have_spec ps2] && [have_spec usb]] config {
<start name="usb_drv">
<resource name="RAM" quantum="12M"/>
<provides><service name="Input"/></provides>
<config ehci="yes" uhci="yes" xhci="no"> <hid/> </config>
</start> }
append config {
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="ram_fs" priority="-1">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<policy label="" root="/" writeable="yes" />
<content>
<dir name="var"/>
</content>
</config>
</start>
<start name="ltris" priority="-2">
<resource name="RAM" quantum="64M"/>
<config>
<libc stdout="/dev/log" stderr="/dev/log" >
<vfs>
<tar name="ltris_data.tar" />
<dir name="dev"> <log/> </dir>
<fs/>
</vfs>
</libc>
</config>
</start>
</config>}
install_config $config
#
# Boot modules
#
# generic modules
set boot_modules {
core init
timer ram_fs
ltris
ld.lib.so
libc.lib.so
libm.lib.so
pthread.lib.so
sdl_mixer.lib.so
sdl.lib.so
stdcxx.lib.so
zlib.lib.so
ltris_data.tar
}
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec usb] boot_modules usb_drv
lappend_if [have_spec platform_rpi] boot_modules platform_drv
build_boot_image $boot_modules
append qemu_args " -m 256 "
run_genode_until forever

19
src/app/ltris/target.mk Normal file
View File

@@ -0,0 +1,19 @@
TARGET = ltris
LIBS = libc stdcxx sdl sdl_mixer
LTRIS_DIR := $(call select_from_ports,ltris)/src/app/ltris
# determine version by looking at the configure script
VERSION := $(shell grep "^ VERSION" $(LTRIS_DIR)/configure | sed "s/.*=//")
CC_OPT += -DHI_DIR=\"/var\" -DSRC_DIR=\"/\" \
-DVERSION=\"$(VERSION)\"
INC_DIR += $(LTRIS_DIR)/src
SRC_C := $(notdir $(wildcard $(LTRIS_DIR)/src/*.c))
vpath %.c $(LTRIS_DIR)/src
$(TARGET): ltris_data.tar
ltris_data.tar:
$(VERBOSE)cd $(LTRIS_DIR)/src; tar cf $(PWD)/bin/$@ gfx sounds figures