Commit b23092c4 authored by J0WI's avatar J0WI

testing/flightgear: upgrade to 2020.3.5

parent 53ea3224
Pipeline #72222 failed with stages
in 51 minutes and 13 seconds
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:
pkgname=flightgear
pkgver=2019.1.1
pkgrel=3
pkgver=2020.3.5
pkgrel=0
pkgdesc="Sophisticated flight simulator"
url="http://flightgear.org"
arch="x86_64" # openscenegraph availability
arch="" # FTBFS, !16887
url="https://www.flightgear.org/"
arch="all !s390x !mips !mips64" # openscenegraph availability
license="GPL"
makedepends="$depends_dev boost-dev cmake curl-dev dbus-dev eudev-dev
freeglut-dev glew-dev libx11-dev libxi-dev libxmu-dev mesa-dev
openal-soft-dev openscenegraph-dev plib qt5-qtbase-dev
freeglut-dev glew-dev libexecinfo-dev libx11-dev libxi-dev libxmu-dev
mesa-dev openal-soft-dev openscenegraph-dev plib qt5-qtbase-dev
qt5-qtdeclarative-dev qt5-qtsvg-dev simgear-dev zlib-dev"
install="$pkgname.post-install"
subpackages="$pkgname-doc $pkgname-dbg"
options="!check" # FIXME test suite does not get built
source="https://downloads.sourceforge.net/project/flightgear/release-${pkgver%.[1-9]*}/flightgear-$pkgver.tar.bz2
fix-navcache.patch
musl-fixes.patch
fix-boost.patch
"
build() {
cmake \
-D BUILD_TESTING=ON \
-D CMAKE_BUILD_TYPE="Release" \
-D CMAKE_BUILD_TYPE=None \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_SYSCONFDIR=/etc/$pkgname \
-D FG_DATA_DIR=/var/lib/$pkgname \
......@@ -40,6 +37,6 @@ package() {
make DESTDIR="$pkgdir" install
}
sha512sums="edcc464af0bde4766e61137211276d77a6bb297567b0168dfaf3b97fdb9a595e5e8a0b84232680fcc975cf195261b9751edb79ae73123333feb31ab3d7215d8c flightgear-2019.1.1.tar.bz2
3350de9e465dc4f865d2a94d96b2f79b4c98c994fc4713cfa296c20ed12129f310779171b89639f69d1e4f5f0103fca6cc01df5a9e25d77f93a0b4e76f6b973a musl-fixes.patch
089d02f47595c2ebb97c1ad23691d5393365d738b497c8d4113328215e78505d844cb321e1fd4838c9bc3792a5cad1f83821419f5ad7fbec90769022c3b79854 fix-boost.patch"
sha512sums="7bd807daea330bf0e12fd0b797c54895dc9ceda98a67dbf36377bf6a4ab74c0e3cff218c4e9796c87fcac886436f1810848e0f4a8ab272fc516178f6d2d6fd0f flightgear-2020.3.5.tar.bz2
7dfe580ff6ac1f569ffa6df2f2ca9b2adae03df9c8ad8be52d4d5ad7917b430ca1cd97e5c2181d705c84e77d840c5bb8f24072e746a672d352b56ffae0b4efb5 fix-navcache.patch
40f7fb15d9f842d7c40d5ca033683911ba34d112af6cb75859f7df751df02409869798553afcf4133f4ce46f57e569345d5d9eac6b81874e831146ee55e9dc4e musl-fixes.patch"
Taken from Gentoo
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -515,7 +515,7 @@
set(NOMINMAX 1)
endif(WIN32)
-set (BOOST_CXX_FLAGS "-DBOOST_BIMAP_DISABLE_SERIALIZATION")
+set (BOOST_CXX_FLAGS "-DBOOST_BIMAP_DISABLE_SERIALIZATION -DBOOST_NO_STDLIB_CONFIG")
# append the SIMD flags if requested
if (ENABLE_SIMD)
Revert "NavCache: add duplicate rebuild protection for Unixes"
This reverts commit 499dc79584d08a6e5204a9c03abd74a8a9314e2c.
diff --git a/src/Navaids/NavDataCache.cxx b/src/Navaids/NavDataCache.cxx
index 1e28d69..5b12377 100644
--- a/src/Navaids/NavDataCache.cxx
+++ b/src/Navaids/NavDataCache.cxx
@@ -49,9 +49,6 @@
#if defined(SG_WINDOWS)
#define WIN32_LEAN_AND_MEAN // less crap :)
#include <Windows.h>
-#else
-# include <sys/file.h>
-#include <unistd.h>
#endif
// SimGear
@@ -1398,91 +1395,34 @@ bool NavDataCache::isRebuildRequired()
#if defined(SG_WINDOWS)
static HANDLE static_fgNavCacheRebuildMutex = nullptr;
-#else
-const std::string static_rebuildLockFile = "fgfs_cache_rebuild.lock";
-static int static_rebuildLockFileFd = -1;
#endif
-enum RebuildLockStatus {
- RebuildLockFailed = 0,
- RebuildLockAlreadyLocked,
- RebuildLockOk
-};
-RebuildLockStatus accquireRebuildLock()
+NavDataCache::RebuildPhase NavDataCache::rebuild()
{
#if defined(SG_WINDOWS)
if (static_fgNavCacheRebuildMutex == nullptr) {
// avoid multiple copies racing on the nav-cache build
static_fgNavCacheRebuildMutex = CreateMutexA(nullptr, FALSE, "org.flightgear.fgfs.rebuild-navcache");
if (static_fgNavCacheRebuildMutex == nullptr) {
- SG_LOG(SG_IO, SG_ALERT, "Failed to create NavCache rebuild mutex");
- return RebuildLockFailed;
- }
-
- if (GetLastError() == ERROR_ALREADY_EXISTS) {
- return RebuildLockAlreadyLocked;
+ flightgear::fatalMessageBoxThenExit("Multiple copies of Flightgear initializing",
+ "Failed to create mutex for nav-cache rebuild protection:" + std::to_string(GetLastError()));
+ } else if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ flightgear::fatalMessageBoxThenExit("Multiple copies of Flightgear initializing",
+ "Multiple copies of FlightGear are trying to initialise the same navigation database. "
+ "This means something has gone badly wrong: please report this error.");
}
// accquire the mutex, so that other processes can check the status.
const int result = WaitForSingleObject(static_fgNavCacheRebuildMutex, 100);
if (result != WAIT_OBJECT_0) {
- SG_LOG(SG_IO, SG_ALERT, "Failed to lock NavCache rebuild mutex:" << GetLastError());
- return RebuildLockFailed;
- }
- }
-#else
- SGPath lockPath(globals->get_fg_home(), static_rebuildLockFile);
- std::string ps = lockPath.utf8Str();
- static_rebuildLockFileFd = ::open(ps.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644);
- if (static_rebuildLockFileFd < 0) {
- SG_LOG(SG_IO, SG_ALERT, "Failed to create rebuild lock file (" << lockPath << "):" << simgear::strutils::error_string(errno));
- return RebuildLockFailed;
- }
- int err = ::flock(static_rebuildLockFileFd, LOCK_EX | LOCK_NB);
- if (err < 0) {
- if (errno == EWOULDBLOCK) {
- return RebuildLockAlreadyLocked;
+ flightgear::fatalMessageBoxThenExit("Multiple copies of Flightgear initializing",
+ "Failed to lock mutex for nav-cache rebuild protection:" + std::to_string(GetLastError()));
}
-
- SG_LOG(SG_IO, SG_ALERT, "Failed to lock file (" << lockPath << "):" << simgear::strutils::error_string(errno));
- return RebuildLockFailed;
}
-
#endif
- return RebuildLockOk;
-}
-
-static void releaseRebuildLock()
-{
-#if defined(SG_WINDOWS)
- ReleaseMutex(static_fgNavCacheRebuildMutex);
-#else
- int err = ::flock(static_rebuildLockFileFd, LOCK_UN);
- if (err < 0) {
- SG_LOG(SG_IO, SG_ALERT, "Failed to unlock rebuild file:" << simgear::strutils::error_string(errno));
- }
- ::close(static_rebuildLockFileFd);
- SGPath lockPath(globals->get_fg_home(), static_rebuildLockFile);
- lockPath.remove();
-#endif
-}
-
-
-NavDataCache::RebuildPhase NavDataCache::rebuild()
-{
if (!d->rebuilder.get()) {
- auto r = accquireRebuildLock();
- if (r == RebuildLockAlreadyLocked) {
- flightgear::fatalMessageBoxThenExit("Multiple copies of Flightgear initializing",
- "Multiple copies of FlightGear are trying to initialise the same navigation database. "
- "This means something has gone badly wrong: please report this error.");
- } else if (r == RebuildLockFailed) {
- flightgear::fatalMessageBoxThenExit("Multiple copies of Flightgear initializing",
- "Failed to initialise NavCache rebuild protection");
- }
-
d->rebuilder.reset(new RebuildThread(this));
d->rebuilder->start();
}
@@ -1491,7 +1431,9 @@ NavDataCache::RebuildPhase NavDataCache::rebuild()
RebuildPhase phase = d->rebuilder->currentPhase();
if (phase == REBUILD_DONE) {
d->rebuilder.reset(); // all done!
- releaseRebuildLock();
+#if defined(SG_WINDOWS)
+ ReleaseMutex(static_fgNavCacheRebuildMutex);
+#endif
}
return phase;
}
@@ -1528,31 +1470,7 @@ bool NavDataCache::isAnotherProcessRebuilding()
// the GU should wait.
return true;
#else
- SGPath lockPath(globals->get_fg_home(), static_rebuildLockFile);
- std::string ps = lockPath.utf8Str();
- static_rebuildLockFileFd = ::open(ps.c_str(), O_RDONLY, 0644);
- if (static_rebuildLockFileFd < 0) {
- if (errno == ENOENT) {
- return false; // no such file, easy
- }
-
- SG_LOG(SG_IO, SG_ALERT, "Error opening lock file:" << simgear::strutils::error_string(errno));
- return false;
- }
-
- int err = ::flock(static_rebuildLockFileFd, LOCK_EX | LOCK_NB);
- if (err < 0) {
- if (errno == EWOULDBLOCK) {
- return true;
- }
-
- SG_LOG(SG_IO, SG_ALERT, "Error querying lock file:" << simgear::strutils::error_string(errno));
- return false;
- }
-
- // release it again, so any *other* waiting copies can also succeed
- ::flock(static_rebuildLockFileFd, LOCK_UN);
- return false;
+ return false; // not implemented on macOS / Linux for now
#endif
}
......@@ -31,28 +31,6 @@ include only if __GLIB__ is defined.
#include <error.h>
#endif
#endif
--- a/src/Main/bootstrap.cxx 2017-03-17 09:52:07.474706542 +0100
+++ b/src/Main/bootstrap.cxx 2017-03-17 09:53:40.361793507 +0100
@@ -141,7 +141,7 @@
}
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) && defined(__GLIBC__)
#include <execinfo.h>
#include <cxxabi.h>
void segfault_handler(int signo) {
@@ -244,8 +244,10 @@
signal(SIGPIPE, SIG_IGN);
# ifndef NDEBUG
+# ifdef __GLIBC__
signal(SIGSEGV, segfault_handler);
# endif
+# endif
#endif
_bootstrap_OSInit = 0;
--- a/src/FDM/JSBSim/JSBSim.cpp 2017-03-01 21:06:31.000000000 +0100
+++ b/src/FDM/JSBSim/JSBSim.cpp 2017-03-17 09:49:13.115544107 +0100
@@ -287,7 +287,7 @@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment