tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
upscayl: darwin support
Matteo Pacini
11 months ago
0d29d5e8
fd45900c
+117
-42
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
up
upscayl
darwin.nix
linux.nix
package.nix
+33
pkgs/by-name/up/upscayl/darwin.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{
2
+
stdenvNoCC,
3
+
unzip,
4
+
makeWrapper,
5
+
6
+
pname,
7
+
version,
8
+
meta,
9
+
src,
10
+
}:
11
+
stdenvNoCC.mkDerivation {
12
+
inherit
13
+
pname
14
+
version
15
+
meta
16
+
src
17
+
;
18
+
19
+
sourceRoot = ".";
20
+
21
+
nativeBuildInputs = [
22
+
unzip
23
+
makeWrapper
24
+
];
25
+
26
+
installPhase = ''
27
+
runHook preInstall
28
+
mkdir -p $out/{bin,Applications}
29
+
cp -r Upscayl.app $out/Applications/
30
+
makeWrapper $out/Applications/Upscayl.app/Contents/MacOS/Upscayl $out/bin/upscayl
31
+
runHook postInstall
32
+
'';
33
+
}
+46
pkgs/by-name/up/upscayl/linux.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{
2
+
appimageTools,
3
+
makeWrapper,
4
+
5
+
pname,
6
+
version,
7
+
meta,
8
+
src,
9
+
}:
10
+
11
+
let
12
+
appimageContents = appimageTools.extractType2 {
13
+
inherit pname version src;
14
+
};
15
+
in
16
+
appimageTools.wrapType2 {
17
+
inherit
18
+
pname
19
+
version
20
+
src
21
+
meta
22
+
;
23
+
24
+
nativeBuildInputs = [
25
+
makeWrapper
26
+
];
27
+
28
+
extraPkgs = pkgs: [
29
+
pkgs.vulkan-headers
30
+
pkgs.vulkan-loader
31
+
];
32
+
33
+
extraInstallCommands = ''
34
+
mkdir -p $out/share/{applications,pixmaps}
35
+
36
+
cp ${appimageContents}/upscayl.desktop $out/share/applications/upscayl.desktop
37
+
cp ${appimageContents}/upscayl.png $out/share/pixmaps/upscayl.png
38
+
39
+
substituteInPlace $out/share/applications/upscayl.desktop \
40
+
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=upscayl'
41
+
42
+
wrapProgram $out/bin/upscayl \
43
+
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
44
+
'';
45
+
46
+
}
+38
-42
pkgs/by-name/up/upscayl/package.nix
···
1
{
2
-
appimageTools,
0
3
fetchurl,
4
-
lib,
5
-
makeWrapper,
6
}:
7
8
let
9
pname = "upscayl";
10
version = "2.15.0";
11
-
12
-
src = fetchurl {
13
-
url = "https://github.com/upscayl/upscayl/releases/download/v${version}/upscayl-${version}-linux.AppImage";
14
-
hash = "sha256-ZFlFfliby5nneepELc5gi6zaM5FrcBmohit8YlKqgik=";
15
-
};
16
-
17
-
appimageContents = appimageTools.extractType2 {
18
-
inherit pname version src;
0
0
19
};
20
-
in
21
-
appimageTools.wrapType2 {
22
-
inherit pname version src;
23
-
24
-
nativeBuildInputs = [
25
-
makeWrapper
26
-
];
27
-
28
-
extraPkgs = pkgs: [
29
-
pkgs.vulkan-headers
30
-
pkgs.vulkan-loader
31
-
];
32
-
33
-
extraInstallCommands = ''
34
-
mkdir -p $out/share/{applications,pixmaps}
35
-
36
-
cp ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
37
-
cp ${appimageContents}/${pname}.png $out/share/pixmaps/${pname}.png
38
-
39
-
substituteInPlace $out/share/applications/${pname}.desktop \
40
-
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
41
-
42
-
wrapProgram $out/bin/${pname} \
43
-
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
44
-
'';
45
-
46
-
meta = with lib; {
47
description = "Free and Open Source AI Image Upscaler";
48
homepage = "https://upscayl.github.io/";
49
-
maintainers = with maintainers; [ icy-thought ];
50
-
license = licenses.agpl3Plus;
51
-
platforms = platforms.linux;
0
0
52
mainProgram = "upscayl";
53
};
54
-
}
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
{
2
+
stdenv,
3
+
lib,
4
fetchurl,
5
+
callPackage,
0
6
}:
7
8
let
9
pname = "upscayl";
10
version = "2.15.0";
11
+
srcs = rec {
12
+
x86_64-linux = fetchurl {
13
+
url = "https://github.com/upscayl/upscayl/releases/download/v${version}/upscayl-${version}-linux.AppImage";
14
+
hash = "sha256-ZFlFfliby5nneepELc5gi6zaM5FrcBmohit8YlKqgik=";
15
+
};
16
+
aarch64-darwin = fetchurl {
17
+
url = "https://github.com/upscayl/upscayl/releases/download/v${version}/upscayl-${version}-mac.zip";
18
+
hash = "sha256-gXqeRaNW0g7ZVkCSbxps9SqPMuVSzLTCGL5F3Om/iwo=";
19
+
};
20
+
x86_64-darwin = aarch64-darwin;
21
};
22
+
meta = {
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
23
description = "Free and Open Source AI Image Upscaler";
24
homepage = "https://upscayl.github.io/";
25
+
maintainers = with lib.maintainers; [
26
+
icy-thought
27
+
];
28
+
license = lib.licenses.agpl3Plus;
29
+
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
30
mainProgram = "upscayl";
31
};
32
+
in
33
+
if stdenv.hostPlatform.isDarwin then
34
+
callPackage ./darwin.nix {
35
+
inherit
36
+
pname
37
+
version
38
+
meta
39
+
;
40
+
src = srcs.${stdenv.hostPlatform.system};
41
+
}
42
+
else
43
+
callPackage ./linux.nix {
44
+
inherit
45
+
pname
46
+
version
47
+
meta
48
+
;
49
+
src = srcs.${stdenv.hostPlatform.system};
50
+
}