Skip to content

Commit

Permalink
upscaler: init at 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LordGrimmauld committed Nov 17, 2024
1 parent 7916ebb commit fa560b7
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions pkgs/by-name/up/upscaler/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
lib,
fetchFromGitLab,
glib,
gtk4,
meson,
ninja,
gitUpdater,
desktop-file-utils,
appstream,
blueprint-compiler,
python3Packages,
pkg-config,
libadwaita,
wrapGAppsHook4,
upscayl-ncnn,
}:

python3Packages.buildPythonApplication rec {
pname = "upscaler";
version = "1.4.0";

pyproject = false; # meson instead of pyproject

src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World";
repo = "Upscaler";
rev = version;
hash = "sha256-Dy8tykIbK5o0XulurG+TxORZZSxfRe5Kjh6aGpsh+0Y=";
};

passthru.updateScript = gitUpdater { };

postPatch = ''
substituteInPlace upscaler/window.py \
--replace-fail '"upscayl-bin",' '"${lib.getExe upscayl-ncnn}",'
'';

strictDeps = true;

nativeBuildInputs = [
wrapGAppsHook4
meson
ninja
desktop-file-utils
appstream
blueprint-compiler
pkg-config
gtk4
glib
];

dependencies = with python3Packages; [
pygobject3
pillow
vulkan
];

buildInputs = [
libadwaita
upscayl-ncnn
];

mesonFlags = [
(lib.mesonBool "network_tests" false)
];

# NOTE: `postCheck` is intentionally not used here, as the entire checkPhase
# is skipped by `buildPythonApplication`
# https://github.com/NixOS/nixpkgs/blob/9d4343b7b27a3e6f08fc22ead568233ff24bbbde/pkgs/development/interpreters/python/mk-python-derivation.nix#L296
postInstallCheck = ''
mesonCheckPhase
'';

dontWrapGApps = true;

makeWrapperArgs = [ "\${gappsWrapperArgs[@]}" ];

meta = {
description = "Upscale and enhance images";
homepage = "https://tesk.page/upscaler";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
grimmauld
getchoo
aleksanaa
];
mainProgram = "upscaler";
platforms = lib.platforms.linux;
};
}

0 comments on commit fa560b7

Please sign in to comment.