Port of Grafx2 (2.4.2035)

"GrafX2 is a bitmap paint program inspired by the Amiga programs
Deluxe Paint and Brilliance. Specialized in 256-color drawing, it
includes a very large number of tools and effects that make it
particularly suitable for pixel art, game graphics, and generally any
detailed graphics painted with a mouse."

Fixes #5.
This commit is contained in:
Josef Söntgen
2015-12-29 17:44:18 +01:00
committed by Norman Feske
parent cb1072ea52
commit efa0111a64
6 changed files with 228 additions and 0 deletions

1
ports/grafx2.hash Normal file
View File

@@ -0,0 +1 @@
b9c5bcd6fdf5c639f9eedb7c86f71b72112acece

15
ports/grafx2.port Normal file
View File

@@ -0,0 +1,15 @@
LICENSE := GPLv2
VERSION := 2.4.2035
DOWNLOADS := grafx2.archive
#
# The original URL is http://pulkomandy.tk/projects/GrafX2/downloads/21
# but it needs a referer and overriding the download command here is
# cumbersome - I went ahead and mirrored the archive.
#
URL(grafx2) := http://usr.sysret.de/jws/grafx2-$(VERSION)-src.tgz
SHA(grafx2) := 7b6aa4e47aa67664947c0a20f32323107cc35440
DIR(grafx2) := src/app/grafx2
PATCHES := src/app/grafx2/genode.patch

145
run/grafx2.run Normal file
View File

@@ -0,0 +1,145 @@
#
# Build
#
set build_components {
core init
drivers/timer
app/grafx2 server/ram_fs
drivers/framebuffer drivers/platform drivers/input
}
lappend_if [have_spec usb] build_components drivers/usb
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
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>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>}
append_platform_drv_config
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 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" />
</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="ram_fs" priority="-1">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config> <policy writeable="yes" root="/"/> </config>
</start>
<start name="grafx2" priority="-2">
<resource name="RAM" quantum="64M"/>
<config>
<libc stdout="/dev/log" stderr="/dev/log" >
<vfs>
<tar name="grafx2_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
grafx2
jpeg.lib.so
ld.lib.so
libc.lib.so
libm.lib.so
libpng.lib.so
pthread.lib.so
sdl_image.lib.so
sdl.lib.so
zlib.lib.so
grafx2_data.tar
}
# platform-specific modules
append_platform_drv_boot_modules
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
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

2
src/app/grafx2/dummy.cc Normal file
View File

@@ -0,0 +1,2 @@
/* silence debug messages */
extern "C" void _sigprocmask() { }

View File

@@ -0,0 +1,47 @@
Shuffle around a few things so that Grafx2 compiles on Genode and provide
a dummy implementation for the drive select dialog.
--- src/app/grafx2/src/filesel.c 2012-09-29 01:06:42.000000000 +0200
+++ src/app/grafx2/src/filesel.c 2015-12-29 17:27:50.605573933 +0100
@@ -623,7 +623,9 @@
drive_index++;
}
}
-
+ #elif defined(GENODE)
+ {
+ }
#else
{
//Sous les différents unix, on va mettre
--- src/app/grafx2/src/main.c 2012-09-30 18:12:26.000000000 +0200
+++ src/app/grafx2/src/main.c 2015-12-29 17:27:50.605573933 +0100
@@ -528,7 +528,7 @@
// SDL
- if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0)
+ if(SDL_Init(SDL_INIT_VIDEO) < 0)
{
// The program can't continue without that anyway
printf("Couldn't initialize SDL.\n");
--- src/app/grafx2/src/mountlist.c 2012-08-11 17:13:36.000000000 +0200
+++ src/app/grafx2/src/mountlist.c 2015-12-29 17:27:50.605573933 +0100
@@ -20,7 +20,7 @@
*/
// This file is not used on some platforms, so don't do anything for them
-#if(!defined(__WIN32__))&&(!defined(__amigaos4__))&&(!defined(__AROS__))&&(!defined(__MORPHOS__))&&(!defined(__amigaos__))
+#if(!defined(__WIN32__))&&(!defined(__amigaos4__))&&(!defined(__AROS__))&&(!defined(__MORPHOS__))&&(!defined(__amigaos__))&&(!defined(GENODE))
// We don't use autoconf and all that in grafx2, so let's do the config here ...
#if defined(__macosx__) || defined(__FreeBSD__) || defined(__OpenBSD__) // MacOS X is POSIX compliant
--- src/app/grafx2/src/realpath.c 2012-08-05 15:18:08.000000000 +0200
+++ src/app/grafx2/src/realpath.c 2015-12-29 17:27:50.601574004 +0100
@@ -6,6 +6,7 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#if defined(__AROS__) || defined(__linux__) || defined(__GLIBC__)
#include <limits.h>
#endif

18
src/app/grafx2/target.mk Normal file
View File

@@ -0,0 +1,18 @@
TARGET := grafx2
GRAFX2_DIR := $(call select_from_ports,grafx2)/src/app/grafx2/src
SRC_C = $(notdir $(wildcard $(GRAFX2_DIR)/*.c))
SRC_CC = dummy.cc
INC_DIR += $(GRAFX2_DIR)
CC_OPT += -DGENODE -DNOTTF=1
LIBS += libc libm libpng sdl sdl_image zlib
$(TARGET): grafx2_data.tar
grafx2_data.tar:
$(VERBOSE)cd $(GRAFX2_DIR)/../; tar cf $(PWD)/bin/$@ share
vpath %.c $(GRAFX2_DIR)