nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nix-update-script,
6 testers,
7 validatePkgConfig,
8 sdl3,
9 cmake,
10 freetype,
11 harfbuzz,
12 glib,
13 ninja,
14 plutosvg,
15 fixDarwinDylibNames,
16}:
17
18stdenv.mkDerivation (finalAttrs: {
19 pname = "sdl3-ttf";
20 version = "3.2.2";
21
22 src = fetchFromGitHub {
23 owner = "libsdl-org";
24 repo = "SDL_ttf";
25 tag = "release-${finalAttrs.version}";
26 hash = "sha256-g7LfLxs7yr7bezQWPWn8arNuPxCfYLCO4kzXmLRUUSY=";
27 };
28
29 strictDeps = true;
30 doCheck = true;
31
32 nativeBuildInputs = [
33 cmake
34 ninja
35 validatePkgConfig
36 ]
37 ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ];
38
39 buildInputs = [
40 sdl3
41 freetype
42 harfbuzz
43 glib
44 plutosvg
45 ];
46
47 cmakeFlags = [
48 (lib.cmakeBool "SDLTTF_STRICT" true)
49 (lib.cmakeBool "SDLTTF_HARFBUZZ" true)
50 (lib.cmakeBool "SDLTTF_PLUTOSVG" true)
51 ];
52
53 passthru = {
54 updateScript = nix-update-script {
55 extraArgs = [
56 "--version-regex"
57 "release-(3\\..*)"
58 ];
59 };
60 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
61 };
62
63 meta = {
64 description = "SDL TrueType font library";
65 homepage = "https://github.com/libsdl-org/SDL_ttf";
66 changelog = "https://github.com/libsdl-org/SDL_ttf/releases/tag/${toString finalAttrs.src.tag}";
67 license = lib.licenses.zlib;
68 maintainers = with lib.maintainers; [
69 charain
70 Emin017
71 ];
72 teams = [ lib.teams.sdl ];
73 pkgConfigModules = [ "sdl3-ttf" ];
74 platforms = lib.platforms.all;
75 };
76})