Skip to content

Commit

Permalink
libexpat 2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bennettgoble committed Apr 2, 2024
1 parent 8437666 commit ec71d9e
Show file tree
Hide file tree
Showing 171 changed files with 49 additions and 74,502 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
name: Build
on: [push]
on:
pull_request:
push:
branches: [main]
tags: [v*]
jobs:
build:
strategy:
matrix:
os: [windows-2022, macos-11, ubuntu-22.04]
addrsize: ["64"]
include:
- os: windows-2022
addrsize: "32"
runs-on: ${{ matrix.os }}
steps:
- uses: secondlife/action-autobuild@v3
with:
addrsize: ${{ matrix.addrsize }}
release:
needs: build
runs-on: [ubuntu-latest]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: secondlife/action-autobuild-release@v3
with:
public: true
18 changes: 4 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
syntax: glob
stage/
autobuild-parabuild-bootstrap/
.*.swp
*.swo
*.swp
*.tar.*


*.o
*.pc
*.lo
*.la
Makefile
*.log
**/.libs/*
expat/xmlwf/xmlwf
build/
stage/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "libexpat"]
path = libexpat
url = https://github.com/libexpat/libexpat.git
7 changes: 2 additions & 5 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
</map>
<key>manifest</key>
<array>
<string>lib/release/*.dylib</string>
<string>lib/release/*.a</string>
</array>
<key>name</key>
Expand All @@ -86,8 +85,6 @@
<key>manifest</key>
<array>
<string>lib/release/*.a</string>
<string>lib/release/*.so.*</string>
<string>lib/release/*.so</string>
</array>
<key>name</key>
<string>linux</string>
Expand Down Expand Up @@ -115,8 +112,8 @@
<string>windows</string>
</map>
</map>
<key>version_file</key>
<string>VERSION.txt</string>
<key>use_scm_version</key>
<boolean>true</boolean>
</map>
<key>type</key>
<string>autobuild</string>
Expand Down
97 changes: 34 additions & 63 deletions build-cmd.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/usr/bin/env bash

# turn on verbose debugging output for parabuild logs.
exec 4>&1; export BASH_XTRACEFD=4; set -x
# make errors fatal
set -e
# complain about undefined vars
set -u
set -eu

if [ -z "$AUTOBUILD" ] ; then
exit 1
Expand All @@ -17,46 +12,39 @@ else
autobuild="$AUTOBUILD"
fi

top="$(dirname "$0")"

STAGING_DIR="$(pwd)"
top="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
stage="$top/stage"
build="$top/build"
src="$top/libexpat/expat"

# load autbuild provided shell functions and variables
source_environment_tempfile="$STAGING_DIR/source_environment.sh"
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"

# remove_cxxstd
source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions"

EXPAT_SOURCE_DIR="$(pwd)/../expat"
EXPAT_VERSION="$(sed -n -E "s/^ *PACKAGE_VERSION *= *'(.*)' *\$/\1/p" \
"$EXPAT_SOURCE_DIR/configure")"
mkdir -p $top
mkdir -p $build
mkdir -p $stage/LICENSES

build=${AUTOBUILD_BUILD_ID:=0}
echo "${EXPAT_VERSION}.${build}" > "${STAGING_DIR}/VERSION.txt"
cmake_flags="${CMAKE_FLAGS:--DEXPAT_SHARED_LIBS=OFF -DEXPAT_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release}"

pushd "$EXPAT_SOURCE_DIR"
pushd $build
case "$AUTOBUILD_PLATFORM" in
windows*)
set +x
load_vsvars
set -x

msbuild.exe \
-t:expat_static \
-p:Configuration=Release \
-p:Platform=$AUTOBUILD_WIN_VSPLATFORM \
-p:PlatformToolset="${AUTOBUILD_WIN_VSTOOLSET:-v143}"

BASE_DIR="$STAGING_DIR/"
mkdir -p "$BASE_DIR/lib/release"
cp win32/bin/Release/libexpatMT.lib "$BASE_DIR/lib/release/"
cmake $(cygpath -w $src) -G"NMake Makefiles" $cmake_flags -DCMAKE_INSTALL_PREFIX=$(cygpath -w $stage) -DEXPAT_MSVC_STATIC_CRT=ON
nmake
nmake test
nmake install

INCLUDE_DIR="$STAGING_DIR/include/expat"
mkdir -p "$INCLUDE_DIR"
cp lib/expat.h "$INCLUDE_DIR"
cp lib/expat_external.h "$INCLUDE_DIR"
mkdir -p "$stage/lib/release"
mv $stage/lib/*.lib "$stage/lib/release/"
;;
darwin*)
opts="-arch $AUTOBUILD_CONFIGURE_ARCH $LL_BUILD_RELEASE"
Expand All @@ -65,47 +53,30 @@ pushd "$EXPAT_SOURCE_DIR"
export CXXFLAGS="$opts"
export LDFLAGS="$plainopts"
export CC="clang"
export PREFIX="$STAGING_DIR"
if ! ./configure --prefix=$PREFIX
then
cat config.log >&2
exit 1
fi
make -j$(nproc)
export PREFIX="$stage"

cmake $src $cmake_flags -DCMAKE_INSTALL_PREFIX=$stage
make -j$AUTOBUILD_CPU_COUNT
make test
make install

mv "$PREFIX/lib" "$PREFIX/release"
mkdir -p "$PREFIX/lib"
mv "$PREFIX/release" "$PREFIX/lib"
pushd "$PREFIX/lib/release"
fix_dylib_id "libexpat.dylib"

# CONFIG_FILE="$build_secrets_checkout/code-signing-osx/config.sh"
# if [ -f "$CONFIG_FILE" ]; then
# source $CONFIG_FILE
# codesign --force --timestamp --sign "$APPLE_SIGNATURE" "libexpat.dylib"
# else
# echo "No config file found; skipping codesign."
# fi
# popd

mv "$PREFIX/include" "$PREFIX/expat"
mkdir -p "$PREFIX/include"
mv "$PREFIX/expat" "$PREFIX/include"
mkdir -p "$stage/lib/release"
mv $stage/lib/*.a "$stage/lib/release/"
;;
linux*)
PREFIX="$STAGING_DIR"
CFLAGS="-m$AUTOBUILD_ADDRSIZE $(remove_cxxstd $LL_BUILD_RELEASE)" \
./configure --prefix="$PREFIX" --libdir="$PREFIX/lib/release"
make -j$(nproc)
cmake $src $cmake_flags -DCMAKE_INSTALL_PREFIX=$stage
make -j$AUTOBUILD_CPU_COUNT
make test
make install

mv "$PREFIX/include" "$PREFIX/expat"
mkdir -p "$PREFIX/include"
mv "$PREFIX/expat" "$PREFIX/include"
mkdir -p "$stage/lib/release"
mv $stage/lib/*.a "$stage/lib/release/"
;;
esac

mkdir -p "$STAGING_DIR/LICENSES"
cp "$EXPAT_SOURCE_DIR/COPYING" "$STAGING_DIR/LICENSES/expat.txt"
popd

mkdir -p "$stage/LICENSES"
mkdir -p "$stage/include/expat"
mv $stage/include/*.h "$stage/include/expat/"
cp "$src/COPYING" "$stage/LICENSES/expat.txt"
42 changes: 0 additions & 42 deletions expat/CMake.README

This file was deleted.

116 changes: 0 additions & 116 deletions expat/CMakeLists.txt

This file was deleted.

0 comments on commit ec71d9e

Please sign in to comment.