diff --git a/pkgs/by-name/li/limo/package.nix b/pkgs/by-name/li/limo/package.nix new file mode 100644 index 000000000000..81fbb5743cba --- /dev/null +++ b/pkgs/by-name/li/limo/package.nix @@ -0,0 +1,82 @@ +{ + lib, + stdenv, + fetchFromGitHub, + + cmake, + pkg-config, + + jsoncpp, + libarchive, + libcpr, + libloot, + pugixml, + + libsForQt5, + + withUnrar ? true, + unrar, # has an unfree license +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "limo"; + version = "1.0.8.2"; + + src = fetchFromGitHub { + owner = "limo-app"; + repo = "limo"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-6rv1IjWb/nrymd57CtrlAjX2KfMYlYNnfiodiRAJ1Ok="; + }; + + patches = lib.optionals (!withUnrar) [ + # remove `unrar` as fallback when libarchive fails + ./remove-unrar.patch + ]; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + pkg-config + libsForQt5.wrapQtAppsHook + ]; + + buildInputs = + [ + jsoncpp + libarchive + libcpr + libloot + pugixml + + libsForQt5.qtbase + libsForQt5.qtsvg + libsForQt5.qtwayland + ] + ++ lib.optionals withUnrar [ + unrar + ]; + + cmakeFlags = + [ + (lib.cmakeFeature "LIMO_INSTALL_PREFIX" (placeholder "out")) + (lib.cmakeBool "USE_SYSTEM_LIBUNRAR" true) + ] + ++ lib.optionals (!withUnrar) [ + (lib.cmakeFeature "LIBUNRAR_PATH" "") + (lib.cmakeFeature "LIBUNRAR_INCLUDE_DIR" "") + ]; + + meta = { + description = "General purpose mod manager with support for the NexusMods API and LOOT"; + homepage = "https://github.com/limo-app/limo"; + license = lib.licenses.gpl3Plus; + mainProgram = "Limo"; + maintainers = with lib.maintainers; [ + tomasajt + MattSturgeon + ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/by-name/li/limo/remove-unrar.patch b/pkgs/by-name/li/limo/remove-unrar.patch new file mode 100644 index 000000000000..7e6373eecf28 --- /dev/null +++ b/pkgs/by-name/li/limo/remove-unrar.patch @@ -0,0 +1,42 @@ +diff --git a/src/core/installer.cpp b/src/core/installer.cpp +index ea384a8..aab8be0 100644 +--- a/src/core/installer.cpp ++++ b/src/core/installer.cpp +@@ -7,7 +7,6 @@ + #include + #include + #define _UNIX +-#include + + namespace sfs = std::filesystem; + namespace pu = path_utils; +@@ -35,6 +34,8 @@ void Installer::extract(const sfs::path& source_path, + } + catch(CompressionError& error) + { ++ throw error; ++ /* + std::string extension = source_path.extension().string(); + std::transform(extension.begin(), + extension.end(), +@@ -48,6 +49,7 @@ void Installer::extract(const sfs::path& source_path, + } + else + throw error; ++ */ + } + for(const auto& dir_entry : sfs::recursive_directory_iterator(dest_path)) + { +@@ -428,6 +430,7 @@ void Installer::extractWithProgress(const sfs::path& source_path, + sfs::current_path(working_dir); + } + ++/* + void Installer::extractRarArchive(const sfs::path& source_path, const sfs::path& dest_path) + { + log(Log::LOG_DEBUG, "Using fallback rar extraction"); +@@ -459,3 +462,4 @@ void Installer::extractRarArchive(const sfs::path& source_path, const sfs::path& + throw CompressionError("Failed to extract RAR archive."); + RARCloseArchive(hArcData); + } ++*/