2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, gettext
|
|
|
|
, gperf
|
2022-03-30 09:31:56 +00:00
|
|
|
, imagemagick
|
2024-01-13 08:15:51 +00:00
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, SDL2
|
|
|
|
, cairo
|
|
|
|
, freetype
|
|
|
|
, fribidi
|
|
|
|
, libimagequant
|
|
|
|
, libpaper
|
|
|
|
, libpng
|
|
|
|
, librsvg
|
|
|
|
, pango
|
|
|
|
, SDL2_gfx
|
|
|
|
, SDL2_image
|
|
|
|
, SDL2_mixer
|
|
|
|
, SDL2_Pango
|
|
|
|
, SDL2_ttf
|
|
|
|
, netpbm
|
2022-03-30 09:31:56 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
let
|
|
|
|
stamps = fetchurl {
|
|
|
|
url = "mirror://sourceforge/project/tuxpaint/tuxpaint-stamps/2023-07-20/tuxpaint-stamps-2023.07.20.tar.gz";
|
|
|
|
hash = "sha256-D7QgYXRRdZpN3Ni/4lXoXCtsJORT+T2hHaLUFpgDeEI=";
|
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.9.31";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "tuxpaint";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-13 08:15:51 +00:00
|
|
|
url = "mirror://sourceforge/tuxpaint/${version}/tuxpaint-${version}.tar.gz";
|
|
|
|
hash = "sha256-GoXAT6XJrms//Syo+oaoTAyLRitQWfofwsRFtc+oV+4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
patches = [
|
|
|
|
./tuxpaint-completion.diff
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2024-01-13 08:15:51 +00:00
|
|
|
grep -Zlr include.*SDL . | xargs -0 \
|
|
|
|
sed -i -E \
|
|
|
|
-e 's,"(SDL2?_?[a-zA-Z]*.h),"SDL2/\1,' \
|
|
|
|
-e 's,SDL2/SDL2_Pango.h,SDL2_Pango.h,'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gettext
|
|
|
|
gperf
|
|
|
|
imagemagick
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
SDL2
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
|
|
|
freetype
|
|
|
|
fribidi
|
|
|
|
libimagequant
|
|
|
|
libpaper
|
|
|
|
libpng
|
|
|
|
librsvg
|
|
|
|
pango
|
|
|
|
SDL2
|
|
|
|
SDL2_gfx
|
|
|
|
SDL2_image
|
|
|
|
SDL2_mixer
|
|
|
|
SDL2_Pango
|
|
|
|
SDL2_ttf
|
|
|
|
];
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"COMPLETIONDIR=$(out)/share/bash-completion/completions"
|
|
|
|
"GPERF=${lib.getExe gperf}"
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-10-07 09:15:18 +00:00
|
|
|
# Install desktop file
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp hildon/tuxpaint.xpm $out/share/pixmaps
|
|
|
|
sed -e "s+Exec=tuxpaint+Exec=$out/bin/tuxpaint+" < src/tuxpaint.desktop > $out/share/applications/tuxpaint.desktop
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
# Install stamps
|
2024-01-13 08:15:51 +00:00
|
|
|
tar xzf ${stamps}
|
2022-03-30 09:31:56 +00:00
|
|
|
cd tuxpaint-stamps-*
|
2020-04-24 23:36:52 +00:00
|
|
|
make install-all PREFIX=$out
|
|
|
|
rm -rf $out/share/tuxpaint/stamps/military
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
# Requirements for tuxpaint-import
|
|
|
|
wrapProgram $out/bin/tuxpaint-import \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ netpbm ]}
|
|
|
|
'';
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Open Source Drawing Software for Children";
|
|
|
|
homepage = "http://www.tuxpaint.org/";
|
2022-03-30 09:31:56 +00:00
|
|
|
license = lib.licenses.gpl3Plus;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with lib.maintainers; [ woffs ];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|