From efa0111a64e1660a4c45833af49bbd71cbc1156a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Tue, 29 Dec 2015 17:44:18 +0100 Subject: [PATCH] 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. --- ports/grafx2.hash | 1 + ports/grafx2.port | 15 ++++ run/grafx2.run | 145 ++++++++++++++++++++++++++++++++++++ src/app/grafx2/dummy.cc | 2 + src/app/grafx2/genode.patch | 47 ++++++++++++ src/app/grafx2/target.mk | 18 +++++ 6 files changed, 228 insertions(+) create mode 100644 ports/grafx2.hash create mode 100644 ports/grafx2.port create mode 100644 run/grafx2.run create mode 100644 src/app/grafx2/dummy.cc create mode 100644 src/app/grafx2/genode.patch create mode 100644 src/app/grafx2/target.mk diff --git a/ports/grafx2.hash b/ports/grafx2.hash new file mode 100644 index 0000000..6a60a44 --- /dev/null +++ b/ports/grafx2.hash @@ -0,0 +1 @@ +b9c5bcd6fdf5c639f9eedb7c86f71b72112acece diff --git a/ports/grafx2.port b/ports/grafx2.port new file mode 100644 index 0000000..82b0577 --- /dev/null +++ b/ports/grafx2.port @@ -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 diff --git a/run/grafx2.run b/run/grafx2.run new file mode 100644 index 0000000..0fd53b3 --- /dev/null +++ b/run/grafx2.run @@ -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 { + + + + + + + + + + + + + + + + + + + + + } + +append_platform_drv_config + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec platform_rpi] config { + + + + + } + +append_if [have_spec framebuffer] config { + + + + + } + +append_if [have_spec ps2] config { + + + + } + +append_if [expr ![have_spec ps2] && [have_spec usb]] config { + + + + + } + +append 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 diff --git a/src/app/grafx2/dummy.cc b/src/app/grafx2/dummy.cc new file mode 100644 index 0000000..c3d7145 --- /dev/null +++ b/src/app/grafx2/dummy.cc @@ -0,0 +1,2 @@ +/* silence debug messages */ +extern "C" void _sigprocmask() { } diff --git a/src/app/grafx2/genode.patch b/src/app/grafx2/genode.patch new file mode 100644 index 0000000..0b0da8c --- /dev/null +++ b/src/app/grafx2/genode.patch @@ -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 + #include + #include ++#include + #if defined(__AROS__) || defined(__linux__) || defined(__GLIBC__) + #include + #endif diff --git a/src/app/grafx2/target.mk b/src/app/grafx2/target.mk new file mode 100644 index 0000000..0a557e6 --- /dev/null +++ b/src/app/grafx2/target.mk @@ -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)