Skip to content

Commit

Permalink
cura5: add desktop icon
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Jan 10, 2025
1 parent 18b7099 commit b364499
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions apps/cura5/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ let
appimageBinName = "cura-appimage-tools-output";
wrapperScriptName = "${pname}-wrapper-script";

src = fetchurl {
url = "https://github.com/Ultimaker/Cura/releases/download/${version}/Ultimaker-Cura-${version}-linux-X64.AppImage";
hash = "sha256-STtVeM4Zs+PVSRO3cI0LxnjRDhOxSlttZF+2RIXnAp4=";
};

appimageContents = appimageTools.extract {
inherit pname version src;
};

curaAppimageToolsWrapped = appimageTools.wrapType2 {
inherit src;
# For `appimageTools.wrapType2`, `pname` determines the binary's name in `bin/`.
pname = appimageBinName;
inherit version;
src = fetchurl {
url = "https://github.com/Ultimaker/Cura/releases/download/${version}/Ultimaker-Cura-${version}-linux-X64.AppImage";
hash = "sha256-STtVeM4Zs+PVSRO3cI0LxnjRDhOxSlttZF+2RIXnAp4=";
};
extraPkgs = _: [ ];
};

Expand Down Expand Up @@ -88,13 +94,15 @@ stdenv.mkDerivation rec {
})
];

# TODO: Extract cura-icon from AppImage source.
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp ${script}/bin/${wrapperScriptName} $out/bin/cura
mkdir -p $out/share/applications $out/share/icons/hicolor/128x128/apps
install -Dm644 ${appimageContents}/usr/share/icons/hicolor/128x128/apps/cura-icon.png $out/share/icons/hicolor/128x128/apps/cura-icon.png
runHook postInstall
'';

Expand All @@ -107,8 +115,10 @@ stdenv.mkDerivation rec {
license = lib.licenses.lgpl3;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [
nh2
pbek
nh2
FliegendeWurst
bct
];
};
}

0 comments on commit b364499

Please sign in to comment.