Skip to content

Commit

Permalink
libxmlsec1 1.2.33
Browse files Browse the repository at this point in the history
  • Loading branch information
jclulow committed May 3, 2022
1 parent 85d1c5c commit 3311e49
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/transforms.mog
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<transform dir path=^opt$ -> set group sys>
<transform dir path=^usr$ -> set group sys>
<transform dir path=^usr/share$ -> set group sys>
<transform dir path=^usr/share/aclocal$ -> set group other>
<transform dir path=^usr/share/doc$ -> set group other>
<transform dir path=^usr/share/applications$ -> set group other>
<transform dir path=^usr/share/locale.* -> set group other>
Expand Down
131 changes: 131 additions & 0 deletions libxmlsec1/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#!/bin/bash

set -o errexit
set -o pipefail

ROOT=$(cd "$(dirname "$0")" && pwd)
. "$ROOT/../lib/common.sh"

ARTEFACT="$ROOT/artefact"
mkdir -p "$ARTEFACT"
WORK="$ROOT/work"
mkdir -p "$WORK"
SRC32="$WORK/src32"
mkdir -p "$SRC32"
SRC64="$WORK/src64"
mkdir -p "$SRC64"
PROTO="$WORK/proto"
mkdir -p "$PROTO"

#
# Directory for workaround scripts that we can put in PATH:
#
WORKAROUND="$ROOT/cache/workaround"
rm -rf "$WORKAROUND"
mkdir -p "$WORKAROUND"

#
# The build will try to detect information about the git repository, but finds
# garbage-compactor.git, because the source archive we use to build Cockroach
# is not, itself, a git repository.
#
cat >"$WORKAROUND/git" <<'EOF'
#!/usr/bin/bash
exit 1
EOF
chmod 0755 "$WORKAROUND/git"

NAM='libxmlsec1'
VER='1.2.33'
URL="http://www.aleksey.com/xmlsec/download/xmlsec1-$VER.tar.gz"

if [[ -x /usr/gcc/10/bin/gcc ]]; then
GCC_DIR=/usr/gcc/10/bin
elif [[ -x /opt/gcc-10/bin/gcc ]]; then
GCC_DIR=/opt/gcc-10/bin
else
fatal "Could not find GCC in any expected location"
fi
info "using $GCC_DIR/gcc: $($GCC_DIR/gcc --version | head -1)"
info "using $GCC_DIR/g++: $($GCC_DIR/g++ --version | head -1)"

build_deps \
'/library/libxml2' \
'/library/libxslt' \
'/library/libusb'

#
# Download artefacts to use during build:
#
header 'downloading artefacts'

file="$ARTEFACT/xmlsec1-$VER.tar.gz"
download_to "$NAM" "$URL" "$file"

#
# Extract artefacts:
#
header 'extracting artefacts'

extract_to "$NAM" "$file" "$SRC32" --strip-components=1
extract_to "$NAM" "$file" "$SRC64" --strip-components=1

header "building $NAM"

export PATH="$WORKAROUND:$PATH"

cd "$SRC32"

CFLAGS='-m32' \
./configure \
--prefix=/usr \
--libdir=/usr/lib \
--enable-static=no

info "make..."
gmake -j8

info "make install..."
gmake install DESTDIR="$PROTO"

cd "$SRC64"

PKG_CONFIG_PATH='/usr/lib/amd64/pkgconfig' \
CFLAGS='-m64' \
LDFLAGS='-R/usr/lib/amd64' \
./configure \
--prefix=/usr \
--libdir=/usr/lib/amd64 \
--enable-static=no

info "make..."
gmake -j8

info "make install..."
gmake install DESTDIR="$PROTO"

if [[ -z "$OUTPUT_TYPE" ]]; then
OUTPUT_TYPE=ips
fi

case "$OUTPUT_TYPE" in
ips)
make_package "library/$NAM" \
'XML Security Library based on libxml2' \
"$WORK/proto"
header 'build output:'
pkgrepo -s "$WORK/repo" list
pkgrecv -a -d "$WORK/$NAM-$VER.p5p" -s "$WORK/repo" "$NAM@$VER-1.0"
ls -lh "$WORK/$NAM-$VER.p5p"
exit 0
;;
none)
#
# Just leave the build tree as-is without doing any more work.
#
exit 0
;;
*)
fatal "unknown output type: $OUTPUT_TYPE"
;;
esac

0 comments on commit 3311e49

Please sign in to comment.