Преглед изворни кода

add polyscope (#1773)

* add polyscope

* update taywee_args

* fix polyscope
Hoildkv пре 2 година
родитељ
комит
2ea0b7670b

+ 6 - 6
packages/i/imgui/port/xmake.lua

@@ -58,35 +58,35 @@ target("imgui")
 
     if has_opengl3 then
         add_files("backends/imgui_impl_opengl3.cpp")
-        add_headerfiles("backends/imgui_impl_opengl3.h")
+        add_headerfiles("(backends/imgui_impl_opengl3.h)")
         if has_config("use_glad") then
             add_defines("IMGUI_IMPL_OPENGL_LOADER_GLAD")
             add_packages("glad")
         else
-            add_headerfiles("backends/imgui_impl_opengl3_loader.h")
+            add_headerfiles("(backends/imgui_impl_opengl3_loader.h)")
         end
     end
 
     if has_vulkan then
         add_files("backends/imgui_impl_vulkan.cpp")
-        add_headerfiles("backends/imgui_impl_vulkan.h")
+        add_headerfiles("(backends/imgui_impl_vulkan.h)")
         add_packages("vulkansdk")
     end
 
     if has_sdl_renderer then
         add_files("backends/imgui_impl_sdlrenderer.cpp")
-        add_headerfiles("backends/imgui_impl_sdlrenderer.h")
+        add_headerfiles("(backends/imgui_impl_sdlrenderer.h)")
     end
 
     if has_glfw then
         add_files("backends/imgui_impl_glfw.cpp")
-        add_headerfiles("backends/imgui_impl_glfw.h")
+        add_headerfiles("(backends/imgui_impl_glfw.h)")
         add_packages("glfw")
     end
 
     if has_sdl2 then
         add_files("backends/imgui_impl_sdl.cpp")
-        add_headerfiles("backends/imgui_impl_sdl.h")
+        add_headerfiles("(backends/imgui_impl_sdl.h)")
         add_packages("libsdl")
     end
 

+ 84 - 0
packages/p/polyscope/patches/v1.3.0/deps.patch

@@ -0,0 +1,84 @@
+diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt
+index 4084142..dd6b111 100644
+--- a/deps/CMakeLists.txt
++++ b/deps/CMakeLists.txt
+@@ -3,23 +3,21 @@ cmake_minimum_required(VERSION 3.5)
+ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
+ 
+   ## Glad
+-  add_subdirectory(glad)
+ 
+   ## GLFW
+   set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
+   set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
+   set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
+   set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
+-  add_subdirectory(glfw)
++  find_package(glfw3 REQUIRED)
+ endif()
+ 
+ if("${POLYSCOPE_BACKEND_OPENGL_MOCK}")
+ endif()
+ 
+ ## Imgui
+-add_subdirectory(imgui)
+ 
+ ## Argparse
+ 
+ ## STB stuff
+-add_subdirectory(stb)
++add_library(stb OBJECT stb_impl.cpp)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 5e5ab62..21410ce 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -49,7 +49,7 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
+ 
+   # Link settings
+   list(APPEND BACKEND_LIBS
+-    glfw ${GLFW_LIBRARIES}
++    ${GLFW_LIBRARIES}
+   )
+ 
+   if(APPLE)
+@@ -283,13 +283,8 @@ add_definitions(-DNOMINMAX)
+ 
+ # Include settings
+ target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include")
+-target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../deps/glm")
+-#target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/args") # not used, polyscope generates no apps directly
+-target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/happly")
+-target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/json/include")
+-target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/stb")
+-target_include_directories(polyscope PRIVATE "${BACKEND_INCLUDE_DIRS}")
+         
+ # Link settings
+ target_link_libraries(polyscope PUBLIC imgui)
+ target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb)
++install(TARGETS polyscope LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin)
+diff --git a/src/polyscope.cpp b/src/polyscope.cpp
+index d270e36..1887ef1 100644
+--- a/src/polyscope.cpp
++++ b/src/polyscope.cpp
+@@ -14,7 +14,7 @@
+ 
+ #include "stb_image.h"
+ 
+-#include "json/json.hpp"
++#include "nlohmann/json.hpp"
+ using json = nlohmann::json;
+ 
+ 
+diff --git a/src/view.cpp b/src/view.cpp
+index 6b93f88..31b73ee 100644
+--- a/src/view.cpp
++++ b/src/view.cpp
+@@ -6,7 +6,7 @@
+ 
+ #include "imgui.h"
+ 
+-#include "json/json.hpp"
++#include "nlohmann/json.hpp"
+ using json = nlohmann::json;
+ 
+ namespace polyscope {

+ 278 - 0
packages/p/polyscope/patches/v1.3.0/imgui.patch

@@ -0,0 +1,278 @@
+diff --git a/deps/imgui/CMakeLists.txt b/deps/imgui/CMakeLists.txt
+index 71301973..502319ce 100644
+--- a/deps/imgui/CMakeLists.txt
++++ b/deps/imgui/CMakeLists.txt
+@@ -19,7 +19,7 @@ endif()
+ 
+ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
+ 
+-  set(SRCS imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_widgets.cpp imgui/imgui_demo.cpp imgui/examples/imgui_impl_glfw.cpp imgui/examples/imgui_impl_opengl3.cpp)
++  set(SRCS imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_tables.cpp imgui/imgui_widgets.cpp imgui/imgui_demo.cpp imgui/backends/imgui_impl_glfw.cpp imgui/backends/imgui_impl_opengl3.cpp)
+ 
+   add_library(
+           imgui
+@@ -36,7 +36,6 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
+       # On macOS, get openGL & friends from Frameworks; do not use GLAD at all
+ 
+       add_definitions(-DGLFW_INCLUDE_GLCOREARB)
+-      add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_CUSTOM=<GLFW/glfw3.h>)
+ 
+       # NOTE: This code is essentially duplicated here and in polyscope/src/CMakeLists.txt
+ 
+@@ -60,7 +59,7 @@ elseif("${POLYSCOPE_BACKEND_OPENGL_MOCK}")
+   add_definitions(-DIMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS)
+   add_definitions(-DIMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)
+   
+-  set(SRCS imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_widgets.cpp)
++  set(SRCS imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_tables.cpp imgui/imgui_widgets.cpp imgui/imgui_demo.cpp)
+ 
+   add_library(
+           imgui
+diff --git a/deps/imgui/imgui b/deps/imgui/imgui
+index 5503c0a1..512c54bb 160000
+--- a/deps/imgui/imgui
++++ b/deps/imgui/imgui
+@@ -1 +1 @@
+-Subproject commit 5503c0a12e0c929e84b3f61b2cb4bb9177ea3da1
++Subproject commit 512c54bbc062c41c74f8a8bd8ff1fd6bebd1e6d0
+diff --git a/include/polyscope/render/opengl/gl_engine.h b/include/polyscope/render/opengl/gl_engine.h
+index 04a1a9e7..7c6074cc 100644
+--- a/include/polyscope/render/opengl/gl_engine.h
++++ b/include/polyscope/render/opengl/gl_engine.h
+@@ -23,8 +23,8 @@
+ 
+ #include "imgui.h"
+ #define IMGUI_IMPL_OPENGL_LOADER_GLAD
+-#include "examples/imgui_impl_glfw.h"
+-#include "examples/imgui_impl_opengl3.h"
++#include "backends/imgui_impl_glfw.h"
++#include "backends/imgui_impl_opengl3.h"
+ 
+ #include <unordered_map>
+ 
+diff --git a/include/polyscope/scalar_quantity.ipp b/include/polyscope/scalar_quantity.ipp
+index dab47e43..5a0cc072 100644
+--- a/include/polyscope/scalar_quantity.ipp
++++ b/include/polyscope/scalar_quantity.ipp
+@@ -65,14 +65,14 @@ void ScalarQuantity<QuantityT>::buildScalarUI() {
+     ImGui::SameLine();
+     if (isolineWidth.get().isRelative()) {
+       if (ImGui::DragFloat("##Isoline width relative", isolineWidth.get().getValuePtr(), .001, 0.0001, 1.0, "%.4f",
+-                           2.0)) {
++                           ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+         isolineWidth.manuallyChanged();
+         requestRedraw();
+       }
+     } else {
+       float scaleWidth = dataRange.second - dataRange.first;
+       if (ImGui::DragFloat("##Isoline width absolute", isolineWidth.get().getValuePtr(), scaleWidth / 1000, 0.,
+-                           scaleWidth, "%.4f", 2.0)) {
++                           scaleWidth, "%.4f", ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+         isolineWidth.manuallyChanged();
+         requestRedraw();
+       }
+@@ -81,7 +81,7 @@ void ScalarQuantity<QuantityT>::buildScalarUI() {
+     // Isoline darkness
+     ImGui::TextUnformatted("Isoline darkness");
+     ImGui::SameLine();
+-    if (ImGui::DragFloat("##Isoline darkness", &isolineDarkness.get(), 0.01, 0., 1.)) {
++    if (ImGui::DragFloat("##Isoline darkness", &isolineDarkness.get(), 0.01, 0.)) {
+       isolineDarkness.manuallyChanged();
+       requestRedraw();
+     }
+diff --git a/src/curve_network.cpp b/src/curve_network.cpp
+index 378cae0f..85d736ff 100644
+--- a/src/curve_network.cpp
++++ b/src/curve_network.cpp
+@@ -330,7 +330,8 @@ void CurveNetwork::buildCustomUI() {
+   }
+   ImGui::SameLine();
+   ImGui::PushItemWidth(100);
+-  if (ImGui::SliderFloat("Radius", radius.get().getValuePtr(), 0.0, .1, "%.5f", 3.)) {
++  if (ImGui::SliderFloat("Radius", radius.get().getValuePtr(), 0.0, .1, "%.5f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     radius.manuallyChanged();
+     requestRedraw();
+   }
+diff --git a/src/imgui_config.cpp b/src/imgui_config.cpp
+index 4526b890..bba99f7f 100644
+--- a/src/imgui_config.cpp
++++ b/src/imgui_config.cpp
+@@ -63,7 +63,7 @@ void configureImGuiStyle() {
+   colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
+   colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
+   colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
+-  colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
++  colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
+   colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f);
+   colors[ImGuiCol_Tab] = ImVec4(0.27f, 0.54f, 0.42f, 0.83f);
+   colors[ImGuiCol_TabHovered] = ImVec4(0.34f, 0.68f, 0.53f, 0.83f);
+diff --git a/src/point_cloud.cpp b/src/point_cloud.cpp
+index efae01f6..bd81c056 100644
+--- a/src/point_cloud.cpp
++++ b/src/point_cloud.cpp
+@@ -255,7 +255,8 @@ void PointCloud::buildCustomUI() {
+   }
+   ImGui::SameLine();
+   ImGui::PushItemWidth(70);
+-  if (ImGui::SliderFloat("Radius", pointRadius.get().getValuePtr(), 0.0, .1, "%.5f", 3.)) {
++  if (ImGui::SliderFloat("Radius", pointRadius.get().getValuePtr(), 0.0, .1, "%.5f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     pointRadius.manuallyChanged();
+     requestRedraw();
+   }
+diff --git a/src/point_cloud_parameterization_quantity.cpp b/src/point_cloud_parameterization_quantity.cpp
+index c5c38f08..9c0c0a13 100644
+--- a/src/point_cloud_parameterization_quantity.cpp
++++ b/src/point_cloud_parameterization_quantity.cpp
+@@ -149,7 +149,8 @@ void PointCloudParameterizationQuantity::buildCustomUI() {
+ 
+ 
+   // Modulo stripey width
+-  if (ImGui::DragFloat("period", &checkerSize.get(), .001, 0.0001, 1.0, "%.4f", 2.0)) {
++  if (ImGui::DragFloat("period", &checkerSize.get(), .001, 0.0001, 1.0, "%.4f", 
++                       ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     setCheckerSize(getCheckerSize());
+   }
+ 
+diff --git a/src/render/engine.cpp b/src/render/engine.cpp
+index a0a5125d..267b741f 100644
+--- a/src/render/engine.cpp
++++ b/src/render/engine.cpp
+@@ -208,9 +208,12 @@ void Engine::buildEngineGui() {
+ 
+     ImGui::SetNextTreeNodeOpen(false, ImGuiCond_FirstUseEver);
+     if (ImGui::TreeNode("Tone Mapping")) {
+-      ImGui::SliderFloat("exposure", &exposure, 0.1, 2.0, "%.3f", 2.);
+-      ImGui::SliderFloat("white level", &whiteLevel, 0.0, 2.0, "%.3f", 2.);
+-      ImGui::SliderFloat("gamma", &gamma, 0.5, 3.0, "%.3f", 2.);
++      ImGui::SliderFloat("exposure", &exposure, 0.1, 2.0, "%.3f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat);
++      ImGui::SliderFloat("white level", &whiteLevel, 0.0, 2.0, "%.3f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat);
++      ImGui::SliderFloat("gamma", &gamma, 0.5, 3.0, "%.3f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat);
+ 
+       ImGui::TreePop();
+     }
+diff --git a/src/ribbon_artist.cpp b/src/ribbon_artist.cpp
+index 417817ac..88d3d5b4 100644
+--- a/src/ribbon_artist.cpp
++++ b/src/ribbon_artist.cpp
+@@ -152,7 +152,8 @@ void RibbonArtist::buildParametersGUI() {
+   }
+ 
+   ImGui::PushItemWidth(150);
+-  if (ImGui::SliderFloat("Ribbon width", ribbonWidth.get().getValuePtr(), 0.0, .1, "%.5f", 3.)) {
++  if (ImGui::SliderFloat("Ribbon width", ribbonWidth.get().getValuePtr(), 0.0, .1, "%.5f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     ribbonWidth.manuallyChanged();
+     requestRedraw();
+   }
+diff --git a/src/surface_count_quantity.cpp b/src/surface_count_quantity.cpp
+index 9d9fcc67..b4040f3e 100644
+--- a/src/surface_count_quantity.cpp
++++ b/src/surface_count_quantity.cpp
+@@ -104,7 +104,8 @@ void SurfaceCountQuantity::buildCustomUI() {
+   ImGui::DragFloatRange2("Color Range", &vizRangeLow, &vizRangeHigh, (dataRangeHigh - dataRangeLow) / 100.,
+                          dataRangeLow, dataRangeHigh, "Min: %.3e", "Max: %.3e");
+ 
+-  if (ImGui::SliderFloat("Radius", pointRadius.get().getValuePtr(), 0.0, .1, "%.5f", 3.)) {
++  if (ImGui::SliderFloat("Radius", pointRadius.get().getValuePtr(), 0.0, .1, "%.5f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     pointRadius.manuallyChanged();
+     requestRedraw();
+   }
+diff --git a/src/surface_distance_quantity.cpp b/src/surface_distance_quantity.cpp
+index 3b9851af..57b3d303 100644
+--- a/src/surface_distance_quantity.cpp
++++ b/src/surface_distance_quantity.cpp
+@@ -93,7 +93,8 @@ void SurfaceDistanceQuantity::buildCustomUI() {
+   }
+ 
+   // Modulo stripey width
+-  if (ImGui::DragFloat("Stripe size", stripeSize.get().getValuePtr(), .001, 0.0001, 1.0, "%.4f", 2.0)) {
++  if (ImGui::DragFloat("Stripe size", stripeSize.get().getValuePtr(), .001, 0.0001, 1.0, "%.4f", 
++                       ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     stripeSize.manuallyChanged();
+     requestRedraw();
+   }
+diff --git a/src/surface_graph_quantity.cpp b/src/surface_graph_quantity.cpp
+index ce4d2e64..b559a680 100644
+--- a/src/surface_graph_quantity.cpp
++++ b/src/surface_graph_quantity.cpp
+@@ -101,7 +101,8 @@ void SurfaceGraphQuantity::buildCustomUI() {
+   ImGui::SameLine();
+   if (ImGui::ColorEdit3("Color", &color.get()[0], ImGuiColorEditFlags_NoInputs)) setColor(getColor());
+   ImGui::Text("Nodes: %lu  Edges: %lu", nodes.size(), edges.size());
+-  if (ImGui::SliderFloat("Radius", radius.get().getValuePtr(), 0.0, .1, "%.5f", 3.)) {
++  if (ImGui::SliderFloat("Radius", radius.get().getValuePtr(), 0.0, .1, "%.5f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     radius.manuallyChanged();
+     requestRedraw();
+   }
+diff --git a/src/surface_parameterization_quantity.cpp b/src/surface_parameterization_quantity.cpp
+index c9e8ebea..7d1d2d8a 100644
+--- a/src/surface_parameterization_quantity.cpp
++++ b/src/surface_parameterization_quantity.cpp
+@@ -154,7 +154,8 @@ void SurfaceParameterizationQuantity::buildCustomUI() {
+ 
+ 
+   // Modulo stripey width
+-  if (ImGui::DragFloat("period", &checkerSize.get(), .001, 0.0001, 1.0, "%.4f", 2.0)) {
++  if (ImGui::DragFloat("period", &checkerSize.get(), .001, 0.0001, 1.0, "%.4f", 
++                       ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     setCheckerSize(getCheckerSize());
+   }
+ 
+diff --git a/src/vector_artist.cpp b/src/vector_artist.cpp
+index 633a12ff..6135bbfe 100644
+--- a/src/vector_artist.cpp
++++ b/src/vector_artist.cpp
+@@ -90,13 +90,15 @@ void VectorArtist::buildParametersUI() {
+ 
+   // Only get to set length for non-ambient vectors
+   if (vectorType != VectorType::AMBIENT) {
+-    if (ImGui::SliderFloat("Length", vectorLengthMult.get().getValuePtr(), 0.0, .1, "%.5f", 3.)) {
++    if (ImGui::SliderFloat("Length", vectorLengthMult.get().getValuePtr(), 0.0, .1, "%.5f",
++                           ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+       vectorLengthMult.manuallyChanged();
+       requestRedraw();
+     }
+   }
+ 
+-  if (ImGui::SliderFloat("Radius", vectorRadius.get().getValuePtr(), 0.0, .1, "%.5f", 3.)) {
++  if (ImGui::SliderFloat("Radius", vectorRadius.get().getValuePtr(), 0.0, .1, "%.5f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+     vectorRadius.manuallyChanged();
+     requestRedraw();
+   }
+diff --git a/src/view.cpp b/src/view.cpp
+index 6b93f885..27a16bfd 100644
+--- a/src/view.cpp
++++ b/src/view.cpp
+@@ -725,18 +725,21 @@ void buildViewGui() {
+       // Clip planes
+       float nearClipRatioF = nearClipRatio;
+       float farClipRatioF = farClipRatio;
+-      if (ImGui::SliderFloat(" Clip Near", &nearClipRatioF, 0., 10., "%.5f", 3.)) {
++      if (ImGui::SliderFloat(" Clip Near", &nearClipRatioF, 0., 10., "%.5f",
++                             ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+         nearClipRatio = nearClipRatioF;
+         requestRedraw();
+       }
+-      if (ImGui::SliderFloat(" Clip Far", &farClipRatioF, 1., 1000., "%.2f", 3.)) {
++      if (ImGui::SliderFloat(" Clip Far", &farClipRatioF, 1., 1000., "%.2f",
++                             ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat)) {
+         farClipRatio = farClipRatioF;
+         requestRedraw();
+       }
+ 
+       // Move speed
+       float moveScaleF = view::moveScale;
+-      ImGui::SliderFloat(" Move Speed", &moveScaleF, 0.0, 1.0, "%.5f", 3.);
++      ImGui::SliderFloat(" Move Speed", &moveScaleF, 0.0, 1.0, "%.5f",
++                         ImGuiSliderFlags_Logarithmic | ImGuiSliderFlags_NoRoundToFormat);
+       view::moveScale = moveScaleF;
+ 
+ 

+ 38 - 0
packages/p/polyscope/xmake.lua

@@ -0,0 +1,38 @@
+package("polyscope")
+
+    set_homepage("https://polyscope.run/")
+    set_description("A C++ & Python viewer for 3D data like meshes and point clouds")
+    set_license("MIT")
+
+    add_urls("https://github.com/nmwsharp/polyscope/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/nmwsharp/polyscope.git")
+    add_versions("v1.3.0", "c0d3594b1c818c6e7efe2c2589d71f5e254db383d36a92555aa909a2114f12d4")
+
+    add_patches("1.3.0", path.join(os.scriptdir(), "patches", "v1.3.0", "deps.patch"), "2d183713be791deddcfb48e4546793f584071eb1aa7a045e03c7ceed841470c8")
+    add_patches("1.3.0", path.join(os.scriptdir(), "patches", "v1.3.0", "imgui.patch"), "e7865d6de85103098cdc25ab8a0e94dd26fb5f718609f20093b91891cc8f21e1")
+
+    if is_plat("windows") then
+        add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
+    end
+
+    add_deps("cmake")
+    add_deps("imgui <=1.86", {configs = {glfw_opengl3 = true}})
+    add_deps("glad", "glfw", "glm", "happly", "nlohmann_json", "stb")
+    on_install("windows", "macosx", "linux", function (package)
+        os.mv("deps/stb/stb_impl.cpp", "deps/stb_impl.cpp")
+        local configs = {"-DPOLYSCOPE_BACKEND_OPENGL_MOCK=OFF"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        import("package.tools.cmake").install(package, configs, {packagedeps = {"imgui", "glad", "glfw", "glm", "happly", "nlohmann_json", "stb"}})
+        os.cp("include/polyscope", package:installdir("include"))
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <polyscope/polyscope.h>
+            void test() {
+                polyscope::init();
+                polyscope::show();
+            }
+        ]]}, {configs = {languages = "c++17"}}))
+    end)

+ 1 - 0
packages/t/taywee_args/xmake.lua

@@ -8,6 +8,7 @@ package("taywee_args")
     add_urls("https://github.com/Taywee/args/archive/refs/tags/$(version).tar.gz",
              "https://github.com/Taywee/args.git")
     add_versions("6.3.0", "e072c4a9d6990872b0ecb45480a5487db82e0dc3d27c3c3eb9fc0930c0d796ae")
+    add_versions("6.4.6", "41ed136bf9b216bf5f18b1de2a8d22a870381657e8427d6621918520b6e2239c")
 
     on_install(function (package)
         os.cp("args.hxx", package:installdir("include"))