pantry/projects/gnome.org/libxml2/package.yml
Jacob Heider 53548a46b8
fix(libxml2.restock)[1]
`darwin` doesn't need this.
2024-01-11 14:48:24 -05:00

56 lines
1.2 KiB
YAML

distributable:
url: https://download.gnome.org/sources/libxml2/{{ version.marketing }}/libxml2-{{ version }}.tar.xz
strip-components: 1
versions:
github: GNOME/libxml2/tags
runtime:
env:
PYTHONPATH: ${{prefix}}/lib/python3.11/site-packages:$PYTHONPATH
dependencies:
zlib.net: ^1
build:
dependencies:
python.org: '>=3<3.12'
freedesktop.org/pkg-config: ~0.29
script: |
./configure $ARGS
make --jobs {{ hw.concurrency }}
make install
cd {{prefix}}/bin
sed -i.bak 's|{{prefix}}|"$(cd "$(dirname "$0")/.." \&\& pwd)"|' xml2-config
rm *.bak
# a lot of stuff is surprised at the libxml2 prefix
cd ../include
mv libxml2/libxml .
rmdir libxml2
ln -s . libxml2
env:
ARGS:
- --prefix={{prefix}}
- --without-lzma
linux:
# undefined symbol errors in newer llvms prevent building shared libs
CFLAGS: $CFLAGS -Wl,--undefined-version
test:
dependencies:
python.org: '>=3<3.12'
script: |
cc `xml2-config --cflags --libs` $CFLAGS test.c
./a.out
python -c "import libxml2"
env:
linux:
CFLAGS: -pthread
provides:
- bin/xml2-config
- bin/xmlcatalog
- bin/xmllint