generated from sethub/template
[libxml2]Add libxml2 library
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
# The image is also used for libxslt.
|
||||
#
|
||||
# package required for
|
||||
# ------------------------------------------------------------
|
||||
# libclang-rt-dev sanitizer runtimes
|
||||
# llvm llvm-symbolizer (for sanitizer backtraces)
|
||||
# git libxslt, downstream projects
|
||||
# libgcrypt-dev libxslt
|
||||
# xz-utils make dist
|
||||
# doxygen documentation
|
||||
# xsltproc documentation
|
||||
# docbook-xsl documentation
|
||||
|
||||
FROM ubuntu:26.04
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl git ca-certificates \
|
||||
autoconf automake libtool pkg-config \
|
||||
make gcc clang llvm libclang-rt-dev \
|
||||
zlib1g-dev libgcrypt-dev \
|
||||
python3-dev \
|
||||
cmake meson \
|
||||
xz-utils \
|
||||
doxygen xsltproc docbook-xsl
|
||||
WORKDIR /tests
|
||||
RUN curl https://www.w3.org/XML/Test/xmlts20080827.tar.gz |tar xz
|
||||
|
||||
# XML::LibXML uses Alien::Libxml2 which has a huge dependency chain.
|
||||
# We try to install most dependencies with apt. We also require
|
||||
# libxml2-dev to stop Alien::Libxml2 from downloading and building
|
||||
# libxml2 on its own.
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
libperl-dev libxml2-dev cpanminus \
|
||||
libalien-build-perl \
|
||||
libio-socket-ssl-perl \
|
||||
libsort-versions-perl \
|
||||
liburi-perl \
|
||||
libxml-namespacesupport-perl \
|
||||
libxml-sax-perl \
|
||||
libyaml-perl
|
||||
RUN cpanm -n Alien::Libxml2
|
||||
RUN apt-get remove -y libxml2-dev
|
||||
|
||||
# PHP
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
bison re2c libsqlite3-dev
|
||||
|
||||
# lxml
|
||||
# ubuntu cython3 is too old, so we install using pip
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
python3-pip
|
||||
RUN pip3 install Cython --break-system-packages
|
||||
|
||||
# xmlstarlet
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
docbook-xsl-ns
|
||||
@@ -0,0 +1,5 @@
|
||||
# Image used to generate documentation with a recent version of Doxygen.
|
||||
# 1.14.0 fixes an important bug.
|
||||
|
||||
FROM archlinux:base-devel
|
||||
RUN pacman -Syu --noconfirm doxygen libxslt docbook-xsl git
|
||||
@@ -0,0 +1,46 @@
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
if (-not (Test-Path 7za.exe)) {
|
||||
Invoke-WebRequest `
|
||||
-Uri https://www.7-zip.org/a/7z1900-extra.7z `
|
||||
-OutFile 7z1900-extra.7z
|
||||
cmake -E tar xf 7z1900-extra.7z 7za.exe
|
||||
}
|
||||
|
||||
if (-not (Test-Path xmlconf)) {
|
||||
Invoke-WebRequest `
|
||||
-Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz `
|
||||
-OutFile xmlts20080827.tar.gz ;
|
||||
.\7za.exe x xmlts20080827.tar.gz
|
||||
.\7za.exe x xmlts20080827.tar
|
||||
}
|
||||
|
||||
cmake `
|
||||
-G "Visual Studio 16 2019" `
|
||||
-DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" `
|
||||
-DCMAKE_INSTALL_PREFIX=libxml2-install `
|
||||
-DLIBXML2_WITH_SCHEMATRON=ON `
|
||||
-DLIBXML2_WITH_ICONV=OFF `
|
||||
-DLIBXML2_WITH_PYTHON=OFF `
|
||||
-DLIBXML2_WITH_ZLIB=OFF `
|
||||
-S . -B libxml2-build
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "cmake failed"
|
||||
}
|
||||
cmake --build libxml2-build --config Debug --target install
|
||||
cmake --build libxml2-build --config Release --target install
|
||||
New-Item -ItemType Directory libxml2-install\share\libxml2
|
||||
Copy-Item Copyright libxml2-install\share\libxml2
|
||||
|
||||
cd libxml2-build
|
||||
ctest -C Debug -VV
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "ctest failed"
|
||||
}
|
||||
ctest -C Release -VV
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "ctest failed"
|
||||
}
|
||||
cd ..
|
||||
|
||||
.\7za.exe a libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:CMAKE_GENERATOR_TOOLSET-$Env:CMAKE_GENERATOR_PLATFORM-$Env:SUFFIX.7z .\libxml2-install\*
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p libxml2-dist
|
||||
cd libxml2-dist
|
||||
sh ../autogen.sh --with-docs --with-legacy
|
||||
VERSION=$(cat libxml-2.0.pc | grep Version | cut -d" " -f2)
|
||||
|
||||
# Build doc into the dist: https://gitlab.gnome.org/GNOME/libxml2/-/issues/1048
|
||||
cd doc
|
||||
make
|
||||
cd ..
|
||||
|
||||
make distcheck V=1 DISTCHECK_CONFIGURE_FLAGS='--with-docs --with-legacy'
|
||||
|
||||
tar xJvf libxml2-$VERSION.tar.xz
|
||||
cp -rf doc libxml2-$VERSION/dist-doc
|
||||
tar cJvf libxml2-$VERSION.tar.xz libxml2-$VERSION
|
||||
|
||||
if [ -z "$CI_COMMIT_TAG" ]; then
|
||||
mv libxml2-$VERSION.tar.xz libxml2-git-$CI_COMMIT_SHORT_SHA.tar.xz
|
||||
fi
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
srcdir=$(pwd)
|
||||
installdir="$srcdir/install"
|
||||
export PKG_CONFIG_PATH="$installdir/lib/pkgconfig"
|
||||
|
||||
git clone --depth 1 https://github.com/lxml/lxml.git
|
||||
cd lxml
|
||||
make
|
||||
LD_LIBRARY_PATH="$installdir/lib" make TESTFLAGS='' test
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
export LIBXML_DIR=$(pwd)
|
||||
export MAKEFLAGS=-j$(nproc)
|
||||
export NOCONFIGURE=1
|
||||
./autogen.sh
|
||||
|
||||
git clone https://github.com/sparklemotion/nokogiri
|
||||
cd nokogiri
|
||||
gem install bundler:2.7.2
|
||||
bundle _2.7.2_ install
|
||||
bundle exec rake compile -- --with-xml2-source-dir=${LIBXML_DIR} --disable-xml2-legacy
|
||||
bundle exec rake test
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
srcdir=$(pwd)
|
||||
installdir="$srcdir/install"
|
||||
export PKG_CONFIG_PATH="$installdir/lib/pkgconfig"
|
||||
|
||||
git clone --depth 1 https://github.com/php/php-src.git
|
||||
cd php-src
|
||||
./buildconf
|
||||
./configure --with-xsl --enable-soap --enable-debug
|
||||
make -j$(nproc)
|
||||
make TESTS=" \
|
||||
-g FAIL \
|
||||
--show-diff \
|
||||
--no-progress \
|
||||
ext/dom \
|
||||
ext/libxml \
|
||||
ext/simplexml \
|
||||
ext/soap \
|
||||
ext/xml \
|
||||
ext/xmlreader \
|
||||
ext/xmlwriter \
|
||||
ext/xsl \
|
||||
" test
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
srcdir=$(pwd)
|
||||
|
||||
mkdir -p install
|
||||
installdir="$srcdir/install"
|
||||
export PKG_CONFIG_PATH="$installdir/lib/pkgconfig"
|
||||
|
||||
sh autogen.sh "--prefix=$installdir" --with-docs --with-schematron --with-zlib
|
||||
make -j$(nproc)
|
||||
make install
|
||||
|
||||
# Make system XML catalog available
|
||||
ln -s /etc install/etc
|
||||
|
||||
git clone --depth 1 https://gitlab.gnome.org/GNOME/libxslt.git
|
||||
cd libxslt
|
||||
sh autogen.sh \
|
||||
"--prefix=$installdir" \
|
||||
--without-python
|
||||
make -j$(nproc)
|
||||
make install
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Newer versions of llvm-symbolizer require libxml2 themselves. Running
|
||||
# a test program with LD_LIBRARY_PATH set to .libs makes llvm-symbolizer
|
||||
# pick up the tested development version of libxml2 which breaks
|
||||
# completely if the build is instrumented with ASan. This wrapper script
|
||||
# invokes llvm-symbolizer with an empty LD_LIBRARY_PATH.
|
||||
|
||||
LD_LIBRARY_PATH='' llvm-symbolizer "$@"
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
pacman --noconfirm -Syu
|
||||
|
||||
prefix=
|
||||
if [ -n "$MINGW_PACKAGE_PREFIX" ]; then
|
||||
prefix="${MINGW_PACKAGE_PREFIX}-"
|
||||
fi
|
||||
for module in docbook-xsl doxygen libiconv python xsltproc xz zlib "$@"; do
|
||||
pacman --noconfirm -S --needed ${prefix}$module
|
||||
done
|
||||
|
||||
mkdir -p libxml2-build
|
||||
|
||||
if [ ! -e xmlconf ]; then
|
||||
wget https://www.w3.org/XML/Test/xmlts20080827.tar -O - |
|
||||
tar -x
|
||||
fi
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd libxml2-build
|
||||
sh ../autogen.sh $BASE_CONFIG $CONFIG || cat config.log
|
||||
make -j$(nproc) V=1 CFLAGS="$CFLAGS -Werror"
|
||||
make CFLAGS="$CFLAGS -Werror" check
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
CFLAGS="-Werror $CFLAGS" \
|
||||
cmake "$@" \
|
||||
-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \
|
||||
-DCMAKE_INSTALL_PREFIX=libxml2-install \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DLIBXML2_WITH_HTTP=ON \
|
||||
-DLIBXML2_WITH_SCHEMATRON=ON \
|
||||
-DLIBXML2_WITH_ZLIB=ON \
|
||||
-DLIBXML2_WITH_PYTHON=ON \
|
||||
$CONFIG \
|
||||
-S . -B libxml2-build
|
||||
cmake --build libxml2-build --target install
|
||||
|
||||
(cd libxml2-build && ctest -VV)
|
||||
|
||||
mkdir -p libxml2-install/share/libxml2
|
||||
cp Copyright libxml2-install/share/libxml2
|
||||
(cd libxml2-install &&
|
||||
tar -czf ../libxml2-$CI_COMMIT_SHORT_SHA-$SUFFIX.tar.gz *)
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# compile with the following warnings:
|
||||
# --warnlevel 3 : passes to the compiler -Wall -Wextra -Wpedantic
|
||||
# --werror : passes to the compiler -Werror
|
||||
# --default-library : can be 'shared', 'static' or 'both'
|
||||
meson setup \
|
||||
--warnlevel 3 \
|
||||
--werror \
|
||||
--buildtype=debugoptimized \
|
||||
--default-library shared \
|
||||
-Ddocs=enabled \
|
||||
-Dhttp=enabled \
|
||||
-Dschematron=enabled \
|
||||
-Dzlib=enabled \
|
||||
-Dpython=enabled \
|
||||
builddir
|
||||
|
||||
ninja -C builddir
|
||||
|
||||
meson test --verbose -C builddir
|
||||
Reference in New Issue
Block a user