AtlatestRepositorycore-channel
core-channel / tree / src / core / packagesxml.sgl
1
;;; XML and HTML parsing.2
;;;3
;;; libxml2 is what gives Emacs `libxml-parse-html-region`, and therefore shr4
;;; and eww. Built static and deliberately narrow: no Python bindings, no5
;;; loadable modules, and no HTTP client, because Emacs uses libxml2 purely as6
;;; a parser and its network stack is its own.7
;;;8
;;; It also carries the channel's first patch, and the reason is worth reading9
;;; before touching it -- see the note beside the `patch` phase.10
(define-library (core packages xml)11
(import (sigil core)12
(core build-environments)13
(sigil env package)14
(sigil build external))15
(export libxml2)16
(begin17
(define libxml218
(package19
name: "libxml2"20
version: "2.13.5"21
source: (external-source22
location: "https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.5.tar.xz"23
sha256: "74fc163217a3964257d3be39af943e08861263c4231f9ef5b496b6f6d4c7b2b6")24
buildenv: core-buildenv25
phases: (list26
;; WHY THIS PATCH EXISTS. The pinned seed's pkgconf 1.9.527
;; ABORTS (SIGABRT, a Zig pointer-overflow panic) on any .pc28
;; file carrying an EMPTY dependency-list field, and libxml229
;; installs `Requires:` empty because it is built30
;; --without-zlib. Emacs finds libxml2 through31
;; PKG_CHECK_MODULES, which runs `pkg-config --exists` and32
;; reads ANY non-zero status as "not present" -- so a33
;; crashing tool impersonates a calm, plausible absence and34
;; configure still exits 0. That is how the port build lost35
;; libxml2 with no error and no warning.36
;;37
;; Measured against the seed's own pkg-config, both38
;; directions: with the empty `Requires:` line,39
;; `pkg-config --exists libxml-2.0` exits 134 with the panic;40
;; with the line deleted it exits 0 and `--cflags --libs`41
;; returns exactly what Emacs needs.42
;;43
;; This patch deletes the line from the TEMPLATE, before44
;; configure substitutes it, so no empty field is ever45
;; generated. It fixes libxml2 only. The general fix is a46
;; seed re-pin onto a pkgconf past the bug47
;; (investigations/seed-pkgconf-empty-field-abort), which is48
;; still owed -- gnutls' closure will hit the same wall.49
(external-phase50
kind: 'patch51
patches: (list52
(channel-patch53
path: "patches/libxml2-pc-drop-empty-requires.patch"54
sha256: "386f08e511d8f45fd649aacc2a55c7fcd52bdbc9ed11fac8fc613aa63eebf441")))55
(external-phase56
kind: 'configure57
args: (list "--prefix=${out}"58
"--disable-shared"59
"--enable-static"60
"--without-python"61
"--without-lzma"62
"--without-zlib"63
"--without-http"64
"--without-modules"))65
(external-phase kind: 'make)66
(external-phase kind: 'install))))))