nixpkgs/pkgs/applications/graphics/lazpaint/default.nix

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

74 lines
2.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, lazarus, fpc, pango, cairo, glib
2020-07-04 22:21:57 +00:00
, atk, gtk2, libX11, gdk-pixbuf, busybox, python3, makeWrapper }:
with stdenv;
let
bgrabitmap = fetchFromGitHub {
owner = "bgrabitmap";
repo = "bgrabitmap";
2023-01-22 19:11:34 +00:00
rev = "v11.5.3";
sha256 = "sha256-qjBD9TVZQy1tKWHFWkuu6vdLjASzQb3+HRy0FLdd9a8=";
2020-07-04 22:21:57 +00:00
};
bgracontrols = fetchFromGitHub {
owner = "bgrabitmap";
repo = "bgracontrols";
2023-01-22 19:11:34 +00:00
rev = "v7.6";
sha256 = "sha256-btg9DMdYg+C8h0H7MU+uoo2Kb4OeLHoxFYHAv7LbLBA=";
2020-07-04 22:21:57 +00:00
};
in stdenv.mkDerivation rec {
pname = "lazpaint";
2023-01-22 19:11:34 +00:00
version = "7.2.2";
2020-07-04 22:21:57 +00:00
src = fetchFromGitHub {
owner = "bgrabitmap";
repo = "lazpaint";
rev = "v${version}";
2023-01-22 19:11:34 +00:00
sha256 = "sha256-J6s0GnGJ7twEYW5+B72bB3EX4AYvLnhSPLbdhZWzlkw=";
2020-07-04 22:21:57 +00:00
};
nativeBuildInputs = [ lazarus fpc makeWrapper ];
buildInputs = [ pango cairo glib atk gtk2 libX11 gdk-pixbuf ];
NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}";
2023-01-22 19:11:34 +00:00
preConfigure = ''
patchShebangs configure
'';
2020-07-04 22:21:57 +00:00
buildPhase = ''
cp -r --no-preserve=mode ${bgrabitmap} bgrabitmap
cp -r --no-preserve=mode ${bgracontrols} bgracontrols
lazbuild --lazarusdir=${lazarus}/share/lazarus \
--build-mode=Release \
bgrabitmap/bgrabitmap/bgrabitmappack.lpk \
bgracontrols/bgracontrols.lpk \
lazpaintcontrols/lazpaintcontrols.lpk \
lazpaint/lazpaint.lpi
'';
installPhase = ''
# Reuse existing install script
2023-01-22 19:11:34 +00:00
substituteInPlace Makefile --replace "/bin/bash" $BASH
2020-07-04 22:21:57 +00:00
cd lazpaint/release/debian
substituteInPlace makedeb.sh --replace "rm -rf" "ls"
patchShebangs ./makedeb.sh
PATH=$PATH:${busybox}/bin ./makedeb.sh
cp -r staging/usr $out
# Python is needed for scripts
makeWrapper $out/share/lazpaint/lazpaint $out/bin/lazpaint \
2021-01-15 13:21:58 +00:00
--prefix PATH : ${lib.makeBinPath [ python3 ]}
2020-07-04 22:21:57 +00:00
'';
meta = with lib; {
2020-07-04 22:21:57 +00:00
description = "Image editor like PaintBrush or Paint.Net";
homepage = "https://sourceforge.net/projects/lazpaint/";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
2020-07-04 22:21:57 +00:00
};
}