Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

74 lines
1.8 KiB
Nix

{
lib,
stdenv,
python3,
fetchFromGitHub,
qt5,
nix-update-script,
}:
let
version = "2.6.3";
in
python3.pkgs.buildPythonApplication {
pname = "novelwriter";
inherit version;
pyproject = true;
src = fetchFromGitHub {
owner = "vkbo";
repo = "novelWriter";
rev = "v${version}";
hash = "sha256-262YMVqxSZv8G82amdRnHiW/5gnxkYyFSQDiS5gOdBE=";
};
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.hostPlatform.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.hostPlatform.isDarwin; # TODO awaiting build instructions for Darwin
};
}