New package: flightgear-3.4.0

This commit is contained in:
Jürgen Buchmüller 2015-10-31 15:34:37 +01:00
parent 1b53786d2f
commit 6cc5892d40
10 changed files with 445 additions and 0 deletions

1
srcpkgs/flightgear-data Symbolic link
View File

@ -0,0 +1 @@
flightgear

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -0,0 +1,36 @@
From 04ca64edc46cfb54ecff5bddf12370b2c7a0f192 Mon Sep 17 00:00:00 2001
From: Fabrice Bellet <fabrice@bellet.info>
Date: Tue, 17 Feb 2015 22:49:50 +0100
Subject: [PATCH] explicitely link with libX11
---
src/Main/CMakeLists.txt | 1 +
utils/fgviewer/CMakeLists.txt | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt
index 12c0961..78c4163 100644
--- src/Main/CMakeLists.txt
+++ src/Main/CMakeLists.txt
@@ -142,6 +142,7 @@ target_link_libraries(fgfs
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${SIMGEAR_SCENE_LIBRARY_DEPENDENCIES}
${PLATFORM_LIBS}
+ ${X11_X11_LIB}
)
if(ENABLE_FLITE)
diff --git a/utils/fgviewer/CMakeLists.txt b/utils/fgviewer/CMakeLists.txt
index 165be74..065b8f1 100644
--- utils/fgviewer/CMakeLists.txt
+++ utils/fgviewer/CMakeLists.txt
@@ -48,5 +48,6 @@ target_link_libraries(fgviewer
${OPENGL_LIBRARIES}
${FGVIEWER_RTI_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
+ ${X11_X11_LIB}
)
install(TARGETS fgviewer RUNTIME DESTINATION bin)
--
2.1.0

View File

@ -0,0 +1,19 @@
Simply disabling the code which enables floating point exceptions
is probably wrong, but I don't have a replacement for the
non-posix functions fegetexcept(3) and feenableexcept(3).
--- src/Main/bootstrap.cxx 2015-02-18 21:10:05.000000000 +0100
+++ src/Main/bootstrap.cxx 2015-11-01 01:25:56.665212195 +0100
@@ -96,8 +96,12 @@
initFPE (bool fpeAbort)
{
+#if defined(__GLIBC__)
if (fpeAbort) {
int except = fegetexcept();
feenableexcept(except | FE_DIVBYZERO | FE_INVALID);
} else {
signal(SIGFPE, handleFPE);
}
+#else
+ signal(SIGFPE, handleFPE);
+#endif

View File

@ -0,0 +1,14 @@
There is no <error.h> in musl libc, thus enable the
include only if __GLIB__ is defined.
--- 3rdparty/iaxclient/lib/libiax2/src/iax.c 2015-02-18 21:10:05.000000000 +0100
+++ 3rdparty/iaxclient/lib/libiax2/src/iax.c 2015-10-31 17:14:55.477461723 +0100
@@ -75,7 +75,7 @@
// FlightGear: Modified to include FreeBSD
#if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <malloc.h>
-#if !defined(SOLARIS)
+#if !defined(SOLARIS) && defined(__GLIBC__)
#include <error.h>
#endif
#endif

View File

@ -0,0 +1,17 @@
For musl libc return the file position using
ftell(3) because fpos_t is opaque.
--- 3rdparty/hts_engine_API/lib/HTS_misc.c 2015-02-18 21:10:05.000000000 +0100
+++ 3rdparty/hts_engine_API/lib/HTS_misc.c 2015-10-31 17:33:53.946349145 +0100
@@ -247,8 +247,10 @@
fgetpos((FILE *) fp->pointer, &pos);
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__ANDROID__) || defined(__FreeBSD__)
return (size_t) pos;
-#else
+#elif defined(__GLIBC__)
return (size_t) pos.__pos;
+#else
+ return (size_t) ftell(fp->pointer);
#endif /* _WIN32 || __CYGWIN__ || __APPLE__ || __ANDROID__ */
}
HTS_error(0, "HTS_ftell: Unknown file type.\n");

View File

