| 1 | defpkgbuild(freetype, |
| 2 | #:pkgname, "freetype", |
| 3 | #:pkgver, "2.13.3", |
| 4 | #:pkgrel, 1, |
| 5 | #:pkgdesc, "Font parsing and glyph rendering library", |
| 6 | #:arch, [#:x86-64, #:aarch64], |
| 7 | #:url, "https://freetype.org/", |
| 8 | #:license, "FTL OR GPL-2.0-or-later", |
| 9 | #:depends, ["musl", "brotli", "bzip2", "libpng", "zlib"], |
| 10 | #:source, ["https://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.xz", |
| 11 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/freetype/pcf-family-names.patch", |
| 12 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/freetype/subpixel.patch", |
| 13 | "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/freetype/table-validation-modules.patch", "glyph.c"], |
| 14 | #:sha256sums, ["0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289", |
| 15 | "5fc0fa5b1ea27721df648e3b1510b89f749f3a8a381c83a4324471efa46be0a1", |
| 16 | "2842df91ec228e40e34ffaea5f60137a311106e1e1a125a5af67fcf530eeb5e0", |
| 17 | "90a6a88e59ad8dabfe8e66145e77d6a7c648b0c3439ac341766e3667d144f33f", |
| 18 | "4d9fea1d329631a7b9f6e045a11f93490f8e6bce3fa374ca45ef622ac82ca19c"], |
| 19 | #:prepare, fn() { |
| 20 | run("patch", "--batch", "-d", "freetype-2.13.3", "-p1", "-i", "../pcf-family-names.patch") |
| 21 | run("patch", "--batch", "-d", "freetype-2.13.3", "-p1", "-i", "../subpixel.patch") |
| 22 | run("patch", "--batch", "-d", "freetype-2.13.3", "-p1", "-i", "../table-validation-modules.patch") |
| 23 | }, |
| 24 | #:build, fn() { |
| 25 | run("vinix-meson", "freetype-2.13.3", "build", "-Ddefault_library=both", |
| 26 | "-Dbrotli=enabled", "-Dbzip2=enabled", "-Dpng=enabled", "-Dzlib=system", "-Dharfbuzz=disabled") |
| 27 | run("meson", "compile", "-C", "build", "-j2") |
| 28 | }, |
| 29 | #:check, fn() { |
| 30 | run("vinix-cc", "-Ibuild/include", "-Ifreetype-2.13.3/include", "glyph.c", "-Lbuild", "-lfreetype", "-o", "glyph") |
| 31 | run("vinix-run", "--library-path", "build", "./glyph") |
| 32 | }, |
| 33 | #:package, fn() { |
| 34 | run("meson", "install", "--no-rebuild", "-C", "build", "--destdir", pkgdir()) |
| 35 | run("install", "-Dm644", "freetype-2.13.3/docs/FTL.TXT", string-append(pkgdir(), "/usr/share/licenses/freetype/FTL.TXT")) |
| 36 | }) |
| 37 | |