2024-07-29 18:05:17 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
alsa-lib,
|
|
|
|
autoPatchelfHook,
|
|
|
|
fetchFromGitHub,
|
2024-07-29 17:42:43 +00:00
|
|
|
godot_4,
|
|
|
|
godot_4-export-templates,
|
|
|
|
libGL,
|
2024-07-29 18:05:17 +00:00
|
|
|
libpulseaudio,
|
|
|
|
libX11,
|
|
|
|
libXcursor,
|
2024-07-29 17:42:43 +00:00
|
|
|
libXext,
|
2024-07-29 18:05:17 +00:00
|
|
|
libXi,
|
|
|
|
libXrandr,
|
|
|
|
nix-update-script,
|
|
|
|
udev,
|
2024-07-29 17:42:43 +00:00
|
|
|
vulkan-loader,
|
2022-09-12 00:05:50 +00:00
|
|
|
}:
|
2022-06-24 21:53:39 +00:00
|
|
|
|
|
|
|
let
|
2024-08-23 21:28:35 +00:00
|
|
|
presets = {
|
|
|
|
"i686-linux" = "Linux 32-bit";
|
|
|
|
"x86_64-linux" = "Linux 64-bit";
|
|
|
|
"aarch64-linux" = "Linux ARM64";
|
|
|
|
};
|
2022-06-24 21:53:39 +00:00
|
|
|
preset =
|
2024-08-23 21:28:35 +00:00
|
|
|
presets.${stdenv.hostPlatform.system}
|
|
|
|
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
2024-07-29 17:42:43 +00:00
|
|
|
|
|
|
|
godot_version_folder = lib.replaceStrings [ "-" ] [ "." ] godot_4.version;
|
2024-07-29 18:05:17 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-06-24 21:53:39 +00:00
|
|
|
pname = "pixelorama";
|
2024-09-22 19:16:51 +00:00
|
|
|
version = "1.0.3";
|
2022-06-24 21:53:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Orama-Interactive";
|
|
|
|
repo = "Pixelorama";
|
2023-06-13 17:26:12 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-09-22 19:16:51 +00:00
|
|
|
hash = "sha256-IMHv5pOLxj7sqRtWmddziCiOX3T20bcMp2+ZzyhcIFg=";
|
2022-06-24 21:53:39 +00:00
|
|
|
};
|
|
|
|
|
2024-07-29 17:42:43 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-06-24 21:53:39 +00:00
|
|
|
nativeBuildInputs = [
|
2022-09-12 00:05:50 +00:00
|
|
|
autoPatchelfHook
|
2024-07-29 17:42:43 +00:00
|
|
|
godot_4
|
2022-09-12 00:05:50 +00:00
|
|
|
];
|
|
|
|
|
2024-07-29 17:42:43 +00:00
|
|
|
runtimeDependencies = map lib.getLib [
|
|
|
|
alsa-lib
|
|
|
|
libGL
|
|
|
|
libpulseaudio
|
2022-09-12 00:05:50 +00:00
|
|
|
libX11
|
|
|
|
libXcursor
|
2024-07-29 17:42:43 +00:00
|
|
|
libXext
|
2022-09-12 00:05:50 +00:00
|
|
|
libXi
|
|
|
|
libXrandr
|
2024-07-29 17:42:43 +00:00
|
|
|
udev
|
|
|
|
vulkan-loader
|
2022-06-24 21:53:39 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
export HOME=$(mktemp -d)
|
2024-07-29 17:42:43 +00:00
|
|
|
mkdir -p $HOME/.local/share/godot/export_templates
|
|
|
|
ln -s "${godot_4-export-templates}" "$HOME/.local/share/godot/export_templates/${godot_version_folder}"
|
2022-06-24 21:53:39 +00:00
|
|
|
mkdir -p build
|
2024-07-29 17:42:43 +00:00
|
|
|
godot4 --headless --export-release "${preset}" ./build/pixelorama
|
2022-06-24 21:53:39 +00:00
|
|
|
|
|
|
|
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
|
2024-07-12 11:59:00 +00:00
|
|
|
install -D -m 644 -T ./assets/graphics/icons/icon.png $out/share/icons/hicolor/256x256/apps/pixelorama.png
|
2022-06-24 21:53:39 +00:00
|
|
|
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 = "Free & open-source 2D sprite editor, made with the Godot Engine!";
|
2023-08-12 11:43:21 +00:00
|
|
|
changelog = "https://github.com/Orama-Interactive/Pixelorama/blob/${finalAttrs.src.rev}/CHANGELOG.md";
|
2022-06-24 21:53:39 +00:00
|
|
|
license = licenses.mit;
|
2024-07-29 18:05:17 +00:00
|
|
|
platforms = [
|
|
|
|
"i686-linux"
|
|
|
|
"x86_64-linux"
|
2024-08-23 21:28:35 +00:00
|
|
|
"aarch64-linux"
|
2024-07-29 18:05:17 +00:00
|
|
|
];
|
2022-06-24 21:53:39 +00:00
|
|
|
maintainers = with maintainers; [ felschr ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "pixelorama";
|
2022-06-24 21:53:39 +00:00
|
|
|
};
|
2023-06-13 17:26:12 +00:00
|
|
|
})
|