nixpkgs/pkgs/applications/editors/pixelorama/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.7 KiB
Nix
Raw Normal View History

2023-05-13 21:55:50 +00:00
{ lib, stdenv, fetchFromGitHub, godot-headless, godot-export-templates, nix-update-script }:
2022-06-24 21:53:39 +00:00
let
preset =
if stdenv.isLinux then
if stdenv.is64bit then "Linux/X11 64-bit"
else "Linux/X11 32-bit"
else if stdenv.isDarwin then "Mac OSX"
else throw "unsupported platform";
in stdenv.mkDerivation (finalAttrs: {
2022-06-24 21:53:39 +00:00
pname = "pixelorama";
2023-06-13 17:23:51 +00:00
version = "0.11";
2022-06-24 21:53:39 +00:00
src = fetchFromGitHub {
owner = "Orama-Interactive";
repo = "Pixelorama";
rev = "v${finalAttrs.version}";
2023-06-13 17:23:51 +00:00
sha256 = "sha256-r4iQJBxXzIbQ7n19Ah6szuIfALmuKlHKcvKsxEzOttk=";
2022-06-24 21:53:39 +00:00
};
nativeBuildInputs = [
godot-headless
];
buildPhase = ''
runHook preBuild
export HOME=$(mktemp -d)
mkdir -p $HOME/.local/share/godot/
ln -s "${godot-export-templates}/share/godot/templates" "$HOME/.local/share/godot/templates"
mkdir -p build
godot-headless -v --export "${preset}" ./build/pixelorama
godot-headless -v --export-pack "${preset}" ./build/pixelorama.pck
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D -m 755 -t $out/libexec ./build/pixelorama
install -D -m 644 -t $out/libexec ./build/pixelorama.pck
install -D -m 644 -t $out/share/applications ./Misc/Linux/com.orama_interactive.Pixelorama.desktop
install -d -m 755 $out/bin
ln -s $out/libexec/pixelorama $out/bin/pixelorama
runHook postInstall
'';
2023-05-13 21:55:50 +00:00
passthru.updateScript = nix-update-script { };
2022-06-24 21:53:39 +00:00
meta = with lib; {
homepage = "https://orama-interactive.itch.io/pixelorama";
description = "A free & open-source 2D sprite editor, made with the Godot Engine!";
license = licenses.mit;
platforms = [ "i686-linux" "x86_64-linux" ];
maintainers = with maintainers; [ felschr ];
};
})