flake.nix 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer";
  3. inputs = {
  4. nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
  5. flake-utils.url = "github:numtide/flake-utils";
  6. raqm_src.url = "github:HOST-Oman/libraqm/v0.7.2";
  7. raqm_src.flake = false;
  8. };
  9. outputs = { self, nixpkgs, flake-utils, raqm_src }:
  10. flake-utils.lib.eachDefaultSystem (system:
  11. let
  12. pkgs = nixpkgs.legacyPackages.${system};
  13. in rec {
  14. packages = flake-utils.lib.flattenTree rec {
  15. raqm = pkgs.stdenv.mkDerivation rec {
  16. pname = "libraqm";
  17. version = "0.7.2";
  18. src = raqm_src;
  19. nativeBuildInputs = [
  20. pkgs.meson
  21. pkgs.ninja
  22. pkgs.pkgconfig
  23. pkgs.python3
  24. ];
  25. buildInputs = [
  26. pkgs.freetype
  27. pkgs.harfbuzz
  28. pkgs.fribidi
  29. ];
  30. propagatedBuildInputs = [
  31. pkgs.glib
  32. pkgs.pcre
  33. ];
  34. };
  35. SDL2_ttf = pkgs.stdenv.mkDerivation {
  36. pname = "SDL2_ttf";
  37. version = "2.0.14-" + (if (self ? shortRev) then self.shortRev else "dirty");
  38. src = nixpkgs.lib.cleanSource ./.;
  39. cmakeFlags = [ "-DWITH_RAQM=1" ];
  40. nativeBuildInputs = [
  41. pkgs.cmake
  42. pkgs.pkg-config
  43. ];
  44. buildInputs = [
  45. raqm
  46. pkgs.SDL2
  47. pkgs.freetype
  48. pkgs.libGL
  49. ];
  50. };
  51. default = SDL2_ttf;
  52. };
  53. }
  54. );
  55. }