allegro: bump version, fix reference to libpng16 (#3832)

This commit is contained in:
Schrijvers Luc
2019-05-12 11:05:13 +02:00
committed by Jérôme Duval
parent 4e148c4888
commit 13f83b343d
2 changed files with 339 additions and 0 deletions

View File

@@ -0,0 +1,121 @@
SUMMARY="A cross-platform game programming library"
DESCRIPTION="Allegro 4 and Allegro 5 are cross-platform, libraries mainly \
aimed at video game and multimedia programming. They handle common, low-level \
tasks such as creating windows, accepting user input, loading data, drawing \
images, playing sounds, etc. and generally abstracting away the underlying \
platform. However, Allegro is not a game engine: you are free to design and \
structure your program as you like.
According to the Oxford Companion to Music, Allegro is the Italian for «quick, \
lively, bright». It is also a recursive acronym which stands for «Allegro Low \
LEvel Game ROutines». Allegro was started by Shawn Hargreaves in the mid-90's \
but has since received contributions from hundreds of people over the net."
HOMEPAGE="https://liballeg.org/"
COPYRIGHT="1998-2019 Shawn Hargreaves et al."
LICENSE="Allegro"
REVISION="1"
SOURCE_URI="https://github.com/liballeg/allegro5/releases/download/$portVersion/allegro-$portVersion.tar.gz"
CHECKSUM_SHA256="ec19dbc9a021244582b4819b3583ee594b50141f9fcf6944a4ed8069cbf8d4d4"
PATCHES="allegro-$portVersion.patchset"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
libVersion="4.4.3"
libVersionCompat="$libVersion compat >= 4.4"
PROVIDES="
allegro$secondaryArchSuffix = $portVersion
lib:liballeg$secondaryArchSuffix = $libVersionCompat
lib:liballeggl$secondaryArchSuffix = $libVersionCompat
lib:libjpgalleg$secondaryArchSuffix = $libVersionCompat
lib:libloadpng$secondaryArchSuffix = $libVersionCompat
lib:liblogg$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libGLU$secondaryArchSuffix
lib:libogg$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libvorbis$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
allegro${secondaryArchSuffix}_devel = $portVersion
cmd:allegro_config$secondaryArchSuffix = $portVersion
devel:liballeg$secondaryArchSuffix = $libVersionCompat
devel:liballeggl$secondaryArchSuffix = $libVersionCompat
devel:libjpgalleg$secondaryArchSuffix = $libVersionCompat
devel:libloadpng$secondaryArchSuffix = $libVersionCompat
devel:liblogg$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
allegro$secondaryArchSuffix == $portVersion base
devel:libGL$secondaryArchSuffix
devel:libGLU$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
devel:libvorbisfile$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
PROVIDES_tools="
allegro${secondaryArchSuffix}_tools
cmd:colormap$secondaryArchSuffix = $portVersion
cmd:dat$secondaryArchSuffix = $portVersion
cmd:dat2c$secondaryArchSuffix = $portVersion
cmd:dat2s$secondaryArchSuffix = $portVersion
cmd:exedat$secondaryArchSuffix = $portVersion
cmd:grabber$secondaryArchSuffix = $portVersion
cmd:pack$secondaryArchSuffix = $portVersion
cmd:pat2dat$secondaryArchSuffix = $portVersion
cmd:rgbmap$secondaryArchSuffix = $portVersion
cmd:textconv$secondaryArchSuffix = $portVersion
"
REQUIRES_tools="
haiku$secondaryArchSuffix
allegro$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libGL$secondaryArchSuffix
devel:libGLU$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cmake . -DCMAKE_INSTALL_PREFIX=$prefix -DDOCDIR=$docDir \
-DMANDIR=$manDir -DLIB_SUFFIX=$secondaryArchSubDir \
-DWANT_TESTS=OFF -DWANT_EXAMPLES=OFF
make $jobArgs
}
INSTALL()
{
make install
prepareInstalledDevelLibs liballeg liballeggl \
libjpgalleg libloadpng liblogg
fixPkgconfig
packageEntries devel \
$binDir/allegro-config \
$developDir
packageEntries tools \
$binDir/
}

