libloot: init at 0.24.5

+257
+46
pkgs/by-name/li/libloot/deps.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 24c7d85..3d070d5 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -79,6 +79,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") 6 + find_package(TBB REQUIRED) 7 + endif() 8 + 9 + +#[==[ 10 + if(NOT DEFINED ESPLUGIN_URL) 11 + set(ESPLUGIN_URL "https://github.com/Ortham/esplugin/archive/refs/tags/6.1.0.tar.gz") 12 + set(ESPLUGIN_HASH "SHA256=52dec796d98426e1c75c5cf3c41351c0b3431a6301137e00fcf6023f4e47b502") 13 + @@ -153,6 +154,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 14 + else() 15 + set(LCI_LIBRARIES ${LCI_LIBRARIES} dl) 16 + endif() 17 + +#]==] 18 + 19 + FetchContent_Declare( 20 + fmt 21 + @@ -307,10 +309,6 @@ set(LIBLOOT_ALL_SOURCES 22 + 23 + # Build API. 24 + add_library(loot ${LIBLOOT_ALL_SOURCES}) 25 + -add_dependencies(loot 26 + - esplugin 27 + - libloadorder 28 + - loot-condition-interpreter) 29 + target_link_libraries(loot PRIVATE 30 + Boost::headers 31 + ${ESPLUGIN_LIBRARIES} 32 + diff --git a/cmake/tests.cmake b/cmake/tests.cmake 33 + index ebccd82..2cef53c 100644 34 + --- a/cmake/tests.cmake 35 + +++ b/cmake/tests.cmake 36 + @@ -108,10 +108,6 @@ set(LIBLOOT_INTERFACE_TESTS_ALL_SOURCES 37 + 38 + # Build tests. 39 + add_executable(libloot_internals_tests ${LIBLOOT_INTERNALS_TESTS_ALL_SOURCES}) 40 + -add_dependencies(libloot_internals_tests 41 + - esplugin 42 + - libloadorder 43 + - loot-condition-interpreter) 44 + target_link_libraries(libloot_internals_tests PRIVATE 45 + Boost::headers 46 + ${ESPLUGIN_LIBRARIES}
+211
pkgs/by-name/li/libloot/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + 6 + rustPlatform, 7 + rust-cbindgen, 8 + 9 + cmake, 10 + pkg-config, 11 + 12 + withDocs ? true, 13 + doxygen, 14 + python3Packages, 15 + 16 + boost, 17 + fmt_11, 18 + gtest, 19 + icu, 20 + spdlog, 21 + tbb_2021_11, 22 + yaml-cpp, 23 + }: 24 + 25 + stdenv.mkDerivation (finalAttrs: { 26 + pname = "libloot"; 27 + version = "0.24.5"; 28 + # Note: don't forget to also update the package versions in the passthru section 29 + 30 + outputs = [ 31 + "out" 32 + "dev" 33 + ] ++ lib.optionals withDocs [ "doc" ]; 34 + 35 + src = fetchFromGitHub { 36 + owner = "loot"; 37 + repo = "libloot"; 38 + rev = "refs/tags/${finalAttrs.version}"; 39 + hash = "sha256-SAnbp34DlGsq4nfaRHfCTGRSGQtv/rRgngvwma2tc7Q="; 40 + }; 41 + 42 + patches = [ 43 + # don't try to build the rust FFI dependencies with cargo, since we build them separately 44 + ./deps.patch 45 + ]; 46 + 47 + postPatch = '' 48 + # there seem to have been some changes in header files generated by rust-cbindgen, so we use the new names 49 + substituteInPlace src/api/plugin.{h,cpp} \ 50 + --replace-fail 'Vec_PluginMetadata' 'Vec<::PluginMetadata>' 51 + ''; 52 + 53 + strictDeps = true; 54 + 55 + nativeBuildInputs = 56 + [ 57 + cmake 58 + pkg-config 59 + ] 60 + ++ lib.optionals withDocs [ 61 + doxygen 62 + python3Packages.sphinx 63 + python3Packages.sphinx-rtd-theme 64 + python3Packages.breathe 65 + ]; 66 + 67 + buildInputs = [ 68 + boost 69 + fmt_11 70 + gtest 71 + icu 72 + (spdlog.override { fmt = fmt_11; }) 73 + tbb_2021_11 74 + 75 + finalAttrs.passthru.yaml-cpp # has merge-key support 76 + finalAttrs.passthru.libloadorder 77 + finalAttrs.passthru.esplugin 78 + finalAttrs.passthru.loot-condition-interpreter 79 + ]; 80 + 81 + cmakeFlags = [ 82 + (lib.cmakeFeature "ESPLUGIN_LIBRARIES" "esplugin_ffi") 83 + (lib.cmakeFeature "LIBLOADORDER_LIBRARIES" "loadorder_ffi") 84 + (lib.cmakeFeature "LCI_LIBRARIES" "loot_condition_interpreter_ffi") 85 + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_TESTING-PLUGINS" "../testing-plugins") 86 + (lib.cmakeBool "LIBLOOT_BUILD_TESTS" finalAttrs.doCheck) 87 + (lib.cmakeBool "LIBLOOT_INSTALL_DOCS" withDocs) 88 + ]; 89 + 90 + postConfigure = lib.optionalString finalAttrs.doCheck '' 91 + cp -r --no-preserve=all ${finalAttrs.passthru.testing-plugins} ../testing-plugins 92 + ''; 93 + 94 + postBuild = lib.optionalString withDocs '' 95 + sphinx-build -b html ../docs docs/html 96 + ''; 97 + 98 + env.GTEST_FILTER = 99 + let 100 + disabledTests = [ 101 + # Some locale releated tests fail because they need the LOCALE_ARCHIVE env var to be set to "${glibcLocales}/lib/locale/locale-archive" 102 + # Due to storage size concerns of `glibcLocales`, we skip this 103 + "CompareFilenames.shouldBeCaseInsensitiveAndLocaleInvariant" 104 + "NormalizeFilename.shouldCaseFoldStringsAndBeLocaleInvariant" 105 + 106 + # Some filesystem related test fail because they assume `std::filesystem::equivalent` works with non-existent paths 107 + "Filesystem.equivalentShouldNotRequireThatBothPathsExist" 108 + "Filesystem.equivalentShouldBeCaseSensitive" 109 + ]; 110 + in 111 + "-${builtins.concatStringsSep ":" disabledTests}"; 112 + 113 + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 114 + 115 + passthru = { 116 + testing-plugins = fetchFromGitHub { 117 + owner = "Ortham"; 118 + repo = "testing-plugins"; 119 + rev = "refs/tags/1.6.2"; 120 + hash = "sha256-3Aa98EwqpuGA3YlsRF8luWzXVEFO/rs6JXisXdLyIK4="; 121 + }; 122 + 123 + buildRustFFIPackage = 124 + args: 125 + rustPlatform.buildRustPackage ( 126 + args 127 + // { 128 + postConfigure = '' 129 + cp -r --no-preserve=all ${finalAttrs.passthru.testing-plugins} testing-plugins 130 + ''; 131 + 132 + nativeBuildInputs = [ rust-cbindgen ]; 133 + 134 + buildAndTestSubdir = "ffi"; 135 + 136 + postBuild = '' 137 + cbindgen ffi/ -l "$lang" -o "$out/include/$header" 138 + ''; 139 + } 140 + ); 141 + 142 + libloadorder = finalAttrs.passthru.buildRustFFIPackage rec { 143 + pname = "libloadorder"; 144 + version = "18.1.3"; 145 + 146 + src = fetchFromGitHub { 147 + owner = "Ortham"; 148 + repo = "libloadorder"; 149 + rev = "refs/tags/${version}"; 150 + hash = "sha256-qJ7gC4BkrXJiVcyA1BqlJSRzgc/7VmNBHtDq0ouJoTU="; 151 + }; 152 + 153 + cargoHash = "sha256-x4LFO6dD3bBKv6gTrNUAo7Rdw5cP67gn44QP6Iwbv0I="; 154 + 155 + lang = "c++"; 156 + header = "libloadorder.hpp"; 157 + }; 158 + 159 + esplugin = finalAttrs.passthru.buildRustFFIPackage rec { 160 + pname = "esplugin"; 161 + version = "6.1.1"; 162 + 163 + src = fetchFromGitHub { 164 + owner = "Ortham"; 165 + repo = "esplugin"; 166 + rev = "refs/tags/${version}"; 167 + hash = "sha256-ygjSyixg+9HFFNV/G+w+TxGFTrjlWxlDt8phpCE8xyQ="; 168 + }; 169 + 170 + cargoHash = "sha256-39iod83yVU5PyIjwv7pLLuMeNw9fHiM0tXDauyGrbx8="; 171 + 172 + lang = "c++"; 173 + header = "esplugin.hpp"; 174 + }; 175 + 176 + loot-condition-interpreter = finalAttrs.passthru.buildRustFFIPackage rec { 177 + pname = "loot-condition-interpreter"; 178 + version = "4.0.2"; 179 + 180 + src = fetchFromGitHub { 181 + owner = "loot"; 182 + repo = "loot-condition-interpreter"; 183 + rev = "refs/tags/${version}"; 184 + hash = "sha256-yXbe7ByYHvFpokRpV2pz2SX0986dpk5IpehwDUhoZKg="; 185 + }; 186 + 187 + cargoHash = "sha256-p+raWZkW16MrvfZhJigSPth8pZZ68twU1+0GL/Mo1Xw="; 188 + 189 + lang = "c"; 190 + header = "loot_condition_interpreter.h"; 191 + }; 192 + 193 + yaml-cpp = yaml-cpp.overrideAttrs rec { 194 + version = "0.8.0+merge-key-support.2"; 195 + src = fetchFromGitHub { 196 + owner = "loot"; 197 + repo = "yaml-cpp"; 198 + rev = "refs/tags/${version}"; 199 + hash = "sha256-whYorebrLiDeO75LC2SMUX/8OD528BR0+DEgnJxxpoQ="; 200 + }; 201 + }; 202 + }; 203 + 204 + meta = { 205 + description = "C++ library for accessing LOOT's metadata and sorting functionality"; 206 + homepage = "https://github.com/loot/libloot"; 207 + license = lib.licenses.gpl3Only; 208 + maintainers = with lib.maintainers; [ tomasajt ]; 209 + platforms = lib.platforms.linux; 210 + }; 211 + })