mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-06 09:12:35 +03:00
Merge pull request #194946 from fee1-dead-contrib/huggle/new
This commit is contained in:
commit
9a74be9597
25
pkgs/applications/misc/huggle/00-remove-third-party.patch
Normal file
25
pkgs/applications/misc/huggle/00-remove-third-party.patch
Normal file
@ -0,0 +1,25 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index a37976e..5669366 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -59,16 +59,12 @@ if(NOT MINGW AND WIN32)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/Debug)
|
||||
endif()
|
||||
|
||||
-add_subdirectory(3rd/libirc/libirc libirc)
|
||||
-add_subdirectory(3rd/libirc/libircclient libircclient)
|
||||
+include_directories(@libirc_includes@)
|
||||
|
||||
# YAML
|
||||
-option(YAML_CPP_BUILD_TOOLS "Disable tests" OFF)
|
||||
-option(YAML_CPP_BUILD_TESTS "Enable testing" OFF)
|
||||
-option(YAML_CPP_BUILD_TOOLS "Enable parse tools" OFF)
|
||||
-option(BUILD_SHARED_LIBS "Build as shared" ON)
|
||||
-include_directories("3rd/yaml-cpp/include/")
|
||||
-add_subdirectory(3rd/yaml-cpp)
|
||||
+find_package(YAML-CPP 0.6.3 QUIET)
|
||||
+include_directories(YAML_CPP_INCLUDE_DIR)
|
||||
+
|
||||
if (HUGGLE_EXT)
|
||||
if(NOT MINGW AND WIN32)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release/extensions)
|
13
pkgs/applications/misc/huggle/01-extensions.patch
Normal file
13
pkgs/applications/misc/huggle/01-extensions.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/src/huggle_core/definitions_prod.hpp b/src/huggle_core/definitions_prod.hpp
|
||||
index 1fc5b1fb..17881ade 100644
|
||||
--- a/src/huggle_core/definitions_prod.hpp
|
||||
+++ b/src/huggle_core/definitions_prod.hpp
|
||||
@@ -216,7 +216,7 @@ namespace std { typedef decltype(nullptr) nullptr_t; }
|
||||
#define HUGGLE_GLOBAL_EXTENSION_PATH QCoreApplication::applicationDirPath() + "/extensions"
|
||||
#elif defined __linux__
|
||||
#define HUGGLE_UPDATER_PLATFORM_TYPE "linux"
|
||||
- #define HUGGLE_GLOBAL_EXTENSION_PATH "/usr/local/share/huggle/extensions"
|
||||
+ #define HUGGLE_GLOBAL_EXTENSION_PATH "@out@/share/huggle/extensions"
|
||||
#elif defined HUGGLE_WIN
|
||||
// This is needed by yaml cpp library, otherwise it won't build with MSVC
|
||||
#define YAML_CPP_DLL
|
63
pkgs/applications/misc/huggle/default.nix
Normal file
63
pkgs/applications/misc/huggle/default.nix
Normal file
@ -0,0 +1,63 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
, ncurses
|
||||
, which
|
||||
, cmake
|
||||
, unzip
|
||||
, wrapQtAppsHook
|
||||
, qtwebengine
|
||||
, libyamlcpp
|
||||
, libirc
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "huggle";
|
||||
version = "3.4.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "huggle";
|
||||
repo = "huggle3-qt-lx";
|
||||
rev = version;
|
||||
sha256 = "UzoX4kdzYU50W0MUhfpo0HaSfvG3eINNC8u5t/gKuqI=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
wrapQtAppsHook
|
||||
pkg-config
|
||||
which
|
||||
cmake
|
||||
];
|
||||
buildInputs = [ ncurses libyamlcpp qtwebengine libirc ];
|
||||
|
||||
patches = [ ./00-remove-third-party.patch ./01-extensions.patch ];
|
||||
postPatch = ''
|
||||
rm -r src/3rd
|
||||
echo ${version} > src/huggle_core/version.txt
|
||||
substituteInPlace src/huggle_core/definitions_prod.hpp --subst-var out
|
||||
substituteInPlace src/CMakeLists.txt --replace '@libirc_includes@' '${libirc.out}'
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-S" "/build/source/src"
|
||||
"-DCMAKE_BUILD_TYPE=None"
|
||||
"-DINSTALL_DATA_DIR=bin"
|
||||
"-DQT5_BUILD=ON"
|
||||
"-DWEB_ENGINE=ON"
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
"-Wno-dev"
|
||||
"-DHUGGLE_EXT=TRUE"
|
||||
];
|
||||
|
||||
installTargets = [ "install" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Anti-vandalism tool for use on MediaWiki-based projects";
|
||||
homepage = "https://github.com/huggle/huggle3-qt-lx";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = [ maintainers.fee1-dead ];
|
||||
platforms = platforms.x86_64;
|
||||
};
|
||||
}
|
35
pkgs/development/libraries/libirc/default.nix
Normal file
35
pkgs/development/libraries/libirc/default.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{ lib, stdenv, fetchFromGitHub, cmake, qtbase }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "libirc";
|
||||
version = "unstable-2022-10-15";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "grumpy-irc";
|
||||
repo = "libirc";
|
||||
rev = "734082ffffb6d6744070c75587159d927342edea";
|
||||
sha256 = "Qi/YKLlau0rdQ9XCMyreQdv4ctQWHFIoE3YlW6QnbSI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DQT5_BUILD=1"
|
||||
"-DQt5Core_DIR=${qtbase.dev}/lib/cmake/Qt5Core"
|
||||
"-DQt5Network_DIR=${qtbase.dev}/lib/cmake/Qt5Network"
|
||||
];
|
||||
|
||||
preFixup = ''
|
||||
mkdir -p $out/libirc/libirc{,client}
|
||||
cp ../libirc/*.h $out/libirc/libirc
|
||||
cp ../libircclient/*.h $out/libirc/libircclient
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "C++ IRC library written in Qt with support for data serialization";
|
||||
homepage = "https://github.com/grumpy-irc/libirc";
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ fee1-dead ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
@ -8792,6 +8792,8 @@ with pkgs;
|
||||
|
||||
libipfix = callPackage ../development/libraries/libipfix { };
|
||||
|
||||
libirc = libsForQt5.callPackage ../development/libraries/libirc { };
|
||||
|
||||
libircclient = callPackage ../development/libraries/libircclient { };
|
||||
|
||||
libiscsi = callPackage ../development/libraries/libiscsi { };
|
||||
@ -28957,6 +28959,8 @@ with pkgs;
|
||||
|
||||
haunt = callPackage ../applications/misc/haunt { };
|
||||
|
||||
huggle = libsForQt5.callPackage ../applications/misc/huggle {};
|
||||
|
||||
hugo = callPackage ../applications/misc/hugo {
|
||||
buildGoModule = buildGo119Module;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user