Merge pull request #278761 from wegank/tuxpaint-bump

tuxpaint: 0.9.28 -> 0.9.31, refactor
This commit is contained in:
Weijia Wang 2024-01-08 20:58:32 +01:00 committed by GitHub
commit 4e7fb1c5d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 128 additions and 23 deletions

View file

@ -0,0 +1,48 @@
{ lib
, stdenv
, fetchFromGitHub
, autoreconfHook
, pkg-config
, freetype
, pango
, SDL2
, darwin
}:
stdenv.mkDerivation rec {
pname = "sdl2-pango";
version = "2.1.5";
src = fetchFromGitHub {
owner = "markuskimius";
repo = "SDL2_Pango";
rev = "v${version}";
hash = "sha256-8SL5ylxi87TuKreC8m2kxlLr8rcmwYYvwkp4vQZ9dkc=";
};
outputs = [ "out" "dev" ];
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
pkg-config
SDL2
];
buildInputs = [
freetype
pango
SDL2
] ++ lib.optionals stdenv.isDarwin [
darwin.libobjc
];
meta = with lib; {
description = "A library for graphically rendering internationalized and tagged text in SDL2 using TrueType fonts";
homepage = "https://github.com/markuskimius/SDL2_Pango";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ rardiol ];
platforms = platforms.all;
};
}

View file

@ -1,37 +1,92 @@
{ lib, stdenv, fetchurl, SDL, SDL_gfx, SDL_image, SDL_ttf, SDL_mixer, libpng
, libimagequant, cairo, librsvg, gettext, libpaper, fribidi, pkg-config, gperf
{ lib
, stdenv
, fetchurl
, gettext
, gperf
, imagemagick
, makeWrapper
, pkg-config
, SDL2
, cairo
, freetype
, fribidi
, libimagequant
, libpaper
, libpng
, librsvg
, pango
, SDL2_gfx
, SDL2_image
, SDL2_mixer
, SDL2_Pango
, SDL2_ttf
, netpbm
}:
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
stdenv.mkDerivation rec {
version = "0.9.28";
version = "0.9.31";
pname = "tuxpaint";
src = fetchurl {
url = "mirror://sourceforge/tuxpaint/${version}/${pname}-${version}-sdl1.tar.gz";
sha256 = "sha256-b4Ru9GqyGf2jMmM24szGXO2vbSxCwvPmA6tgEUWhhos=";
url = "mirror://sourceforge/tuxpaint/${version}/tuxpaint-${version}.tar.gz";
hash = "sha256-GoXAT6XJrms//Syo+oaoTAyLRitQWfofwsRFtc+oV+4=";
};
nativeBuildInputs = [
SDL SDL_gfx SDL_image SDL_ttf SDL_mixer libpng cairo libimagequant librsvg
gettext libpaper fribidi pkg-config gperf imagemagick
patches = [
./tuxpaint-completion.diff
];
hardeningDisable = [ "format" ];
makeFlags = [ "GPERF=${gperf}/bin/gperf"
"PREFIX=$$out"
"COMPLETIONDIR=$$out/share/bash-completion/completions"
];
patches = [ ./tuxpaint-completion.diff ];
postPatch = ''
grep -Zlr include.*SDL . | xargs -0 sed -i -e 's,"SDL,"SDL/SDL,'
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,'
'';
# stamps
stamps = fetchurl {
url = "mirror://sourceforge/project/tuxpaint/tuxpaint-stamps/2022-06-04/tuxpaint-stamps-2022.06.04.tar.gz";
sha256 = "sha256-hCBlV2+uVUNY4A5R1xpJJhamSQsStZIigGdHfCh6C/g=";
};
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;
postInstall = ''
# Install desktop file
@ -40,13 +95,15 @@ stdenv.mkDerivation rec {
sed -e "s+Exec=tuxpaint+Exec=$out/bin/tuxpaint+" < src/tuxpaint.desktop > $out/share/applications/tuxpaint.desktop
# Install stamps
tar xzf $stamps
tar xzf ${stamps}
cd tuxpaint-stamps-*
make install-all PREFIX=$out
rm -rf $out/share/tuxpaint/stamps/military
'';
enableParallelBuilding = true;
# Requirements for tuxpaint-import
wrapProgram $out/bin/tuxpaint-import \
--prefix PATH : ${lib.makeBinPath [ netpbm ]}
'';
meta = {
description = "Open Source Drawing Software for Children";