Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supercell-wx: init at 0.4.4 #316266

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2221,6 +2221,11 @@
githubId = 206242;
name = "Andreas Wiese";
};
aware70 = {
name = "aware70";
github = "aware70";
githubId = 7832566;
};
ayazhafiz = {
email = "ayaz.hafiz.1@gmail.com";
github = "hafiz";
Expand Down
155 changes: 155 additions & 0 deletions pkgs/by-name/su/supercell-wx/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
aws-sdk-cpp,
bzip2,
cmake,
ninja,
zlib,
openssl,
curl,
glew,
geos,
boost185,
spdlog,
stb,
libcpr_1_10_5,
libpng,
libSM,
geographiclib,
howard-hinnant-date,
re2,
gtest,
glm,
qt6,
tbb_2021_11,
tzdata,
substituteAll,
python3,
}:
let
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 (finalAttrs: {
pname = "supercell-wx";
version = "0.4.4";
src = fetchFromGitHub {
owner = "dpaulat";
repo = "supercell-wx";
rev = "refs/tags/v${finalAttrs.version}-release";
sha256 = "sha256-HghyRFLKboztQEOsvN2VaSxxcuPPu1GIakBNWRIWBOk=";
fetchSubmodules = true;
};

meta = {
homepage = "https://supercell-wx.rtfd.io";
downloadPage = "https://github.com/dpaulat/supercell-wx/releases";
description = "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 = finalAttrs.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
# fix apparent logic error when checking for supported audio codecs on launch
(fetchpatch {
name = "fix-audio-codec-setup.diff";
url = "https://patch-diff.githubusercontent.com/raw/dpaulat/supercell-wx/pull/223.diff";
sha256 = "sha256-sGw/vwJVNcWD56z/cG0VMZo+daQXb/I0+zbG3Gr18lU=";
})
# }}}
];

# 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
qt6.wrapQtAppsHook
];

buildInputs = [
zlib
openssl
curl
qt6.qtbase
qt6.qttools
qt6.qtmultimedia
qt6.qtpositioning
qt6.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
]))
];
})
48 changes: 48 additions & 0 deletions pkgs/by-name/su/supercell-wx/patches/add-cstdint.patch
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
{
53 changes: 53 additions & 0 deletions pkgs/by-name/su/supercell-wx/patches/fix-cmake-install.patch
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")
36 changes: 36 additions & 0 deletions pkgs/by-name/su/supercell-wx/patches/fix-zoned-time.patch
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);
}
}
}
22 changes: 22 additions & 0 deletions pkgs/by-name/su/supercell-wx/patches/skip-git-versioning.patch
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