From e4346914e19f1ffc1b26a8eac09b245f92a513e0 Mon Sep 17 00:00:00 2001 From: Viktor Sonesten Date: Tue, 7 Nov 2023 21:04:30 +0100 Subject: [PATCH 01/38] glfw: fix build for Python bindings --- pkgs/development/python-modules/glfw/default.nix | 4 +--- .../development/python-modules/glfw/search-path.patch | 11 ----------- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 pkgs/development/python-modules/glfw/search-path.patch diff --git a/pkgs/development/python-modules/glfw/default.nix b/pkgs/development/python-modules/glfw/default.nix index db9f369a3497..d39daf9e9dc2 100644 --- a/pkgs/development/python-modules/glfw/default.nix +++ b/pkgs/development/python-modules/glfw/default.nix @@ -20,10 +20,8 @@ buildPythonPackage rec { }; # Patch path to GLFW shared object - patches = [ ./search-path.patch ]; - postPatch = '' - substituteInPlace glfw/library.py --replace "@GLFW@" '${glfw3}/lib' + substituteInPlace glfw/library.py --replace "_get_library_search_paths()," "[ '${glfw3}/lib' ]," ''; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/glfw/search-path.patch b/pkgs/development/python-modules/glfw/search-path.patch deleted file mode 100644 index 0c4a42ceb362..000000000000 --- a/pkgs/development/python-modules/glfw/search-path.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/glfw/library.py b/glfw/library.py -index 20387e1..9bdd62a 100644 ---- a/glfw/library.py -+++ b/glfw/library.py -@@ -189,5 +189,4 @@ elif sys.platform == 'win32': - except OSError: - pass - else: -- glfw = _load_library(['glfw', 'glfw3'], ['.so', '.dylib'], -- _get_library_search_paths(), _glfw_get_version) -+ glfw = _load_library(['glfw', 'glfw3'], ['.so', '.dylib'], ['@GLFW@'], _glfw_get_version) From 290bc1fbe0855cbc82efa17bf9382f428512910f Mon Sep 17 00:00:00 2001 From: Viktor Sonesten Date: Tue, 7 Nov 2023 21:18:36 +0100 Subject: [PATCH 02/38] mujoco: 2.3.7 -> 3.0.0, add Python bindings https://mujoco.readthedocs.io/en/stable/changelog.html#version-3-0-0-october-18-2023 Fixes #262698 Fixes #262629 Fixes #262593 Co-authored-by: Silvio Traversaro --- .../science/robotics/mujoco/default.nix | 242 +++++--- .../robotics/mujoco/dependencies.patch | 114 ---- .../mujoco-system-deps-dont-fetch.patch | 538 ++++++++++++++++++ .../robotics/mujoco/sdflib-system-deps.patch | 192 +++++++ .../python-modules/mujoco/default.nix | 70 +++ pkgs/top-level/python-packages.nix | 4 + 6 files changed, 956 insertions(+), 204 deletions(-) delete mode 100644 pkgs/applications/science/robotics/mujoco/dependencies.patch create mode 100644 pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch create mode 100644 pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch create mode 100644 pkgs/development/python-modules/mujoco/default.nix diff --git a/pkgs/applications/science/robotics/mujoco/default.nix b/pkgs/applications/science/robotics/mujoco/default.nix index c4f84e158399..94524672789d 100644 --- a/pkgs/applications/science/robotics/mujoco/default.nix +++ b/pkgs/applications/science/robotics/mujoco/default.nix @@ -1,122 +1,184 @@ -{ cmake +{ cereal_1_3_2 +, cmake , fetchFromGitHub , fetchFromGitLab -, git +, glfw +, glm , lib -, libGL +, spdlog , stdenv -, xorg }: let - # See https://github.com/deepmind/mujoco/blob/c9246e1f5006379d599e0bcddf159a8616d31441/cmake/MujocoDependencies.cmake#L17-L55 - abseil-cpp = fetchFromGitHub { - owner = "abseil"; - repo = "abseil-cpp"; - rev = "c2435f8342c2d0ed8101cb43adfd605fdc52dca2"; - hash = "sha256-PLoI7ix+reUqkZ947kWzls8lujYqWXk9A9a55UcfahI="; - }; - benchmark = fetchFromGitHub { - owner = "google"; - repo = "benchmark"; - rev = "2dd015dfef425c866d9a43f2c67d8b52d709acb6"; - hash = "sha256-pUW9YVaujs/y00/SiPqDgK4wvVsaM7QUp/65k0t7Yr0="; - }; - ccd = fetchFromGitHub { - owner = "danfis"; - repo = "libccd"; - rev = "7931e764a19ef6b21b443376c699bbc9c6d4fba8"; - hash = "sha256-TIZkmqQXa0+bSWpqffIgaBela0/INNsX9LPM026x1Wk="; - }; - eigen3 = fetchFromGitLab { - owner = "libeigen"; - repo = "eigen"; - rev = "211c5dfc6741a5570ad007983c113ef4d144f9f3"; - hash = "sha256-oT/h8QkL0vwaflh46Zsnu9Db1b65AP6p//nAga8M5jI="; - }; - googletest = fetchFromGitHub { - owner = "google"; - repo = "googletest"; - rev = "b796f7d44681514f58a683a3a71ff17c94edb0c1"; - hash = "sha256-LVLEn+e7c8013pwiLzJiiIObyrlbBHYaioO/SWbItPQ="; - }; - lodepng = fetchFromGitHub { - owner = "lvandeve"; - repo = "lodepng"; - rev = "b4ed2cd7ecf61d29076169b49199371456d4f90b"; - hash = "sha256-5cCkdj/izP4e99BKfs/Mnwu9aatYXjlyxzzYiMD/y1M="; - }; - qhull = fetchFromGitHub { - owner = "qhull"; - repo = "qhull"; - rev = "0c8fc90d2037588024d9964515c1e684f6007ecc"; - hash = "sha256-Ptzxad3ewmKJbbcmrBT+os4b4SR976zlCG9F0nq0x94="; - }; - tinyobjloader = fetchFromGitHub { - owner = "tinyobjloader"; - repo = "tinyobjloader"; - rev = "1421a10d6ed9742f5b2c1766d22faa6cfbc56248"; - hash = "sha256-9z2Ne/WPCiXkQpT8Cun/pSGUwgClYH+kQ6Dx1JvW6w0="; - }; - tinyxml2 = fetchFromGitHub { - owner = "leethomason"; - repo = "tinyxml2"; - rev = "9a89766acc42ddfa9e7133c7d81a5bda108a0ade"; - hash = "sha256-YGAe4+Ttv/xeou+9FoJjmQCKgzupTYdDhd+gzvtz/88="; + pin = { + + # See https://github.com/google-deepmind/mujoco/blob/3.0.0/cmake/MujocoDependencies.cmake#L17-L64 + abseil-cpp = fetchFromGitHub { + owner = "abseil"; + repo = "abseil-cpp"; + rev = "fb3621f4f897824c0dbe0615fa94543df6192f30"; + hash = "sha256-uNGrTNg5G5xFGtc+BSWE389x0tQ/KxJQLHfebNWas/k="; + }; + benchmark = fetchFromGitHub { + owner = "google"; + repo = "benchmark"; + rev = "344117638c8ff7e239044fd0fa7085839fc03021"; + hash = "sha256-gztnxui9Fe/FTieMjdvfJjWHjkImtlsHn6fM1FruyME="; + }; + ccd = fetchFromGitHub { + owner = "danfis"; + repo = "libccd"; + rev = "7931e764a19ef6b21b443376c699bbc9c6d4fba8"; + hash = "sha256-TIZkmqQXa0+bSWpqffIgaBela0/INNsX9LPM026x1Wk="; + }; + eigen3 = fetchFromGitLab { + owner = "libeigen"; + repo = "eigen"; + rev = "e8515f78ac098329ab9f8cab21c87caede090a3f"; + hash = "sha256-HXKtFJsKGpug+wNPjYynTuyaG0igo3oG4rFQktveh1g="; + }; + googletest = fetchFromGitHub { + owner = "google"; + repo = "googletest"; + rev = "f8d7d77c06936315286eb55f8de22cd23c188571"; + hash = "sha256-t0RchAHTJbuI5YW4uyBPykTvcjy90JW9AOPNjIhwh6U="; + }; + lodepng = fetchFromGitHub { + owner = "lvandeve"; + repo = "lodepng"; + rev = "b4ed2cd7ecf61d29076169b49199371456d4f90b"; + hash = "sha256-5cCkdj/izP4e99BKfs/Mnwu9aatYXjlyxzzYiMD/y1M="; + }; + qhull = fetchFromGitHub { + owner = "qhull"; + repo = "qhull"; + rev = "0c8fc90d2037588024d9964515c1e684f6007ecc"; + hash = "sha256-Ptzxad3ewmKJbbcmrBT+os4b4SR976zlCG9F0nq0x94="; + }; + tinyobjloader = fetchFromGitHub { + owner = "tinyobjloader"; + repo = "tinyobjloader"; + rev = "1421a10d6ed9742f5b2c1766d22faa6cfbc56248"; + hash = "sha256-9z2Ne/WPCiXkQpT8Cun/pSGUwgClYH+kQ6Dx1JvW6w0="; + }; + tinyxml2 = fetchFromGitHub { + owner = "leethomason"; + repo = "tinyxml2"; + rev = "9a89766acc42ddfa9e7133c7d81a5bda108a0ade"; + hash = "sha256-YGAe4+Ttv/xeou+9FoJjmQCKgzupTYdDhd+gzvtz/88="; + }; + marchingcubecpp = fetchFromGitHub { + owner = "aparis69"; + repo = "MarchingCubeCpp"; + rev = "5b79e5d6bded086a0abe276a4b5a69fc17ae9bf1"; + hash = "sha256-L0DH1GJZ/3vatQAU/KZj/2xTKE6Fwcw9eQYzLdqX2N4="; + }; + + tmd = stdenv.mkDerivation rec { + name = "TriangleMeshDistance"; + + src = fetchFromGitHub { + owner = "InteractiveComputerGraphics"; + repo = name; + rev = "e55a15c20551f36242fd6368df099a99de71d43a"; + hash = "sha256-vj6TMMT8mp7ciLa5nzVAhMWPcAHXq+ZwHlWsRA3uCmg="; + }; + + installPhase = '' + mkdir -p $out/include/tmd + cp ${name}/include/tmd/${name}.h $out/include/tmd/ + ''; + }; + + sdflib = stdenv.mkDerivation rec { + name = "SdfLib"; + + src = fetchFromGitHub { + owner = "UPC-ViRVIG"; + repo = name; + rev = "7c49cfba9bbec763b5d0f7b90b26555f3dde8088"; + hash = "sha256-5bnQ3rHH9Pw1jRVpZpamFnhIJHWnGm6krgZgIBqNtVg="; + }; + + patches = [ ./sdflib-system-deps.patch ]; + + cmakeFlags = [ + "-DSDFLIB_USE_ASSIMP=OFF" + "-DSDFLIB_USE_OPENMP=OFF" + "-DSDFLIB_USE_ENOKI=OFF" + "-DSDFLIB_USE_SYSTEM_GLM=ON" + "-DSDFLIB_USE_SYSTEM_SPDLOG=ON" + "-DSDFLIB_USE_SYSTEM_CEREAL=ON" + "-DSDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE=ON" + ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ + pin.tmd + + # Mainline. The otherwise pinned glm realease from 2018 does + # not build due to test failures and missing files. + glm + + spdlog + cereal_1_3_2 + ]; + }; + }; - # See https://github.com/deepmind/mujoco/blob/c9246e1f5006379d599e0bcddf159a8616d31441/simulate/cmake/SimulateDependencies.cmake#L32-L35 - glfw3 = fetchFromGitHub { - owner = "glfw"; - repo = "glfw"; - rev = "7482de6071d21db77a7236155da44c172a7f6c9e"; - hash = "sha256-4+H0IXjAwbL5mAWfsIVhW0BSJhcWjkQx4j2TrzZ3aIo="; - }; -in -stdenv.mkDerivation rec { +in stdenv.mkDerivation rec { pname = "mujoco"; - version = "2.3.7"; + version = "3.0.0"; src = fetchFromGitHub { - owner = "deepmind"; + owner = "google-deepmind"; repo = pname; rev = version; - hash = "sha256-LgpA+iPGqciHuWBSD6/7yvZ7p+vo48ZYKjjrDZSnAwE="; + hash = "sha256-zHK1uYtWkKFWBMqkw/NwuBlLoXyiZJeNC/sSXwSfgW4="; }; - patches = [ ./dependencies.patch ]; + patches = [ ./mujoco-system-deps-dont-fetch.patch ]; - nativeBuildInputs = [ cmake git ]; + nativeBuildInputs = [ cmake ]; buildInputs = [ - libGL - xorg.libX11 - xorg.libXcursor - xorg.libXext - xorg.libXi - xorg.libXinerama - xorg.libXrandr + pin.sdflib + glm + + # non-numerical + spdlog + cereal_1_3_2 + glfw + ]; + + cmakeFlags = [ + "-DMUJOCO_USE_SYSTEM_sdflib=ON" + "-DMUJOCO_SIMULATE_USE_SYSTEM_GLFW=ON" + "-DMUJOCO_SAMPLES_USE_SYSTEM_GLFW=ON" ]; # Move things into place so that cmake doesn't try downloading dependencies. preConfigure = '' mkdir -p build/_deps - ln -s ${abseil-cpp} build/_deps/abseil-cpp-src - ln -s ${benchmark} build/_deps/benchmark-src - ln -s ${ccd} build/_deps/ccd-src - ln -s ${eigen3} build/_deps/eigen3-src - ln -s ${glfw3} build/_deps/glfw3-src - ln -s ${googletest} build/_deps/googletest-src - ln -s ${lodepng} build/_deps/lodepng-src - ln -s ${qhull} build/_deps/qhull-src - ln -s ${tinyobjloader} build/_deps/tinyobjloader-src - ln -s ${tinyxml2} build/_deps/tinyxml2-src + ln -s ${pin.abseil-cpp} build/_deps/abseil-cpp-src + ln -s ${pin.benchmark} build/_deps/benchmark-src + ln -s ${pin.ccd} build/_deps/ccd-src + ln -s ${pin.eigen3} build/_deps/eigen3-src + ln -s ${pin.googletest} build/_deps/googletest-src + ln -s ${pin.lodepng} build/_deps/lodepng-src + ln -s ${pin.qhull} build/_deps/qhull-src + ln -s ${pin.tinyobjloader} build/_deps/tinyobjloader-src + ln -s ${pin.tinyxml2} build/_deps/tinyxml2-src + ln -s ${pin.marchingcubecpp} build/_deps/marchingcubecpp-src ''; + passthru.pin = { inherit (pin) lodepng eigen3 abseil-cpp; }; + meta = with lib; { description = "Multi-Joint dynamics with Contact. A general purpose physics simulator."; homepage = "https://mujoco.org/"; license = licenses.asl20; - maintainers = with maintainers; [ samuela ]; + maintainers = with maintainers; [ samuela tmplt ]; }; } diff --git a/pkgs/applications/science/robotics/mujoco/dependencies.patch b/pkgs/applications/science/robotics/mujoco/dependencies.patch deleted file mode 100644 index f7dcc06a9e05..000000000000 --- a/pkgs/applications/science/robotics/mujoco/dependencies.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake -index 3e322ea..980aace 100644 ---- a/cmake/MujocoDependencies.cmake -+++ b/cmake/MujocoDependencies.cmake -@@ -87,8 +87,6 @@ set(BUILD_SHARED_LIBS - if(NOT TARGET lodepng) - FetchContent_Declare( - lodepng -- GIT_REPOSITORY https://github.com/lvandeve/lodepng.git -- GIT_TAG ${MUJOCO_DEP_VERSION_lodepng} - ) - - FetchContent_GetProperties(lodepng) -@@ -127,10 +125,6 @@ findorfetch( - qhull - LIBRARY_NAME - qhull -- GIT_REPO -- https://github.com/qhull/qhull.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_qhull} - TARGETS - qhull - EXCLUDE_FROM_ALL -@@ -151,10 +145,6 @@ findorfetch( - tinyxml2 - LIBRARY_NAME - tinyxml2 -- GIT_REPO -- https://github.com/leethomason/tinyxml2.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_tinyxml2} - TARGETS - tinyxml2 - EXCLUDE_FROM_ALL -@@ -169,10 +159,6 @@ findorfetch( - tinyobjloader - LIBRARY_NAME - tinyobjloader -- GIT_REPO -- https://github.com/tinyobjloader/tinyobjloader.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_tinyobjloader} - TARGETS - tinyobjloader - EXCLUDE_FROM_ALL -@@ -187,10 +173,6 @@ findorfetch( - ccd - LIBRARY_NAME - ccd -- GIT_REPO -- https://github.com/danfis/libccd.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_ccd} - TARGETS - ccd - EXCLUDE_FROM_ALL -@@ -227,10 +209,6 @@ if(MUJOCO_BUILD_TESTS) - absl - LIBRARY_NAME - abseil-cpp -- GIT_REPO -- https://github.com/abseil/abseil-cpp.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_abseil} - TARGETS - absl::core_headers - EXCLUDE_FROM_ALL -@@ -254,10 +232,6 @@ if(MUJOCO_BUILD_TESTS) - GTest - LIBRARY_NAME - googletest -- GIT_REPO -- https://github.com/google/googletest.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_gtest} - TARGETS - gtest - gmock -@@ -288,10 +262,6 @@ if(MUJOCO_BUILD_TESTS) - benchmark - LIBRARY_NAME - benchmark -- GIT_REPO -- https://github.com/google/benchmark.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_benchmark} - TARGETS - benchmark::benchmark - benchmark::benchmark_main -@@ -308,8 +278,6 @@ if(MUJOCO_TEST_PYTHON_UTIL) - - FetchContent_Declare( - Eigen3 -- GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git -- GIT_TAG ${MUJOCO_DEP_VERSION_Eigen3} - ) - - FetchContent_GetProperties(Eigen3) -diff --git a/simulate/cmake/SimulateDependencies.cmake b/simulate/cmake/SimulateDependencies.cmake -index fa539c2..5985d5a 100644 ---- a/simulate/cmake/SimulateDependencies.cmake -+++ b/simulate/cmake/SimulateDependencies.cmake -@@ -81,10 +81,6 @@ findorfetch( - glfw3 - LIBRARY_NAME - glfw3 -- GIT_REPO -- https://github.com/glfw/glfw.git -- GIT_TAG -- ${MUJOCO_DEP_VERSION_glfw3} - TARGETS - glfw - EXCLUDE_FROM_ALL diff --git a/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch b/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch new file mode 100644 index 000000000000..15373eb0b60f --- /dev/null +++ b/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch @@ -0,0 +1,538 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 285250b..32d03e3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -92,7 +92,7 @@ add_subdirectory(src/render) + add_subdirectory(src/thread) + add_subdirectory(src/ui) + +-target_compile_definitions(mujoco PRIVATE _GNU_SOURCE CCD_STATIC_DEFINE MUJOCO_DLL_EXPORTS -DMC_IMPLEM_ENABLE) ++target_compile_definitions(mujoco PRIVATE _GNU_SOURCE MUJOCO_DLL_EXPORTS -DMC_IMPLEM_ENABLE) + if(MUJOCO_ENABLE_AVX_INTRINSICS) + target_compile_definitions(mujoco PUBLIC mjUSEPLATFORMSIMD) + endif() +@@ -117,7 +117,7 @@ target_link_libraries( + lodepng + qhullstatic_r + tinyobjloader +- tinyxml2 ++ tinyxml2::tinyxml2 + ) + + set_target_properties( +diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake +index 4e3e2c8..f6143d9 100644 +--- a/cmake/MujocoDependencies.cmake ++++ b/cmake/MujocoDependencies.cmake +@@ -90,153 +90,203 @@ set(BUILD_SHARED_LIBS + CACHE INTERNAL "Build SHARED libraries" + ) + ++ + if(NOT TARGET lodepng) +- FetchContent_Declare( ++ fetchcontent_declare( + lodepng +- GIT_REPOSITORY https://github.com/lvandeve/lodepng.git +- GIT_TAG ${MUJOCO_DEP_VERSION_lodepng} + ) ++endif() ++ ++if(NOT TARGET lodepng) ++ if(NOT MUJOCO_USE_SYSTEM_lodepng) ++ fetchcontent_declare( ++ lodepng ++ GIT_REPOSITORY https://github.com/lvandeve/lodepng.git ++ GIT_TAG ${MUJOCO_DEP_VERSION_lodepng} ++ ) + +- FetchContent_GetProperties(lodepng) +- if(NOT lodepng_POPULATED) +- FetchContent_Populate(lodepng) +- # This is not a CMake project. +- set(LODEPNG_SRCS ${lodepng_SOURCE_DIR}/lodepng.cpp) +- set(LODEPNG_HEADERS ${lodepng_SOURCE_DIR}/lodepng.h) +- add_library(lodepng STATIC ${LODEPNG_HEADERS} ${LODEPNG_SRCS}) +- target_compile_options(lodepng PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) +- target_link_options(lodepng PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) +- target_include_directories(lodepng PUBLIC ${lodepng_SOURCE_DIR}) ++ fetchcontent_getproperties(lodepng) ++ if(NOT lodepng_POPULATED) ++ fetchcontent_populate(lodepng) ++ # This is not a CMake project. ++ set(LODEPNG_SRCS ${lodepng_SOURCE_DIR}/lodepng.cpp) ++ set(LODEPNG_HEADERS ${lodepng_SOURCE_DIR}/lodepng.h) ++ add_library(lodepng STATIC ${LODEPNG_HEADERS} ${LODEPNG_SRCS}) ++ target_compile_options(lodepng PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) ++ target_link_options(lodepng PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++ target_include_directories(lodepng PUBLIC ${lodepng_SOURCE_DIR}) ++ endif() ++ else() ++ find_package(lodepng REQUIRED) + endif() + endif() + + if(NOT TARGET marchingcubecpp) +- FetchContent_Declare( ++ fetchcontent_declare( + marchingcubecpp +- GIT_REPOSITORY https://github.com/aparis69/MarchingCubeCpp.git +- GIT_TAG ${MUJOCO_DEP_VERSION_MarchingCubeCpp} + ) + +- FetchContent_GetProperties(marchingcubecpp) ++ fetchcontent_getproperties(marchingcubecpp) + if(NOT marchingcubecpp_POPULATED) +- FetchContent_Populate(marchingcubecpp) ++ fetchcontent_populate(marchingcubecpp) + include_directories(${marchingcubecpp_SOURCE_DIR}) + endif() + endif() + ++option(MUJOCO_USE_SYSTEM_qhull "Use installed qhull version." OFF) ++mark_as_advanced(MUJOCO_USE_SYSTEM_qhull) ++ + set(QHULL_ENABLE_TESTING OFF) + + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_qhull} + PACKAGE_NAME +- qhull ++ Qhull + LIBRARY_NAME + qhull +- GIT_REPO +- https://github.com/qhull/qhull.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_qhull} + TARGETS + qhull + EXCLUDE_FROM_ALL + ) +-# MuJoCo includes a file from libqhull_r which is not exported by the qhull include directories. +-# Add it to the target. +-target_include_directories( +- qhullstatic_r INTERFACE $ +-) +-target_compile_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) +-target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++ ++if(NOT MUJOCO_USE_SYSTEM_qhull) ++ # MuJoCo includes a file from libqhull_r which is not exported by the qhull include directories. ++ # Add it to the target. ++ target_include_directories( ++ qhullstatic_r INTERFACE $ ++ ) ++ target_compile_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) ++ target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++else() ++ if(NOT TARGET qhullstatic_r) ++ add_library(qhullstatic_r INTERFACE) ++ set_target_properties(qhullstatic_r PROPERTIES INTERFACE_LINK_LIBRARIES Qhull::qhull_r) ++ ++ # Workaround as headers are installed in /include/libqhull_r/something.h ++ # but mujoco include them as #include ++ get_property(qhull_include_dirs TARGET Qhull::qhull_r PROPERTY INTERFACE_INCLUDE_DIRECTORIES) ++ foreach(qhull_include_dir IN LISTS qhull_include_dirs) ++ target_include_directories(qhullstatic_r INTERFACE ${qhull_include_dirs}/libqhull_r) ++ endforeach() ++ target_include_directories(qhullstatic_r INTERFACE ) ++ endif() ++endif() ++ ++option(MUJOCO_USE_SYSTEM_tinyxml2 "Use installed tinyxml2 version." OFF) ++mark_as_advanced(MUJOCO_USE_SYSTEM_tinyxml2) + + set(tinyxml2_BUILD_TESTING OFF) + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_tinyxml2} + PACKAGE_NAME + tinyxml2 + LIBRARY_NAME + tinyxml2 +- GIT_REPO +- https://github.com/leethomason/tinyxml2.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_tinyxml2} + TARGETS +- tinyxml2 ++ tinyxml2::tinyxml2 + EXCLUDE_FROM_ALL + ) +-target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) +-target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++ ++if(NOT MUJOCO_USE_SYSTEM_tinyxml2) ++ target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) ++ target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++endif() ++ ++option(MUJOCO_USE_SYSTEM_tinyobjloader "Use installed tinyobjloader version." OFF) ++mark_as_advanced(MUJOCO_USE_SYSTEM_tinyobjloader) + + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_tinyobjloader} + PACKAGE_NAME + tinyobjloader + LIBRARY_NAME + tinyobjloader +- GIT_REPO +- https://github.com/tinyobjloader/tinyobjloader.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_tinyobjloader} + TARGETS + tinyobjloader + EXCLUDE_FROM_ALL + ) + ++if(MUJOCO_USE_SYSTEM_tinyobjloader) ++ # As of tinyobjloader v2.0.0rc10, the tinyobjloader target is named tinyobjloader in the build, ++ # but tinyobjloader::tinyobjloader when it is installed. To deal with this, if tinyobjloader is ++ # found in the system, we create an ALIAS ++ # The following is equivalent to add_library(tinyobjloader ALIAS tinyobjloader::tinyobjloader), ++ # but compatible with CMake 3.16 . Once the minimum CMake is bumped to CMake 3.18, we can use ++ # the simpler version ++ add_library(tinyobjloader INTERFACE IMPORTED) ++ set_target_properties(tinyobjloader PROPERTIES INTERFACE_LINK_LIBRARIES tinyobjloader::tinyobjloader) ++endif() ++ ++option(MUJOCO_USE_SYSTEM_sdflib "Use installed sdflib version." OFF) ++mark_as_advanced(MUJOCO_USE_SYSTEM_sdflib) ++ + option(SDFLIB_USE_ASSIMP OFF) + option(SDFLIB_USE_OPENMP OFF) + option(SDFLIB_USE_ENOKI OFF) ++ + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_sdflib} + PACKAGE_NAME +- sdflib ++ SdfLib + LIBRARY_NAME + sdflib +- GIT_REPO +- https://github.com/UPC-ViRVIG/SdfLib.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_sdflib} + TARGETS +- SdfLib ++ SdfLib::SdfLib + EXCLUDE_FROM_ALL + ) +-target_compile_options(SdfLib PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) +-target_link_options(SdfLib PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++ ++if(NOT MUJOCO_USE_SYSTEM_sdflib) ++ target_compile_options(SdfLib PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) ++ target_link_options(SdfLib PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++endif() ++ ++option(MUJOCO_USE_SYSTEM_ccd "Use installed ccd version." OFF) ++mark_as_advanced(MUJOCO_USE_SYSTEM_ccd) + + set(ENABLE_DOUBLE_PRECISION ON) + set(CCD_HIDE_ALL_SYMBOLS ON) + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_ccd} + PACKAGE_NAME + ccd + LIBRARY_NAME + ccd +- GIT_REPO +- https://github.com/danfis/libccd.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_ccd} + TARGETS + ccd + EXCLUDE_FROM_ALL + ) +-target_compile_options(ccd PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) +-target_link_options(ccd PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) +- +-# libCCD has an unconditional `#define _CRT_SECURE_NO_WARNINGS` on Windows. +-# TODO(stunya): Remove this after https://github.com/danfis/libccd/pull/77 is merged. +-if(WIN32) +- if(MSVC) +- # C4005 is the MSVC equivalent of -Wmacro-redefined. +- target_compile_options(ccd PRIVATE /wd4005) +- else() +- target_compile_options(ccd PRIVATE -Wno-macro-redefined) ++ ++if(NOT MUJOCO_USE_SYSTEM_ccd) ++ target_compile_options(ccd PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS}) ++ target_link_options(ccd PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS}) ++ # This is necessary to ensure that the any library that consumes the ccd ++ # compiled internally by MuJoCo (as static library) has CCD_EXPORT correctly ++ # defined as an empty string. For ccd itself, this is ensured by the variable ++ # CCD_HIDE_ALL_SYMBOLS set to ON before the call to findorfetch ++ # See https://github.com/danfis/libccd/pull/79 ++ target_compile_definitions(ccd INTERFACE CCD_STATIC_DEFINE) ++ ++ # libCCD has an unconditional `#define _CRT_SECURE_NO_WARNINGS` on Windows. ++ # TODO(stunya): Remove this after https://github.com/danfis/libccd/pull/77 is merged. ++ if(WIN32) ++ if(MSVC) ++ # C4005 is the MSVC equivalent of -Wmacro-redefined. ++ target_compile_options(ccd PRIVATE /wd4005) ++ else() ++ target_compile_options(ccd PRIVATE -Wno-macro-redefined) ++ endif() + endif() + endif() + + if(MUJOCO_BUILD_TESTS) ++ option(MUJOCO_USE_SYSTEM_abseil "Use installed abseil version." OFF) ++ mark_as_advanced(MUJOCO_USE_SYSTEM_abseil) ++ + set(ABSL_PROPAGATE_CXX_STD ON) + + # This specific version of Abseil does not have the following variable. We need to work with BUILD_TESTING +@@ -249,15 +299,11 @@ if(MUJOCO_BUILD_TESTS) + set(ABSL_BUILD_TESTING OFF) + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_abseil} + PACKAGE_NAME + absl + LIBRARY_NAME + abseil-cpp +- GIT_REPO +- https://github.com/abseil/abseil-cpp.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_abseil} + TARGETS + absl::core_headers + EXCLUDE_FROM_ALL +@@ -268,6 +314,9 @@ if(MUJOCO_BUILD_TESTS) + CACHE BOOL "Build tests." FORCE + ) + ++ option(MUJOCO_USE_SYSTEM_gtest "Use installed gtest version." OFF) ++ mark_as_advanced(MUJOCO_USE_SYSTEM_gtest) ++ + # Avoid linking errors on Windows by dynamically linking to the C runtime. + set(gtest_force_shared_crt + ON +@@ -276,22 +325,20 @@ if(MUJOCO_BUILD_TESTS) + + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_gtest} + PACKAGE_NAME + GTest + LIBRARY_NAME + googletest +- GIT_REPO +- https://github.com/google/googletest.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_gtest} + TARGETS +- gtest +- gmock +- gtest_main ++ GTest::gmock ++ GTest::gtest_main + EXCLUDE_FROM_ALL + ) + ++ option(MUJOCO_USE_SYSTEM_benchmark "Use installed benchmark version." OFF) ++ mark_as_advanced(MUJOCO_USE_SYSTEM_benchmark) ++ + set(BENCHMARK_EXTRA_FETCH_ARGS "") + if(WIN32 AND NOT MSVC) + set(BENCHMARK_EXTRA_FETCH_ARGS +@@ -310,15 +357,11 @@ if(MUJOCO_BUILD_TESTS) + + findorfetch( + USE_SYSTEM_PACKAGE +- OFF ++ ${MUJOCO_USE_SYSTEM_benchmark} + PACKAGE_NAME + benchmark + LIBRARY_NAME + benchmark +- GIT_REPO +- https://github.com/google/benchmark.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_benchmark} + TARGETS + benchmark::benchmark + benchmark::benchmark_main +@@ -328,26 +371,42 @@ if(MUJOCO_BUILD_TESTS) + endif() + + if(MUJOCO_TEST_PYTHON_UTIL) ++ option(MUJOCO_USE_SYSTEM_Eigen3 "Use installed Eigen3 version." OFF) ++ mark_as_advanced(MUJOCO_USE_SYSTEM_Eigen3) ++ + add_compile_definitions(EIGEN_MPL2_ONLY) +- if(NOT TARGET eigen) +- # Support new IN_LIST if() operator. +- set(CMAKE_POLICY_DEFAULT_CMP0057 NEW) ++ if(NOT TARGET Eigen3::Eigen) ++ if(NOT MUJOCO_USE_SYSTEM_Eigen3) ++ # Support new IN_LIST if() operator. ++ set(CMAKE_POLICY_DEFAULT_CMP0057 NEW) ++ endif() + +- FetchContent_Declare( ++ fetchcontent_declare( + Eigen3 +- GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git +- GIT_TAG ${MUJOCO_DEP_VERSION_Eigen3} + ) + +- FetchContent_GetProperties(Eigen3) ++ fetchcontent_getproperties(Eigen3) + if(NOT Eigen3_POPULATED) +- FetchContent_Populate(Eigen3) ++ fetchcontent_populate(Eigen3) + + # Mark the library as IMPORTED as a workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/15415 + add_library(Eigen3::Eigen INTERFACE IMPORTED) + set_target_properties( + Eigen3::Eigen PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}" + ) ++ ++ fetchcontent_getproperties(Eigen3) ++ # if(NOT Eigen3_POPULATED) ++ # fetchcontent_populate(Eigen3) ++ ++ # # Mark the library as IMPORTED as a workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/15415 ++ # add_library(Eigen3::Eigen INTERFACE IMPORTED) ++ # set_target_properties( ++ # Eigen3::Eigen PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}" ++ # ) ++ # endif() ++ else() ++ find_package(Eigen3 REQUIRED) + endif() + endif() + endif() +diff --git a/plugin/sdf/CMakeLists.txt b/plugin/sdf/CMakeLists.txt +index 3e216fc..e7e3a1e 100644 +--- a/plugin/sdf/CMakeLists.txt ++++ b/plugin/sdf/CMakeLists.txt +@@ -37,7 +37,7 @@ set(MUJOCO_SDF_SRCS + add_library(sdf SHARED) + target_sources(sdf PRIVATE ${MUJOCO_SDF_SRCS}) + target_include_directories(sdf PRIVATE ${MUJOCO_SDF_INCLUDE}) +-target_link_libraries(sdf PRIVATE mujoco SdfLib) ++target_link_libraries(sdf PRIVATE mujoco SdfLib::SdfLib) + target_compile_options( + sdf + PRIVATE ${AVX_COMPILE_OPTIONS} +diff --git a/python/mujoco/util/CMakeLists.txt b/python/mujoco/util/CMakeLists.txt +index 666a372..d89bb49 100644 +--- a/python/mujoco/util/CMakeLists.txt ++++ b/python/mujoco/util/CMakeLists.txt +@@ -63,8 +63,8 @@ if(BUILD_TESTING) + target_link_libraries( + array_traits_test + array_traits +- gmock +- gtest_main ++ GTest::gmock ++ GTest::gtest_main + ) + gtest_add_tests(TARGET array_traits_test SOURCES array_traits_test.cc) + +@@ -72,8 +72,8 @@ if(BUILD_TESTING) + target_link_libraries( + func_traits_test + func_traits +- gmock +- gtest_main ++ GTest::gmock ++ GTest::gtest_main + ) + gtest_add_tests(TARGET func_traits_test SOURCES func_traits_test.cc) + +@@ -81,8 +81,8 @@ if(BUILD_TESTING) + target_link_libraries( + func_wrap_test + func_wrap +- gmock +- gtest_main ++ GTest::gmock ++ GTest::gtest_main + ) + gtest_add_tests(TARGET func_wrap_test SOURCES func_wrap_test.cc) + +@@ -90,8 +90,8 @@ if(BUILD_TESTING) + target_link_libraries( + tuple_tools_test + func_wrap +- gmock +- gtest_main ++ GTest::gmock ++ GTest::gtest_main + ) + gtest_add_tests(TARGET tuple_tools_test SOURCES tuple_tools_test.cc) + endif() +diff --git a/simulate/cmake/SimulateDependencies.cmake b/simulate/cmake/SimulateDependencies.cmake +index 5141406..75ff788 100644 +--- a/simulate/cmake/SimulateDependencies.cmake ++++ b/simulate/cmake/SimulateDependencies.cmake +@@ -81,10 +81,6 @@ findorfetch( + glfw3 + LIBRARY_NAME + glfw3 +- GIT_REPO +- https://github.com/glfw/glfw.git +- GIT_TAG +- ${MUJOCO_DEP_VERSION_glfw3} + TARGETS + glfw + EXCLUDE_FROM_ALL +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 6bec911..2a16c21 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -30,7 +30,7 @@ macro(mujoco_test name) + ) + + add_executable(${name} ${name}.cc) +- target_link_libraries(${name} gtest_main mujoco) ++ target_link_libraries(${name} GTest::gtest_main mujoco) + target_include_directories(${name} PRIVATE ${MUJOCO_TEST_INCLUDE}) + set_target_properties(${name} PROPERTIES BUILD_RPATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + # gtest_discover_tests is recommended over gtest_add_tests, but has some issues in Windows. +@@ -59,20 +59,20 @@ target_link_libraries( + PUBLIC absl::core_headers + absl::strings + absl::synchronization +- gtest +- gmock ++ GTest::gtest ++ GTest::gmock + mujoco::mujoco + ) + target_include_directories(fixture PRIVATE ${mujoco_SOURCE_DIR}/include gmock) + + mujoco_test(fixture_test) +-target_link_libraries(fixture_test fixture gmock) ++target_link_libraries(fixture_test fixture GTest::gmock) + + mujoco_test(header_test) +-target_link_libraries(header_test fixture gmock) ++target_link_libraries(header_test fixture GTest::gmock) + + mujoco_test(pipeline_test) +-target_link_libraries(pipeline_test fixture gmock) ++target_link_libraries(pipeline_test fixture GTest::gmock) + + add_subdirectory(benchmark) + add_subdirectory(engine) diff --git a/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch b/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch new file mode 100644 index 000000000000..ca84c60a63df --- /dev/null +++ b/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch @@ -0,0 +1,192 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 251c456..3d30231 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,7 +27,7 @@ option(SDFLIB_USE_SYSTEM_GLM "Use glm library via find_package instead of downlo + option(SDFLIB_USE_SYSTEM_SPDLOG "Use spdlog library via find_package instead of downloading it" OFF) + option(SDFLIB_USE_SYSTEM_CEREAL "Use cereal library via find_package instead of downloading it" OFF) + option(SDFLIB_USE_SYSTEM_ASSIMP "Use assimp library via find_package instead of downloading it" OFF) +- ++option(SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE "Use TriangleMeshDistance library via system includes instead of downloading it" OFF) + + if(SDFLIB_DEBUG_INFO) + add_compile_definitions(SDFLIB_PRINT_STATISTICS) +@@ -55,13 +55,52 @@ file(GLOB UTILS_SOURCE_FILES src/utils/*.cpp) + file(GLOB UTILS_HEADER_FILES src/utils/*.h) + + # Add libraries +-add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES} ${PUBLIC_HEADER_FILES} +- ${SDF_SOURCE_FILES} ${SDF_HEADER_FILES} +- ${UTILS_SOURCE_FILES} ${UTILS_HEADER_FILES}) +- +-target_include_directories(${PROJECT_NAME} PUBLIC include/) ++add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${PUBLIC_HEADER_FILES} ++ ${SDF_SOURCE_FILES} ${SDF_HEADER_FILES} ++ ${UTILS_SOURCE_FILES} ${UTILS_HEADER_FILES}) ++add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) ++if(BUILD_SHARED_LIBS AND WIN32) ++ set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) ++endif() ++include(GNUInstallDirs) ++target_include_directories(${PROJECT_NAME} PUBLIC $ ++ $) + target_include_directories(${PROJECT_NAME} PRIVATE src/) + ++# Install library and CMake config files ++install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}) ++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/SdfLib ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ ++install(EXPORT ${PROJECT_NAME} ++ FILE ${PROJECT_NAME}Targets.cmake ++ DESTINATION lib/cmake/${PROJECT_NAME} ++ NAMESPACE ${PROJECT_NAME}:: ++) ++ ++include(CMakePackageConfigHelpers) ++set(PACKAGE_DEPENDENCIES "") ++if(SDFLIB_USE_SYSTEM_GLM) ++ string(APPEND PACKAGE_DEPENDENCIES "find_dependency(glm)\n") ++endif() ++if(SDFLIB_USE_SYSTEM_SPDLOG) ++ string(APPEND PACKAGE_DEPENDENCIES "find_dependency(spdlog)\n") ++endif() ++if(SDFLIB_USE_SYSTEM_CEREAL) ++ string(APPEND PACKAGE_DEPENDENCIES "find_dependency(cereal)\n") ++endif() ++if(SDFLIB_USE_ASSIMP AND SDFLIB_USE_SYSTEM_ASSIMP) ++ string(APPEND PACKAGE_DEPENDENCIES "find_dependency(assimp)\n") ++endif() ++ ++configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" ++ INSTALL_DESTINATION "lib/cmake/${PROJECT_NAME}" ++ NO_SET_AND_CHECK_MACRO ++ NO_CHECK_REQUIRED_COMPONENTS_MACRO) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake ++ DESTINATION lib/cmake/${PROJECT_NAME}) ++ + # Add shaders + file(GLOB SHADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/shaders + src/render_engine/shaders/*.frag +@@ -69,7 +108,7 @@ file(GLOB SHADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/sh + src/render_engine/shaders/*.comp) + + foreach(SHADER IN LISTS SHADER_FILES) +- add_custom_command(OUTPUT ${SHADER} ++add_custom_command(OUTPUT ${SHADER} + COMMAND cmake -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/shaders/${SHADER} $/shaders/${SHADER} + DEPENDS src/render_engine/shaders/${SHADER} + ) +@@ -112,7 +151,10 @@ endif() + target_link_libraries(${PROJECT_NAME} PUBLIC ${SDFLIB_GLM_TARGET}) + target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog) + target_link_libraries(${PROJECT_NAME} PUBLIC cereal::cereal) +-target_link_libraries(${PROJECT_NAME} PUBLIC icg) ++ ++if(NOT SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE) ++ target_link_libraries(${PROJECT_NAME} PUBLIC TriangleMeshDistance) ++endif() + + if(CMAKE_CXX_COMPILER_ID MATCHES GNU) + target_link_libraries(${PROJECT_NAME} PUBLIC -lstdc++fs) +diff --git a/SdfLibConfig.cmake.in b/SdfLibConfig.cmake.in +new file mode 100644 +index 0000000..9b8265c +--- /dev/null ++++ b/SdfLibConfig.cmake.in +@@ -0,0 +1,7 @@ ++@PACKAGE_INIT@ ++ ++include(CMakeFindDependencyMacro) ++ ++@PACKAGE_DEPENDENCIES@ ++ ++include("${CMAKE_CURRENT_LIST_DIR}/SdfLibTargets.cmake") +diff --git a/include/SdfLib/TrianglesInfluence.h b/include/SdfLib/TrianglesInfluence.h +index fc2ca52..b276f23 100644 +--- a/include/SdfLib/TrianglesInfluence.h ++++ b/include/SdfLib/TrianglesInfluence.h +@@ -11,7 +11,7 @@ + #include "InterpolationMethods.h" + #include "utils/Timer.h" + #include "utils/GJK.h" +-#include ++#include + + #include + #include +diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt +index 79f70c1..e2a4f10 100644 +--- a/libs/CMakeLists.txt ++++ b/libs/CMakeLists.txt +@@ -137,9 +137,10 @@ if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS) + target_include_directories(stb_image INTERFACE stb) + endif() + +-# icg +-add_library(icg INTERFACE) +-target_include_directories(icg INTERFACE InteractiveComputerGraphics) ++if (NOT SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE) ++ add_library(TriangleMeshDistance INTERFACE) ++ target_include_directories(TriangleMeshDistance INTERFACE InteractiveComputerGraphics) ++endif() + + if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS) + # glfw +diff --git a/libs/InteractiveComputerGraphics/InteractiveComputerGraphics/TriangleMeshDistance.h b/libs/InteractiveComputerGraphics/tmd/TriangleMeshDistance.h +similarity index 100% +rename from libs/InteractiveComputerGraphics/InteractiveComputerGraphics/TriangleMeshDistance.h +rename to libs/InteractiveComputerGraphics/tmd/TriangleMeshDistance.h +diff --git a/src/tools/ImageQueryTime/main.cpp b/src/tools/ImageQueryTime/main.cpp +index 357a78b..f4fd9e7 100644 +--- a/src/tools/ImageQueryTime/main.cpp ++++ b/src/tools/ImageQueryTime/main.cpp +@@ -17,7 +17,7 @@ + + #define TEST_METHODS + #ifdef TEST_METHODS +-#include ++#include + // #include + // #include + // #include +diff --git a/src/tools/SdfErrorCompare/main.cpp b/src/tools/SdfErrorCompare/main.cpp +index deef25f..9e402c4 100644 +--- a/src/tools/SdfErrorCompare/main.cpp ++++ b/src/tools/SdfErrorCompare/main.cpp +@@ -23,7 +23,7 @@ using namespace sdflib; + // #define TEST_OPENVDB + + #ifdef TEST_ICG +-#include ++#include + #endif + #ifdef TEST_CGAL + #include +diff --git a/src/tools/SdfLibUnity/SdfExportFunc.cpp b/src/tools/SdfLibUnity/SdfExportFunc.cpp +index ff4e017..7e06ada 100644 +--- a/src/tools/SdfLibUnity/SdfExportFunc.cpp ++++ b/src/tools/SdfLibUnity/SdfExportFunc.cpp +@@ -1,7 +1,7 @@ + #include "SdfExportFunc.h" + #include "spdlog/sinks/rotating_file_sink.h" + +-#include ++#include + + using namespace sdflib; + +diff --git a/src/tools/SdfOffsets/main.cpp b/src/tools/SdfOffsets/main.cpp +index b6769d7..07f137b 100644 +--- a/src/tools/SdfOffsets/main.cpp ++++ b/src/tools/SdfOffsets/main.cpp +@@ -9,7 +9,7 @@ + #include + #include + +-#include ++#include + #include + #include + #include diff --git a/pkgs/development/python-modules/mujoco/default.nix b/pkgs/development/python-modules/mujoco/default.nix new file mode 100644 index 000000000000..ac24200332ab --- /dev/null +++ b/pkgs/development/python-modules/mujoco/default.nix @@ -0,0 +1,70 @@ +{ buildPythonPackage +, cmake +, fetchPypi +, glfw +, lib +, mujoco +, numpy +, perl +, pkgs +, pybind11 +, python +, setuptools +}: + +buildPythonPackage rec { + pname = "mujoco"; + version = "3.0.0"; + + pyproject = true; + + # We do not fetch from the repository because the PyPi tarball is + # impurely build via + # + # in the project's CI. + src = fetchPypi { + inherit pname version; + hash = "sha256-2ImKDfm9hCORaH7iou/Lp979VSCugCM/Gqnb/CkTeOw="; + }; + + nativeBuildInputs = [ cmake setuptools ]; + dontUseCmakeConfigure = true; + buildInputs = [ mujoco pybind11 ]; + propagatedBuildInputs = [ glfw numpy ]; + + pythonImportsCheck = [ "${pname}" ]; + + env.MUJOCO_PATH = "${mujoco}"; + env.MUJOCO_PLUGIN_PATH = "${mujoco}/lib"; + env.MUJOCO_CMAKE_ARGS = "-DMUJOCO_SIMULATE_USE_SYSTEM_GLFW=ON"; + + preConfigure = + # Use system packages for pybind + '' + ${perl}/bin/perl -0777 -i -pe "s/(findorfetch\(.{3}USE_SYSTEM_PACKAGE.{3})(OFF)(.{3}PACKAGE_NAME.{3}pybind11.*\))/\1ON\3/gms" mujoco/CMakeLists.txt + '' + + # Use non-system eigen3, lodepng, abseil: Remove mirror info and prefill + # dependency directory. $build from setuptools. + (let + # E.g. 3.11.2 -> "311" + pythonVersionMajorMinor = with lib.versions; + "${major python.pythonVersion}${minor python.pythonVersion}"; + in '' + ${perl}/bin/perl -0777 -i -pe "s/GIT_REPO\n.*\n.*GIT_TAG\n.*\n//gm" mujoco/CMakeLists.txt + ${perl}/bin/perl -0777 -i -pe "s/(FetchContent_Declare\(\n.*lodepng\n.*)(GIT_REPO.*\n.*GIT_TAG.*\n)(.*\))/\1\3/gm" mujoco/simulate/CMakeLists.txt + + build="/build/${pname}-${version}/build/temp.linux-x86_64-cpython-${pythonVersionMajorMinor}/" + mkdir -p $build/_deps + ln -s ${mujoco.pin.lodepng} $build/_deps/lodepng-src + ln -s ${mujoco.pin.eigen3} $build/_deps/eigen-src + ln -s ${mujoco.pin.abseil-cpp} $build/_deps/abseil-cpp-src + ''); + + meta = with lib; { + description = + "Python bindings for MuJoCo: a general purpose physics simulator."; + homepage = "https://mujoco.org/"; + license = licenses.asl20; + maintainers = with maintainers; [ tmplt ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f9ed05e39462..e04693f60e0a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7119,6 +7119,10 @@ self: super: with self; { mutf8 = callPackage ../development/python-modules/mutf8 { }; + mujoco = callPackage ../development/python-modules/mujoco { + inherit (pkgs) mujoco; + }; + mujson = callPackage ../development/python-modules/mujson { }; mwcli = callPackage ../development/python-modules/mwcli { }; From 59878f63cac103b28bb8fec293798f4efd18e816 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 13 Nov 2023 20:09:22 +0100 Subject: [PATCH 03/38] python311Packages.black: 23.9.1 -> 23.11.0 https://github.com/psf/black/blob/23.11.0/CHANGES.md --- pkgs/development/python-modules/black/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/black/default.nix b/pkgs/development/python-modules/black/default.nix index 76890aeda286..52cc36e989cc 100644 --- a/pkgs/development/python-modules/black/default.nix +++ b/pkgs/development/python-modules/black/default.nix @@ -26,14 +26,14 @@ buildPythonPackage rec { pname = "black"; - version = "23.9.1"; + version = "23.11.0"; format = "pyproject"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-JLaz/1xtnqCKiIj2l36uhY4fNA1yYM9W1wpJgjI2ti0="; + hash = "sha256-TGiFWCX/Qy0ZcimEb5cbxNZmbOkEkuWwIBO8rKTZqwU="; }; nativeBuildInputs = [ From dd6fa9c2e691ead3b729a064d816c375be2a0c1f Mon Sep 17 00:00:00 2001 From: Viktor Sonesten Date: Thu, 16 Nov 2023 19:09:22 +0100 Subject: [PATCH 04/38] mujoco: 3.0.0 -> 3.0.1 --- pkgs/applications/science/robotics/mujoco/default.nix | 4 ++-- pkgs/development/python-modules/mujoco/default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/robotics/mujoco/default.nix b/pkgs/applications/science/robotics/mujoco/default.nix index 94524672789d..139e1140e7c9 100644 --- a/pkgs/applications/science/robotics/mujoco/default.nix +++ b/pkgs/applications/science/robotics/mujoco/default.nix @@ -129,13 +129,13 @@ let in stdenv.mkDerivation rec { pname = "mujoco"; - version = "3.0.0"; + version = "3.0.1"; src = fetchFromGitHub { owner = "google-deepmind"; repo = pname; rev = version; - hash = "sha256-zHK1uYtWkKFWBMqkw/NwuBlLoXyiZJeNC/sSXwSfgW4="; + hash = "sha256-UXE+7KDti8RarpoJoo9Ei3TgW/Qdnj3ASRo8uTWhGrU="; }; patches = [ ./mujoco-system-deps-dont-fetch.patch ]; diff --git a/pkgs/development/python-modules/mujoco/default.nix b/pkgs/development/python-modules/mujoco/default.nix index ac24200332ab..2392de3847bd 100644 --- a/pkgs/development/python-modules/mujoco/default.nix +++ b/pkgs/development/python-modules/mujoco/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "mujoco"; - version = "3.0.0"; + version = "3.0.1"; pyproject = true; @@ -24,7 +24,7 @@ buildPythonPackage rec { # in the project's CI. src = fetchPypi { inherit pname version; - hash = "sha256-2ImKDfm9hCORaH7iou/Lp979VSCugCM/Gqnb/CkTeOw="; + hash = "sha256-pftecOk4q19qKBHs9hBBVenI+SgJg9VT7vc6NKuiY0s="; }; nativeBuildInputs = [ cmake setuptools ]; From 4d3c9e00cbcda1b6180e6f92dbf7c75334ddeb06 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 21 Nov 2023 12:59:12 +0100 Subject: [PATCH 05/38] go2rtc: 1.8.2 -> 1.8.4 https://github.com/AlexxIT/go2rtc/releases/tag/v1.8.3 https://github.com/AlexxIT/go2rtc/releases/tag/v1.8.4 --- pkgs/tools/video/go2rtc/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/video/go2rtc/default.nix b/pkgs/tools/video/go2rtc/default.nix index 9b0f9bbe3f70..7b6c6920bcc2 100644 --- a/pkgs/tools/video/go2rtc/default.nix +++ b/pkgs/tools/video/go2rtc/default.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "go2rtc"; - version = "1.8.2"; + version = "1.8.4"; src = fetchFromGitHub { owner = "AlexxIT"; repo = "go2rtc"; rev = "refs/tags/v${version}"; - hash = "sha256-3cWhASwOgSovApNT/MUbhHhmp/o4k3ckgfcSFwJJqI8="; + hash = "sha256-knC8GWu8543QIvk2OKotTHB88qgSQpOI+58oHusgVKc="; }; - vendorHash = "sha256-SV4sMDgUv6Ci0aC7wsam7ftqMSpFwsMGkC9qLpR+O68="; + vendorHash = "sha256-+n0atALq5e2iEbEeJ1kefnKka7gTE0iFRSRnUCz4bh8="; buildFlagArrays = [ "-trimpath" From da1facff638c224b67434598037a54fc30378f5d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 21 Nov 2023 13:08:33 +0100 Subject: [PATCH 06/38] python311Packages.django_5: 5.0b1 -> 5.0rc1 https://www.djangoproject.com/weblog/2023/nov/20/django-50-rc1/ --- pkgs/development/python-modules/django/5.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/django/5.nix b/pkgs/development/python-modules/django/5.nix index 0ea8de9a4c7c..ed4f7a9162a7 100644 --- a/pkgs/development/python-modules/django/5.nix +++ b/pkgs/development/python-modules/django/5.nix @@ -42,14 +42,14 @@ buildPythonPackage rec { pname = "Django"; - version = "5.0b1"; + version = "5.0rc1"; pyproject = true; disabled = pythonOlder "3.10"; src = fetchPypi { inherit pname version; - hash = "sha256-yIY15zPwoO9GwhljXiHI9ZeOsqFMORgiRlRUG8XVcDA="; + hash = "sha256-pLt3plnaAyt0GpXcuVeGTzaVJ10dWB73Y3IUMA+qrzA="; }; patches = [ From fb0afe23a454d665da53b22a8597d52f28d4e9e4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 28 Nov 2023 00:38:21 +0100 Subject: [PATCH 07/38] esphome: 2023.11.4 -> 2023.11.6 https://github.com/esphome/esphome/releases/tag/2023.11.5 https://github.com/esphome/esphome/releases/tag/2023.11.6 --- pkgs/tools/misc/esphome/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/esphome/default.nix b/pkgs/tools/misc/esphome/default.nix index 6ac1f24a2010..2b683e73ed0f 100644 --- a/pkgs/tools/misc/esphome/default.nix +++ b/pkgs/tools/misc/esphome/default.nix @@ -16,14 +16,14 @@ let in python.pkgs.buildPythonApplication rec { pname = "esphome"; - version = "2023.11.4"; + version = "2023.11.6"; format = "setuptools"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-KIDqIf9aJP5IS+qE0Gy5j3F2DGz/WGbN4Wf9SGzgnzA="; + hash = "sha256-9LqZlhCt+7p6tnSHFhbnUzkEOJQDsg/Pd/hgd/Il0ZQ="; }; postPatch = '' From 37517db1dee39b41b92bde635e75b5f0fbfcdefe Mon Sep 17 00:00:00 2001 From: Manuel Frischknecht Date: Tue, 28 Nov 2023 20:40:15 +0100 Subject: [PATCH 08/38] mpdcron: fix build by correcting a C function conflict in `nokogiri` `nokogiri` defines a C function called `canonicalize` which conflicts with another function defined in glibc. Upstream has fixed this issue [1], but in a much newer version. And because the affected file has changed since the merged patch [2], it isn't directly applicable to the old gem version `mpdcron` depends on. [1]: https://github.com/sparklemotion/nokogiri/issues/2105 [2]: https://github.com/sparklemotion/nokogiri/commit/7a74cdbe4538e964023e5a0fdca58d8af708b91e --- ...fix-canonicalize-conflict-with-glibc.patch | 22 +++++++++++++++++++ pkgs/tools/audio/mpdcron/gemset.nix | 13 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/tools/audio/mpdcron/fix-canonicalize-conflict-with-glibc.patch diff --git a/pkgs/tools/audio/mpdcron/fix-canonicalize-conflict-with-glibc.patch b/pkgs/tools/audio/mpdcron/fix-canonicalize-conflict-with-glibc.patch new file mode 100644 index 000000000000..dd89f8998498 --- /dev/null +++ b/pkgs/tools/audio/mpdcron/fix-canonicalize-conflict-with-glibc.patch @@ -0,0 +1,22 @@ +diff --git a/ext/nokogiri/xml_document.c b/ext/nokogiri/xml_document.c +index 1d2119c8..c1c87713 100644 +--- a/ext/nokogiri/xml_document.c ++++ b/ext/nokogiri/xml_document.c +@@ -492,7 +492,7 @@ static int block_caller(void * ctx, xmlNodePtr _node, xmlNodePtr _parent) + * The block must return a non-nil, non-false value if the +obj+ passed in + * should be included in the canonicalized document. + */ +-static VALUE canonicalize(int argc, VALUE* argv, VALUE self) ++static VALUE nokogiri_xml_document_canonicalize(int argc, VALUE* argv, VALUE self) + { + VALUE mode; + VALUE incl_ns; +@@ -573,7 +573,7 @@ void init_xml_document() + rb_define_method(klass, "encoding", encoding, 0); + rb_define_method(klass, "encoding=", set_encoding, 1); + rb_define_method(klass, "version", version, 0); +- rb_define_method(klass, "canonicalize", canonicalize, -1); ++ rb_define_method(klass, "nokogiri_xml_document_canonicalize", canonicalize, -1); + rb_define_method(klass, "dup", duplicate_document, -1); + rb_define_method(klass, "url", url, 0); + rb_define_method(klass, "create_entity", create_entity, -1); diff --git a/pkgs/tools/audio/mpdcron/gemset.nix b/pkgs/tools/audio/mpdcron/gemset.nix index 836878c9d88a..ee254bb6354b 100644 --- a/pkgs/tools/audio/mpdcron/gemset.nix +++ b/pkgs/tools/audio/mpdcron/gemset.nix @@ -18,6 +18,19 @@ sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4"; type = "gem"; }; + + dontBuild = false; + patches = [ + # Fixes a naming conflict of nokogiri's `canonicalize` function + # with one defined in glibc. This has been fixed upstream in 2020 + # in a much newer version (1.15.5), but through the divergence + # of the affected file, the commit isn't directly applicable to + # the one packaged here: + # + # https://github.com/sparklemotion/nokogiri/pull/2106/commits/7a74cdbe4538e964023e5a0fdca58d8af708b91e + # https://github.com/sparklemotion/nokogiri/issues/2105 + ./fix-canonicalize-conflict-with-glibc.patch + ]; version = "1.10.3"; }; } From d28af53cce1bf747d9dde091d8542750a86695bb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 1 Dec 2023 13:39:54 +0100 Subject: [PATCH 09/38] zigbee2mqtt: 1.33.2 -> 1.34.0 https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.34.0 --- pkgs/servers/zigbee2mqtt/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/zigbee2mqtt/default.nix b/pkgs/servers/zigbee2mqtt/default.nix index 010112dff80b..6b655c63cd86 100644 --- a/pkgs/servers/zigbee2mqtt/default.nix +++ b/pkgs/servers/zigbee2mqtt/default.nix @@ -8,16 +8,16 @@ buildNpmPackage rec { pname = "zigbee2mqtt"; - version = "1.33.2"; + version = "1.34.0"; src = fetchFromGitHub { owner = "Koenkk"; repo = "zigbee2mqtt"; rev = version; - hash = "sha256-pRY4FOIJwsLSKYieN0D1esKdoUqx62NMFgiYXaXguJ0="; + hash = "sha256-2D9WylfpetnEZdY4STIrGEU6Gg1gET/zf5p7Ou/Wm5Q="; }; - npmDepsHash = "sha256-9bOFM8Ie0334H2L94ypgkMrB6zyVJ9YTvNnKeBJjOUI="; + npmDepsHash = "sha256-MXTKZNERxryt7L42dHxKx7XfXByNQ67oU+4FKTd0u4U="; nativeBuildInputs = [ python3 From b1b67e980a9a8e6227d5f71f8b036e17c7716f0d Mon Sep 17 00:00:00 2001 From: netali Date: Fri, 1 Dec 2023 14:04:45 +0100 Subject: [PATCH 10/38] nixos/mysql-auth: fix passwords in config files --- nixos/modules/config/mysql.nix | 57 +++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/nixos/modules/config/mysql.nix b/nixos/modules/config/mysql.nix index 95c9ba76663e..4f72d22c4f0e 100644 --- a/nixos/modules/config/mysql.nix +++ b/nixos/modules/config/mysql.nix @@ -6,6 +6,8 @@ let cfg = config.users.mysql; in { + meta.maintainers = [ maintainers.netali ]; + options = { users.mysql = { enable = mkEnableOption (lib.mdDoc "Authentication against a MySQL/MariaDB database"); @@ -358,7 +360,7 @@ in user = "root"; group = "root"; mode = "0600"; - # password will be added from password file in activation script + # password will be added from password file in systemd oneshot text = '' users.host=${cfg.host} users.db_user=${cfg.user} @@ -423,34 +425,45 @@ in mode = "0600"; user = config.services.nscd.user; group = config.services.nscd.group; - # password will be added from password file in activation script + # password will be added from password file in systemd oneshot text = '' username ${cfg.user} ''; }; - # preStart script to append the password from the password file - # to the configuration files. It also fixes the owner of the - # libnss-mysql-root.cfg because it is changed to root after the - # password is appended. - systemd.services.mysql.preStart = '' - if [[ -r ${cfg.passwordFile} ]]; then - org_umask=$(umask) - umask 0077 + systemd.services.mysql-auth-pw-init = { + description = "Adds the mysql password to the mysql auth config files"; - conf_nss="$(mktemp)" - cp /etc/libnss-mysql-root.cfg $conf_nss - printf 'password %s\n' "$(cat ${cfg.passwordFile})" >> $conf_nss - mv -fT "$conf_nss" /etc/libnss-mysql-root.cfg - chown ${config.services.nscd.user}:${config.services.nscd.group} /etc/libnss-mysql-root.cfg + before = [ "nscd.service" ]; + wantedBy = [ "multi-user.target" ]; - conf_pam="$(mktemp)" - cp /etc/security/pam_mysql.conf $conf_pam - printf 'users.db_passwd=%s\n' "$(cat ${cfg.passwordFile})" >> $conf_pam - mv -fT "$conf_pam" /etc/security/pam_mysql.conf + serviceConfig = { + Type = "oneshot"; + User = "root"; + Group = "root"; + }; - umask $org_umask - fi - ''; + restartTriggers = [ + config.environment.etc."security/pam_mysql.conf".source + config.environment.etc."libnss-mysql.cfg".source + config.environment.etc."libnss-mysql-root.cfg".source + ]; + + script = '' + if [[ -r ${cfg.passwordFile} ]]; then + umask 0077 + conf_nss="$(mktemp)" + cp /etc/libnss-mysql-root.cfg $conf_nss + printf 'password %s\n' "$(cat ${cfg.passwordFile})" >> $conf_nss + mv -fT "$conf_nss" /etc/libnss-mysql-root.cfg + chown ${config.services.nscd.user}:${config.services.nscd.group} /etc/libnss-mysql-root.cfg + + conf_pam="$(mktemp)" + cp /etc/security/pam_mysql.conf $conf_pam + printf 'users.db_passwd=%s\n' "$(cat ${cfg.passwordFile})" >> $conf_pam + mv -fT "$conf_pam" /etc/security/pam_mysql.conf + fi + ''; + }; }; } From 229e6eb8edb304a8b0e8dec70eaf8a6e9f990020 Mon Sep 17 00:00:00 2001 From: pennae Date: Fri, 1 Dec 2023 18:20:24 +0100 Subject: [PATCH 11/38] nixos-render-docs: don't drop code languages anymore this was needed because the nixos/nixpkgs manuals, for some reason, *did* drop the languages. we no longer have to render exactly as the docbook toolchain did, so we can finally fix this bug. --- .../tools/nix/nixos-render-docs/src/nixos_render_docs/html.py | 4 ++-- .../nix/nixos-render-docs/src/nixos_render_docs/options.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py index ffe64cde4d34..c6d8d317f6bf 100644 --- a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py +++ b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py @@ -97,8 +97,8 @@ class HTMLRenderer(Renderer): def strong_close(self, token: Token, tokens: Sequence[Token], i: int) -> str: return "" def fence(self, token: Token, tokens: Sequence[Token], i: int) -> str: - # TODO use token.info. docbook doesn't so we can't yet. - return f'
\n{escape(token.content)}
' + info = f" {escape(token.info, True)}" if token.info != "" else "" + return f'
\n{escape(token.content)}
' def blockquote_open(self, token: Token, tokens: Sequence[Token], i: int) -> str: return '
' def blockquote_close(self, token: Token, tokens: Sequence[Token], i: int) -> str: diff --git a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py index d0229e074c54..c5fa9acb9afc 100644 --- a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py +++ b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py @@ -496,8 +496,8 @@ class OptionsHTMLRenderer(OptionDocsRestrictions, HTMLRenderer): token.meta['compact'] = False return super().bullet_list_open(token, tokens, i) def fence(self, token: Token, tokens: Sequence[Token], i: int) -> str: - # TODO use token.info. docbook doesn't so we can't yet. - return f'
{html.escape(token.content)}
' + info = f" {html.escape(token.info, True)}" if token.info != "" else "" + return f'
{html.escape(token.content)}
' class HTMLConverter(BaseConverter[OptionsHTMLRenderer]): __option_block_separator__ = "" From b7c363b20dbc962b1c762a23b69d098cfd143428 Mon Sep 17 00:00:00 2001 From: Niko <97130632+Nyabinary@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:30:25 -0500 Subject: [PATCH 12/38] vinegar: init at 1.5.8 --- pkgs/by-name/vi/vinegar/package.nix | 54 +++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 pkgs/by-name/vi/vinegar/package.nix diff --git a/pkgs/by-name/vi/vinegar/package.nix b/pkgs/by-name/vi/vinegar/package.nix new file mode 100644 index 000000000000..6fe0035dab6b --- /dev/null +++ b/pkgs/by-name/vi/vinegar/package.nix @@ -0,0 +1,54 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, wine +, makeBinaryWrapper +, pkg-config +, libGL +, libxkbcommon +, xorg +}: + +buildGoModule rec { + pname = "vinegar"; + version = "1.5.8"; + + src = fetchFromGitHub { + owner = "vinegarhq"; + repo = "vinegar"; + rev = "v${version}"; + hash = "sha256-1KDcc9Hms1hQgpvf/49zFJ85kDUsieNcoOTYaZWV+S0="; + }; + + vendorHash = "sha256-UJLwSOJ4vZt3kquKllm5OMfFheZtAG5gLSA20313PpA="; + + nativeBuildInputs = [ pkg-config makeBinaryWrapper ]; + buildInputs = [ libGL libxkbcommon xorg.libX11 xorg.libXcursor xorg.libXfixes wine ]; + + buildPhase = '' + runHook preBuild + make PREFIX=$out + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + make PREFIX=$out install + runHook postInstall + ''; + + postInstall = '' + wrapProgram $out/bin/vinegar \ + --prefix PATH : ${lib.makeBinPath [ wine ]} + ''; + + meta = with lib; { + description = "An open-source, minimal, configurable, fast bootstrapper for running Roblox on Linux"; + homepage = "https://github.com/vinegarhq/vinegar"; + changelog = "https://github.com/vinegarhq/vinegar/releases/tag/v${version}"; + mainProgram = "vinegar"; + license = licenses.gpl3Only; + platforms = [ "x86_64-linux" "i686-linux" ]; + maintainers = with maintainers; [ nyanbinary ]; + }; +} From 548f98f4fbf4ff72294cc21ab261f810ca5e5c6e Mon Sep 17 00:00:00 2001 From: pennae Date: Fri, 1 Dec 2023 18:31:41 +0100 Subject: [PATCH 13/38] nixos-render-docs: wrap code in
, not 

