Unverified Commit c4c2f725 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

supercell-wx: 0.4.9 -> 0.5.3 (#454201)

parents dd439a45 84c49e75
Loading
Loading
Loading
Loading
+99 −77
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  stdenv,
  fetchFromGitHub,
  fetchpatch,
  aws-sdk-cpp,
  bzip2,
  replaceVars,
  tracy,

  # nativeBuildInputs
  cmake,
  ninja,
  zlib,
  openssl,
  curl,
  glew,
  geos,
  qt6,

  # buildInputs
  aws-sdk-cpp,
  boost,
  spdlog,
  stb,
  libcpr,
  libpng,
  libSM,
  bzip2,
  geos,
  geographiclib,
  howard-hinnant-date,
  re2,
  gtest,
  glew,
  glm,
  qt6,
  gtest,
  howard-hinnant-date,
  libSM,
  libcpr,
  libpng,
  onetbb,
  tracy,
  replaceVars,
  openssl,
  python3,
  range-v3,
  re2,
  spdlog,
  stb,
  zlib,
}:
let
  gtestSkip = [
    # Skip tests requiring network access
    "AwsLevel*DataProvider.FindKeyNow"
    "AwsLevel*DataProvider.FindKeyFixed"
    "AwsLevel*DataProvider.LoadObjectByKey"
    "AwsLevel*DataProvider.Refresh"
    "AwsLevel*DataProvider.FindKeyNow"
    "AwsLevel*DataProvider.GetAvailableProducts"
    "AwsLevel*DataProvider.GetTimePointsByDate"
    "AwsLevel*DataProvider.LoadObjectByKey"
    "AwsLevel*DataProvider.Prune"
    "AwsLevel*DataProvider.Refresh"
    "IemApiProviderTest.*"
    "NtpClient.*"
    "NwsApiProviderTest.*"
    "UpdateManagerTest.CheckForUpdates"
    "WarningsProvider*\"https"

@@ -50,47 +56,16 @@ let
in
stdenv.mkDerivation (finalAttrs: {
  pname = "supercell-wx";
  version = "0.4.9";
  version = "0.5.3";

  src = fetchFromGitHub {
    owner = "dpaulat";
    repo = "supercell-wx";
    rev = "refs/tags/v${finalAttrs.version}-release";
    sha256 = "sha256-3fVUxbGosN4Y4h8BJXUV7DNv7VZTma+IsV94+Zt8DCA=";
    tag = "v${finalAttrs.version}-release";
    fetchSubmodules = true;
    hash = "sha256-1n1WXBLco2TpyhS8KA1tk6HzRIXLqS6YV3aYagoQiTM=";
  };

  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"
      #     "aarch64-linux"
    ];
    maintainers = with lib.maintainers; [ aware70 ];
  };

  env.CXXFLAGS = "-Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=stringop-overflow -DQT_NO_USE_NODISCARD_FILE_OPEN";
  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'"
    "-DSTB_INCLUDE_DIR=${stb}/include/stb"
    "-DFETCHCONTENT_SOURCE_DIR_TRACY=${tracy.src}"
  ];

  patches = [
    # These are for Nix compatibility {{{
    ./patches/use-find-package.patch # Replace some vendored dependencies with Nix provided versions
@@ -105,6 +80,7 @@ stdenv.mkDerivation (finalAttrs: {
    # These may be or already are submitted upstream {{{
    ./patches/explicit-link-aws-crt.patch # fix missing symbols from aws-crt-cpp
    ./patches/fix-qt-6.10.patch
    ./patches/fix-find-opengl.patch
    # }}}
  ];

@@ -114,6 +90,28 @@ stdenv.mkDerivation (finalAttrs: {
      --replace-fail "CMAKE_SOURCE_DIR" "PROJECT_SOURCE_DIR"
  '';

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

  cmakeFlags = [
    # CMake Error at external/aws-sdk-cpp/crt/aws-crt-cpp/cmake/EnforceSubmoduleVersions.cmake:18 (message):
    # ENFORCE_SUBMODULE_VERSIONS is ON but Git was not found.
    (lib.cmakeBool "ENFORCE_SUBMODULE_VERSIONS" false)

    # These tests aren't built by 'all', but ctest still tries to run them.
    (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "-E;'test_mln_core|test_mln_widgets'")
    (lib.cmakeFeature "STB_INCLUDE_DIR" "${stb}/include/stb")
    (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_TRACY" "${tracy.src}")
  ];

  nativeBuildInputs = [
    cmake
    ninja
@@ -121,36 +119,37 @@ stdenv.mkDerivation (finalAttrs: {
  ];

  buildInputs = [
    zlib
    openssl
    qt6.qtbase
    qt6.qttools
    qt6.qtmultimedia
    qt6.qtpositioning
    qt6.qtimageformats
    aws-sdk-cpp
    howard-hinnant-date
    boost
    onetbb
    glew
    bzip2
    geos
    spdlog
    stb
    libcpr
    libpng
    libSM
    re2
    openssl
    # FIXME: split outputs aren't working with find_package. Possibly related to nixpkgs/issues/144170 ?
    (geographiclib.overrideAttrs {
      outputs = [ "out" ];
    })
    gtest
    glew
    glm
    bzip2
    gtest
    howard-hinnant-date
    libSM
    libcpr
    libpng
    onetbb
    openssl
    (python3.withPackages (ps: [
      ps.geopandas
      ps.jinja2
    ]))
    qt6.qtbase
    qt6.qtimageformats
    qt6.qtmultimedia
    qt6.qtpositioning
    qt6.qttools
    re2
    range-v3
    spdlog
    stb
    zlib
  ];

  # Currently crashes on wayland; must force X11
@@ -158,10 +157,33 @@ stdenv.mkDerivation (finalAttrs: {
    "--set QT_QPA_PLATFORM xcb"
  ];

  doCheck = true;

  # Install .desktop file and icons
  postInstall = ''
    install -m0644 -D "$src/scwx-qt/res/linux/supercell-wx.desktop" "$out/share/applications/supercell-wx.desktop"
    install -m0644 -D "$src/scwx-qt/res/icons/scwx-256.png"  "$out/share/icons/hicolor/256x256/apps/supercell-wx.png"
    install -m0644 -D "$src/scwx-qt/res/icons/scwx-64.png"  "$out/share/icons/hicolor/64x64/apps/supercell-wx.png"
  '';

  meta = {
    homepage = "https://supercell-wx.rtfd.io";
    downloadPage = "https://github.com/dpaulat/supercell-wx/releases";
    description = "Live visualization of NEXRAD weather data and alerts";
    changelog = "https://github.com/dpaulat/supercell-wx/releases/tag/${finalAttrs.src.tag}";
    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"
      "aarch64-linux"
    ];
    maintainers = with lib.maintainers; [ aware70 ];
  };
})
+3 −3
Original line number Diff line number Diff line
diff --git a/wxdata/wxdata.cmake b/wxdata/wxdata.cmake
index 47ada181..a1beea15 100644
index 36911947..451efc13 100644
--- a/wxdata/wxdata.cmake
+++ b/wxdata/wxdata.cmake
@@ -280,6 +280,7 @@ endif()
@@ -320,6 +320,7 @@ endif()
 
 target_link_libraries(wxdata PUBLIC aws-cpp-sdk-core
                                     aws-cpp-sdk-s3
+                                    aws-crt-cpp
                                     cpr::cpr
                                     LibXml2::LibXml2
                                     re2::re2
                                     OpenSSL::Crypto
+15 −12
Original line number Diff line number Diff line
diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake
index cda6c7f..32d807a 100644
index 648b6578..4833b9c2 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
@@ -776,6 +776,7 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets
                                      Boost::timer
                                      Boost::atomic
                                      QMapLibre::Core
+                                     QMapLibre::Widgets
                                      $<$<CXX_COMPILER_ID:MSVC>:opengl32>
                                      $<$<CXX_COMPILER_ID:MSVC>:SetupAPI>
                                      Fontconfig::Fontconfig
                                      GeographicLib::GeographicLib
@@ -615,40 +616,13 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets
@@ -793,18 +794,7 @@ target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets
 target_link_libraries(supercell-wx PRIVATE scwx-qt
                                            wxdata)
 
-if (LINUX)
-    # 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")
-endif()
-
 install(TARGETS supercell-wx
-                MLNQtCore # QMapLibre::Core
@@ -26,7 +28,8 @@ index cda6c7f..32d807a 100644
-                               "^(/usr)?/lib/.*\\.so(\\..*)?"
         RUNTIME
           COMPONENT supercell-wx
         LIBRARY
         BUNDLE
@@ -819,24 +809,6 @@ install(TARGETS supercell-wx
           COMPONENT supercell-wx
           OPTIONAL)
 
@@ -48,6 +51,6 @@ index cda6c7f..32d807a 100644
-install(SCRIPT ${deploy_script_scwx}
-        COMPONENT supercell-wx)
-
 if (MSVC)
     set(CPACK_PACKAGE_NAME                "Supercell Wx")
     set(CPACK_PACKAGE_VENDOR              "Dan Paulat")
 if (APPLE)
     # Install additional script to fix up the bundle
     install(CODE [[
+27 −0
Original line number Diff line number Diff line
diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake
index 648b6578..3f1d8070 100644
--- a/scwx-qt/scwx-qt.cmake
+++ b/scwx-qt/scwx-qt.cmake
@@ -18,7 +18,7 @@ find_package(Fontconfig)
 find_package(geographiclib)
 find_package(geos)
 find_package(glm)
-find_package(OpenGL)
+find_package(OpenGL REQUIRED)
 find_package(Python COMPONENTS Interpreter)
 find_package(SQLite3)
 
@@ -759,12 +759,7 @@ if (LINUX)
     target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::WaylandClient)
 endif()
 
-if (LINUX)
-    find_package(mesa-glu REQUIRED)
-    target_link_libraries(scwx-qt PUBLIC mesa-glu::mesa-glu)
-else()
-    target_link_libraries(scwx-qt PUBLIC OpenGL::GLU)
-endif()
+target_link_libraries(scwx-qt PUBLIC OpenGL::GLU)
 
 target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets
                                      Qt${QT_VERSION_MAJOR}::OpenGLWidgets
+4 −4
Original line number Diff line number Diff line
diff --git a/scwx-qt/tools/generate_versions.py b/scwx-qt/tools/generate_versions.py
index c6c94020..3fcdcf08 100644
index c6c94020..000f6e6e 100644
--- a/scwx-qt/tools/generate_versions.py
+++ b/scwx-qt/tools/generate_versions.py
@@ -1,6 +1,5 @@
@@ -9,7 +9,7 @@ index c6c94020..3fcdcf08 100644
 import json
 import os
 import pathlib
@@ -110,27 +109,22 @@ def ParseArguments():
@@ -110,27 +109,23 @@ def ParseArguments():
                         required = True)
     return parser.parse_args()
 
@@ -25,7 +25,7 @@ index c6c94020..3fcdcf08 100644
     print("Collecting version info")
 
     versionInfo = VersionInfo()
-
 
-    repo = git.Repo(args.gitRepo_, search_parent_directories = True)
-
-    commitString = str(repo.head.commit)[:10]
@@ -43,7 +43,7 @@ index c6c94020..3fcdcf08 100644
-    versionInfo.copyrightYear_ = copyrightYear
-    versionInfo.resourceDir_   = resourceDir
+    versionInfo.commitString_  = "@rev@"
+    versionInfo.copyrightYear_ = GetYearFromLicense(args.gitRepo_ / 'LICENSE.txt')
+    versionInfo.copyrightYear_ = GetYearFromLicense(args.gitRepo_ / "LICENSE.txt")
+    versionInfo.resourceDir_   = str(args.gitRepo_).replace("\\", "\\\\")
     versionInfo.versionString_ = args.version_
 
Loading