From e6fa2145cfbf8e069964e759dca556a7b0f4f0e9 Mon Sep 17 00:00:00 2001 From: Felix Schröter Date: Mon, 29 Jul 2024 19:45:15 +0200 Subject: pixelorama: migrate to pkgs/by-name --- pkgs/by-name/pi/pixelorama/package.nix | 96 ++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 pkgs/by-name/pi/pixelorama/package.nix (limited to 'pkgs/by-name/pi') diff --git a/pkgs/by-name/pi/pixelorama/package.nix b/pkgs/by-name/pi/pixelorama/package.nix new file mode 100644 index 000000000000..59be19eaab55 --- /dev/null +++ b/pkgs/by-name/pi/pixelorama/package.nix @@ -0,0 +1,96 @@ +{ lib +, stdenv +, alsa-lib +, autoPatchelfHook +, fetchFromGitHub +, godot3-headless +, godot3-export-templates +, libGLU +, libpulseaudio +, libX11 +, libXcursor +, libXi +, libXinerama +, libXrandr +, libXrender +, nix-update-script +, udev +}: + +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: { + pname = "pixelorama"; + version = "0.11.4"; + + src = fetchFromGitHub { + owner = "Orama-Interactive"; + repo = "Pixelorama"; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-VEQjZ9kDqXz1hoT4PrsBtzoi1TYWyN+YcPMyf9qJMRE="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + godot3-headless + ]; + + buildInputs = [ + libGLU + libX11 + libXcursor + libXi + libXinerama + libXrandr + libXrender + ]; + + buildPhase = '' + runHook preBuild + + export HOME=$(mktemp -d) + mkdir -p $HOME/.local/share/godot/ + ln -s "${godot3-export-templates}/share/godot/templates" "$HOME/.local/share/godot/templates" + mkdir -p build + godot3-headless -v --export "${preset}" ./build/pixelorama + godot3-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 644 -T ./assets/graphics/icons/icon.png $out/share/icons/hicolor/256x256/apps/pixelorama.png + install -d -m 755 $out/bin + ln -s $out/libexec/pixelorama $out/bin/pixelorama + + runHook postInstall + ''; + + runtimeDependencies = map lib.getLib [ + alsa-lib + libpulseaudio + udev + ]; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + homepage = "https://orama-interactive.itch.io/pixelorama"; + description = "Free & open-source 2D sprite editor, made with the Godot Engine!"; + changelog = "https://github.com/Orama-Interactive/Pixelorama/blob/${finalAttrs.src.rev}/CHANGELOG.md"; + license = licenses.mit; + platforms = [ "i686-linux" "x86_64-linux" ]; + maintainers = with maintainers; [ felschr ]; + mainProgram = "pixelorama"; + }; +}) -- cgit 1.4.1