mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 09:15:35 +00:00
parent
3b75ae7ff1
commit
aa807c0c3c
5 changed files with 44 additions and 102 deletions
|
@ -1,31 +0,0 @@
|
||||||
FROM ubuntu:22.04
|
|
||||||
|
|
||||||
RUN apt update && \
|
|
||||||
apt install -y make gcc libreadline-dev wget unzip git zip && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ADD https://www.lua.org/ftp/lua-5.1.5.tar.gz /tmp/lua-5.1.5.tar.gz
|
|
||||||
RUN tar -zxf /tmp/lua-5.1.5.tar.gz -C /tmp && rm /tmp/lua-5.1.5.tar.gz
|
|
||||||
RUN cd /tmp/lua-5.1.5 && \
|
|
||||||
make linux -j $(nproc) && \
|
|
||||||
make install && \
|
|
||||||
rm -r /tmp/lua-5.1.5
|
|
||||||
|
|
||||||
ADD https://luarocks.org/releases/luarocks-2.4.2.tar.gz /tmp/luarocks-2.4.2.tar.gz
|
|
||||||
RUN tar -zxpf /tmp/luarocks-2.4.2.tar.gz -C /tmp && rm /tmp/luarocks-2.4.2.tar.gz
|
|
||||||
RUN cd /tmp/luarocks-2.4.2 && \
|
|
||||||
./configure && \
|
|
||||||
make build -j $(nproc) && \
|
|
||||||
make install && \
|
|
||||||
rm -r /tmp/luarocks-2.4.2
|
|
||||||
|
|
||||||
ADD https://gitlab.com/ptmikheev/openmw-luadocumentor/-/raw/master/luarocks/openmwluadocumentor-0.1.1-1.rockspec /tmp/openmwluadocumentor-0.1.1-1.rockspec
|
|
||||||
RUN cd /tmp && \
|
|
||||||
luarocks pack openmwluadocumentor-0.1.1-1.rockspec && \
|
|
||||||
luarocks install openmwluadocumentor-0.1.1-1.src.rock && \
|
|
||||||
rm /tmp/openmwluadocumentor-0.1.1-1.rockspec /tmp/openmwluadocumentor-0.1.1-1.src.rock
|
|
||||||
|
|
||||||
VOLUME /openmw
|
|
||||||
|
|
||||||
ENV DOCS_SOURCE_DIR=/openmw/docs/source
|
|
||||||
ENV DOCUMENTOR_PATH=/usr/local/bin/openmwluadocumentor
|
|
|
@ -1,18 +0,0 @@
|
||||||
# Source files for OpenMW documentation
|
|
||||||
|
|
||||||
## Generating Lua scripting API reference
|
|
||||||
|
|
||||||
### Building Docker image
|
|
||||||
|
|
||||||
Run following command from OpenMW source directory to build a new Docker image `openmw.luadoc`:
|
|
||||||
```bash
|
|
||||||
docker build -f docs/source/Dockerfile.luadoc -t openmw.luadoc docs/source
|
|
||||||
```
|
|
||||||
|
|
||||||
### Generating HTML
|
|
||||||
|
|
||||||
Run following command from OpenMW source directory to generate HTML pages:
|
|
||||||
```bash
|
|
||||||
docker run --rm --tty --interactive --user "$(id -u)":"$(id -g)" \
|
|
||||||
--volume "${PWD}":/openmw openmw.luadoc /openmw/docs/source/generate_luadoc.sh
|
|
||||||
```
|
|
|
@ -151,11 +151,7 @@ def setup(app):
|
||||||
app.add_stylesheet('figures.css')
|
app.add_stylesheet('figures.css')
|
||||||
app.add_stylesheet('luadoc.css')
|
app.add_stylesheet('luadoc.css')
|
||||||
try:
|
try:
|
||||||
# Assume we need to setup openmw-luadocumentor only when running this script in a Docker container because
|
subprocess.call(project_root + '/docs/source/generate_luadoc.sh')
|
||||||
# readthedocs pipeline runs there.
|
|
||||||
if os.path.exists('/.dockerenv'):
|
|
||||||
subprocess.check_call(os.path.join(project_root, 'docs/source/setup_openmw_luadocumentor.sh'))
|
|
||||||
subprocess.check_call(os.path.join(project_root, 'docs/source/generate_luadoc.sh'))
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('Can\'t generate Lua API documentation:', e)
|
print('Can\'t generate Lua API documentation:', e)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash
|
||||||
|
|
||||||
# How to install openmwluadocumentor:
|
# How to install openmwluadocumentor:
|
||||||
|
|
||||||
|
@ -20,31 +20,52 @@
|
||||||
# open "Git Bash" in the same directory and run script:
|
# open "Git Bash" in the same directory and run script:
|
||||||
# ./generate_luadoc.sh
|
# ./generate_luadoc.sh
|
||||||
|
|
||||||
if [[ -z "${DOCS_SOURCE_DIR+x}" ]]; then
|
if [ -f /.dockerenv ]; then
|
||||||
DOCS_SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
# We are inside readthedocs pipeline
|
||||||
|
echo "Install lua 5.1"
|
||||||
|
cd ~
|
||||||
|
curl -R -O https://www.lua.org/ftp/lua-5.1.5.tar.gz
|
||||||
|
tar -zxf lua-5.1.5.tar.gz
|
||||||
|
cd lua-5.1.5/
|
||||||
|
make linux
|
||||||
|
PATH=$PATH:~/lua-5.1.5/src
|
||||||
|
|
||||||
|
echo "Install luarocks"
|
||||||
|
cd ~
|
||||||
|
wget https://luarocks.org/releases/luarocks-2.4.2.tar.gz
|
||||||
|
tar zxpf luarocks-2.4.2.tar.gz
|
||||||
|
cd luarocks-2.4.2/
|
||||||
|
./configure --with-lua-bin=$HOME/lua-5.1.5/src --with-lua-include=$HOME/lua-5.1.5/src --prefix=$HOME/luarocks
|
||||||
|
make build
|
||||||
|
make install
|
||||||
|
PATH=$PATH:~/luarocks/bin
|
||||||
|
|
||||||
|
echo "Install openmwluadocumentor"
|
||||||
|
cd ~
|
||||||
|
git clone https://gitlab.com/ptmikheev/openmw-luadocumentor.git
|
||||||
|
cd openmw-luadocumentor/luarocks
|
||||||
|
luarocks --local pack openmwluadocumentor-0.1.1-1.rockspec
|
||||||
|
luarocks --local install openmwluadocumentor-0.1.1-1.src.rock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILES_DIR="${DOCS_SOURCE_DIR:?}/../../files"
|
DOCS_SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
OUTPUT_DIR="${DOCS_SOURCE_DIR:?}/reference/lua-scripting/generated_html"
|
FILES_DIR=$DOCS_SOURCE_DIR/../../files
|
||||||
|
OUTPUT_DIR=$DOCS_SOURCE_DIR/reference/lua-scripting/generated_html
|
||||||
|
DOCUMENTOR_PATH=~/.luarocks/bin/openmwluadocumentor
|
||||||
|
|
||||||
if [[ -z "${DOCUMENTOR_PATH+x}" ]]; then
|
if [ ! -x $DOCUMENTOR_PATH ]; then
|
||||||
DOCUMENTOR_PATH=~/.luarocks/bin/openmwluadocumentor
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -x "${DOCUMENTOR_PATH:?}" ]; then
|
|
||||||
# running on Windows?
|
# running on Windows?
|
||||||
DOCUMENTOR_PATH="${APPDATA:?}/LuaRocks/bin/openmwluadocumentor.bat"
|
DOCUMENTOR_PATH="$APPDATA/LuaRocks/bin/openmwluadocumentor.bat"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf "${OUTPUT_DIR:?}"
|
rm -f $OUTPUT_DIR/*.html
|
||||||
mkdir "${OUTPUT_DIR:?}"
|
|
||||||
|
|
||||||
cd "${FILES_DIR:?}/lua_api"
|
cd $FILES_DIR/lua_api
|
||||||
"${DOCUMENTOR_PATH:?}" -f doc -d "${OUTPUT_DIR:?}" openmw/*lua
|
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR openmw/*lua
|
||||||
|
|
||||||
cd "${FILES_DIR:?}/data"
|
cd $FILES_DIR/data
|
||||||
"${DOCUMENTOR_PATH:?}" -f doc -d "${OUTPUT_DIR:?}" openmw_aux/*lua
|
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR openmw_aux/*lua
|
||||||
"${DOCUMENTOR_PATH:?}" -f doc -d "${OUTPUT_DIR:?}" scripts/omw/ai.lua
|
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR scripts/omw/ai.lua
|
||||||
"${DOCUMENTOR_PATH:?}" -f doc -d "${OUTPUT_DIR:?}" scripts/omw/camera/camera.lua
|
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR scripts/omw/camera/camera.lua
|
||||||
"${DOCUMENTOR_PATH:?}" -f doc -d "${OUTPUT_DIR:?}" scripts/omw/mwui/init.lua
|
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR scripts/omw/mwui/init.lua
|
||||||
"${DOCUMENTOR_PATH:?}" -f doc -d "${OUTPUT_DIR:?}" scripts/omw/settings/player.lua
|
$DOCUMENTOR_PATH -f doc -d $OUTPUT_DIR scripts/omw/settings/player.lua
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
echo "Install lua 5.1"
|
|
||||||
cd ~
|
|
||||||
curl -R -O https://www.lua.org/ftp/lua-5.1.5.tar.gz
|
|
||||||
tar -zxf lua-5.1.5.tar.gz
|
|
||||||
cd lua-5.1.5/
|
|
||||||
make -j $(nproc) linux
|
|
||||||
PATH="${PATH:?}:~/lua-5.1.5/src"
|
|
||||||
|
|
||||||
echo "Install luarocks"
|
|
||||||
cd ~
|
|
||||||
wget https://luarocks.org/releases/luarocks-2.4.2.tar.gz
|
|
||||||
tar zxpf luarocks-2.4.2.tar.gz
|
|
||||||
cd luarocks-2.4.2/
|
|
||||||
./configure --with-lua-bin="${HOME:?}/lua-5.1.5/src" --with-lua-include="${HOME:?}/lua-5.1.5/src" --prefix="${HOME:?}/luarocks"
|
|
||||||
make -j $(nproc) build
|
|
||||||
make -j $(nproc) install
|
|
||||||
PATH="${PATH:?}:~/luarocks/bin"
|
|
||||||
|
|
||||||
echo "Install openmwluadocumentor"
|
|
||||||
cd ~
|
|
||||||
git clone --depth 1 https://gitlab.com/ptmikheev/openmw-luadocumentor.git
|
|
||||||
cd openmw-luadocumentor/luarocks
|
|
||||||
luarocks --local pack openmwluadocumentor-0.1.1-1.rockspec
|
|
||||||
luarocks --local install openmwluadocumentor-0.1.1-1.src.rock
|
|
Loading…
Reference in a new issue