2023-11-16 04:20:00 +00:00
|
|
|
{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2, freetype, harfbuzz, libGL, testers }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "SDL2_ttf";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.22.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://www.libsdl.org/projects/SDL_ttf/release/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-1Iy9HOR1ueF4IGvzty1Wtm2E1E9krAWAMyg5YjTWdyM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
configureFlags = [ "--disable-harfbuzz-builtin" ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ "--disable-sdltest" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = [ SDL2 freetype harfbuzz ]
|
2023-07-15 17:15:38 +00:00
|
|
|
++ lib.optional (!stdenv.isDarwin) libGL
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin darwin.libobjc;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.tests.pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2022-02-10 20:34:41 +00:00
|
|
|
description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.zlib;
|
2022-02-10 20:34:41 +00:00
|
|
|
homepage = "https://github.com/libsdl-org/SDL_ttf";
|
2023-11-16 04:20:00 +00:00
|
|
|
pkgConfigModules = [ "SDL2_ttf" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
})
|