Improve compatibility with Windows and its Powershell

This commit is contained in:
Lorenzooone 2021-12-30 21:48:59 +01:00
parent fca0331def
commit 025d617b02
4 changed files with 19 additions and 3 deletions

View File

@ -35,7 +35,7 @@ This project aims to both complete the VWF codebase and to provide a tool for tr
Docker allows easily building without having to install the dependencies.
1. Put a MOTHER 1+2 ROM in `bin/m12fresh.gba`
2. While in the root of the project, run: `docker run --rm -it -v $PWD:/home/m2gba/src lorenzooone/m2gba_translation:builder`
2. While in the root of the project, run: `docker run --rm -it -v ${PWD}:/home/m2gba/src lorenzooone/m2gba_translation:builder`
The output will be inside the newly created `out` folder.
@ -76,7 +76,7 @@ The output will be inside the newly created `out` folder.
Docker allows easily testing without having to install the dependencies.
1. Put a MOTHER 1+2 ROM in `bin/m12fresh.gba`
2. While in the root of the project, run: `docker run --rm -it -v $PWD:/home/m2gba/src lorenzooone/m2gba_translation:tester`
2. While in the root of the project, run: `docker run --rm -it -v ${PWD}:/home/m2gba/src lorenzooone/m2gba_translation:tester`
## Manually Testing

View File

@ -50,7 +50,7 @@ FROM builder AS tester
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends xvfb pulseaudio alsa-utils libsdl2-dev \
libzip-dev libavcodec-dev libavfilter-dev && \
libzip-dev libavcodec-dev libavfilter-dev x11-utils && \
apt-get autoremove -y && apt-get clean
WORKDIR /opt/src
USER m2gba

View File

@ -3,6 +3,7 @@
"Starting Dummy services"
Xvfb :1 -screen 0 1024x768x16 &
$Env:DISPLAY = ":1.0"
bash /home/m2gba/src/docker-scripts/xvfb_ready.sh
pulseaudio -D --exit-idle-time=-1
pactl load-module module-null-sink sink_name=SpeakerOutput sink_properties=device.description="Dummy_Output"

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Wait for Xvfb
MAX_ATTEMPTS=120 # About 60 seconds
COUNT=0
echo -n "Waiting for Xvfb to be ready..."
while ! xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; do
echo -n "."
sleep 0.50s
COUNT=$(( COUNT + 1 ))
if [ "${COUNT}" -ge "${MAX_ATTEMPTS}" ]; then
echo " Gave up waiting for X server on ${DISPLAY}"
exit 1
fi
done
echo " Done - Xvfb is ready!"