Skip to content

Commit

Permalink
supercell-wx: init at 0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
aware70 committed Oct 26, 2024
1 parent 989ae4e commit a3cf298
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 0 deletions.
158 changes: 158 additions & 0 deletions pkgs/applications/science/meteorology/supercell-wx/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
stdenv,
lib,
fetchFromGitHub,
aws-sdk-cpp,
bzip2,
cmake,
ninja,
zlib,
openssl,
curl,
glew,
geos,
git,
boost185,
spdlog,
stb,
libcpr_1_10_5,
libpng,
libSM,
geographiclib,
howard-hinnant-date,
re2,
gtest,
glm,
qtbase,
qttools,
qtmultimedia,
qtpositioning,
qtimageformats,
tbb_2021_11,
tzdata,
substituteAll,
python3,
wrapQtAppsHook,
}:
let
version = "0.4.4";
src = fetchFromGitHub {
owner = "dpaulat";
repo = "supercell-wx";
rev = "refs/tags/v${version}-release";
sha256 = "sha256-HghyRFLKboztQEOsvN2VaSxxcuPPu1GIakBNWRIWBOk=";
fetchSubmodules = true;
};

gtestSkip = [
# Skip tests requiring network access
"AwsLevel*DataProvider.FindKeyNow"
"AwsLevel*DataProvider.FindKeyFixed"
"AwsLevel*DataProvider.LoadObjectByKey"
"AwsLevel*DataProvider.Refresh"
"AwsLevel*DataProvider.GetAvailableProducts"
"AwsLevel*DataProvider.GetTimePointsByDate"
"AwsLevel*DataProvider.Prune"
"UpdateManagerTest.CheckForUpdates"
"WarningsProvider*\"https"

# These tests are failing (seemingly can't overwrite a file created by earlier test).
"SettingsManager/DefaultSettingsTest*"
"SettingsManager/BadSettingsTest*"
];
in
stdenv.mkDerivation {
name = "supercell-wx";
inherit version;
inherit src;

meta = {
homepage = "https://supercell-wx.rtfd.io";
downloadPage = "https://github.com/dpaulat/supercell-wx/releases";
description = "Provides live visualization of NEXRAD weather data and alerts.";
longDescription = ''
Supercell Wx is a free, open source application to visualize live and
archive NEXRAD Level 2 and Level 3 data, and severe weather alerts.
It displays continuously updating weather data on top of a responsive
map, providing the capability to monitor weather events using
reflectivity, velocity, and other products.
'';
license = lib.licenses.mit;
mainProgram = "supercell-wx";
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ aware70 ];
};

CXXFLAGS = "-Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations";
env.GTEST_FILTER = "-${lib.concatStringsSep ":" gtestSkip}";

doCheck = true;

# These tests aren't built by 'all', but ctest still tries to run them.
cmakeFlags = [
"-DCMAKE_CTEST_ARGUMENTS=-E;'test_mln_core|test_mln_widgets'"
];

patches = [
# These are for Nix compatibility {{{
./patches/use-find-package.patch # Replace some vendored dependencies with Nix provided versions
(substituteAll {
# Skip tagging build with git version, and substitute it with the src revision (still uses current year timestamp)
src = ./patches/skip-git-versioning.patch;
rev = src.rev;
})
# Prevents using some Qt scripts that seemed to break the install step. Fixes missing link to some targets.
./patches/fix-cmake-install.patch
# }}}

# These may be submitted upstream {{{
./patches/add-cstdint.patch # use <cstdint> for GCC 13 compatibility
./patches/fix-zoned-time.patch # fix ambiguity of some date/chrono functions in GCC 13
./patches/fix-audio-codec-setup.patch # fix apparent logic error when checking for supported audio codecs on launch
# }}}
];

# This also may be submitted upstream to maplibre-native-qt, which is currently vendored
postPatch = ''
substituteInPlace external/maplibre-native-qt/src/core/CMakeLists.txt \
--replace-fail "CMAKE_SOURCE_DIR" "PROJECT_SOURCE_DIR"
'';

nativeBuildInputs = [
cmake
ninja
wrapQtAppsHook
];

