AtlatestRepositorycore-channel
1;;; Foreign function interface.
2;;;
3;;; libffi is here for exactly one consumer -- libwayland's connection layer
4;;; dispatches protocol messages through `ffi_call`, in the CLIENT as well as
5;;; the server -- but it is filed under its own domain rather than beside
6;;; wayland, on the same reasoning that put libevent in `event.sgl` instead of
7;;; `terminal.sgl`: a module named for the consumer writes "this exists to
8;;; serve wayland" into the layout, and it does not.
9(define-library (core packages ffi)
10 (import (sigil core)
11 (core build-environments)
12 (sigil env package)
13 (sigil build external))
14 (export libffi)
15 (begin
16 (define libffi
17 (package
18 name: "libffi"
19 version: "3.4.8"
20 source: (external-source
21 location: "https://github.com/libffi/libffi/releases/download/v3.4.8/libffi-3.4.8.tar.gz"
22 sha256: "bc9842a18898bfacb0ed1252c4febcc7e78fa139fd27fdc7a3e30d9d9356119b")
23 buildenv: core-buildenv
24 phases: (list
25 (external-phase
26 kind: 'configure
27 args: (list "--prefix=${out}"
28 "--disable-shared"
29 "--enable-static"
30 ;; No docs: they want makeinfo, which is not in
31 ;; the seed, and libffi's build does not fail
32 ;; without it -- it silently ships no info
33 ;; pages, which is a smaller and quieter
34 ;; version of the same absent-tool problem.
35 "--disable-docs"
36 ;; The multi-OS directory layout installs
37 ;; headers under lib/libffi-<ver>/include,
38 ;; which no consumer's -I would find.
39 "--disable-multi-os-directory"))
40 (external-phase kind: 'make)
41 (external-phase kind: 'install))))))