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