View File

@@ -0,0 +1,218 @@
From 71974e9d6bf87a1abc7f90c0fbf7863c6f9a96fe Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 30 Nov 2013 12:14:54 +0100
Subject: Import Allegro 4.4.1.1 fixes that were not upstreamed.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d661bd9..8a7f4da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -287,7 +287,7 @@ if(APPLE)
endif(COMPILER_GCC)
endif(APPLE)
-if(BEOS)
+if(BEOS OR HAIKU)
if(CMAKE_SYSTEM_NAME STREQUAL Haiku)
set(ALLEGRO_HAIKU 1)
else(CMAKE_SYSTEM_NAME STREQUAL Haiku)
@@ -296,9 +296,9 @@ if(BEOS)
set(WFLAGS "-W -Wall -Wno-unused -Wno-multichar")
set(WFLAGS_C_ONLY "")
set(WFLAGS_CXX_ONLY "-Wno-ctor-dtor-privacy")
-endif(BEOS)
+endif()
-if(UNIX AND NOT APPLE AND NOT BEOS)
+if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
set(ALLEGRO_UNIX 1)
endif()
@@ -634,10 +634,10 @@ endif(WIN32)
# -- Haiku/BeOS --
-if(BEOS)
+if(BEOS OR HAIKU)
list(APPEND PLATFORM_SOURCES ${ALLEGRO_SRC_BEOS_FILES})
list(APPEND PLATFORM_LIBS game midi device)
-endif(BEOS)
+endif()
# -- Mac OS X --
diff --git a/cmake/Common.cmake b/cmake/Common.cmake
index 41822dd..1b89f7e 100644
--- a/cmake/Common.cmake
+++ b/cmake/Common.cmake
@@ -43,7 +43,11 @@ endfunction(install_our_library)
function(install_our_headers)
foreach(hdr ${ARGN})
get_source_file_property(LOC ${hdr} MACOSX_PACKAGE_LOCATION)
- string(REGEX REPLACE "^Headers" "include" LOC ${LOC})
+ if(HAIKU)
+ string(REGEX REPLACE "^Headers" "develop/headers" LOC ${LOC})
+ else()
+ string(REGEX REPLACE "^Headers" "include" LOC ${LOC})
+ endif()
install(FILES ${hdr} DESTINATION ${LOC})
endforeach()
endfunction(install_our_headers)
diff --git a/src/beos/bsysapi.cpp b/src/beos/bsysapi.cpp
index c6e4dad..a7c9d46 100644
--- a/src/beos/bsysapi.cpp
+++ b/src/beos/bsysapi.cpp
@@ -128,7 +128,7 @@ static int32 system_thread(void *data)
using_custom_allegro_app = false;
term = getenv("TERM");
- if (!strcmp(term, "dumb")) {
+ if (!term || !strcmp(term, "dumb")) {
/* The TERM environmental variable is set to "dumb" if the app was
* not started from a terminal.
*/
--
2.21.0
From 3d01fbf800e38e835e2eb9e6d0538963aecbb5f1 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 25 Sep 2014 11:09:14 +0200
Subject: Hack install dirfor binaries.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a7f4da..a6a6366 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -899,7 +899,7 @@ if(UNIX) # including MACOSX
)
install(PROGRAMS ${CMAKE_BINARY_DIR}/allegro-config
- DESTINATION bin
+ DESTINATION bin${LIB_SUFFIX}
)
endif(UNIX)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 170c3b4..d6d1bef 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -48,7 +48,7 @@ target_link_libraries(aldat allegro ${ALDAT_JPGALLEG})
function(add_our_tool nm)
add_our_executable(${nm} ${nm}.c ${ARGN})
install(TARGETS ${nm}
- DESTINATION bin
+ DESTINATION bin${LIB_SUFFIX}
)
endfunction()
@@ -69,7 +69,7 @@ target_link_libraries(pat2dat aldat)
add_our_executable(grabber WIN32 grabber.c)
target_link_libraries(grabber aldat)
install(TARGETS grabber
- DESTINATION bin
+ DESTINATION bin${LIB_SUFFIX}
)
#-----------------------------------------------------------------------------#
--
2.21.0
From 2f97014b45bf835a041d2ee48e09c792245aa8e4 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 12 Nov 2015 23:02:46 +0100
Subject: Remove useless check of the keyboard id
* Why not accept different keyboard types?
diff --git a/src/beos/bkeyapi.cpp b/src/beos/bkeyapi.cpp
index 302f353..74a672f 100644
--- a/src/beos/bkeyapi.cpp
+++ b/src/beos/bkeyapi.cpp
@@ -26,8 +26,6 @@
#error something is wrong with the makefile
#endif
-#define KEY_ID_PC101 0 // the docs say it should be 0x83ab, but they lie
-
#define KEY_SEMAPHORE_NAME "keyboard driver waiting..."
#define KEY_THREAD_PERIOD 33333 // microseconds, 1/30th of a second
@@ -44,8 +42,6 @@
#define PREFIX_W "al-bkey WARNING: "
#define PREFIX_E "al-bkey ERROR: "
-static uint16 keyboard_id = (uint16)(-1);
-
static volatile int keyboard_thread_running = FALSE;
static thread_id keyboard_thread_id = -1;
@@ -299,14 +295,6 @@ extern "C" int be_key_init(void)
_pckeys_init();
- if (get_keyboard_id(&keyboard_id) == B_ERROR) {
- goto cleanup;
- }
-
- if (keyboard_id != KEY_ID_PC101) {
- goto cleanup;
- }
-
waiting_for_input = create_sem(0, "waiting for input...");
if (waiting_for_input < B_NO_ERROR) {
@@ -363,8 +351,6 @@ extern "C" void be_key_exit(void)
delete_sem(waiting_for_input);
waiting_for_input = -1;
}
-
- keyboard_id = (uint16)(-1);
}
--
2.21.0
From e089fe50b65740b10337d8387ad40a9be87b25e5 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 11 May 2019 10:44:07 +0200
Subject: Enabel liballeggl for Haiku
diff --git a/addons/allegrogl/CMakeLists.txt b/addons/allegrogl/CMakeLists.txt
index 36cfcc3..f306586 100644
--- a/addons/allegrogl/CMakeLists.txt
+++ b/addons/allegrogl/CMakeLists.txt
@@ -7,7 +7,7 @@ find_package(OpenGL)
if(NOT OPENGL_FOUND)
return()
endif()
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT HAIKU)
find_package(X11)
if(NOT X11_FOUND)
return()
diff --git a/addons/allegrogl/include/alleggl.h b/addons/allegrogl/include/alleggl.h
index fa36c98..71a1d66 100644
--- a/addons/allegrogl/include/alleggl.h
+++ b/addons/allegrogl/include/alleggl.h
@@ -462,6 +462,11 @@ AGL_FUNC(void, allegro_gl_load_settings, (void));
#define GFX_OPENGL_WINDOWED AL_ID('O','G','L','W')
#define GFX_OPENGL_FULLSCREEN AL_ID('O','G','L','F')
+#elif defined ALLEGRO_HAIKU
+ /* Haiku always supports fullscreen */
+ #define GFX_OPENGL_WINDOWED AL_ID('O','G','L','W')
+ #define GFX_OPENGL_FULLSCREEN AL_ID('O','G','L','F')
+
#else
#warning Unknown or unsupported platform.
#endif
--
2.21.0