newer hljs stylesheets work best with 
 wrapping, and it's
semantically more accurate as well.
---
 .../src/nixos_render_docs/html.py             |  2 +-
 .../src/nixos_render_docs/options.py          |  2 +-
 .../nixos-render-docs/src/tests/test_html.py  | 24 ++++++++++++-------
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py
index c6d8d317f6bf..b9227814dea2 100644
--- a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py
+++ b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/html.py
@@ -98,7 +98,7 @@ class HTMLRenderer(Renderer):
         return ""
     def fence(self, token: Token, tokens: Sequence[Token], i: int) -> str:
         info = f" {escape(token.info, True)}" if token.info != "" else ""
-        return f'
\n{escape(token.content)}
' + return f'
{escape(token.content)}
' def blockquote_open(self, token: Token, tokens: Sequence[Token], i: int) -> str: return '
' def blockquote_close(self, token: Token, tokens: Sequence[Token], i: int) -> str: diff --git a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py index c5fa9acb9afc..9a00da567fa9 100644 --- a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py +++ b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py @@ -497,7 +497,7 @@ class OptionsHTMLRenderer(OptionDocsRestrictions, HTMLRenderer): return super().bullet_list_open(token, tokens, i) def fence(self, token: Token, tokens: Sequence[Token], i: int) -> str: info = f" {html.escape(token.info, True)}" if token.info != "" else "" - return f'
{html.escape(token.content)}
' + return f'
{html.escape(token.content)}
' class HTMLConverter(BaseConverter[OptionsHTMLRenderer]): __option_block_separator__ = "" diff --git a/pkgs/tools/nix/nixos-render-docs/src/tests/test_html.py b/pkgs/tools/nix/nixos-render-docs/src/tests/test_html.py index 96cf8d0b7dff..fba0ce2679a4 100644 --- a/pkgs/tools/nix/nixos-render-docs/src/tests/test_html.py +++ b/pkgs/tools/nix/nixos-render-docs/src/tests/test_html.py @@ -204,8 +204,10 @@ def test_full() -> None:

