upscayl: darwin support, add darwin maintainer (#372657)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{
|
||||
stdenvNoCC,
|
||||
unzip,
|
||||
makeWrapper,
|
||||
|
||||
pname,
|
||||
version,
|
||||
meta,
|
||||
src,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
meta
|
||||
src
|
||||
;
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
nativeBuildInputs = [
|
||||
unzip
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/{bin,Applications}
|
||||
cp -r Upscayl.app $out/Applications/
|
||||
makeWrapper $out/Applications/Upscayl.app/Contents/MacOS/Upscayl $out/bin/upscayl
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
appimageTools,
|
||||
makeWrapper,
|
||||
|
||||
pname,
|
||||
version,
|
||||
meta,
|
||||
src,
|
||||
}:
|
||||
|
||||
let
|
||||
appimageContents = appimageTools.extractType2 {
|
||||
inherit pname version src;
|
||||
};
|
||||
in
|
||||
appimageTools.wrapType2 {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
src
|
||||
meta
|
||||
;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
extraPkgs = pkgs: [
|
||||
pkgs.vulkan-headers
|
||||
pkgs.vulkan-loader
|
||||
];
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir -p $out/share/{applications,pixmaps}
|
||||
|
||||
cp ${appimageContents}/upscayl.desktop $out/share/applications/upscayl.desktop
|
||||
cp ${appimageContents}/upscayl.png $out/share/pixmaps/upscayl.png
|
||||
|
||||
substituteInPlace $out/share/applications/upscayl.desktop \
|
||||
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=upscayl'
|
||||
|
||||
wrapProgram $out/bin/upscayl \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
|
||||
'';
|
||||
|
||||
}
|
||||
@@ -1,54 +1,51 @@
|
||||
{
|
||||
appimageTools,
|
||||
fetchurl,
|
||||
stdenv,
|
||||
lib,
|
||||
makeWrapper,
|
||||
fetchurl,
|
||||
callPackage,
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "upscayl";
|
||||
version = "2.15.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/upscayl/upscayl/releases/download/v${version}/upscayl-${version}-linux.AppImage";
|
||||
hash = "sha256-ZFlFfliby5nneepELc5gi6zaM5FrcBmohit8YlKqgik=";
|
||||
srcs = rec {
|
||||
x86_64-linux = fetchurl {
|
||||
url = "https://github.com/upscayl/upscayl/releases/download/v${version}/upscayl-${version}-linux.AppImage";
|
||||
hash = "sha256-ZFlFfliby5nneepELc5gi6zaM5FrcBmohit8YlKqgik=";
|
||||
};
|
||||
aarch64-darwin = fetchurl {
|
||||
url = "https://github.com/upscayl/upscayl/releases/download/v${version}/upscayl-${version}-mac.zip";
|
||||
hash = "sha256-gXqeRaNW0g7ZVkCSbxps9SqPMuVSzLTCGL5F3Om/iwo=";
|
||||
};
|
||||
x86_64-darwin = aarch64-darwin;
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extractType2 {
|
||||
inherit pname version src;
|
||||
};
|
||||
in
|
||||
appimageTools.wrapType2 {
|
||||
inherit pname version src;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
extraPkgs = pkgs: [
|
||||
pkgs.vulkan-headers
|
||||
pkgs.vulkan-loader
|
||||
];
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir -p $out/share/{applications,pixmaps}
|
||||
|
||||
cp ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||
cp ${appimageContents}/${pname}.png $out/share/pixmaps/${pname}.png
|
||||
|
||||
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
|
||||
|
||||
wrapProgram $out/bin/${pname} \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Free and Open Source AI Image Upscaler";
|
||||
homepage = "https://upscayl.github.io/";
|
||||
maintainers = with maintainers; [ icy-thought ];
|
||||
license = licenses.agpl3Plus;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with lib.maintainers; [
|
||||
icy-thought
|
||||
matteopacini
|
||||
];
|
||||
license = lib.licenses.agpl3Plus;
|
||||
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
|
||||
mainProgram = "upscayl";
|
||||
};
|
||||
}
|
||||
in
|
||||
if stdenv.hostPlatform.isDarwin then
|
||||
callPackage ./darwin.nix {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
meta
|
||||
;
|
||||
src = srcs.${stdenv.hostPlatform.system};
|
||||
}
|
||||
else
|
||||
callPackage ./linux.nix {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
meta
|
||||
;
|
||||
src = srcs.${stdenv.hostPlatform.system};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user