nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitLab,
4 glib,
5 gtk4,
6 meson,
7 ninja,
8 gitUpdater,
9 desktop-file-utils,
10 appstream,
11 blueprint-compiler,
12 python3Packages,
13 pkg-config,
14 libadwaita,
15 wrapGAppsHook4,
16 upscayl-ncnn,
17}:
18
19python3Packages.buildPythonApplication rec {
20 pname = "upscaler";
21 version = "1.6.2";
22
23 pyproject = false; # meson instead of pyproject
24
25 src = fetchFromGitLab {
26 domain = "gitlab.gnome.org";
27 owner = "World";
28 repo = "Upscaler";
29 rev = version;
30 hash = "sha256-Mt0bFPidg0/bxd3NP+1jVgWzRemaGKlU/l5orKbziB0=";
31 };
32
33 passthru.updateScript = gitUpdater { };
34
35 postPatch = ''
36 substituteInPlace upscaler/window.py \
37 --replace-fail '"upscayl-bin",' '"${lib.getExe upscayl-ncnn}",'
38 '';
39
40 strictDeps = true;
41
42 nativeBuildInputs = [
43 wrapGAppsHook4
44 meson
45 ninja
46 desktop-file-utils
47 appstream
48 blueprint-compiler
49 pkg-config
50 gtk4
51 glib
52 ];
53
54 dependencies = with python3Packages; [
55 pygobject3
56 pillow
57 vulkan
58 ];
59
60 buildInputs = [
61 libadwaita
62 upscayl-ncnn
63 ];
64
65 mesonFlags = [
66 (lib.mesonBool "network_tests" false)
67 ];
68
69 # NOTE: `postCheck` is intentionally not used here, as the entire checkPhase
70 # is skipped by `buildPythonApplication`
71 # https://github.com/NixOS/nixpkgs/blob/9d4343b7b27a3e6f08fc22ead568233ff24bbbde/pkgs/development/interpreters/python/mk-python-derivation.nix#L296
72 postInstallCheck = ''
73 mesonCheckPhase
74 '';
75
76 dontWrapGApps = true;
77
78 makeWrapperArgs = [ "\${gappsWrapperArgs[@]}" ];
79
80 meta = {
81 description = "Upscale and enhance images";
82 homepage = "https://tesk.page/upscaler";
83 license = lib.licenses.gpl3Only;
84 maintainers = with lib.maintainers; [
85 grimmauld
86 getchoo
87 aleksana
88 ];
89 mainProgram = "upscaler";
90 platforms = lib.platforms.linux;
91 };
92}