1 # Build recipe for libxml2.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018, Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
20 pkgversion="$(echo $version | tr - _)"
23 # Set 'outdir' for a nice and well-organized output directory
24 outdir="${outdir}/${arch}/libs"
26 tarname=${program}-${version}.tar.gz
29 fetch=ftp://xmlsoft.org/libxml2/$tarname
32 A XML C parser library and toolkit.
34 XML itself is a meta language to design markup languages. HTML is the
35 most well-known markup language. Though the library is written in C,
36 a variety of language bindings make it available in other environments.
39 homepage=http://xmlsoft.org
42 docs="AUTHORS ChangeLog Copyright NEWS README TODO"
43 docsdir="${docdir}/${program}-${version}"
45 # The source has a custom directory
46 srcdir="${program}-${version%-*}"
51 unpack "${tardir}/$tarname"
55 # Set sane permissions
56 chmod -R u+w,go-w,a+rX-s .
58 # Recommended patch to prevent a segfault when using Python v3
59 # (Thanks to Beyond of Linux From Scratch!)
60 # patch -p1 < "${worktree}/patches/libxml2/libxml2-2.9.8-python3_hack-1.patch"
62 # # To ensure that the Python module can be built by python-3.6
63 # sed -i '/_PyVerify_fd/,+1d' python/types.c
65 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
67 --libdir=/usr/lib${libSuffix} \
73 --with-python=/usr/bin/python3 \
76 --build="$(cc -dumpmachine)"
79 make -j${jobs} DESTDIR="$destdir" install-strip
81 # Compress info documents deleting index file for the package
82 if test -d "${destdir}/$infodir"
84 rm -f "${destdir}/${infodir}/dir"
85 lzip -9 "${destdir}/${infodir}"/*
88 # Compress and link man pages (if needed)
89 if test -d "${destdir}/$mandir"
92 cd "${destdir}/$mandir"
93 find . -type f -exec lzip -9 '{}' +
94 find . -type l | while read -r file
96 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
103 mkdir -p "${destdir}${docsdir}"
107 cp -p $file "${destdir}${docsdir}"