+libxml2 (#63)

This commit is contained in:
Max Howell 2022-08-02 07:15:02 -04:00 committed by GitHub
parent f13750bb50
commit 20342be4de
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,22 @@
distributable:
url: https://download.gnome.org/sources/libxml2/{{ version.major }}.{{ version.minor }}/libxml2-{{ version }}.tar.xz
strip-components: 1
versions:
github: GNOME/libxml2/tags
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
script: |
./configure --prefix={{prefix}}
make --jobs {{ hw.concurrency }}
make install
test:
dependencies:
tea.xyz/gx/cc: c99
script: |
cc `xml2-config --cflags --libs` -o test {{ pkg.pantry-prefix }}/test.c
./test

View file

@ -0,0 +1,9 @@
#include <libxml/tree.h>
int main() {
xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
xmlNodePtr root_node = xmlNewNode(NULL, BAD_CAST "root");
xmlDocSetRootElement(doc, root_node);
xmlFreeDoc(doc);
return 0;
}