supercell-wx: init at 0.4.8

aware70 e05745ad 018cb798

+349
+167
pkgs/by-name/su/supercell-wx/package.nix
··· 1 + { 2 + stdenv, 3 + lib, 4 + fetchFromGitHub, 5 + fetchpatch, 6 + aws-sdk-cpp, 7 + bzip2, 8 + cmake, 9 + ninja, 10 + zlib, 11 + openssl, 12 + curl, 13 + glew, 14 + geos, 15 + boost, 16 + spdlog, 17 + stb, 18 + libcpr, 19 + libpng, 20 + libSM, 21 + geographiclib, 22 + howard-hinnant-date, 23 + re2, 24 + gtest, 25 + glm, 26 + qt6, 27 + tbb_2021_11, 28 + tracy, 29 + substituteAll, 30 + python3, 31 + }: 32 + let 33 + gtestSkip = [ 34 + # Skip tests requiring network access 35 + "AwsLevel*DataProvider.FindKeyNow" 36 + "AwsLevel*DataProvider.FindKeyFixed" 37 + "AwsLevel*DataProvider.LoadObjectByKey" 38 + "AwsLevel*DataProvider.Refresh" 39 + "AwsLevel*DataProvider.GetAvailableProducts" 40 + "AwsLevel*DataProvider.GetTimePointsByDate" 41 + "AwsLevel*DataProvider.Prune" 42 + "UpdateManagerTest.CheckForUpdates" 43 + "WarningsProvider*\"https" 44 + 45 + # These tests are failing (seemingly can't overwrite a file created by earlier test). 46 + "SettingsManager/DefaultSettingsTest*" 47 + "SettingsManager/BadSettingsTest*" 48 + "MarkerModelTest.*" 49 + ]; 50 + in 51 + stdenv.mkDerivation (finalAttrs: { 52 + pname = "supercell-wx"; 53 + version = "0.4.8"; 54 + src = fetchFromGitHub { 55 + owner = "dpaulat"; 56 + repo = "supercell-wx"; 57 + rev = "refs/tags/v${finalAttrs.version}-release"; 58 + sha256 = "sha256-gKR5Mfzw5B4f4/dWintlbDHX3q+d1RmFE+MNp5uSSuc="; 59 + fetchSubmodules = true; 60 + }; 61 + 62 + meta = { 63 + homepage = "https://supercell-wx.rtfd.io"; 64 + downloadPage = "https://github.com/dpaulat/supercell-wx/releases"; 65 + description = "Live visualization of NEXRAD weather data and alerts"; 66 + longDescription = '' 67 + Supercell Wx is a free, open source application to visualize live and 68 + archive NEXRAD Level 2 and Level 3 data, and severe weather alerts. 69 + It displays continuously updating weather data on top of a responsive 70 + map, providing the capability to monitor weather events using 71 + reflectivity, velocity, and other products. 72 + ''; 73 + license = lib.licenses.mit; 74 + mainProgram = "supercell-wx"; 75 + platforms = [ 76 + "x86_64-linux" 77 + # "aarch64-linux" 78 + ]; 79 + maintainers = with lib.maintainers; [ aware70 ]; 80 + }; 81 + 82 + env.CXXFLAGS = "-Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=stringop-overflow"; 83 + env.GTEST_FILTER = "-${lib.concatStringsSep ":" gtestSkip}"; 84 + 85 + doCheck = true; 86 + 87 + # These tests aren't built by 'all', but ctest still tries to run them. 88 + cmakeFlags = [ 89 + "-DCMAKE_CTEST_ARGUMENTS=-E;'test_mln_core|test_mln_widgets'" 90 + "-DSTB_INCLUDE_DIR=${stb}/include/stb" 91 + "-DFETCHCONTENT_SOURCE_DIR_TRACY=${tracy.src}" 92 + ]; 93 + 94 + patches = [ 95 + # These are for Nix compatibility {{{ 96 + ./patches/use-find-package.patch # Replace some vendored dependencies with Nix provided versions 97 + (substituteAll { 98 + # Skip tagging build with git version, and substitute it with the src revision (still uses current year timestamp) 99 + src = ./patches/skip-git-versioning.patch; 100 + rev = finalAttrs.src.rev; 101 + }) 102 + # Prevents using some Qt scripts that seemed to break the install step. Fixes missing link to some targets. 103 + ./patches/fix-cmake-install.patch 104 + # }}} 105 + 106 + # These may be or already are submitted upstream {{{ 107 + ./patches/explicit-link-aws-crt.patch # fix missing symbols from aws-crt-cpp 108 + # }}} 109 + ]; 110 + 111 + # This also may be submitted upstream to maplibre-native-qt, which is currently vendored 112 + postPatch = '' 113 + substituteInPlace external/maplibre-native-qt/src/core/CMakeLists.txt \ 114 + --replace-fail "CMAKE_SOURCE_DIR" "PROJECT_SOURCE_DIR" 115 + ''; 116 + 117 + nativeBuildInputs = [ 118 + cmake 119 + ninja 120 + qt6.wrapQtAppsHook 121 + ]; 122 + 123 + buildInputs = [ 124 + zlib 125 + openssl 126 + qt6.qtbase 127 + qt6.qttools 128 + qt6.qtmultimedia 129 + qt6.qtpositioning 130 + qt6.qtimageformats 131 + aws-sdk-cpp 132 + howard-hinnant-date 133 + boost 134 + tbb_2021_11 135 + glew 136 + geos 137 + spdlog 138 + stb 139 + libcpr 140 + libpng 141 + libSM 142 + re2 143 + openssl 144 + # FIXME: split outputs aren't working with find_package. Possibly related to nixpkgs/issues/144170 ? 145 + (geographiclib.overrideAttrs { 146 + outputs = [ "out" ]; 147 + }) 148 + gtest 149 + glm 150 + bzip2 151 + (python3.withPackages (ps: [ 152 + ps.geopandas 153 + ])) 154 + ]; 155 + 156 + # Currently crashes on wayland; must force X11 157 + qtWrapperArgs = [ 158 + "--set QT_QPA_PLATFORM xcb" 159 + ]; 160 + 161 + # Install .desktop file and icons 162 + postInstall = '' 163 + install -m0644 -D "$src/scwx-qt/res/linux/supercell-wx.desktop" "$out/share/applications/supercell-wx.desktop" 164 + install -m0644 -D "$src/scwx-qt/res/icons/scwx-256.png" "$out/share/icons/hicolor/256x256/apps/supercell-wx.png" 165 + install -m0644 -D "$src/scwx-qt/res/icons/scwx-64.png" "$out/share/icons/hicolor/64x64/apps/supercell-wx.png" 166 + ''; 167 + })
+53
pkgs/by-name/su/supercell-wx/patches/fix-cmake-install.patch
··· 1 + diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake 2 + index cda6c7f..32d807a 100644 3 + --- a/scwx-qt/scwx-qt.cmake 4 + +++ b/scwx-qt/scwx-qt.cmake 5 + @@ -601,6 +601,7 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets 6 + Boost::json 7 + Boost::timer 8 + QMapLibre::Core 9 + + QMapLibre::Widgets 10 + $<$<CXX_COMPILER_ID:MSVC>:opengl32> 11 + Fontconfig::Fontconfig 12 + GeographicLib::GeographicLib 13 + @@ -615,40 +616,13 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets 14 + target_link_libraries(supercell-wx PRIVATE scwx-qt 15 + wxdata) 16 + 17 + -# Set DT_RUNPATH for Linux targets 18 + -set_target_properties(MLNQtCore PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib") # QMapLibre::Core 19 + -set_target_properties(supercell-wx PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib") 20 + - 21 + install(TARGETS supercell-wx 22 + - MLNQtCore # QMapLibre::Core 23 + - RUNTIME_DEPENDENCIES 24 + - PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" "qt6" 25 + - POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" 26 + - "^(/usr)?/lib/.*\\.so(\\..*)?" 27 + RUNTIME 28 + COMPONENT supercell-wx 29 + LIBRARY 30 + COMPONENT supercell-wx 31 + OPTIONAL) 32 + 33 + -# NO_TRANSLATIONS is needed for Qt 6.5.0 (will be fixed in 6.5.1) 34 + -# https://bugreports.qt.io/browse/QTBUG-112204 35 + -qt_generate_deploy_app_script(TARGET MLNQtCore # QMapLibre::Core 36 + - OUTPUT_SCRIPT deploy_script_qmaplibre_core 37 + - NO_TRANSLATIONS 38 + - NO_UNSUPPORTED_PLATFORM_ERROR) 39 + - 40 + -qt_generate_deploy_app_script(TARGET supercell-wx 41 + - OUTPUT_SCRIPT deploy_script_scwx 42 + - NO_TRANSLATIONS 43 + - NO_UNSUPPORTED_PLATFORM_ERROR) 44 + - 45 + -install(SCRIPT ${deploy_script_qmaplibre_core} 46 + - COMPONENT supercell-wx) 47 + - 48 + -install(SCRIPT ${deploy_script_scwx} 49 + - COMPONENT supercell-wx) 50 + - 51 + if (MSVC) 52 + set(CPACK_PACKAGE_NAME "Supercell Wx") 53 + set(CPACK_PACKAGE_VENDOR "Dan Paulat")
+50
pkgs/by-name/su/supercell-wx/patches/skip-git-versioning.patch
··· 1 + diff --git a/scwx-qt/tools/generate_versions.py b/scwx-qt/tools/generate_versions.py 2 + index c6c94020..3fcdcf08 100644 3 + --- a/scwx-qt/tools/generate_versions.py 4 + +++ b/scwx-qt/tools/generate_versions.py 5 + @@ -1,6 +1,5 @@ 6 + import argparse 7 + import datetime 8 + -import git 9 + import json 10 + import os 11 + import pathlib 12 + @@ -110,27 +109,22 @@ def ParseArguments(): 13 + required = True) 14 + return parser.parse_args() 15 + 16 + +def GetYearFromLicense(license_file: pathlib.Path): 17 + + import re 18 + + for line in license_file.read_text().splitlines(): 19 + + m = re.search(r'^\s*Copyright \(c\) 2021-(\d{4,})', line) 20 + + if m is not None: 21 + + return int(m.group(1)) 22 + + raise RuntimeError(f"Could not find copyright year in {license_file}") 23 + + 24 + def CollectVersionInfo(args): 25 + print("Collecting version info") 26 + 27 + versionInfo = VersionInfo() 28 + - 29 + - repo = git.Repo(args.gitRepo_, search_parent_directories = True) 30 + - 31 + - commitString = str(repo.head.commit)[:10] 32 + - 33 + - if not repo.is_dirty(submodules = False): 34 + - copyrightYear = datetime.datetime.fromtimestamp(repo.head.commit.committed_date).year 35 + - else: 36 + - commitString = commitString + "+dirty" 37 + - copyrightYear = datetime.date.today().year 38 + - 39 + - resourceDir = str(args.gitRepo_).replace("\\", "\\\\") 40 + - 41 + versionInfo.buildNumber_ = args.buildNumber_ 42 + - versionInfo.commitString_ = commitString 43 + - versionInfo.copyrightYear_ = copyrightYear 44 + - versionInfo.resourceDir_ = resourceDir 45 + + versionInfo.commitString_ = "@rev@" 46 + + versionInfo.copyrightYear_ = GetYearFromLicense(args.gitRepo_ / 'LICENSE.txt') 47 + + versionInfo.resourceDir_ = str(args.gitRepo_).replace("\\", "\\\\") 48 + versionInfo.versionString_ = args.version_ 49 + 50 + versionInfo.Calculate()
+67
pkgs/by-name/su/supercell-wx/patches/use-find-package.patch
··· 1 + diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt 2 + index 2137ae62..041cb87d 100644 3 + --- a/external/CMakeLists.txt 4 + +++ b/external/CMakeLists.txt 5 + @@ -14,7 +14,7 @@ set_property(DIRECTORY 6 + units.cmake 7 + qt6ct.cmake) 8 + 9 + -include(aws-sdk-cpp.cmake) 10 + +find_package(AWSSDK CONFIG REQUIRED) 11 + include(date.cmake) 12 + include(hsluv-c.cmake) 13 + include(imgui.cmake) 14 + diff --git a/external/stb.cmake b/external/stb.cmake 15 + index 570af425..f9817226 100644 16 + --- a/external/stb.cmake 17 + +++ b/external/stb.cmake 18 + @@ -1,4 +1,3 @@ 19 + cmake_minimum_required(VERSION 3.24) 20 + set(PROJECT_NAME scwx-stb) 21 + 22 + -set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE) 23 + +# Nix: set STB_INCLUDE_DIR in cmake flags 24 + diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake 25 + index 09ea6fe3..c20a2cb6 100644 26 + --- a/scwx-qt/scwx-qt.cmake 27 + +++ b/scwx-qt/scwx-qt.cmake 28 + @@ -11,14 +11,15 @@ set(CMAKE_AUTORCC ON) 29 + set(CMAKE_CXX_STANDARD 20) 30 + set(CMAKE_CXX_STANDARD_REQUIRED ON) 31 + 32 + -find_package(Boost) 33 + +find_package(Boost REQUIRED COMPONENTS json timer) 34 + find_package(Fontconfig) 35 + -find_package(geographiclib) 36 + +find_package(GeographicLib) 37 + find_package(geos) 38 + find_package(GLEW) 39 + find_package(glm) 40 + find_package(Python COMPONENTS Interpreter) 41 + find_package(SQLite3) 42 + +find_package(PNG) 43 + 44 + find_package(QT NAMES Qt6 45 + COMPONENTS Gui 46 + @@ -699,6 +700,7 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets 47 + imgui 48 + qt6ct-common 49 + SQLite::SQLite3 50 + + PNG::PNG 51 + wxdata) 52 + 53 + target_link_libraries(supercell-wx PRIVATE scwx-qt 54 + diff --git a/wxdata/wxdata.cmake b/wxdata/wxdata.cmake 55 + index 94b0e3a7..a36c2c81 100644 56 + --- a/wxdata/wxdata.cmake 57 + +++ b/wxdata/wxdata.cmake 58 + @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.24) 59 + 60 + project(scwx-data) 61 + 62 + -find_package(Boost) 63 + +find_package(Boost REQUIRED COMPONENTS iostreams) 64 + +find_package(BZip2) 65 + find_package(cpr) 66 + find_package(LibXml2) 67 + find_package(OpenSSL)