depot/third_party/nixpkgs/pkgs/by-name/sd/SDL2_ttf/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

65 lines
1.3 KiB
Nix

{
lib,
SDL2,
darwin,
fetchurl,
freetype,
harfbuzz,
libGL,
pkg-config,
stdenv,
testers,
# Boolean flags
enableSdltest ? (!stdenv.isDarwin),
}:
stdenv.mkDerivation (finalAttrs: {
pname = "SDL2_ttf";
version = "2.22.0";
src = fetchurl {
url = "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${finalAttrs.version}.tar.gz";
sha256 = "sha256-1Iy9HOR1ueF4IGvzty1Wtm2E1E9krAWAMyg5YjTWdyM=";
};
nativeBuildInputs = [
SDL2
pkg-config
];
buildInputs = [
SDL2
freetype
harfbuzz
]
++ lib.optionals (!stdenv.isDarwin) [
libGL
]
++ lib.optionals stdenv.isDarwin [
darwin.libobjc
];
configureFlags = [
(lib.enableFeature false "harfbuzz-builtin")
(lib.enableFeature false "freetype-builtin")
(lib.enableFeature enableSdltest "sdltest")
];
strictDeps = true;
passthru = {
tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
};
meta = {
homepage = "https://github.com/libsdl-org/SDL_ttf";
description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer";
license = lib.licenses.zlib;
maintainers = lib.teams.sdl.members
++ (with lib.maintainers; [ ]);
inherit (SDL2.meta) platforms;
pkgConfigModules = [ "SDL2_ttf" ];
};
})