nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 SDL,
4 fetchFromGitHub,
5 freetype,
6 stdenv,
7 unstableGitUpdater,
8 # Boolean flags
9 enableSdltest ? (!stdenv.hostPlatform.isDarwin),
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "SDL_ttf";
14 version = "2.0.11-unstable-2024-04-23";
15
16 src = fetchFromGitHub {
17 owner = "libsdl-org";
18 repo = "SDL_ttf";
19 rev = "3c4233732b94ce08d5f6a868e597af39e13f8b23";
20 hash = "sha256-FX6Ko4CaOSCSKdpWVsJhTZXlWk1cnjbfVfMDiGG2+TU=";
21 };
22
23 buildInputs = [
24 SDL
25 freetype
26 ];
27
28 # pass in correct *-config for cross builds
29 env.SDL_CONFIG = lib.getExe' (lib.getDev SDL) "sdl-config";
30 env.FT2_CONFIG = lib.getExe' freetype.dev "freetype-config";
31
32 configureFlags = [
33 (lib.enableFeature enableSdltest "sdltest")
34 ];
35
36 env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-liconv";
37
38 strictDeps = true;
39
40 passthru.updateScript = unstableGitUpdater {
41 tagFormat = "release-2.0.11";
42 tagPrefix = "release-";
43 branch = "SDL-1.2";
44 };
45
46 meta = {
47 homepage = "https://github.com/libsdl-org/SDL_ttf";
48 description = "SDL TrueType library";
49 license = lib.licenses.zlib;
50 teams = [ lib.teams.sdl ];
51 inherit (SDL.meta) platforms;
52 knownVulnerabilities = [
53 # CVE applies to SDL2 https://github.com/NixOS/nixpkgs/pull/274836#issuecomment-2708627901
54 # "CVE-2022-27470"
55 ];
56 };
57})