mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
[Backport release-25.05] kohighlights: init at 2.3.1.0 (#410382)
This commit is contained in:
80
pkgs/by-name/ko/kohighlights/package.nix
Normal file
80
pkgs/by-name/ko/kohighlights/package.nix
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
python3,
|
||||
python3Packages,
|
||||
qt5,
|
||||
makeWrapper,
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "kohighlights";
|
||||
version = "2.3.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "noembryo";
|
||||
repo = "KoHighlights";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-JxUVv2gq/AcNbikF5ix1KjbCILW3fQ1PBKMlrJH3lsk=";
|
||||
};
|
||||
|
||||
dontWrapPythonPrograms = true;
|
||||
dontBuild = true;
|
||||
format = "other";
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
qt5.qtbase
|
||||
]
|
||||
++ lib.optionals (stdenv.hostPlatform.isLinux) [
|
||||
qt5.qtwayland
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
qt5.wrapQtAppsHook
|
||||
makeWrapper
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
pyside2
|
||||
beautifulsoup4
|
||||
packaging
|
||||
requests
|
||||
future
|
||||
];
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "kohighlights";
|
||||
desktopName = "KoHighlights";
|
||||
exec = meta.mainProgram;
|
||||
comment = meta.description;
|
||||
categories = [ "Utility" ];
|
||||
})
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share/KoHighlights
|
||||
rm -rf docs screens
|
||||
cp -r * $out/share/KoHighlights
|
||||
makeWrapper ${python3.interpreter} $out/bin/KoHighlights \
|
||||
--add-flags "$out/share/KoHighlights/main.py" \
|
||||
--set PYTHONPATH "${python3Packages.makePythonPath dependencies}"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Utility for viewing and/or exporting KOReader's highlights";
|
||||
homepage = "https://github.com/noembryo/KoHighlights";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ dtomvan ];
|
||||
mainProgram = "KoHighlights";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user