Update README to describe how to build game2text from source

This commit is contained in:
Nikita Hasert committed 2025-05-24 00:15:42 +02:00
1 parent 80ff7a4f8a
commit ff17e315d4
3 files changed
+57 -19

No files matched your search

+51
View File
@@ -8,6 +8,8 @@
- [Japanese Learning](#japanese-learning)
- [./scripts/enable\_jp\_locale](#scriptsenable_jp_locale)
- [Installing game2text](#installing-game2text)
- [Running the Windows Build Via Bottles](#running-the-windows-build-via-bottles)
- [Building Game2text From Source on the Steamdeck](#building-game2text-from-source-on-the-steamdeck)
- [Installing MPV and mpvacious](#installing-mpv-and-mpvacious)
- [Japanese Input](#japanese-input)
- [Anki](#anki)
@@ -66,6 +68,11 @@ LANG=ja_JP 7zz x <zip-archive>
### Installing game2text
#### Running the Windows Build Via Bottles
> [!WARNING]
> Unfortunately attempting to run game2text on SteamOS 3.7 via bottles seems to be broken currently
[game2text](https://game2text.com/) can be used via [bottles](https://usebottles.com/).
1. Install bottles from the Software Center
@@ -74,6 +81,50 @@ LANG=ja_JP 7zz x <zip-archive>
4. Setup a bottle optimized for gaming
5. Run game2text inside the bottle you just created
#### Building Game2text From Source on the Steamdeck
See: [Game2Text](https://github.com/mathewthe2/Game2Text)
Install the prerequisites
```bash
# This will install tesseract and data for horizontal and vertical japanese
./scripts/install_tesseract_jpn
# This will install virtualenv which we will need for building game2text from source
./scipts/install_virtualenv
# This will install the prerequisites to build game2text
sudo steamos-readonly disable
sudo pacman base-devel glibc linux-api-headers zlib cmake python3 gcc nodejs npm libffi openssl rust tk tcl
sudo steamos-readonly enable
```
Clone Game2Text and prepare its directory contents for building
```bash
git clone https://github.com/mathewthe2/Game2Text.git
cd Game2Text
virtualenv venv --python='/usr/bin/python'
source venv/bin/activate
pip install virtualenv
```
> [!IMPORTANT]
> Before continuing
> 1. Replace `==` with `>=` for the versions in `requirements.py`
> 2. In `config.ini` replace `browser = default` with `browser = chromium`. See: https://game2text.com/faq/switch-browser/
```bash
pip install -r requirements.txt
deactivate
```
You can now run game2text natively in `Game2Text/` via
```bash
source venv/bin/activate
python game2text.py
deactivate
```
### Installing MPV and mpvacious
1. Install MPV through the Software Center
+3
View File
@@ -6,3 +6,6 @@
. scripts/install_neovim
. scripts/install_xclip
. scripts/install_podman-compose
. scipts/install_virtualenv
. scipts/install_tesseract_jpn
+3 -19
View File
@@ -1,26 +1,12 @@
#!/bin/bash
# See: https://github.com/mathewthe2/Game2Text
function make_python_3_7_4 {
# wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz && \
# tar -xf Python-3.7.4.tgz && \
# cd Python-3.7.4 && \
# ./configure && \
# make && \
# cd .. && \
pip install virtualenv && \
# curl -fsSL https://pyenv.run | bash
# Add the following to your ~/.bashrc
# echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
# echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
# echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
# pyenv install 3.12.10
}
function make_game2text {
# The requirements may need to be slightly adjusted if e.g. the specific version of numpy is not available
# TODO: Replace == with >= in requirements.py automatically
# TODO: In config.ini replace `browser = default` with `browser = chromium` automatically See: https://game2text.com/faq/switch-browser/
# TODO: In config.ini replace `browser = default` with `browser = chromium` automatically
# See: https://game2text.com/faq/switch-browser/
pip install -r requirements.txt
}
@@ -29,11 +15,9 @@ sudo pacman base-devel glibc linux-api-headers zlib cmake python3 gcc nodejs npm
sudo steamos-readonly enable && \
git clone https://github.com/mathewthe2/Game2Text.git && \
cd Game2Text && \
#virtualenv venv --python=Python-3.7.4/python && \
#virtualenv venv --python='/home/deck/.pyenv/versions/3.12.10/bin/python' && \
virtualenv venv --python='/usr/bin/python' && \
source venv/bin/activate && \
make_python_3_7_4 && \
pip install virtualenv && \
make_game2text && \
deactivate