AtlatestRepositorycore-channel
core-channel / tree / src / core / packagesgraphics.sgl
1
;;; Software rasterisation.2
;;;3
;;; pixman is foot's renderer: foot draws its cells into pixman images in4
;;; shared memory and hands the buffer to the compositor through `wl_shm`.5
;;; There is no GPU path in foot at all, which is why nothing in this channel6
;;; needs Mesa, a DRM driver, or anything else that would have to match the7
;;; host's graphics stack.8
;;;9
;;; VERSION, and this is a deliberate choice rather than staleness: 0.42.2 is10
;;; the last pixman release with an autotools build. 0.43 and later are11
;;; meson-only. foot's meson.build asks only for `pixman-1` with no version12
;;; constraint -- it tests `pixman.version().version_compare('>=0.46.0')` to13
;;; decide whether to define HAVE_PIXMAN_RGBA_16, and simply does not define it14
;;; otherwise. So taking the autotools release costs one optional pixel format15
;;; and removes a meson build from the chain.16
(define-library (core packages graphics)17
(import (sigil core)18
(core build-environments)19
(core packages compression)20
(sigil env package)21
(sigil build external))22
(export pixman libpng)23
(begin24
(define pixman25
(package26
name: "pixman"27
version: "0.42.2"28
source: (external-source29
location: "https://cairographics.org/releases/pixman-0.42.2.tar.gz"30
sha256: "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e")31
buildenv: core-buildenv32
phases: (list33
(external-phase34
kind: 'configure35
args: (list "--prefix=${out}"36
"--disable-shared"37
"--enable-static"38
;; Every one of these is a probe that would39
;; otherwise make the output depend on what40
;; happens to be visible in the build41
;; environment. Turning them off is what makes42
;; the result a function of the declared43
;; inputs rather than of the sandbox's luck.44
"--disable-gtk"45
"--disable-libpng"46
"--disable-openmp"))47
(external-phase kind: 'make)48
(external-phase kind: 'install))))50
;; libpng exists here for `grim`, the screenshot client, and for nothing51
;; else -- foot renders through pixman and never encodes an image.52
;;53
;; zlib is declared for the reason set out at length on `fontconfig` in54
;; (core packages fonts): libpng's generated `libpng.pc` carries a55
;; `Requires:` on zlib, and this channel composes PKG_CONFIG_PATH from56
;; DIRECT dependencies only. It is also simply true -- PNG's compression57
;; IS zlib's deflate, so zlib is on every libpng consumer's static link58
;; line.59
(define libpng60
(package61
name: "libpng"62
version: "1.6.50"63
source: (external-source64
location: "https://download.sourceforge.net/libpng/libpng-1.6.50.tar.xz"65
sha256: "4df396518620a7aa3651443e87d1b2862e4e88cad135a8b93423e01706232307")66
buildenv: core-buildenv67
dependencies: (list zlib)68
phases: (list69
(external-phase70
kind: 'configure71
args: (list "--prefix=${out}"72
"--disable-shared"73
"--enable-static"))74
(external-phase kind: 'make)75
(external-phase kind: 'install)76
(external-phase77
kind: 'run78
args: (list "sh" "-c"79
(string-append80
"set -eu\n"81
"d=\"$(dirname \"$PWD\")/install-root\"\n"82
"test -f \"$d${out}/lib/pkgconfig/libpng.pc\"\n"83
"echo LIBPNG-PC-PRESENT\n"))))))))