Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Jan 27, 2021
0 parents commit 9b0d6d0
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
create:
tags:
push:
branches:
- main
pull_request:

jobs:
build:
name: Native Build
runs-on: ubuntu-latest
env:
WASI_SDK_MAJOR_VERSION: 12
WASI_SDK_MINOR_VERSION: 0
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install ninja
run: sudo apt install ninja-build
- name: Install wasi-sdk
run: |
WASI_SDK_VERSION=$WASI_SDK_MAJOR_VERSION.$WASI_SDK_MINOR_VERSION
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_MAJOR_VERSION/wasi-sdk-$WASI_SDK_VERSION-linux.tar.gz
tar xvf wasi-sdk-$WASI_SDK_VERSION-linux.tar.gz
ln -s wasi-sdk-$WASI_SDK_VERSION wasi-sdk
- name: Build
run: |
export WASI_SDK_PREFIX="$GITHUB_WORKSPACE/wasi-sdk"
make package
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: libxml2-wasm32-unknown-wasi.tar.gz
path: build/libxml2-wasm32-unknown-wasi.tar.gz
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/libxml2"]
path = src/libxml2
url = https://gitlab.gnome.org/GNOME/libxml2.git
62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
ROOT_DIR = ${CURDIR}
DESTDIR = $(abspath build/install)

ifndef WASI_SDK_PREFIX
$(error WASI_SDK_PREFIX is not set)
endif

build/libxml2.BUILT:
mkdir -p build/libxml2
cd build/libxml2 && cmake $(ROOT_DIR)/src/libxml2 -GNinja \
-DLIBXML2_WITH_C14N=OFF \
-DLIBXML2_WITH_CATALOG=OFF \
-DLIBXML2_WITH_DEBUG=OFF \
-DLIBXML2_WITH_DOCB=OFF \
-DLIBXML2_WITH_FTP=OFF \
-DLIBXML2_WITH_HTML=OFF \
-DLIBXML2_WITH_HTTP=OFF \
-DLIBXML2_WITH_ICONV=OFF \
-DLIBXML2_WITH_ICU=OFF \
-DLIBXML2_WITH_ISO8859X=OFF \
-DLIBXML2_WITH_LEGACY=OFF \
-DLIBXML2_WITH_LZMA=OFF \
-DLIBXML2_WITH_MEM_DEBUG=OFF \
-DLIBXML2_WITH_MODULES=OFF \
-DLIBXML2_WITH_OUTPUT=ON \
-DLIBXML2_WITH_PATTERN=OFF \
-DLIBXML2_WITH_PROGRAMS=OFF \
-DLIBXML2_WITH_PUSH=ON \
-DLIBXML2_WITH_PYTHON=OFF \
-DLIBXML2_WITH_READER=OFF \
-DLIBXML2_WITH_REGEXPS=ON \
-DLIBXML2_WITH_RUN_DEBUG=OFF \
-DLIBXML2_WITH_SAX1=OFF \
-DLIBXML2_WITH_SCHEMAS=OFF \
-DLIBXML2_WITH_SCHEMATRON=OFF \
-DLIBXML2_WITH_TESTS=OFF \
-DLIBXML2_WITH_THREADS=OFF \
-DLIBXML2_WITH_THREAD_ALLOC=OFF \
-DLIBXML2_WITH_TREE=ON \
-DLIBXML2_WITH_VALID=ON \
-DLIBXML2_WITH_WRITER=OFF \
-DLIBXML2_WITH_XINCLUDE=OFF \
-DLIBXML2_WITH_XPATH=ON \
-DLIBXML2_WITH_XPTR=OFF \
-DLIBXML2_WITH_ZLIB=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DWASI_SDK_PREFIX=$(WASI_SDK_PREFIX) \
-DCMAKE_C_COMPILER_WORKS=ON \
-DCMAKE_SYSROOT=$(WASI_SDK_PREFIX)/share/wasi-sysroot \
-DCMAKE_TOOLCHAIN_FILE=$(WASI_SDK_PREFIX)/share/cmake/wasi-sdk.cmake

DESTDIR=$(DESTDIR) ninja install -C build/libxml2

touch build/libxml2.BUILT

build/package.BUILT: build/libxml2.BUILT
mkdir -p build/libxml2-wasm32-unknown-wasi
cp -r build/install/usr/local/include build/libxml2-wasm32-unknown-wasi/
cp -r build/install/usr/local/lib build/libxml2-wasm32-unknown-wasi/
tar czf build/libxml2-wasm32-unknown-wasi.tar.gz -C build libxml2-wasm32-unknown-wasi

package: build/package.BUILT
1 change: 1 addition & 0 deletions src/libxml2
Submodule libxml2 added at f93ca3

0 comments on commit 9b0d6d0

Please sign in to comment.