Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion install/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Ignore any generated files
temp/
temp/
*.zip
21 changes: 21 additions & 0 deletions install/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.10.8

ARG cobra_commit=117d0983848468747dd3c7ab0699b230347b1db5
ARG pyffi_commit=4b18387137a4e73386f020fff66d033354ab2186
ARG nifxml_commit=89d03ffe69254ef4b3b58b0a22ec2ff9820b2e63

WORKDIR /codegen
RUN git clone https://github.com/OpenNaja/cobra-tools.git && cd cobra-tools && git reset --hard $cobra_commit && cd ..
RUN git clone https://github.com/Candoran2/new-pyffi && cd new-pyffi && git reset --hard $pyffi_commit && cd .. && \
mv ./new-pyffi/formats/nif ./cobra-tools/source/formats && \
mv ./new-pyffi/spells ./cobra-tools/source && \
mv ./new-pyffi/utils ./cobra-tools/source
RUN git clone https://github.com/niftools/nifxml.git && cd nifxml && git reset --hard $nifxml_commit && cd .. && \
mv ./nifxml/nif.xml ./cobra-tools/source/formats/nif

WORKDIR cobra-tools
RUN python3 -m pip install --upgrade pip setuptools && \
python3 -m pip install -r requirements.txt

ADD generate.sh .
CMD ["./generate.sh"]
7 changes: 7 additions & 0 deletions install/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.9"

services:
codegen:
build: .
volumes:
- ./temp/io_scene_niftools/dependencies:/output
14 changes: 14 additions & 0 deletions install/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

python3 codegen.py
rm -r /output/*
mkdir -p /output/generated/formats
cd /codegen/cobra-tools/generated || exit 1
# Everything is ~4.3MB while just taking the formats we need is just ~2.8MB
mv ./formats/base /output/generated/formats
mv ./formats/dds /output/generated/formats
mv ./formats/nif /output/generated/formats
mv ./spells /output/generated
mv ./utils /output/generated
echo "Done"
exit
1 change: 1 addition & 0 deletions install/makezip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ xcopy /s "%ROOT%\io_scene_niftools" io_scene_niftools
mkdir "%DEPS%"

python -m pip install "PyFFI==%PYFFI_VERSION%" --target="%DEPS%"
docker compose up || exit 1

xcopy "%ROOT%"\AUTHORS.rst io_scene_niftools
xcopy "%ROOT%"\CHANGELOG.rst io_scene_niftools
Expand Down
1 change: 1 addition & 0 deletions install/makezip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cp -r "${ADDON_IN}" "${ADDON_OUT}"
echo "Creating dependencies folder ${DEPS_OUT:-${BUILD_DIR}/dependencies}"
#python -m pip install -i https://test.pypi.org/simple/ PyFFI==2.2.4.dev5 --target="${DEPS_OUT:-${BUILD_DIR}/dependencies}"
python -m pip install "PyFFI==${PYFFI_VERSION}" --target="${DEPS_OUT:-${BUILD_DIR}/dependencies}"
docker compose up || exit 1

echo "Copying loose files"
cp "${ROOT}"/AUTHORS.rst "${ADDON_OUT}"
Expand Down