@ -0,0 +1,42 @@
# Template file for 'flightgear'
pkgname=flightgear
version=3.4.0
revision=1
build_style=cmake
configure_args="-DFG_DATA_DIR:STRING=/usr/share/flightgear/fgdata"
hostmakedepends="cmake fltk pkg-config"
makedepends="MesaLib-devel boost-devel freealut-devel glu-devel libfreeglut-devel fltk-devel
libopenal-devel osg-devel plib-devel simgear"
depends="flightgear-data>=${version}"
short_desc="Sophisticated flight wimulator"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-3"
homepage="http://www.flightgear.org/"
distfiles="
http://ftp.igh.cnrs.fr/pub/flightgear/ftp/Source/flightgear-${version}.tar.bz2
http://ftp.igh.cnrs.fr/pub/flightgear/ftp/Shared/FlightGear-data-${version}.tar.bz2"
checksum="
b5645d05b50728a89f091292bc557f440d8f8719dd9cebf7f5bf3fa8ea795780
8cefa7c323d974d8e51fd23c97ae79dc731e65b81e1729cb1bc9bc1f99df128b"
if [ "$CROSS_BUILD" ]; then
configure_args+=" -DSIMGEAR_COMPILE_TEST_EXITCODE=0"
fi
post_install() {
vinstall package/flightgear.desktop 644 usr/share/applications
vinstall package/flightgear.ico 644 usr/share/icons
vinstall ${FILESDIR}/flightgear.png 644 usr/share/pixmaps
vinstall scripts/completion/fg-completion.bash 644 usr/share/bash-completion/completions/fgfs
sed -i ${DESTDIR}/usr/share/applications/flightgear.desktop \
-e "s;Exec=.*;Exec=fgfs --fg-root=/usr/share/flightgear/fgdata;"
}
flightgear-data_package() {
short_desc+=" - data files"
noarch=yes
pkg_install() {
vmkdir usr/share/flightgear
mv ${XBPS_BUILDDIR}/fgdata ${PKGDESTDIR}/usr/share/flightgear
}
}

View File