buildInputs = [
zlib
openssl
curl
qtbase
qttools
qtmultimedia
qtpositioning
qtimageformats
aws-sdk-cpp
howard-hinnant-date
boost185
tbb_2021_11
glew
geos
spdlog
stb
libcpr_1_10_5
libpng
libSM
re2
openssl
geographiclib
gtest
glm
bzip2
(python3.withPackages (ps: [
ps.geopandas
ps.gitpython
]))
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/scwx-qt/source/scwx/qt/settings/settings_interface.hpp b/scwx-qt/source/scwx/qt/settings/settings_interface.hpp
index f5f5bb4..27afba4 100644
--- a/scwx-qt/source/scwx/qt/settings/settings_interface.hpp
+++ b/scwx-qt/source/scwx/qt/settings/settings_interface.hpp
@@ -6,6 +6,7 @@
#include <memory>
#include <string>
#include <vector>
+#include <cstdint>

namespace scwx
{
diff --git a/wxdata/include/scwx/common/vcp.hpp b/wxdata/include/scwx/common/vcp.hpp
index 9d95c7a..de6cb58 100644
--- a/wxdata/include/scwx/common/vcp.hpp
+++ b/wxdata/include/scwx/common/vcp.hpp
@@ -1,6 +1,7 @@
#pragma once

#include <string>
+#include <cstdint>

namespace scwx
{
diff --git a/wxdata/include/scwx/util/digest.hpp b/wxdata/include/scwx/util/digest.hpp
index e0bbc3c..3602e4e 100644
--- a/wxdata/include/scwx/util/digest.hpp
+++ b/wxdata/include/scwx/util/digest.hpp
@@ -2,6 +2,7 @@

#include <istream>
#include <vector>
+#include <cstdint>

#include <openssl/evp.h>

diff --git a/wxdata/include/scwx/util/strings.hpp b/wxdata/include/scwx/util/strings.hpp
index e282133..4d6e6eb 100644
--- a/wxdata/include/scwx/util/strings.hpp
+++ b/wxdata/include/scwx/util/strings.hpp
@@ -3,6 +3,7 @@
#include <optional>
#include <string>
#include <vector>
+#include <cstdint>

namespace scwx
{
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/scwx-qt/source/scwx/qt/ui/setup/audio_codec_page.cpp b/scwx-qt/source/scwx/qt/ui/setup/audio_codec_page.cpp
index 2830ed3..8617ed0 100644
--- a/scwx-qt/source/scwx/qt/ui/setup/audio_codec_page.cpp
+++ b/scwx-qt/source/scwx/qt/ui/setup/audio_codec_page.cpp
@@ -167,7 +167,7 @@ bool AudioCodecPage::IsRequired()
// Setup is required if codec errors are not ignored, and the default codecs
// are not supported
return (!ignoreCodecErrors &&
- oggCodecs.contains(QMediaFormat::AudioCodec::Vorbis));
+ !oggCodecs.contains(QMediaFormat::AudioCodec::Vorbis));
}

} // namespace setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake
index cda6c7f..32d807a 100644
--- a/scwx-qt/scwx-qt.cmake
+++ b/scwx-qt/scwx-qt.cmake
@@ -601,6 +601,7 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets
Boost::json
Boost::timer
QMapLibre::Core
+ QMapLibre::Widgets
$<$<CXX_COMPILER_ID:MSVC>:opengl32>
Fontconfig::Fontconfig
GeographicLib::GeographicLib
@@ -615,40 +616,13 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets
target_link_libraries(supercell-wx PRIVATE scwx-qt
wxdata)

-# Set DT_RUNPATH for Linux targets
-set_target_properties(MLNQtCore PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib") # QMapLibre::Core
-set_target_properties(supercell-wx PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib")
-
install(TARGETS supercell-wx
- MLNQtCore # QMapLibre::Core
- RUNTIME_DEPENDENCIES
- PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" "qt6"
- POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
- "^(/usr)?/lib/.*\\.so(\\..*)?"
RUNTIME
COMPONENT supercell-wx
LIBRARY
COMPONENT supercell-wx
OPTIONAL)

-# NO_TRANSLATIONS is needed for Qt 6.5.0 (will be fixed in 6.5.1)
-# https://bugreports.qt.io/browse/QTBUG-112204
-qt_generate_deploy_app_script(TARGET MLNQtCore # QMapLibre::Core
- OUTPUT_SCRIPT deploy_script_qmaplibre_core
- NO_TRANSLATIONS
- NO_UNSUPPORTED_PLATFORM_ERROR)
-
-qt_generate_deploy_app_script(TARGET supercell-wx
- OUTPUT_SCRIPT deploy_script_scwx
- NO_TRANSLATIONS
- NO_UNSUPPORTED_PLATFORM_ERROR)
-
-install(SCRIPT ${deploy_script_qmaplibre_core}
- COMPONENT supercell-wx)
-
-install(SCRIPT ${deploy_script_scwx}
- COMPONENT supercell-wx)
-
if (MSVC)
set(CPACK_PACKAGE_NAME "Supercell Wx")
set(CPACK_PACKAGE_VENDOR "Dan Paulat")
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/wxdata/source/scwx/util/time.cpp b/wxdata/source/scwx/util/time.cpp
index 0149e33..ed66072 100644
--- a/wxdata/source/scwx/util/time.cpp
+++ b/wxdata/source/scwx/util/time.cpp
@@ -71,26 +71,26 @@ std::string TimeString(std::chrono::system_clock::time_point time,
{
if (timeZone != nullptr)
{
- zoned_time zt = {timeZone, timeInSeconds};
+ date::zoned_time zt = {timeZone, timeInSeconds};

if (clockFormat == ClockFormat::_24Hour)
{
- os << format(FORMAT_STRING_24_HOUR, zt);
+ os << date::format(FORMAT_STRING_24_HOUR, zt);
}
else
{
- os << format(FORMAT_STRING_12_HOUR, zt);
+ os << date::format(FORMAT_STRING_12_HOUR, zt);
}
}
else
{
if (clockFormat == ClockFormat::_24Hour)
{
- os << format(FORMAT_STRING_24_HOUR, timeInSeconds);
+ os << date::format(FORMAT_STRING_24_HOUR, timeInSeconds);
}
else
{
- os << format(FORMAT_STRING_12_HOUR, timeInSeconds);
+ os << date::format(FORMAT_STRING_12_HOUR, timeInSeconds);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/scwx-qt/tools/generate_versions.py b/scwx-qt/tools/generate_versions.py
index e7c470e..dde3e4f 100644
--- a/scwx-qt/tools/generate_versions.py
+++ b/scwx-qt/tools/generate_versions.py
@@ -74,15 +74,8 @@ def CollectVersionInfo(args):

versionInfo = VersionInfo()

- repo = git.Repo(args.gitRepo_, search_parent_directories = True)
-
- commitString = str(repo.head.commit)[:10]
-
- if not repo.is_dirty(submodules = False):
- copyrightYear = datetime.datetime.fromtimestamp(repo.head.commit.committed_date).year
- else:
- commitString = commitString + "+dirty"
- copyrightYear = datetime.date.today().year
+ commitString = "@rev@"
+ copyrightYear = datetime.date.today().year

versionInfo.commitString_ = commitString
versionInfo.copyrightYear_ = copyrightYear
Loading

0 comments on commit a3cf298

Please sign in to comment.