File: compile-against-libxml2-source

package info (click to toggle)
ruby-nokogiri 1.13.10%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,416 kB
  • sloc: ansic: 38,198; xml: 28,086; ruby: 22,271; java: 15,517; cpp: 7,037; yacc: 244; sh: 148; makefile: 136
file content (44 lines) | stat: -rwxr-xr-x 850 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /usr/bin/env bash

set -eu

PREFIX="${HOME}/tmp/libxml2"
rm -rf "${PREFIX}"
mkdir -p "$PREFIX"

pushd ../libxml2

clean_p=0
if [[ ${1:-} == "--clean" ]] ; then
  clean_p=1
  shift
fi

if [[ $clean_p -gt 0 ]] ; then
  make clean || true

  ./configure --prefix="${PREFIX}" --without-python --without-readline --with-c14n --with-debug --with-threads --with-iconv=yes --host=x86_64-pc-linux-gnu CFLAGS="-O2 -g"
fi

make install

popd

export LD_LIBRARY_PATH=${PREFIX}/lib
export CFLAGS="-I${PREFIX}/include/libxml2"
export LDFLAGS="-lxml2 -L${PREFIX}/lib"

echo export LD_LIBRARY_PATH=${PREFIX}/lib
echo export CFLAGS="-I${PREFIX}/include/libxml2"
echo export LDFLAGS="-lxml2 -L${PREFIX}/lib"

if [[ $clean_p -gt 0 ]] ; then
  bundle exec rake clean
fi

NOKOGIRI_USE_SYSTEM_LIBRARIES=t bundle exec rake compile

if [[ ${1:-} != "" ]] ; then
  $*
fi