@ -0,0 +1,187 @@
--- simgear/canvas/elements/CanvasText.cxx 2015-02-18 21:10:39.000000000 +0100
+++ simgear/canvas/elements/CanvasText.cxx 2015-10-31 11:45:28.423416396 +0100
@@ -159,13 +159,17 @@
if( empty() )
return pos;
-
+#if OSG_VERSION_LESS_THAN(3,3,5)
GlyphQuads::Coords2 const& coords = _quads->_coords;
+#else
+ GlyphQuads::Coords2 refCoords = _quads->_coords;
+ GlyphQuads::Coords2::element_type &coords = *refCoords.get();
+#endif
size_t global_i = _begin + i;
if( global_i == _begin )
// before first character of line
pos.x() = coords[_begin * 4].x();
else if( global_i == _end )
// After Last character of line
pos.x() = coords[(_end - 1) * 4 + 2].x();
@@ -194,7 +198,12 @@
return cursorPos(0);
GlyphQuads::Glyphs const& glyphs = _quads->_glyphs;
+#if OSG_VERSION_LESS_THAN(3,3,5)
GlyphQuads::Coords2 const& coords = _quads->_coords;
+#else
+ GlyphQuads::Coords2 refCoords = _quads->_coords;
+ GlyphQuads::Coords2::element_type &coords = *refCoords.get();
+#endif
float const HIT_FRACTION = 0.6;
float const character_width = _text->getCharacterHeight()
@@ -627,7 +636,12 @@
const GlyphQuads& quads = _textureGlyphQuadMap.begin()->second;
const GlyphQuads::Glyphs& glyphs = quads._glyphs;
- const GlyphQuads::Coords2& coords = quads._coords;
+#if OSG_VERSION_LESS_THAN(3,3,5)
+ GlyphQuads::Coords2 const& coords = quads._coords;
+#else
+ GlyphQuads::Coords2 refCoords = quads._coords;
+ GlyphQuads::Coords2::element_type &coords = *refCoords.get();
+#endif
const GlyphQuads::LineNumbers& line_numbers = quads._lineNumbers;
float wr = _characterHeight / getCharacterAspectRatio();
--- simgear/scene/material/Technique.cxx 2015-02-18 21:10:39.000000000 +0100
+++ simgear/scene/material/Technique.cxx 2015-10-31 11:50:38.266385757 +0100
@@ -326,9 +326,15 @@
= GL2Extensions::Get(static_cast<unsigned>(contextId), true);
if (!extensions)
return;
+#if OSG_VERSION_LESS_THAN(3,3,4)
if (!extensions->isGlslSupported())
return;
value = extensions->getLanguageVersion();
+#else
+ if (!extensions->isGlslSupported)
+ return;
+ value = extensions->glslLanguageVersion;
+#endif
}
};
@@ -357,7 +363,11 @@
= GL2Extensions::Get(static_cast<unsigned>(contextId), true);
if (!extensions)
return;
+#if OSG_VERSION_LESS_THAN(3,3,4)
value = extensions->isGlslSupported();
+#else
+ value = extensions->isGlslSupported;
+#endif
}
};
--- simgear/scene/sky/CloudShaderGeometry.cxx 2015-02-18 21:10:39.000000000 +0100
+++ simgear/scene/sky/CloudShaderGeometry.cxx 2015-10-31 11:53:28.855368888 +0100
@@ -128,7 +128,11 @@
sortData.frameSorted = frameNumber;
}
+#if OSG_VERSION_LESS_THAN(3,3,4)
const Extensions* extensions = getExtensions(state.getContextID(),true);
+#else
+ const GLExtensions* extensions = GLExtensions::Get(state.getContextID(),true);
+#endif
GLfloat ua1[3] = { (GLfloat) alpha_factor,
(GLfloat) shade_factor,
(GLfloat) cloud_height };
--- simgear/scene/tgdb/ShaderGeometry.cxx 2015-02-18 21:10:39.000000000 +0100
+++ simgear/scene/tgdb/ShaderGeometry.cxx 2015-10-31 11:55:05.748359307 +0100
@@ -47,7 +47,11 @@
void ShaderGeometry::drawImplementation(osg::RenderInfo& renderInfo) const
{
State& state = *renderInfo.getState();
+#if OSG_VERSION_LESS_THAN(3,3,4)
const Extensions* extensions = getExtensions(state.getContextID(), true);
+#else
+ const GLExtensions* extensions = GLExtensions::Get(state.getContextID(), true);
+#endif
Vec4Array::const_iterator citer = _posScaleArray->begin();
Vec4Array::const_iterator cend = _posScaleArray->end();
FloatArray::const_iterator viter = _vertexAttribArray->begin();
--- simgear/scene/util/SGSceneFeatures.cxx 2015-02-18 21:10:39.000000000 +0100
+++ simgear/scene/util/SGSceneFeatures.cxx 2015-10-31 12:02:22.654316104 +0100
@@ -25,11 +25,13 @@
#include "SGSceneFeatures.hxx"
+#include <osg/Version>
#include <osg/FragmentProgram>
#include <osg/VertexProgram>
#include <osg/Point>
#include <osg/PointSprite>
#include <osg/Texture>
+#include <osg/GLExtensions>
#include <OpenThreads/Mutex>
#include <OpenThreads/ScopedLock>
@@ -84,12 +84,18 @@
bool
SGSceneFeatures::getHavePointSprites(unsigned contextId) const
{
+#if OSG_VERSION_LESS_THAN(3,3,4)
return osg::PointSprite::isPointSpriteSupported(contextId);
+#else
+ const osg::GLExtensions* ex = osg::GLExtensions::Get(contextId, true);
+ return ex && ex->isPointSpriteSupported;
+#endif
}
bool
SGSceneFeatures::getHaveFragmentPrograms(unsigned contextId) const
{
+#if OSG_VERSION_LESS_THAN(3,3,4)
const osg::FragmentProgram::Extensions* fpe;
fpe = osg::FragmentProgram::getExtensions(contextId, true);
if (!fpe)
@@ -98,11 +104,16 @@
return false;
return true;
+#else
+ const osg::GLExtensions* ex = osg::GLExtensions::Get(contextId, true);
+ return ex && ex->isFragmentProgramSupported;
+#endif
}
bool
SGSceneFeatures::getHaveVertexPrograms(unsigned contextId) const
{
+#if OSG_VERSION_LESS_THAN(3,3,4)
const osg::VertexProgram::Extensions* vpe;
vpe = osg::VertexProgram::getExtensions(contextId, true);
if (!vpe)
@@ -111,6 +122,10 @@
return false;
return true;
+#else
+ const osg::GLExtensions* ex = osg::GLExtensions::Get(contextId, true);
+ return ex && ex->isVertexProgramSupported;
+#endif
}
bool
@@ -124,6 +139,7 @@
bool
SGSceneFeatures::getHavePointParameters(unsigned contextId) const
{
+#if OSG_VERSION_LESS_THAN(3,3,4)
const osg::Point::Extensions* pe;
pe = osg::Point::getExtensions(contextId, true);
if (!pe)
@@ -131,5 +147,9 @@
if (!pe->isPointParametersSupported())
return false;
return true;
+#else
+ const osg::GLExtensions* ex = osg::GLExtensions::Get(contextId, true);
+ return ex && ex->isPointParametersSupported;
+#endif
}

View File

@ -0,0 +1,107 @@
--- simgear/package/md5.h 2015-02-18 21:10:39.000000000 +0100
+++ simgear/package/md5.h 2015-11-01 01:47:16.218143005 +0100
@@ -19,27 +19,23 @@
extern "C" {
#endif
-#if defined(_MSC_VER)
-typedef unsigned char u_int8_t;
-typedef unsigned int u_int32_t;
-typedef unsigned __int64 u_int64_t;
-#endif
+#include <stdint.h>
#define MD5_BLOCK_LENGTH 64
#define MD5_DIGEST_LENGTH 16
#define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1)
typedef struct MD5Context {
- u_int32_t state[4]; /* state */
- u_int64_t count; /* number of bits, mod 2^64 */
- u_int8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
+ uint32_t state[4]; /* state */
+ uint64_t count; /* number of bits, mod 2^64 */
+ uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
} SG_MD5_CTX;
void SG_MD5Init(SG_MD5_CTX *);
-void SG_MD5Update(SG_MD5_CTX *, const u_int8_t *, size_t);
+void SG_MD5Update(SG_MD5_CTX *, const uint8_t *, size_t);
void SG_MD5Pad(SG_MD5_CTX *);
-void SG_MD5Final(u_int8_t [MD5_DIGEST_LENGTH], SG_MD5_CTX *);
-void SG_MD5Transform(u_int32_t [4], const u_int8_t [MD5_BLOCK_LENGTH]);
+void SG_MD5Final(uint8_t [MD5_DIGEST_LENGTH], SG_MD5_CTX *);
+void SG_MD5Transform(uint32_t [4], const uint8_t [MD5_BLOCK_LENGTH]);
#ifdef __cplusplus
} // of extern C
@@ -49,4 +45,4 @@
-
\ Kein Zeilenumbruch am Dateiende.
+
--- simgear/package/md5.c 2015-02-18 21:10:39.000000000 +0100
+++ simgear/package/md5.c 2015-11-01 01:46:42.843144810 +0100
@@ -39,7 +39,7 @@
(cp)[1] = (value) >> 8; \
(cp)[0] = (value); } while (0)
-static u_int8_t PADDING[MD5_BLOCK_LENGTH] = {
+static uint8_t PADDING[MD5_BLOCK_LENGTH] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -73,7 +73,7 @@
need = MD5_BLOCK_LENGTH - have;
/* Update bitcount */
- ctx->count += (u_int64_t)len << 3;
+ ctx->count += (uint64_t)len << 3;
if (len >= need) {
if (have != 0) {
@@ -104,7 +104,7 @@
void
SG_MD5Pad(SG_MD5_CTX *ctx)
{
- u_int8_t count[8];
+ uint8_t count[8];
size_t padlen;
/* Convert count to 8 bytes in little endian order. */
@@ -154,19 +154,19 @@
* the data and converts bytes into longwords for this routine.
*/
void
-SG_MD5Transform(u_int32_t state[4], const u_int8_t block[MD5_BLOCK_LENGTH])
+SG_MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_LENGTH])
{
- u_int32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4];
+ uint32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4];
#ifndef WORDS_BIGENDIAN
memcpy(in, block, sizeof(in));
#else
for (a = 0; a < MD5_BLOCK_LENGTH / 4; a++) {
- in[a] = (u_int32_t)(
- (u_int32_t)(block[a * 4 + 0]) |
- (u_int32_t)(block[a * 4 + 1]) << 8 |
- (u_int32_t)(block[a * 4 + 2]) << 16 |
- (u_int32_t)(block[a * 4 + 3]) << 24);
+ in[a] = (uint32_t)(
+ (uint32_t)(block[a * 4 + 0]) |
+ (uint32_t)(block[a * 4 + 1]) << 8 |
+ (uint32_t)(block[a * 4 + 2]) << 16 |
+ (uint32_t)(block[a * 4 + 3]) << 24);
}
#endif
@@ -247,4 +247,4 @@
state[1] += b;
state[2] += c;
state[3] += d;
-}
\ Kein Zeilenumbruch am Dateiende.
+}

22
srcpkgs/simgear/template Normal file
View File

@ -0,0 +1,22 @@
# Template file for 'simgear'
pkgname=simgear
version=3.4.0
revision=1
# XXX: always keep in sync with flightgear version!
build_style=cmake
configure_args="-DENABLE_TESTS=OFF $(vopt_if svn '-DENABLE_LIBSVN=ON' '-DENABLE_LIBSVN=OFF')"
hostmakedepends="cmake pkg-config"
makedepends="boost-devel expat-devel freetype-devel libjpeg-turbo-devel giflib-devel
libopenal-devel osg-devel plib-devel $(vopt_if svn libsvn)"
short_desc="Simulation engine for FlightGear - static libraries"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-2"
homepage="http://www.flightgear.org/"
distfiles="http://mirrors.ibiblio.org/pub/mirrors/simgear/ftp/Source/simgear-${version}.tar.bz2"
checksum=927d66fe72aacb9dacced4506430bd5fc7726bc8d3d07d6f1866bc4cb11a5894
build_options="svn"
desc_option_svn="Enable support for subversion scenery fetching"
if [ -z "$CROSS_BUILD" ]; then
build_options_default="svn"
fi