with nesting

-
↵
-             nested code block↵
+            
+             
+              nested code block↵
+             
             
@@ -213,8 +215,10 @@ def test_full() -> None:
  • and lists

  • -
    ↵
    -              containing code↵
    +             
    +              
    +               containing code↵
    +              
                  
@@ -240,11 +244,15 @@ def test_full() -> None:

-
↵
-            code block↵
+           
+            
+             code block↵
+            
            
-
↵
-            fenced block↵
+           
+            
+             fenced block↵
+            
            

text

From 3bf6d6d251f4df59690b6ec7174a90789ec3717b Mon Sep 17 00:00:00 2001 From: pennae Date: Fri, 1 Dec 2023 18:33:47 +0100 Subject: [PATCH 14/38] documentation-highlighter: 9.12.0 -> 11.9.0, add new langs this has been overdue for a while. we also add the `shell` language to the bundle (in addition to nix and bash) for ShellSession highlighting. perhaps we should use the full, regular distribution instead of a custom build, but eh. --- .editorconfig | 3 + pkgs/misc/documentation-highlighter/LICENSE | 43 ++- pkgs/misc/documentation-highlighter/README.md | 155 ++------ .../highlight.pack.js | 347 +++++++++++++++++- pkgs/misc/documentation-highlighter/loader.js | 11 +- .../documentation-highlighter/mono-blue.css | 33 +- pkgs/misc/documentation-highlighter/update.sh | 18 +- 7 files changed, 427 insertions(+), 183 deletions(-) diff --git a/.editorconfig b/.editorconfig index ebb66b07945c..c4682829e357 100644 --- a/.editorconfig +++ b/.editorconfig @@ -90,6 +90,9 @@ insert_final_newline = unset indent_style = unset trim_trailing_whitespace = unset +[pkgs/misc/documentation-highlighter/**] +insert_final_newline = unset + [pkgs/servers/dict/wordnet_structures.py] trim_trailing_whitespace = unset diff --git a/pkgs/misc/documentation-highlighter/LICENSE b/pkgs/misc/documentation-highlighter/LICENSE index 422deb7350fe..2250cc7eca9b 100644 --- a/pkgs/misc/documentation-highlighter/LICENSE +++ b/pkgs/misc/documentation-highlighter/LICENSE @@ -1,24 +1,29 @@ -Copyright (c) 2006, Ivan Sagalaev +BSD 3-Clause License + +Copyright (c) 2006, Ivan Sagalaev. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of highlight.js nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkgs/misc/documentation-highlighter/README.md b/pkgs/misc/documentation-highlighter/README.md index f4baa3c8e001..569c90affed9 100644 --- a/pkgs/misc/documentation-highlighter/README.md +++ b/pkgs/misc/documentation-highlighter/README.md @@ -1,132 +1,30 @@ This file was generated with pkgs/misc/documentation-highlighter/update.sh -# Highlight.js +# Highlight.js CDN Assets -[![Build Status](https://travis-ci.org/isagalaev/highlight.js.svg?branch=master)](https://travis-ci.org/isagalaev/highlight.js) +[![install size](https://packagephobia.now.sh/badge?p=highlight.js)](https://packagephobia.now.sh/result?p=highlight.js) + +**This package contains only the CDN build assets of highlight.js.** + +This may be what you want if you'd like to install the pre-built distributable highlight.js client-side assets via NPM. If you're wanting to use highlight.js mainly on the server-side you likely want the [highlight.js][1] package instead. + +To access these files via CDN:
+https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/ + +**If you just want a single .js file with the common languages built-in: +** + +--- + +## Highlight.js Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any -markup, doesn’t depend on any framework and has automatic language +markup, doesn’t depend on any framework, and has automatic language detection. -## Getting Started - -The bare minimum for using highlight.js on a web page is linking to the -library along with one of the styles and calling -[`initHighlightingOnLoad`][1]: - -```html - - - -``` - -This will find and highlight code inside of `
` tags; it tries
-to detect the language automatically. If automatic detection doesn’t
-work for you, you can specify the language in the `class` attribute:
-
-```html
-
...
-``` - -The list of supported language classes is available in the [class -reference][2]. Classes can also be prefixed with either `language-` or -`lang-`. - -To disable highlighting altogether use the `nohighlight` class: - -```html -
...
-``` - -## Custom Initialization - -When you need a bit more control over the initialization of -highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4] -functions. This allows you to control *what* to highlight and *when*. - -Here’s an equivalent way to calling [`initHighlightingOnLoad`][1] using -jQuery: - -```javascript -$(document).ready(function() { - $('pre code').each(function(i, block) { - hljs.highlightBlock(block); - }); -}); -``` - -You can use any tags instead of `
` to mark up your code. If
-you don't use a container that preserve line breaks you will need to
-configure highlight.js to use the `
` tag: - -```javascript -hljs.configure({useBR: true}); - -$('div.code').each(function(i, block) { - hljs.highlightBlock(block); -}); -``` - -For other options refer to the documentation for [`configure`][4]. - - -## Web Workers - -You can run highlighting inside a web worker to avoid freezing the browser -window while dealing with very big chunks of code. - -In your main script: - -```javascript -addEventListener('load', function() { - var code = document.querySelector('#code'); - var worker = new Worker('worker.js'); - worker.onmessage = function(event) { code.innerHTML = event.data; } - worker.postMessage(code.textContent); -}) -``` - -In worker.js: - -```javascript -onmessage = function(event) { - importScripts('/highlight.pack.js'); - var result = self.hljs.highlightAuto(event.data); - postMessage(result.value); -} -``` - - -## Getting the Library - -You can get highlight.js as a hosted, or custom-build, browser script or -as a server module. Right out of the box the browser script supports -both AMD and CommonJS, so if you wish you can use RequireJS or -Browserify without having to build from source. The server module also -works perfectly fine with Browserify, but there is the option to use a -build specific to browsers rather than something meant for a server. -Head over to the [download page][5] for all the options. - -**Don't link to GitHub directly.** The library is not supposed to work straight -from the source, it requires building. If none of the pre-packaged options -work for you refer to the [building documentation][6]. - -**The CDN-hosted package doesn't have all the languages.** Otherwise it'd be -too big. If you don't see the language you need in the ["Common" section][5], -it can be added manually: - -```html - -``` - -**On Almond.** You need to use the optimizer to give the module a name. For -example: - -``` -r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js -``` - +If you'd like to read the full README:
+ ## License @@ -137,16 +35,13 @@ for details. The official site for the library is at . +The Github project may be found at: + Further in-depth documentation for the API and other topics is at . -Authors and contributors are listed in the [AUTHORS.en.txt][8] file. +A list of the Core Team and contributors can be found in the [CONTRIBUTORS.md][8] file. -[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload -[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html -[3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block -[4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options -[5]: https://highlightjs.org/download/ -[6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html -[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE -[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.en.txt +[1]: https://www.npmjs.com/package/highlight.js +[7]: https://github.com/highlightjs/highlight.js/blob/main/LICENSE +[8]: https://github.com/highlightjs/highlight.js/blob/main/CONTRIBUTORS.md diff --git a/pkgs/misc/documentation-highlighter/highlight.pack.js b/pkgs/misc/documentation-highlighter/highlight.pack.js index f909702367ec..b8008d3650f0 100644 --- a/pkgs/misc/documentation-highlighter/highlight.pack.js +++ b/pkgs/misc/documentation-highlighter/highlight.pack.js @@ -1,2 +1,345 @@ -/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */ -!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function u(e){s+=""}function c(e){("start"===e.event?o:u)(e.node)}for(var l=0,s="",f=[];e.length||r.length;){var g=i();if(s+=n(a.substring(l,g[0].offset)),l=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===l);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return s+n(a.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):x(a.k).forEach(function(e){u(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return l("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var c=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=c.length?t(c.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function l(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?"":I.classPrefix,i='',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=l(E,r),e?(B+=e[1],a+=p(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!y[E.sL])return n(k);var t=e?f(E.sL,k,!0,x[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(B+=t.r),e&&(x[E.sL]=t.top),p(t.language,t.value,!1,!0)}function b(){L+=null!=E.sL?d():h(),k=""}function v(e){L+=e.cN?p(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(k+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),b(),t.rB||t.eB||(k=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),b(),a.eE&&(k=n));do E.cN&&(L+=C),E.skip||(B+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return k+=n,n.length||1}var N=w(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,E=i||N,x={},L="";for(R=E;R!==N;R=R.parent)R.cN&&(L=p(R.cN,"",!0)+L);var k="",B=0;try{for(var M,j,O=0;;){if(E.t.lastIndex=O,M=E.t.exec(t),!M)break;j=m(t.substring(O,M.index),M[0]),O=M.index+j}for(m(t.substr(O)),R=E;R.parent;R=R.parent)R.cN&&(L+=C);return{r:B,value:L,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function g(e,t){t=t||I.languages||x(y);var r={r:0,value:n(e)},a=r;return t.filter(w).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return I.tabReplace||I.useBR?e.replace(M,function(e,n){return I.useBR&&"\n"===e?"
":I.tabReplace?n.replace(/\t/g,I.tabReplace):""}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function d(e){var n,t,r,o,l,s=i(e);a(s)||(I.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):n=e,l=n.textContent,r=s?f(s,l,!0):g(l),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),l)),r.value=p(r.value),e.innerHTML=r.value,e.className=h(e.className,s,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){I=o(I,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,d)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=y[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function R(){return x(y)}function w(e){return e=(e||"").toLowerCase(),y[e]||y[L[e]]}var E=[],x=Object.keys,y={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="
",I={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=d,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("nix",function(e){var r={keyword:"rec with let in inherit assert if else then",literal:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},t={cN:"subst",b:/\$\{/,e:/}/,k:r},i={b:/[a-zA-Z0-9-_]+(\s*=)/,rB:!0,r:0,c:[{cN:"attr",b:/\S+/}]},s={cN:"string",c:[t],v:[{b:"''",e:"''"},{b:'"',e:'"'}]},a=[e.NM,e.HCM,e.CBCM,s,i];return t.c=a,{aliases:["nixos"],k:r,c:a}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,a,t]}}); \ No newline at end of file +/*! + Highlight.js v11.9.0 (git: b7ec4bfafc) + (c) 2006-2023 undefined and other contributors + License: BSD-3-Clause + */ +var hljs=function(){"use strict";function e(t){ +return t instanceof Map?t.clear=t.delete=t.set=()=>{ +throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{ +const i=t[n],s=typeof i;"object"!==s&&"function"!==s||Object.isFrozen(i)||e(i) +})),t}class t{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function n(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function i(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] +;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const s=e=>!!e.scope +;class o{constructor(e,t){ +this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ +this.buffer+=n(e)}openNode(e){if(!s(e))return;const t=((e,{prefix:t})=>{ +if(e.startsWith("language:"))return e.replace("language:","language-") +;if(e.includes(".")){const n=e.split(".") +;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") +}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)} +closeNode(e){s(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ +this.buffer+=``}}const r=(e={})=>{const t={children:[]} +;return Object.assign(t,e),t};class a{constructor(){ +this.rootNode=r(),this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const t=r({scope:e}) +;this.add(t),this.stack.push(t)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ +return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), +t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +a._collapse(e)})))}}class c extends a{constructor(e){super(),this.options=e} +addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){ +this.closeNode()}__addSublanguage(e,t){const n=e.root +;t&&(n.scope="language:"+t),this.add(n)}toHTML(){ +return new o(this,this.options).value()}finalize(){ +return this.closeAllNodes(),!0}}function l(e){ +return e?"string"==typeof e?e:e.source:null}function g(e){return h("(?=",e,")")} +function u(e){return h("(?:",e,")*")}function d(e){return h("(?:",e,")?")} +function h(...e){return e.map((e=>l(e))).join("")}function f(...e){const t=(e=>{ +const t=e[e.length-1] +;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} +})(e);return"("+(t.capture?"":"?:")+e.map((e=>l(e))).join("|")+")"} +function p(e){return RegExp(e.toString()+"|").exec("").length-1} +const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ +;function m(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n +;let i=l(e),s="";for(;i.length>0;){const e=b.exec(i);if(!e){s+=i;break} +s+=i.substring(0,e.index), +i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0], +"("===e[0]&&n++)}return s})).map((e=>`(${e})`)).join(t)} +const E="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",O={ +begin:"\\\\[\\s\\S]",relevance:0},v={scope:"string",begin:"'",end:"'", +illegal:"\\n",contains:[O]},k={scope:"string",begin:'"',end:'"',illegal:"\\n", +contains:[O]},N=(e,t,n={})=>{const s=i({scope:"comment",begin:e,end:t, +contains:[]},n);s.contains.push({scope:"doctag", +begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", +end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) +;const o=f("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) +;return s.contains.push({begin:h(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s +},S=N("//","$"),M=N("/\\*","\\*/"),R=N("#","$");var j=Object.freeze({ +__proto__:null,APOS_STRING_MODE:v,BACKSLASH_ESCAPE:O,BINARY_NUMBER_MODE:{ +scope:"number",begin:_,relevance:0},BINARY_NUMBER_RE:_,COMMENT:N, +C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:S,C_NUMBER_MODE:{scope:"number", +begin:y,relevance:0},C_NUMBER_RE:y,END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ +t.data._beginMatch!==e[1]&&t.ignoreMatch()}}),HASH_COMMENT_MODE:R,IDENT_RE:E, +MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+x,relevance:0}, +NUMBER_MODE:{scope:"number",begin:w,relevance:0},NUMBER_RE:w, +PHRASAL_WORDS_MODE:{ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},QUOTE_STRING_MODE:k,REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/, +end:/\/[gimuy]*/,contains:[O,{begin:/\[/,end:/\]/,relevance:0,contains:[O]}]}, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const t=/^#![ ]*\// +;return e.binary&&(e.begin=h(t,/.*\b/,e.binary,/\b.*/)),i({scope:"meta",begin:t, +end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, +TITLE_MODE:{scope:"title",begin:E,relevance:0},UNDERSCORE_IDENT_RE:x, +UNDERSCORE_TITLE_MODE:{scope:"title",begin:x,relevance:0}});function A(e,t){ +"."===e.input[e.index-1]&&t.ignoreMatch()}function I(e,t){ +void 0!==e.className&&(e.scope=e.className,delete e.className)}function T(e,t){ +t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function L(e,t){ +Array.isArray(e.illegal)&&(e.illegal=f(...e.illegal))}function B(e,t){ +if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function P(e,t){ +void 0===e.relevance&&(e.relevance=1)}const D=(e,t)=>{if(!e.beforeMatch)return +;if(e.starts)throw Error("beforeMatch cannot be used with starts") +;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] +})),e.keywords=n.keywords,e.begin=h(n.beforeMatch,g(n.begin)),e.starts={ +relevance:0,contains:[Object.assign(n,{endsParent:!0})] +},e.relevance=0,delete n.beforeMatch +},H=["of","and","for","in","not","or","if","then","parent","list","value"],C="keyword" +;function $(e,t,n=C){const i=Object.create(null) +;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{ +Object.assign(i,$(e[n],t,n))})),i;function s(e,n){ +t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") +;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ +return t?Number(t):(e=>H.includes(e.toLowerCase()))(e)?0:1}const z={},W=e=>{ +console.error(e)},X=(e,...t)=>{console.log("WARN: "+e,...t)},G=(e,t)=>{ +z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) +},K=Error();function F(e,t,{key:n}){let i=0;const s=e[n],o={},r={} +;for(let e=1;e<=t.length;e++)r[e+i]=s[e],o[e+i]=!0,i+=p(t[e-1]) +;e[n]=r,e[n]._emit=o,e[n]._multi=!0}function Z(e){(e=>{ +e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, +delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ +_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope +}),(e=>{if(Array.isArray(e.begin)){ +if(e.skip||e.excludeBegin||e.returnBegin)throw W("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), +K +;if("object"!=typeof e.beginScope||null===e.beginScope)throw W("beginScope must be object"), +K;F(e,e.begin,{key:"beginScope"}),e.begin=m(e.begin,{joinWith:""})}})(e),(e=>{ +if(Array.isArray(e.end)){ +if(e.skip||e.excludeEnd||e.returnEnd)throw W("skip, excludeEnd, returnEnd not compatible with endScope: {}"), +K +;if("object"!=typeof e.endScope||null===e.endScope)throw W("endScope must be object"), +K;F(e,e.end,{key:"endScope"}),e.end=m(e.end,{joinWith:""})}})(e)}function V(e){ +function t(t,n){ +return RegExp(l(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) +}class n{constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,t){ +t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), +this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(m(e,{joinWith:"|" +}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex +;const t=this.matcherRe.exec(e);if(!t)return null +;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] +;return t.splice(0,n),Object.assign(t,i)}}class s{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n +;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), +t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ +this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ +const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex +;let n=t.exec(e) +;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ +const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} +return n&&(this.regexIndex+=n.position+1, +this.regexIndex===this.count&&this.considerAll()),n}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=i(e.classNameAliases||{}),function n(o,r){const a=o +;if(o.isCompiled)return a +;[I,B,Z,D].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))), +o.__beforeBegin=null,[T,L,P].forEach((e=>e(o,r))),o.isCompiled=!0;let c=null +;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords), +c=o.keywords.$pattern, +delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=$(o.keywords,e.case_insensitive)), +a.keywordPatternRe=t(c,!0), +r&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/), +o.end&&(a.endRe=t(a.end)), +a.terminatorEnd=l(a.end)||"",o.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)), +o.illegal&&(a.illegalRe=t(o.illegal)), +o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>i(e,{ +variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?i(e,{ +starts:e.starts?i(e.starts):null +}):Object.isFrozen(e)?i(e):e))("self"===e?o:e)))),o.contains.forEach((e=>{n(e,a) +})),o.starts&&n(o.starts,r),a.matcher=(e=>{const t=new s +;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ +return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ +constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} +const Y=n,Q=i,ee=Symbol("nomatch"),te=n=>{ +const i=Object.create(null),s=Object.create(null),o=[];let r=!0 +;const a="Could not find the language '{}', did you forget to load/include a language module?",l={ +disableAutodetect:!0,name:"Plain text",contains:[]};let p={ +ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +cssSelector:"pre code",languages:null,__emitter:c};function b(e){ +return p.noHighlightRe.test(e)}function m(e,t,n){let i="",s="" +;"object"==typeof t?(i=e, +n=t.ignoreIllegals,s=t.language):(G("10.7.0","highlight(lang, code, ...args) has been deprecated."), +G("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +s=e,i=t),void 0===n&&(n=!0);const o={code:i,language:s};N("before:highlight",o) +;const r=o.result?o.result:E(o.language,o.code,n) +;return r.code=o.code,N("after:highlight",r),r}function E(e,n,s,o){ +const c=Object.create(null);function l(){if(!N.keywords)return void M.addText(R) +;let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(R),n="" +;for(;t;){n+=R.substring(e,t.index) +;const s=_.case_insensitive?t[0].toLowerCase():t[0],o=(i=s,N.keywords[i]);if(o){ +const[e,i]=o +;if(M.addText(n),n="",c[s]=(c[s]||0)+1,c[s]<=7&&(j+=i),e.startsWith("_"))n+=t[0];else{ +const n=_.classNameAliases[e]||e;u(t[0],n)}}else n+=t[0] +;e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(R)}var i +;n+=R.substring(e),M.addText(n)}function g(){null!=N.subLanguage?(()=>{ +if(""===R)return;let e=null;if("string"==typeof N.subLanguage){ +if(!i[N.subLanguage])return void M.addText(R) +;e=E(N.subLanguage,R,!0,S[N.subLanguage]),S[N.subLanguage]=e._top +}else e=x(R,N.subLanguage.length?N.subLanguage:null) +;N.relevance>0&&(j+=e.relevance),M.__addSublanguage(e._emitter,e.language) +})():l(),R=""}function u(e,t){ +""!==e&&(M.startScope(t),M.addText(e),M.endScope())}function d(e,t){let n=1 +;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue} +const i=_.classNameAliases[e[n]]||e[n],s=t[n];i?u(s,i):(R=s,l(),R=""),n++}} +function h(e,t){ +return e.scope&&"string"==typeof e.scope&&M.openNode(_.classNameAliases[e.scope]||e.scope), +e.beginScope&&(e.beginScope._wrap?(u(R,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), +R=""):e.beginScope._multi&&(d(e.beginScope,t),R="")),N=Object.create(e,{parent:{ +value:N}}),N}function f(e,n,i){let s=((e,t)=>{const n=e&&e.exec(t) +;return n&&0===n.index})(e.endRe,i);if(s){if(e["on:end"]){const i=new t(e) +;e["on:end"](n,i),i.isMatchIgnored&&(s=!1)}if(s){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return f(e.parent,n,i)}function b(e){ +return 0===N.matcher.regexIndex?(R+=e[0],1):(T=!0,0)}function m(e){ +const t=e[0],i=n.substring(e.index),s=f(N,e,i);if(!s)return ee;const o=N +;N.endScope&&N.endScope._wrap?(g(), +u(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(g(), +d(N.endScope,e)):o.skip?R+=t:(o.returnEnd||o.excludeEnd||(R+=t), +g(),o.excludeEnd&&(R=t));do{ +N.scope&&M.closeNode(),N.skip||N.subLanguage||(j+=N.relevance),N=N.parent +}while(N!==s.parent);return s.starts&&h(s.starts,e),o.returnEnd?0:t.length} +let w={};function y(i,o){const a=o&&o[0];if(R+=i,null==a)return g(),0 +;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===a){ +if(R+=n.slice(o.index,o.index+1),!r){const t=Error(`0 width match regex (${e})`) +;throw t.languageName=e,t.badRule=w.rule,t}return 1} +if(w=o,"begin"===o.type)return(e=>{ +const n=e[0],i=e.rule,s=new t(i),o=[i.__beforeBegin,i["on:begin"]] +;for(const t of o)if(t&&(t(e,s),s.isMatchIgnored))return b(n) +;return i.skip?R+=n:(i.excludeBegin&&(R+=n), +g(),i.returnBegin||i.excludeBegin||(R=n)),h(i,e),i.returnBegin?0:n.length})(o) +;if("illegal"===o.type&&!s){ +const e=Error('Illegal lexeme "'+a+'" for mode "'+(N.scope||"")+'"') +;throw e.mode=N,e}if("end"===o.type){const e=m(o);if(e!==ee)return e} +if("illegal"===o.type&&""===a)return 1 +;if(I>1e5&&I>3*o.index)throw Error("potential infinite loop, way more iterations than matches") +;return R+=a,a.length}const _=O(e) +;if(!_)throw W(a.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const v=V(_);let k="",N=o||v;const S={},M=new p.__emitter(p);(()=>{const e=[] +;for(let t=N;t!==_;t=t.parent)t.scope&&e.unshift(t.scope) +;e.forEach((e=>M.openNode(e)))})();let R="",j=0,A=0,I=0,T=!1;try{ +if(_.__emitTokens)_.__emitTokens(n,M);else{for(N.matcher.considerAll();;){ +I++,T?T=!1:N.matcher.considerAll(),N.matcher.lastIndex=A +;const e=N.matcher.exec(n);if(!e)break;const t=y(n.substring(A,e.index),e) +;A=e.index+t}y(n.substring(A))}return M.finalize(),k=M.toHTML(),{language:e, +value:k,relevance:j,illegal:!1,_emitter:M,_top:N}}catch(t){ +if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), +illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A, +context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:k},_emitter:M};if(r)return{ +language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:N} +;throw t}}function x(e,t){t=t||p.languages||Object.keys(i);const n=(e=>{ +const t={value:Y(e),illegal:!1,relevance:0,_top:l,_emitter:new p.__emitter(p)} +;return t._emitter.addText(e),t})(e),s=t.filter(O).filter(k).map((t=>E(t,e,!1))) +;s.unshift(n);const o=s.sort(((e,t)=>{ +if(e.relevance!==t.relevance)return t.relevance-e.relevance +;if(e.language&&t.language){if(O(e.language).supersetOf===t.language)return 1 +;if(O(t.language).supersetOf===e.language)return-1}return 0})),[r,a]=o,c=r +;return c.secondBest=a,c}function w(e){let t=null;const n=(e=>{ +let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" +;const n=p.languageDetectRe.exec(t);if(n){const t=O(n[1]) +;return t||(X(a.replace("{}",n[1])), +X("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} +return t.split(/\s+/).find((e=>b(e)||O(e)))})(e);if(b(n))return +;if(N("before:highlightElement",{el:e,language:n +}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) +;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), +console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), +console.warn("The element with unescaped HTML:"), +console.warn(e)),p.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) +;t=e;const i=t.textContent,o=n?m(i,{language:n,ignoreIllegals:!0}):x(i) +;e.innerHTML=o.value,e.dataset.highlighted="yes",((e,t,n)=>{const i=t&&s[t]||n +;e.classList.add("hljs"),e.classList.add("language-"+i) +})(e,n,o.language),e.result={language:o.language,re:o.relevance, +relevance:o.relevance},o.secondBest&&(e.secondBest={ +language:o.secondBest.language,relevance:o.secondBest.relevance +}),N("after:highlightElement",{el:e,result:o,text:i})}let y=!1;function _(){ +"loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(w):y=!0 +}function O(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]} +function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +s[e.toLowerCase()]=t}))}function k(e){const t=O(e) +;return t&&!t.disableAutodetect}function N(e,t){const n=e;o.forEach((e=>{ +e[n]&&e[n](t)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +y&&_()}),!1),Object.assign(n,{highlight:m,highlightAuto:x,highlightAll:_, +highlightElement:w, +highlightBlock:e=>(G("10.7.0","highlightBlock will be removed entirely in v12.0"), +G("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{p=Q(p,e)}, +initHighlighting:()=>{ +_(),G("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, +initHighlightingOnLoad:()=>{ +_(),G("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") +},registerLanguage:(e,t)=>{let s=null;try{s=t(n)}catch(t){ +if(W("Language definition for '{}' could not be registered.".replace("{}",e)), +!r)throw t;W(t),s=l} +s.name||(s.name=e),i[e]=s,s.rawDefinition=t.bind(null,n),s.aliases&&v(s.aliases,{ +languageName:e})},unregisterLanguage:e=>{delete i[e] +;for(const t of Object.keys(s))s[t]===e&&delete s[t]}, +listLanguages:()=>Object.keys(i),getLanguage:O,registerAliases:v, +autoDetection:k,inherit:Q,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ +e["before:highlightBlock"](Object.assign({block:t.el},t)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ +e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),o.push(e)}, +removePlugin:e=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),n.debugMode=()=>{ +r=!1},n.safeMode=()=>{r=!0},n.versionString="11.9.0",n.regex={concat:h, +lookahead:g,either:f,optional:d,anyNumberOfTimes:u} +;for(const t in j)"object"==typeof j[t]&&e(j[t]);return Object.assign(n,j),n +},ne=te({});return ne.newInstance=()=>te({}),ne}() +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `bash` grammar compiled for Highlight.js 11.9.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const s=e.regex,t={},n={begin:/\$\{/, +end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{ +className:"variable",variants:[{ +begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const a={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE] +},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,t,a]};a.contains.push(o);const r={begin:/\$?\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] +},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, +contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ +name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/, +keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"], +literal:["true","false"], +built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"] +},contains:[l,e.SHEBANG(),m,r,i,c,{match:/(\/[a-z._-]+)+/},o,{match:/\\"/},{ +className:"string",begin:/'/,end:/'/},{match:/\\'/},t]}}})() +;hljs.registerLanguage("bash",e)})();/*! `nix` grammar compiled for Highlight.js 11.9.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const n={ +keyword:["rec","with","let","in","inherit","assert","if","else","then"], +literal:["true","false","or","and","null"], +built_in:["import","abort","baseNameOf","dirOf","isNull","builtins","map","removeAttrs","throw","toString","derivation"] +},s={className:"subst",begin:/\$\{/,end:/\}/,keywords:n},a={className:"string", +contains:[{className:"char.escape",begin:/''\$/},s],variants:[{begin:"''", +end:"''"},{begin:'"',end:'"'}] +},i=[e.NUMBER_MODE,e.HASH_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,{ +begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{ +className:"attr",begin:/\S+/,relevance:.2}]}];return s.contains=i,{name:"Nix", +aliases:["nixos"],keywords:n,contains:i}}})();hljs.registerLanguage("nix",e) +})();/*! `shell` grammar compiled for Highlight.js 11.9.0 */ +(()=>{var s=(()=>{"use strict";return s=>({name:"Shell Session", +aliases:["console","shellsession"],contains:[{className:"meta.prompt", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]})})();hljs.registerLanguage("shell",s)})(); \ No newline at end of file diff --git a/pkgs/misc/documentation-highlighter/loader.js b/pkgs/misc/documentation-highlighter/loader.js index 4ad7dbf24b51..cf0fdac574dd 100644 --- a/pkgs/misc/documentation-highlighter/loader.js +++ b/pkgs/misc/documentation-highlighter/loader.js @@ -1,7 +1,6 @@ /* This file is NOT part of highlight.js */ -document.onreadystatechange = function () { - var listings = document.querySelectorAll('.programlisting, .screen'); - for (i = 0; i < listings.length; ++i) { - hljs.highlightBlock(listings[i]); - } -} +document.addEventListener('DOMContentLoaded', (event) => { + document.querySelectorAll('.programlisting, .screen').forEach((element) => { + hljs.highlightElement(element); + }); +}); diff --git a/pkgs/misc/documentation-highlighter/mono-blue.css b/pkgs/misc/documentation-highlighter/mono-blue.css index 884c97c7673f..bc9bceae4b10 100644 --- a/pkgs/misc/documentation-highlighter/mono-blue.css +++ b/pkgs/misc/documentation-highlighter/mono-blue.css @@ -1,17 +1,18 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} /* Five-color theme from a single blue hue. */ .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; background: #eaeef3; + color: #00193a } - -.hljs { - color: #00193a; -} - .hljs-keyword, .hljs-selector-tag, .hljs-title, @@ -19,13 +20,11 @@ .hljs-doctag, .hljs-name, .hljs-strong { - font-weight: bold; + font-weight: bold } - .hljs-comment { - color: #738191; + color: #738191 } - .hljs-string, .hljs-title, .hljs-section, @@ -38,9 +37,8 @@ .hljs-name, .hljs-selector-id, .hljs-selector-class { - color: #0048ab; + color: #0048ab } - .hljs-meta, .hljs-subst, .hljs-symbol, @@ -51,9 +49,8 @@ .hljs-template-variable, .hljs-link, .hljs-bullet { - color: #4c81c9; + color: #4c81c9 } - .hljs-emphasis { - font-style: italic; -} + font-style: italic +} \ No newline at end of file diff --git a/pkgs/misc/documentation-highlighter/update.sh b/pkgs/misc/documentation-highlighter/update.sh index 3b77af4af416..8d44e9ddd9a1 100755 --- a/pkgs/misc/documentation-highlighter/update.sh +++ b/pkgs/misc/documentation-highlighter/update.sh @@ -21,19 +21,21 @@ trap finish EXIT mkdir $scratch/src cd $scratch/src -token=$(curl https://highlightjs.org/download/ -c "$scratch/jar" \ - | grep csrf \ - | cut -d"'" -f6) +curl \ + -X POST \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "api": 2, + "languages": ["bash", "nix", "shell"] + }' \ + https://highlightjs.org/api/download > $scratch/out.zip -curl --header "Referer: https://highlightjs.org/download/"\ - -b "$scratch/jar" \ - --data "csrfmiddlewaretoken=$token&nix.js=on&bash.js=on" \ - https://highlightjs.org/download/ > $scratch/out.zip unzip "$scratch/out.zip" out="$root/" mkdir -p "$out" -cp ./{highlight.pack.js,LICENSE,styles/mono-blue.css} "$out" +cp ./highlight.min.js "$out/highlight.pack.js" +cp ./{LICENSE,styles/mono-blue.css} "$out" ( echo "This file was generated with pkgs/misc/documentation-highlighter/update.sh" From 929da5021636f123c836c8091f009ba64b81ed98 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 1 Dec 2023 23:33:59 +0100 Subject: [PATCH 15/38] update-python-libraries: don't update packages with cargoDeps This is unsupported and breaks packages on update. --- .../python/update-python-libraries/update-python-libraries.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index 970da7c5c5a4..287373f49907 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -393,6 +393,8 @@ def _update_package(path, target): for pname in pnames: if BULK_UPDATE and _skip_bulk_update(f"python3Packages.{pname}"): raise ValueError(f"Bulk update skipped for {pname}") + elif _get_attr_value(f"python3Packages.{pname}.cargoDeps") is not None: + raise ValueError(f"Cargo dependencies are unsupported, skipping {pname}") try: new_version, new_sha256, prefix = FETCHERS[fetcher](pname, extension, version, target) successful_fetch = True From 180ccef717a349e70479325dc56c7ee628b4ccf6 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 2 Dec 2023 01:37:41 +0100 Subject: [PATCH 16/38] update-python-libraries: add package changelog to commit message --- .../python/update-python-libraries/update-python-libraries.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index 287373f49907..a7b6b58701fe 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -492,6 +492,9 @@ def _commit(path, pname, old_version, new_version, pkgs_prefix="python: ", **kwa msg = f'{pkgs_prefix}{pname}: {old_version} -> {new_version}' + if changelog := _get_attr_value(f"{pkgs_prefix}{pname}.meta.changelog"): + msg += f"\n\n{changelog}" + try: subprocess.check_call([GIT, 'add', path]) subprocess.check_call([GIT, 'commit', '-m', msg]) From 50311a8d071c7f741f9a4d12736a8025b962ec64 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 2 Dec 2023 02:48:15 +0100 Subject: [PATCH 17/38] update-python-libraries: format with black/isort --- .../update-python-libraries.py | 291 ++++++++++-------- 1 file changed, 165 insertions(+), 126 deletions(-) diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index a7b6b58701fe..ff58c4438057 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -12,23 +12,24 @@ to update all non-pinned libraries in that folder. """ import argparse +import collections import json import logging import os import re -import requests -from concurrent.futures import ThreadPoolExecutor as Pool -from packaging.version import Version as _Version -from packaging.version import InvalidVersion -from packaging.specifiers import SpecifierSet -from typing import Optional, Any -import collections import subprocess +from concurrent.futures import ThreadPoolExecutor as Pool +from typing import Any, Optional + +import requests +from packaging.specifiers import SpecifierSet +from packaging.version import InvalidVersion +from packaging.version import Version as _Version INDEX = "https://pypi.io/pypi" """url of PyPI""" -EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar', 'zip', '.whl'] +EXTENSIONS = ["tar.gz", "tar.bz2", "tar", "zip", ".whl"] """Permitted file extensions. These are evaluated from left to right and the first occurance is returned.""" PRERELEASES = False @@ -37,13 +38,16 @@ BULK_UPDATE = False GIT = "git" -NIXPKGS_ROOT = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode('utf-8').strip() +NIXPKGS_ROOT = ( + subprocess.check_output(["git", "rev-parse", "--show-toplevel"]) + .decode("utf-8") + .strip() +) logging.basicConfig(level=logging.INFO) class Version(_Version, collections.abc.Sequence): - def __init__(self, version): super().__init__(version) # We cannot use `str(Version(0.04.21))` because that becomes `0.4.21` @@ -65,7 +69,7 @@ def _get_values(attribute, text): :returns: List of matches. """ - regex = fr'{re.escape(attribute)}\s+=\s+"(.*)";' + regex = rf'{re.escape(attribute)}\s+=\s+"(.*)";' regex = re.compile(regex) values = regex.findall(text) return values @@ -73,14 +77,18 @@ def _get_values(attribute, text): def _get_attr_value(attr_path: str) -> Optional[Any]: try: - response = subprocess.check_output([ - "nix", - "--extra-experimental-features", "nix-command", - "eval", - "-f", f"{NIXPKGS_ROOT}/default.nix", - "--json", - f"{attr_path}" - ]) + response = subprocess.check_output( + [ + "nix", + "--extra-experimental-features", + "nix-command", + "eval", + "-f", + f"{NIXPKGS_ROOT}/default.nix", + "--json", + f"{attr_path}", + ] + ) return json.loads(response.decode()) except (subprocess.CalledProcessError, ValueError): return None @@ -100,12 +108,13 @@ def _get_unique_value(attribute, text): else: raise ValueError("no value found for {}".format(attribute)) + def _get_line_and_value(attribute, text, value=None): """Match attribute in text. Return the line and the value of the attribute.""" if value is None: - regex = rf'({re.escape(attribute)}\s+=\s+\"(.*)\";)' + regex = rf"({re.escape(attribute)}\s+=\s+\"(.*)\";)" else: - regex = rf'({re.escape(attribute)}\s+=\s+\"({re.escape(value)})\";)' + regex = rf"({re.escape(attribute)}\s+=\s+\"({re.escape(value)})\";)" regex = re.compile(regex) results = regex.findall(text) n = len(results) @@ -138,7 +147,7 @@ def _fetch_page(url): def _fetch_github(url): headers = {} - token = os.environ.get('GITHUB_API_TOKEN') + token = os.environ.get("GITHUB_API_TOKEN") if token: headers["Authorization"] = f"token {token}" r = requests.get(url, headers=headers) @@ -151,31 +160,26 @@ def _fetch_github(url): def _hash_to_sri(algorithm, value): """Convert a hash to its SRI representation""" - return subprocess.check_output([ - "nix", - "hash", - "to-sri", - "--type", algorithm, - value - ]).decode().strip() + return ( + subprocess.check_output(["nix", "hash", "to-sri", "--type", algorithm, value]) + .decode() + .strip() + ) def _skip_bulk_update(attr_name: str) -> bool: - return bool(_get_attr_value( - f"{attr_name}.skipBulkUpdate" - )) + return bool(_get_attr_value(f"{attr_name}.skipBulkUpdate")) SEMVER = { - 'major' : 0, - 'minor' : 1, - 'patch' : 2, + "major": 0, + "minor": 1, + "patch": 2, } def _determine_latest_version(current_version, target, versions): - """Determine latest version, given `target`. - """ + """Determine latest version, given `target`.""" current_version = Version(current_version) def _parse_versions(versions): @@ -193,7 +197,7 @@ def _determine_latest_version(current_version, target, versions): if len(ceiling) == 0: ceiling = None else: - ceiling[-1]+=1 + ceiling[-1] += 1 ceiling = Version(".".join(map(str, ceiling))) # We do not want prereleases @@ -210,17 +214,19 @@ def _get_latest_version_pypi(package, extension, current_version, target): url = "{}/{}/json".format(INDEX, package) json = _fetch_page(url) - versions = json['releases'].keys() + versions = json["releases"].keys() version = _determine_latest_version(current_version, target, versions) try: - releases = json['releases'][version] + releases = json["releases"][version] except KeyError as e: - raise KeyError('Could not find version {} for {}'.format(version, package)) from e + raise KeyError( + "Could not find version {} for {}".format(version, package) + ) from e for release in releases: - if release['filename'].endswith(extension): + if release["filename"].endswith(extension): # TODO: In case of wheel we need to do further checks! - sha256 = release['digests']['sha256'] + sha256 = release["digests"]["sha256"] break else: sha256 = None @@ -240,33 +246,40 @@ def _get_latest_version_github(package, extension, current_version, target): attr_path = os.environ.get("UPDATE_NIX_ATTR_PATH", f"python3Packages.{package}") try: homepage = subprocess.check_output( - ["nix", "eval", "-f", f"{NIXPKGS_ROOT}/default.nix", "--raw", f"{attr_path}.src.meta.homepage"])\ - .decode('utf-8') + [ + "nix", + "eval", + "-f", + f"{NIXPKGS_ROOT}/default.nix", + "--raw", + f"{attr_path}.src.meta.homepage", + ] + ).decode("utf-8") except Exception as e: raise ValueError(f"Unable to determine homepage: {e}") - owner_repo = homepage[len("https://github.com/"):] # remove prefix + owner_repo = homepage[len("https://github.com/") :] # remove prefix owner, repo = owner_repo.split("/") url = f"https://api.github.com/repos/{owner}/{repo}/releases" all_releases = _fetch_github(url) - releases = list(filter(lambda x: not x['prerelease'], all_releases)) + releases = list(filter(lambda x: not x["prerelease"], all_releases)) if len(releases) == 0: raise ValueError(f"{homepage} does not contain any stable releases") - versions = map(lambda x: strip_prefix(x['tag_name']), releases) + versions = map(lambda x: strip_prefix(x["tag_name"]), releases) version = _determine_latest_version(current_version, target, versions) - release = next(filter(lambda x: strip_prefix(x['tag_name']) == version, releases)) - prefix = get_prefix(release['tag_name']) + release = next(filter(lambda x: strip_prefix(x["tag_name"]) == version, releases)) + prefix = get_prefix(release["tag_name"]) # some attributes require using the fetchgit git_fetcher_args = [] - if (_get_attr_value(f"{attr_path}.src.fetchSubmodules")): + if _get_attr_value(f"{attr_path}.src.fetchSubmodules"): git_fetcher_args.append("--fetch-submodules") - if (_get_attr_value(f"{attr_path}.src.fetchLFS")): + if _get_attr_value(f"{attr_path}.src.fetchLFS"): git_fetcher_args.append("--fetch-lfs") - if (_get_attr_value(f"{attr_path}.src.leaveDotGit")): + if _get_attr_value(f"{attr_path}.src.leaveDotGit"): git_fetcher_args.append("--leave-dotGit") if git_fetcher_args: @@ -274,8 +287,10 @@ def _get_latest_version_github(package, extension, current_version, target): cmd = [ "nix-prefetch-git", f"https://github.com/{owner}/{repo}.git", - "--hash", algorithm, - "--rev", f"refs/tags/{release['tag_name']}" + "--hash", + algorithm, + "--rev", + f"refs/tags/{release['tag_name']}", ] cmd.extend(git_fetcher_args) response = subprocess.check_output(cmd) @@ -283,45 +298,60 @@ def _get_latest_version_github(package, extension, current_version, target): hash = _hash_to_sri(algorithm, document[algorithm]) else: try: - hash = subprocess.check_output([ - "nix-prefetch-url", - "--type", "sha256", - "--unpack", - f"{release['tarball_url']}" - ], stderr=subprocess.DEVNULL).decode('utf-8').strip() + hash = ( + subprocess.check_output( + [ + "nix-prefetch-url", + "--type", + "sha256", + "--unpack", + f"{release['tarball_url']}", + ], + stderr=subprocess.DEVNULL, + ) + .decode("utf-8") + .strip() + ) except (subprocess.CalledProcessError, UnicodeError): # this may fail if they have both a branch and a tag of the same name, attempt tag name - tag_url = str(release['tarball_url']).replace("tarball","tarball/refs/tags") - hash = subprocess.check_output([ - "nix-prefetch-url", - "--type", "sha256", - "--unpack", - tag_url - ], stderr=subprocess.DEVNULL).decode('utf-8').strip() + tag_url = str(release["tarball_url"]).replace( + "tarball", "tarball/refs/tags" + ) + hash = ( + subprocess.check_output( + ["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url], + stderr=subprocess.DEVNULL, + ) + .decode("utf-8") + .strip() + ) return version, hash, prefix FETCHERS = { - 'fetchFromGitHub' : _get_latest_version_github, - 'fetchPypi' : _get_latest_version_pypi, - 'fetchurl' : _get_latest_version_pypi, + "fetchFromGitHub": _get_latest_version_github, + "fetchPypi": _get_latest_version_pypi, + "fetchurl": _get_latest_version_pypi, } -DEFAULT_SETUPTOOLS_EXTENSION = 'tar.gz' +DEFAULT_SETUPTOOLS_EXTENSION = "tar.gz" FORMATS = { - 'setuptools' : DEFAULT_SETUPTOOLS_EXTENSION, - 'wheel' : 'whl', - 'pyproject' : 'tar.gz', - 'flit' : 'tar.gz' + "setuptools": DEFAULT_SETUPTOOLS_EXTENSION, + "wheel": "whl", + "pyproject": "tar.gz", + "flit": "tar.gz", } + def _determine_fetcher(text): # Count occurrences of fetchers. - nfetchers = sum(text.count('src = {}'.format(fetcher)) for fetcher in FETCHERS.keys()) + nfetchers = sum( + text.count("src = {}".format(fetcher)) for fetcher in FETCHERS.keys() + ) if nfetchers == 0: raise ValueError("no fetcher.") elif nfetchers > 1: @@ -329,7 +359,7 @@ def _determine_fetcher(text): else: # Then we check which fetcher to use. for fetcher in FETCHERS.keys(): - if 'src = {}'.format(fetcher) in text: + if "src = {}".format(fetcher) in text: return fetcher @@ -341,47 +371,46 @@ def _determine_extension(text, fetcher): - fetchurl, we determine the extension from the url. - fetchFromGitHub we simply use `.tar.gz`. """ - if fetcher == 'fetchPypi': + if fetcher == "fetchPypi": try: - src_format = _get_unique_value('format', text) + src_format = _get_unique_value("format", text) except ValueError: - src_format = None # format was not given + src_format = None # format was not given try: - extension = _get_unique_value('extension', text) + extension = _get_unique_value("extension", text) except ValueError: - extension = None # extension was not given + extension = None # extension was not given if extension is None: if src_format is None: - src_format = 'setuptools' - elif src_format == 'other': + src_format = "setuptools" + elif src_format == "other": raise ValueError("Don't know how to update a format='other' package.") extension = FORMATS[src_format] - elif fetcher == 'fetchurl': - url = _get_unique_value('url', text) + elif fetcher == "fetchurl": + url = _get_unique_value("url", text) extension = os.path.splitext(url)[1] - if 'pypi' not in url: - raise ValueError('url does not point to PyPI.') + if "pypi" not in url: + raise ValueError("url does not point to PyPI.") - elif fetcher == 'fetchFromGitHub': + elif fetcher == "fetchFromGitHub": extension = "tar.gz" return extension def _update_package(path, target): - # Read the expression - with open(path, 'r') as f: + with open(path, "r") as f: text = f.read() # Determine pname. Many files have more than one pname - pnames = _get_values('pname', text) + pnames = _get_values("pname", text) # Determine version. - version = _get_unique_value('version', text) + version = _get_unique_value("version", text) # First we check how many fetchers are mentioned. fetcher = _determine_fetcher(text) @@ -396,7 +425,9 @@ def _update_package(path, target): elif _get_attr_value(f"python3Packages.{pname}.cargoDeps") is not None: raise ValueError(f"Cargo dependencies are unsupported, skipping {pname}") try: - new_version, new_sha256, prefix = FETCHERS[fetcher](pname, extension, version, target) + new_version, new_sha256, prefix = FETCHERS[fetcher]( + pname, extension, version, target + ) successful_fetch = True break except ValueError: @@ -413,7 +444,7 @@ def _update_package(path, target): if not new_sha256: raise ValueError("no file available for {}.".format(pname)) - text = _replace_value('version', new_version, text) + text = _replace_value("version", new_version, text) # hashes from pypi are 16-bit encoded sha256's, normalize it to sri to avoid merge conflicts # sri hashes have been the default format since nix 2.4+ @@ -423,16 +454,16 @@ def _update_package(path, target): if old_hash := _get_attr_value(f"python3Packages.{pname}.src.outputHash"): # fetchers can specify a sha256, or a sri hash try: - text = _replace_value('hash', sri_hash, text, old_hash) + text = _replace_value("hash", sri_hash, text, old_hash) except ValueError: - text = _replace_value('sha256', sri_hash, text, old_hash) + text = _replace_value("sha256", sri_hash, text, old_hash) else: raise ValueError(f"Unable to retrieve old hash for {pname}") - if fetcher == 'fetchFromGitHub': + if fetcher == "fetchFromGitHub": # in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";` # in which no string value is meant to be substituted. However, we can just overwrite the previous value. - regex = r'(rev\s+=\s+[^;]*;)' + regex = r"(rev\s+=\s+[^;]*;)" regex = re.compile(regex) matches = regex.findall(text) n = len(matches) @@ -444,30 +475,33 @@ def _update_package(path, target): match = matches[0] text = text.replace(match, f'rev = "refs/tags/{prefix}${{version}}";') # incase there's no prefix, just rewrite without interpolation - text = text.replace('"${version}";', 'version;') + text = text.replace('"${version}";', "version;") - with open(path, 'w') as f: + with open(path, "w") as f: f.write(text) - logging.info("Path {}: updated {} from {} to {}".format(path, pname, version, new_version)) + logging.info( + "Path {}: updated {} from {} to {}".format( + path, pname, version, new_version + ) + ) result = { - 'path' : path, - 'target': target, - 'pname': pname, - 'old_version' : version, - 'new_version' : new_version, + "path": path, + "target": target, + "pname": pname, + "old_version": version, + "new_version": new_version, #'fetcher' : fetcher, - } + } return result def _update(path, target): - # We need to read and modify a Nix expression. if os.path.isdir(path): - path = os.path.join(path, 'default.nix') + path = os.path.join(path, "default.nix") # If a default.nix does not exist, we quit. if not os.path.isfile(path): @@ -487,35 +521,41 @@ def _update(path, target): def _commit(path, pname, old_version, new_version, pkgs_prefix="python: ", **kwargs): - """Commit result. - """ + """Commit result.""" - msg = f'{pkgs_prefix}{pname}: {old_version} -> {new_version}' + msg = f"{pkgs_prefix}{pname}: {old_version} -> {new_version}" if changelog := _get_attr_value(f"{pkgs_prefix}{pname}.meta.changelog"): msg += f"\n\n{changelog}" try: - subprocess.check_call([GIT, 'add', path]) - subprocess.check_call([GIT, 'commit', '-m', msg]) + subprocess.check_call([GIT, "add", path]) + subprocess.check_call([GIT, "commit", "-m", msg]) except subprocess.CalledProcessError as e: - subprocess.check_call([GIT, 'checkout', path]) - raise subprocess.CalledProcessError(f'Could not commit {path}') from e + subprocess.check_call([GIT, "checkout", path]) + raise subprocess.CalledProcessError(f"Could not commit {path}") from e return True def main(): - epilog = """ environment variables: GITHUB_API_TOKEN\tGitHub API token used when updating github packages """ - parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog) - parser.add_argument('package', type=str, nargs='+') - parser.add_argument('--target', type=str, choices=SEMVER.keys(), default='major') - parser.add_argument('--commit', action='store_true', help='Create a commit for each package update') - parser.add_argument('--use-pkgs-prefix', action='store_true', help='Use python3Packages.${pname}: instead of python: ${pname}: when making commits') + parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog + ) + parser.add_argument("package", type=str, nargs="+") + parser.add_argument("--target", type=str, choices=SEMVER.keys(), default="major") + parser.add_argument( + "--commit", action="store_true", help="Create a commit for each package update" + ) + parser.add_argument( + "--use-pkgs-prefix", + action="store_true", + help="Use python3Packages.${pname}: instead of python: ${pname}: when making commits", + ) args = parser.parse_args() target = args.target @@ -550,6 +590,5 @@ environment variables: logging.info("{} package(s) updated".format(count)) - -if __name__ == '__main__': +if __name__ == "__main__": main() From ac82700414f1c2877cc33d11bbc39d309295e367 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 2 Dec 2023 03:29:04 +0100 Subject: [PATCH 18/38] update-python-libraries: quiet nix stderr output We query lots of derivation attributes, most of which do not exist, so logging stderr causes a lot of noise for no gain. --- .../python/update-python-libraries/update-python-libraries.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index ff58c4438057..d9b539926b83 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -87,7 +87,8 @@ def _get_attr_value(attr_path: str) -> Optional[Any]: f"{NIXPKGS_ROOT}/default.nix", "--json", f"{attr_path}", - ] + ], + stderr=subprocess.DEVNULL, ) return json.loads(response.decode()) except (subprocess.CalledProcessError, ValueError): From 90b6a0206e93e9773c55963f1614b792ba564008 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 2 Dec 2023 04:20:00 +0000 Subject: [PATCH 19/38] pgpool: 4.4.4 -> 4.4.5 Changelog: https://www.pgpool.net/docs/latest/en/html/release-4-4-5.html --- pkgs/servers/sql/pgpool/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/sql/pgpool/default.nix b/pkgs/servers/sql/pgpool/default.nix index 6d825ddb6680..74fd51d45266 100644 --- a/pkgs/servers/sql/pgpool/default.nix +++ b/pkgs/servers/sql/pgpool/default.nix @@ -10,12 +10,12 @@ stdenv.mkDerivation rec { pname = "pgpool-II"; - version = "4.4.4"; + version = "4.4.5"; src = fetchurl { url = "https://www.pgpool.net/mediawiki/download.php?f=pgpool-II-${version}.tar.gz"; name = "pgpool-II-${version}.tar.gz"; - sha256 = "sha256-EL7Wb4GXx03LAKDnP2GAZtXV4K3IeIZcL8+hyUXmj08="; + hash = "sha256-zNSSLIaUmRECor72TdQ/M/U59qGFvULyGDIrqwo4imA="; }; buildInputs = [ From 853e3d5a36a010490289664cc9c68a9dc6582b67 Mon Sep 17 00:00:00 2001 From: Kirill Radzikhovskyy Date: Sat, 2 Dec 2023 13:58:08 +1100 Subject: [PATCH 20/38] amoeba: fix build --- pkgs/games/amoeba/default.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/games/amoeba/default.nix b/pkgs/games/amoeba/default.nix index 0e21a9a1b9ea..445c86c3bd16 100644 --- a/pkgs/games/amoeba/default.nix +++ b/pkgs/games/amoeba/default.nix @@ -1,18 +1,18 @@ -{ lib, stdenv, fetchurl, amoeba-data, alsa-lib, expat, freetype, gtk2, libvorbis, libGLU, xorg, pkg-config }: +{ lib, stdenv, fetchurl, amoeba-data, alsa-lib, expat, freetype, gtk3, libvorbis, libGLU, xorg, pkg-config, installShellFiles }: stdenv.mkDerivation rec { pname = "amoeba"; version = "1.1"; - debver = "29.1"; + debver = "31"; srcs = [ (fetchurl { url = "http://http.debian.net/debian/pool/contrib/a/amoeba/amoeba_${version}.orig.tar.gz"; - sha256 = "1hyycw4r36ryka2gab9vzkgs8gq4gqhk08vn29cwak95w0rahgim"; + hash = "sha256-NT6oMuAlTcVZEnYjMCF+BD+k3/w7LfWEmj6bkQln3sM="; }) (fetchurl { url = "http://http.debian.net/debian/pool/contrib/a/amoeba/amoeba_${version}-${debver}.debian.tar.xz"; - sha256 = "1xgi2sqzq97w6hd3dcyq6cka8xmp6nr25qymzhk52cwqh7qb75p3"; + hash = "sha256-Ga/YeXbPXjkG/6qd9Z201d14Hlj/Je6DxgzeIQOqrWc="; }) ]; sourceRoot = "amoeba-1.1.orig"; @@ -22,17 +22,17 @@ stdenv.mkDerivation rec { ''; postPatch = '' sed -i packer/pakfile.cpp -e 's|/usr/share/amoeba|${amoeba-data}/share/amoeba|' - sed -i main/linux-config/linux-config.cpp -e 's|libgdk-x11-2.0.so.0|${gtk2}/lib/&|' - sed -i main/linux-config/linux-config.cpp -e 's|libgtk-x11-2.0.so.0|${gtk2}/lib/&|' + sed -i main/linux-config/linux-config.cpp -e 's|libgdk-x11-2.0.so.0|${gtk3}/lib/&|' + sed -i main/linux-config/linux-config.cpp -e 's|libgtk-x11-2.0.so.0|${gtk3}/lib/&|' ''; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ alsa-lib expat freetype gtk2 libvorbis libGLU xorg.libXxf86vm ]; + nativeBuildInputs = [ pkg-config installShellFiles ]; + buildInputs = [ alsa-lib expat freetype gtk3 libvorbis libGLU xorg.libXxf86vm ]; installPhase = '' - mkdir -p $out/bin $out/share/man/man1/ + mkdir -p $out/bin cp amoeba $out/bin/ - cp ../debian/amoeba.1 $out/share/man/man1/ + installManPage ../debian/amoeba.1 ''; meta = with lib; { From 190d261984d508c694ac2fcca00c58009ecb6069 Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Sat, 2 Dec 2023 14:37:08 +0800 Subject: [PATCH 21/38] etcd_3_5: 3.5.9 -> 3.5.10 --- pkgs/servers/etcd/3.5.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/etcd/3.5.nix b/pkgs/servers/etcd/3.5.nix index a7507f1dd237..e5d9a677f950 100644 --- a/pkgs/servers/etcd/3.5.nix +++ b/pkgs/servers/etcd/3.5.nix @@ -1,13 +1,13 @@ { lib, buildGoModule, fetchFromGitHub, symlinkJoin, nixosTests }: let - version = "3.5.9"; + version = "3.5.10"; src = fetchFromGitHub { owner = "etcd-io"; repo = "etcd"; rev = "v${version}"; - hash = "sha256-Vp8U49fp0FowIuSSvbrMWjAKG2oDO1o0qO4izSnTR3U="; + hash = "sha256-X/de8YA55SZ6p8r/pV8CGxfDKN8voJlyA0r4ckan6ZE="; }; CGO_ENABLED = 0; @@ -25,7 +25,7 @@ let inherit CGO_ENABLED meta src version; - vendorHash = "sha256-vu5VKHnDbvxSd8qpIFy0bA88IIXLaQ5S8dVUJEwnKJA="; + vendorHash = "sha256-kFR6RvHoNM4SZOgJd7inUuw5GfRLM+3WsKU73We8UzU="; modRoot = "./server"; @@ -45,7 +45,7 @@ let inherit CGO_ENABLED meta src version; - vendorHash = "sha256-i60rKCmbEXkdFOZk2dTbG5EtYKb5eCBSyMcsTtnvATs="; + vendorHash = "sha256-oVabZ2JZlLKHFCuAeeWRTrcSCxzz05HlvDu/YSMKuCs="; modRoot = "./etcdutl"; }; @@ -55,7 +55,7 @@ let inherit CGO_ENABLED meta src version; - vendorHash = "sha256-awl/4kuOjspMVEwfANWK0oi3RId6ERsFkdluiRaaXlA="; + vendorHash = "sha256-0j35caQfLh7kwDKgmTe1novqKfz/3JlQLbUk3+GFPhk="; modRoot = "./etcdctl"; }; From 5b9f691ffe6cc373f581dbdaac4b0a1a074c09b9 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 2 Dec 2023 06:43:03 +0000 Subject: [PATCH 22/38] python310Packages.fontawesomefree: 6.4.2 -> 6.5.1 --- pkgs/development/python-modules/fontawesomefree/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/fontawesomefree/default.nix b/pkgs/development/python-modules/fontawesomefree/default.nix index 437259ff6d3e..dea884ab0b30 100644 --- a/pkgs/development/python-modules/fontawesomefree/default.nix +++ b/pkgs/development/python-modules/fontawesomefree/default.nix @@ -5,7 +5,7 @@ buildPythonPackage rec { pname = "fontawesomefree"; - version = "6.4.2"; + version = "6.5.1"; format = "wheel"; # they only provide a wheel @@ -13,7 +13,7 @@ buildPythonPackage rec { inherit pname version format; dist = "py3"; python = "py3"; - hash = "sha256-zq/378T8Odrf88P/cpinoQlUAxENNz8iRWuxw0q22wI="; + hash = "sha256-jexKLuN7+OUzeeu/DTjO/sTgbHySJ/Wa8527exYygXs="; }; pythonImportsCheck = [ From f697235162fd6a63de10fa440d5a53b75b2bdb07 Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Sat, 2 Dec 2023 15:50:15 +0800 Subject: [PATCH 23/38] etcd_3_4: 3.4.27 -> 3.4.28 --- pkgs/servers/etcd/3.4.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/etcd/3.4.nix b/pkgs/servers/etcd/3.4.nix index 61b3f99d0147..597cad35021b 100644 --- a/pkgs/servers/etcd/3.4.nix +++ b/pkgs/servers/etcd/3.4.nix @@ -2,25 +2,25 @@ buildGoModule rec { pname = "etcd"; - version = "3.4.27"; - - vendorHash = "sha256-duqOIMIXAuJjvKDM15mDdi+LZUZm0uK0MjTv2Dsl3FA="; - - doCheck = false; + version = "3.4.28"; src = fetchFromGitHub { owner = "etcd-io"; repo = "etcd"; rev = "v${version}"; - sha256 = "sha256-iw9rWfloK1h0M0O10AqCFKETSN6Adn71ujn4twVgsnk="; + hash = "sha256-M0iD05Wk3pC56kGKeIb0bfMUpy9idMKin0+DYhBo/cw="; }; + vendorHash = "sha256-DbDIz/cbXqYHaGqNqP+wYpuiaFiZYElRXmQwBXnCbMk="; + buildPhase = '' patchShebangs . ./build ./functional/build ''; + doCheck = false; + installPhase = '' install -Dm755 bin/* bin/functional/cmd/* -t $out/bin ''; From 4ff7f410735f9d89f6b35be17a1b994f4eba3422 Mon Sep 17 00:00:00 2001 From: Kirill Radzikhovskyy Date: Sat, 2 Dec 2023 19:40:16 +1100 Subject: [PATCH 24/38] tiledb: 2.18.0 -> 2.18.2 --- pkgs/development/libraries/tiledb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/tiledb/default.nix b/pkgs/development/libraries/tiledb/default.nix index ae182ff46136..f8540d4ffaa0 100644 --- a/pkgs/development/libraries/tiledb/default.nix +++ b/pkgs/development/libraries/tiledb/default.nix @@ -34,13 +34,13 @@ let in stdenv.mkDerivation rec { pname = "tiledb"; - version = "2.18.0"; + version = "2.18.2"; src = fetchFromGitHub { owner = "TileDB-Inc"; repo = "TileDB"; rev = version; - hash = "sha256-y5/kXODzkNKmMn8P+WOOWGy9Htd0nhXbUxmfw/SqSYY="; + hash = "sha256-uLiXhigYz3v7NgY38twot3sBHxZS5QCrOiPfME4wWzE="; }; patches = [ From c31bc86da8753de6575603385dd2e260af056f8e Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sat, 2 Dec 2023 10:15:22 +0000 Subject: [PATCH 25/38] xfce.parole: 4.18.0 -> 4.18.1 https://gitlab.xfce.org/apps/parole/-/compare/parole-4.18.0...parole-4.18.1 --- .../xfce/applications/parole/default.nix | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/desktops/xfce/applications/parole/default.nix b/pkgs/desktops/xfce/applications/parole/default.nix index 070ea4f7d0cb..eeadfe793a7c 100644 --- a/pkgs/desktops/xfce/applications/parole/default.nix +++ b/pkgs/desktops/xfce/applications/parole/default.nix @@ -1,15 +1,25 @@ -{ lib, mkXfceDerivation, dbus, dbus-glib -, gst_all_1, gtk3, libnotify, libxfce4ui, libxfce4util -, taglib, xfconf }: +{ lib +, mkXfceDerivation +, dbus +, dbus-glib +, gst_all_1 +, gtk3 +, libnotify +, libX11 +, libxfce4ui +, libxfce4util +, taglib +, xfconf +}: # Doesn't seem to find H.264 codec even though built with gst-plugins-bad. mkXfceDerivation { category = "apps"; pname = "parole"; - version = "4.18.0"; + version = "4.18.1"; - sha256 = "sha256-TLH9ZUggjclJlbBg3EBVgbcrdiMZ8n+cGDgfNgYNiPI="; + sha256 = "sha256-g+Wy90tHpCeylbU7aUa8578ehmuyWI5WlCK7YdJKlNQ="; postPatch = '' substituteInPlace src/plugins/mpris2/Makefile.am \ @@ -25,6 +35,7 @@ mkXfceDerivation { gst-plugins-ugly gtk3 libnotify + libX11 libxfce4ui libxfce4util taglib From 230757608b2eb004b1a8a207c219337bdecd5c51 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sat, 2 Dec 2023 10:16:08 +0000 Subject: [PATCH 26/38] xfce.tumbler: 4.18.1 -> 4.18.2 https://gitlab.xfce.org/xfce/tumbler/-/compare/tumbler-4.18.1...tumbler-4.18.2 --- pkgs/desktops/xfce/core/tumbler/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/xfce/core/tumbler/default.nix b/pkgs/desktops/xfce/core/tumbler/default.nix index 7427e8d74182..e8c7ac2b4948 100644 --- a/pkgs/desktops/xfce/core/tumbler/default.nix +++ b/pkgs/desktops/xfce/core/tumbler/default.nix @@ -16,9 +16,9 @@ mkXfceDerivation { category = "xfce"; pname = "tumbler"; - version = "4.18.1"; + version = "4.18.2"; - sha256 = "sha256-hn77W8IsvwNc9xSuDe9rXw9499olOvvJ2P7q+26HIG8="; + sha256 = "sha256-thioE0q2qnV4weJFPz8OWoHIRuUcXnQEviwBtCWsSV4="; buildInputs = [ libxfce4util From 02c2d83dc81dee9a99c90db8d6847b57d2400932 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sat, 2 Dec 2023 10:16:45 +0000 Subject: [PATCH 27/38] xfce.xfce4-power-manager: 4.18.2 -> 4.18.3 https://gitlab.xfce.org/xfce/xfce4-power-manager/-/compare/xfce4-power-manager-4.18.2...xfce4-power-manager-4.18.3 --- pkgs/desktops/xfce/core/xfce4-power-manager/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix b/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix index 19b552937119..c483c58c8172 100644 --- a/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix +++ b/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix @@ -12,9 +12,9 @@ mkXfceDerivation { category = "xfce"; pname = "xfce4-power-manager"; - version = "4.18.2"; + version = "4.18.3"; - sha256 = "sha256-1+DP5CACzzj96FyRTeCdVEFORnpzFT49d9Uk1iijbFs="; + sha256 = "sha256-CuW2siApho7u8P01t15dAiqNAiwQzAMZsEugYuKN4kM="; buildInputs = [ gtk3 From 4428fe8f0cd8af22fd97efac66127472648e9002 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sat, 2 Dec 2023 10:17:32 +0000 Subject: [PATCH 28/38] xfce.xfce4-settings: 4.18.3 -> 4.18.4 https://gitlab.xfce.org/xfce/xfce4-settings/-/compare/xfce4-settings-4.18.3...xfce4-settings-4.18.4 --- pkgs/desktops/xfce/core/xfce4-settings/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/xfce/core/xfce4-settings/default.nix b/pkgs/desktops/xfce/core/xfce4-settings/default.nix index 022a04cff963..31aa4bc2e98a 100644 --- a/pkgs/desktops/xfce/core/xfce4-settings/default.nix +++ b/pkgs/desktops/xfce/core/xfce4-settings/default.nix @@ -16,9 +16,9 @@ mkXfceDerivation { category = "xfce"; pname = "xfce4-settings"; - version = "4.18.3"; + version = "4.18.4"; - sha256 = "sha256-QGh5th790qkvqchUfi+kOAJ9A1M+zEIzMxOM5eCGPEk="; + sha256 = "sha256-f6ldTmTSvfRjn6j/LKIoFI3cbYZFtNdnAq3dQewc948="; postPatch = '' for f in xfsettingsd/pointers.c dialogs/mouse-settings/main.c; do From c1567ae44fbfa593a0bd4c0b7b639eada51db562 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 2 Dec 2023 11:21:47 +0000 Subject: [PATCH 29/38] argyllcms: 3.0.2 -> 3.1.0 Changes: https://www.argyllcms.com/doc/ChangesSummary.html --- pkgs/tools/graphics/argyllcms/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/graphics/argyllcms/default.nix b/pkgs/tools/graphics/argyllcms/default.nix index 271d5a5754f9..941e4cfec22c 100644 --- a/pkgs/tools/graphics/argyllcms/default.nix +++ b/pkgs/tools/graphics/argyllcms/default.nix @@ -6,13 +6,13 @@ stdenv.mkDerivation rec { pname = "argyllcms"; - version = "3.0.2"; + version = "3.1.0"; src = fetchzip { # Kind of flacky URL, it was reaturning 406 and inconsistent binaries for a # while on me. It might be good to find a mirror url = "https://www.argyllcms.com/Argyll_V${version}_src.zip"; - hash = "sha256-9+rUhZVwSzAM9Ko6FYyl2OVvsOFBaUCA1PJs9kaLWaE="; + hash = "sha256-IZScf+xpvvMt5YFlYQprg51cw2ztMdOrqcLm7l5uBhU="; }; nativeBuildInputs = [ jam unzip ]; From 6f33e6e4ab2e47124e8c1160c574f9c60c40a523 Mon Sep 17 00:00:00 2001 From: LDprg Date: Sat, 2 Dec 2023 19:19:08 +0100 Subject: [PATCH 30/38] nixos/preload: fix log permission --- nixos/modules/services/misc/preload.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/preload.nix b/nixos/modules/services/misc/preload.nix index 19b2531087dd..d26e2c3d383e 100644 --- a/nixos/modules/services/misc/preload.nix +++ b/nixos/modules/services/misc/preload.nix @@ -19,7 +19,7 @@ in { serviceConfig = { EnvironmentFile = "${cfg.package}/etc/conf.d/preload"; - ExecStart = "${getExe cfg.package} --foreground $PRELOAD_OPTS"; + ExecStart = "${getExe cfg.package} -l '' --foreground $PRELOAD_OPTS"; Type = "simple"; # Only preload data during CPU idle time IOSchedulingClass = 3; From 22b5fecd98c2af980c787e03ea98ead70f7d5a01 Mon Sep 17 00:00:00 2001 From: netali Date: Sat, 2 Dec 2023 20:18:30 +0100 Subject: [PATCH 31/38] nixos/tests/auth-mysql: fix test --- nixos/tests/auth-mysql.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/tests/auth-mysql.nix b/nixos/tests/auth-mysql.nix index 0ed4b050a69a..77a69eb1cd58 100644 --- a/nixos/tests/auth-mysql.nix +++ b/nixos/tests/auth-mysql.nix @@ -84,7 +84,7 @@ in getpwuid = '' SELECT name, 'x', uid, gid, name, CONCAT('/home/', name), "/run/current-system/sw/bin/bash" \ FROM users \ - WHERE id=%1$u \ + WHERE uid=%1$u \ LIMIT 1 ''; getspnam = '' @@ -140,6 +140,7 @@ in machine.wait_for_unit("multi-user.target") machine.wait_for_unit("mysql.service") + machine.wait_until_succeeds("cat /etc/security/pam_mysql.conf | grep users.db_passwd") machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'") with subtest("Local login"): From df0c3c570c20eb9aa0075dbf973a731c2fa31bcc Mon Sep 17 00:00:00 2001 From: Kirill Radzikhovskyy Date: Sun, 3 Dec 2023 06:27:36 +1100 Subject: [PATCH 32/38] fsautocomplete: fix build --- pkgs/development/tools/fsautocomplete/deps.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/tools/fsautocomplete/deps.nix b/pkgs/development/tools/fsautocomplete/deps.nix index fdd669cf90ab..b807457ad01e 100644 --- a/pkgs/development/tools/fsautocomplete/deps.nix +++ b/pkgs/development/tools/fsautocomplete/deps.nix @@ -78,9 +78,9 @@ (fetchNuGet { pname = "McMaster.NETCore.Plugins"; version = "1.4.0"; sha256 = "1k2qz0qnf2b1kfwbzcynivy93jm7dcwl866d0fl7qlgq5vql7niy"; }) (fetchNuGet { pname = "MessagePack"; version = "2.5.108"; sha256 = "0cnaz28lhrdmavnxjkakl9q8p2yv8mricvp1b0wxdfnz8v41gwzs"; }) (fetchNuGet { pname = "MessagePack.Annotations"; version = "2.5.108"; sha256 = "0nb1fx8dwl7304kw0bc375bvlhb7pg351l4cl3vqqd7d8zqjwx5v"; }) - (fetchNuGet { pname = "Microsoft.AspNetCore.App.Ref"; version = "6.0.24"; sha256 = "0lriw4f48f0q2vyagbngnffshdismn3msn7d6dj0lb2xdkzsz1f1"; }) - (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-arm64"; version = "6.0.24"; sha256 = "08670zhn2ywkwy0d7sj89rikxccy5qg0vsjwpbypvzndawng0bb9"; }) - (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-x64"; version = "6.0.24"; sha256 = "0knx6lhlqxn3lkgakpab0663788q0si00m9ga7wdn2mzqq0s9yx0"; }) + (fetchNuGet { pname = "Microsoft.AspNetCore.App.Ref"; version = "6.0.25"; sha256 = "1vrmqn5j6ibwkqasbf7x7n4w5jdclnz3giymiwvym2wa0y5zc59q"; }) + (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-arm64"; version = "6.0.25"; sha256 = "0mgcs4si7mwd0f555s1vg17pf4nqfaijd1pci359l1pgrmv70rrg"; }) + (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-x64"; version = "6.0.25"; sha256 = "0wvzhqhlmlbnpa18qp8m3wcrlcgj3ckvp3iv2n7g8vb60c3238aq"; }) (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "7.0.0"; sha256 = "1waiggh3g1cclc81gmjrqbh128kwfjky3z79ma4bd2ms9pa3gvfm"; }) (fetchNuGet { pname = "Microsoft.Bcl.HashCode"; version = "1.1.0"; sha256 = "1ggsadahlp76zcn1plapszd5v5ja8rh479fwrahqd3knql4dfnr0"; }) (fetchNuGet { pname = "Microsoft.Build"; version = "17.2.0"; sha256 = "09hs74nr0kv83wc1way9x7vq3nmxbr2s4vdy99hx78kj25pylcr7"; }) @@ -121,11 +121,11 @@ (fetchNuGet { pname = "Microsoft.NET.StringTools"; version = "17.4.0"; sha256 = "1smx30nq22plrn2mw4wb5vfgxk6hyx12b60c4wabmpnr81lq3nzv"; }) (fetchNuGet { pname = "Microsoft.NET.StringTools"; version = "17.6.3"; sha256 = "0g5jdg0jp844a2ygwlm04igsxkrihqcq2rpmfx722nrv3vrk0r0z"; }) (fetchNuGet { pname = "Microsoft.NET.Test.Sdk"; version = "17.4.1"; sha256 = "02p1j9fncd4fb2hyp51kw49d0dz30vvazhzk24c9f5ccc00ijpra"; }) - (fetchNuGet { pname = "Microsoft.NETCore.App.Host.linux-arm64"; version = "6.0.24"; sha256 = "1vyy01i4w2wcx82mrjjsbp98v9sjn1cwhdvkhrw8yrrb04lcxbir"; }) - (fetchNuGet { pname = "Microsoft.NETCore.App.Host.linux-x64"; version = "6.0.24"; sha256 = "02l6javfqwsaialkimmpsq3v4dhb1j4sxy19yvr5w5sdjmq1jh5y"; }) - (fetchNuGet { pname = "Microsoft.NETCore.App.Ref"; version = "6.0.24"; sha256 = "1fy1hr14igy4lix4vmwkjj13cbyjjfhx8izch9cd9hc4f1y25767"; }) - (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-arm64"; version = "6.0.24"; sha256 = "1zcn4px94z67j60cidynm5ab8cln1rrxabv7c24mlajqnkfw14sb"; }) - (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-x64"; version = "6.0.24"; sha256 = "0rylvdvdc5rdmw2vcqi0fdzmiwwa1pwlqiavqnb2pslhhq8qg4mh"; }) + (fetchNuGet { pname = "Microsoft.NETCore.App.Host.linux-arm64"; version = "6.0.25"; sha256 = "052388yjivzkfllkss0nljbzmjx787jqdjsbb6ls855sp6wh9xfd"; }) + (fetchNuGet { pname = "Microsoft.NETCore.App.Host.linux-x64"; version = "6.0.25"; sha256 = "103xy6kncjwbbchfnpqvsjpjy92x3dralcg9pw939jp0dwggwarz"; }) + (fetchNuGet { pname = "Microsoft.NETCore.App.Ref"; version = "6.0.25"; sha256 = "0jfhmfxpx1h4f3axgf60gc8d4cnlvbb853400kag6nk0875hr0x1"; }) + (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-arm64"; version = "6.0.25"; sha256 = "0jpcmva1l8z36r4phz055l7fz9s6z8pv8pqc4ia69mhhgvr0ks7y"; }) + (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-x64"; version = "6.0.25"; sha256 = "012jml0bqxbspahf1j4bvvd91pz85hsbcyhq00gxczcazhxpkhz4"; }) (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "7.0.4"; sha256 = "0afmivk3m0hmwsiqnl87frzi7g57aiv5fwnjds0icl66djpb6zsm"; }) (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "5.0.0"; sha256 = "0z3qyv7qal5irvabc8lmkh58zsl42mrzd1i0sssvzhv4q4kl3cg6"; }) (fetchNuGet { pname = "Microsoft.NETFramework.ReferenceAssemblies"; version = "1.0.3"; sha256 = "0hc4d4d4358g5192mf8faijwk0bpf9pjwcfd3h85sr67j0zhj6hl"; }) From ac3352a65c67adcd2d75d461b31ba02234394180 Mon Sep 17 00:00:00 2001 From: netali Date: Sat, 2 Dec 2023 21:05:39 +0100 Subject: [PATCH 33/38] pam_mysql: add test --- pkgs/os-specific/linux/pam_mysql/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/pam_mysql/default.nix b/pkgs/os-specific/linux/pam_mysql/default.nix index 036d4b20cb4c..1088d8abe7a6 100644 --- a/pkgs/os-specific/linux/pam_mysql/default.nix +++ b/pkgs/os-specific/linux/pam_mysql/default.nix @@ -1,4 +1,15 @@ -{ lib, stdenv, fetchFromGitHub, meson, ninja, pam, pkg-config, libmysqlclient, mariadb, libxcrypt }: +{ lib +, nixosTests +, stdenv +, fetchFromGitHub +, meson +, ninja +, pam +, pkg-config +, libmysqlclient +, mariadb +, libxcrypt +}: stdenv.mkDerivation rec { pname = "pam_mysql"; @@ -14,6 +25,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson pkg-config ninja ]; buildInputs = [ pam libmysqlclient mariadb libxcrypt ]; + passthru.tests = { + inherit (nixosTests) auth-mysql; + }; + meta = with lib; { description = "PAM authentication module against a MySQL database"; homepage = "https://github.com/NigelCunningham/pam-MySQL"; From c0b2326892f6f2468522b2062745e8d1cd1fae09 Mon Sep 17 00:00:00 2001 From: netali Date: Sat, 2 Dec 2023 21:07:31 +0100 Subject: [PATCH 34/38] libnss-mysql: add test --- pkgs/os-specific/linux/libnss-mysql/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/libnss-mysql/default.nix b/pkgs/os-specific/linux/libnss-mysql/default.nix index 77e629b03074..133312801119 100644 --- a/pkgs/os-specific/linux/libnss-mysql/default.nix +++ b/pkgs/os-specific/linux/libnss-mysql/default.nix @@ -1,4 +1,11 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, which, libmysqlclient }: +{ lib +, nixosTests +, stdenv +, fetchFromGitHub +, autoreconfHook +, which +, libmysqlclient +}: stdenv.mkDerivation rec { pname = "libnss-mysql"; @@ -20,6 +27,10 @@ stdenv.mkDerivation rec { rm -r $out/etc ''; + passthru.tests = { + inherit (nixosTests) auth-mysql; + }; + meta = with lib; { description = "MySQL module for the Solaris Nameservice Switch (NSS)"; homepage = "https://github.com/saknopper/libnss-mysql"; From 57bfbc781c39b51aa440f0d1aebead78eab9bdf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 2 Dec 2023 22:27:23 +0100 Subject: [PATCH 35/38] nixos/home-assistant: fix error when switching between writable and none writable lovelace config error message before was: cp: not writing through dangling symlink '/var/lib/hass/ui-lovelace.yaml' --- nixos/modules/services/home-automation/home-assistant.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix index 54fd3e17292f..6aa0ae9eba47 100644 --- a/nixos/modules/services/home-automation/home-assistant.nix +++ b/nixos/modules/services/home-automation/home-assistant.nix @@ -455,10 +455,10 @@ in { ln -s /etc/home-assistant/configuration.yaml "${cfg.configDir}/configuration.yaml" ''; copyLovelaceConfig = if cfg.lovelaceConfigWritable then '' + rm -f "${cfg.configDir}/ui-lovelace.yaml" cp --no-preserve=mode ${lovelaceConfigFile} "${cfg.configDir}/ui-lovelace.yaml" '' else '' - rm -f "${cfg.configDir}/ui-lovelace.yaml" - ln -s /etc/home-assistant/ui-lovelace.yaml "${cfg.configDir}/ui-lovelace.yaml" + ln -fs /etc/home-assistant/ui-lovelace.yaml "${cfg.configDir}/ui-lovelace.yaml" ''; copyCustomLovelaceModules = if cfg.customLovelaceModules != [] then '' mkdir -p "${cfg.configDir}/www" From 37445f3c5c1015a4f8019900e9a23528f7c6bd2a Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 3 Dec 2023 01:28:17 +0300 Subject: [PATCH 36/38] lib/customisation: fix callPackage error messages --- lib/customisation.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/customisation.nix b/lib/customisation.nix index 5e290230ca4e..462a85908c06 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -4,11 +4,12 @@ let inherit (builtins) intersectAttrs; inherit (lib) - functionArgs isFunction mirrorFunctionArgs isAttrs setFunctionArgs levenshteinAtMost + functionArgs isFunction mirrorFunctionArgs isAttrs setFunctionArgs optionalAttrs attrNames levenshtein filter elemAt concatStringsSep sort take length filterAttrs optionalString flip pathIsDirectory head pipe isDerivation listToAttrs mapAttrs seq flatten deepSeq warnIf isInOldestRelease extends ; + inherit (lib.strings) levenshteinAtMost; in rec { @@ -198,7 +199,7 @@ rec { + "${loc'}${prettySuggestions (getSuggestions arg)}"; # Only show the error for the first missing argument - error = errorForArg missingArgs.${head (attrNames missingArgs)}; + error = errorForArg (head (attrNames missingArgs)); in if missingArgs == {} then makeOverridable f allArgs From 1b45f71c2efb34ab9db46e4da6bfaf24a3cf6935 Mon Sep 17 00:00:00 2001 From: c4710n Date: Fri, 1 Dec 2023 10:33:46 +0800 Subject: [PATCH 37/38] elixir: enable Erlang compiler option - deterministic --- pkgs/development/interpreters/elixir/generic-builder.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/elixir/generic-builder.nix b/pkgs/development/interpreters/elixir/generic-builder.nix index 9007ab12d754..348d054a6c77 100644 --- a/pkgs/development/interpreters/elixir/generic-builder.nix +++ b/pkgs/development/interpreters/elixir/generic-builder.nix @@ -20,7 +20,7 @@ } @ args: let - inherit (lib) getVersion versionAtLeast optional; + inherit (lib) getVersion versionAtLeast optional concatStringsSep; in assert versionAtLeast (getVersion erlang) minimumOTPVersion; @@ -36,7 +36,12 @@ stdenv.mkDerivation ({ LANG = "C.UTF-8"; LC_TYPE = "C.UTF-8"; - buildFlags = optional debugInfo "ERL_COMPILER_OPTIONS=debug_info"; + ERLC_OPTS = + let + erlc_opts = [ "deterministic" ] + ++ optional debugInfo "debug_info"; + in + "[${concatStringsSep "," erlc_opts}]"; preBuild = '' patchShebangs ${escriptPath} || true From 600572706589601e291abd818009c0c4a623a523 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 2 Dec 2023 15:46:03 -0800 Subject: [PATCH 38/38] mlt: 7.20.0 -> 7.22.0 (#270928) --- pkgs/development/libraries/mlt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/mlt/default.nix b/pkgs/development/libraries/mlt/default.nix index ed803772f730..ded5a5990a60 100644 --- a/pkgs/development/libraries/mlt/default.nix +++ b/pkgs/development/libraries/mlt/default.nix @@ -40,13 +40,13 @@ stdenv.mkDerivation rec { pname = "mlt"; - version = "7.20.0"; + version = "7.22.0"; src = fetchFromGitHub { owner = "mltframework"; repo = "mlt"; rev = "v${version}"; - hash = "sha256-5yELGA3U/YkINEtRyr/tb3HjWMQjqKIWjUbH7ZFMgLU="; + hash = "sha256-vJKpeEdQIWBQRRdDui5ibSZtD8qUlDZBD+UQE+0cQqk="; }; nativeBuildInputs = [