nixpkgs/pkgs/by-name/no/novelwriter/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
1.7 KiB
Nix
Raw Normal View History

2024-06-08 08:46:17 +00:00
{
lib,
stdenv,
python3,
fetchFromGitHub,
qt5,
nix-update-script,
}:
let
2024-06-18 22:40:02 +00:00
version = "2.4.4";
2024-06-08 08:46:17 +00:00
in
python3.pkgs.buildPythonApplication {
pname = "novelwriter";
inherit version;
pyproject = true;
src = fetchFromGitHub {
owner = "vkbo";
repo = "novelWriter";
rev = "v${version}";
2024-06-18 22:40:02 +00:00
hash = "sha256-vYvrSRQTp/8jcCQIL6HgxdSJwogiPJKfVO+9hhK6emc=";
2024-06-08 08:46:17 +00:00
};
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
build-system = with python3.pkgs; [ setuptools ];
dependencies = with python3.pkgs; [
pyqt5
pyenchant
qt5.qtbase
qt5.qtwayland
];
preBuild = ''
export QT_QPA_PLATFORM_PLUGIN_PATH=${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins/platforms
'';
postInstall = lib.optionalString stdenv.isLinux ''
mkdir -p $out/share/{icons,applications,pixmaps,mime/packages}
cp -r setup/data/hicolor $out/share/icons
cp setup/data/novelwriter.desktop $out/share/applications
cp setup/data/novelwriter.png $out/share/pixmaps
cp setup/data/x-novelwriter-project.xml $out/share/mime/packages
'';
dontWrapQtApps = true;
postFixup = ''
wrapQtApp $out/bin/novelwriter
'';
passthru.updateScript = nix-update-script {
# Stable releases only
extraArgs = [
"--version-regex"
"^v([0-9.]+)$"
];
};
meta = {
description = "Open source plain text editor designed for writing novels";
homepage = "https://novelwriter.io";
changelog = "https://github.com/vkbo/novelWriter/blob/main/CHANGELOG.md";
license = with lib.licenses; [ gpl3 ];
maintainers = with lib.maintainers; [ pluiedev ];
mainProgram = "novelwriter";
platforms = with lib.platforms; unix ++ windows;
broken = stdenv.isDarwin; # TODO awaiting build instructions for Darwin
};
}