Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into merge-main-into-uni…
Browse files Browse the repository at this point in the history
…ttests
  • Loading branch information
ctrlaltf24 committed Oct 26, 2024
2 parents ad58f52 + bb4f715 commit 6e9c521
Show file tree
Hide file tree
Showing 16 changed files with 241 additions and 224 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

- 4.0.0-beta.3
- Fix various regressions from beta (e.g., #209, #213) [N. Shaaban]
- Fix #191 [N. Shaaban]
- 4.0.0-beta.2
- Fix #171 [N. Marti]
- Fix #185 [N. Marti]
Expand Down
100 changes: 100 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Contributor Documentation

## Installing/running from Source (for developers)

You can clone the repo and install the app from source. To do so, you will need to ensure a few prerequisites:
1. Install build dependencies
2. Clone this repository
3. Build/install Python 3.12 and Tcl/Tk
4. Set up a virtual environment

### Install build dependencies

e.g. for debian-based systems:
```
sudo apt-get install git build-essential gdb lcov pkg-config \
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
lzma lzma-dev python3-tk tk-dev uuid-dev zlib1g-dev
```
*See Python's [Build dependencies](https://devguide.python.org/getting-started/setup-building/index.html#build-dependencies) section for further info.*

### Clone this repository
```
git clone 'https://github.com/FaithLife-Community/LogosLinuxInstaller.git'
```

### Install Python 3.12 and Tcl/Tk
Your system might already include Python 3.12 built with Tcl/Tk. This will verify
the installation:
```
$ python3 --version
Python 3.12.5
$ python3 -m tkinter # should open a basic Tk window
```
If your Python version is < 3.12, then you might want to install 3.12 and tcl/tk
using your system's package manager or compile it from source using the
following guide or the script provided in `scripts/ensure-python.sh`. This is
because the app is built using 3.12 and might have errors if run with other
versions.

**Install & build python 3.12 using the script:**
```
./LogosLinuxInstaller/scripts/ensure-python.sh
```

**Install & build python 3.12 manually:**
```
$ ver=$(wget -qO- https://www.python.org/ftp/python/ | grep -oE '3\.12\.[0-9]+' | sort -u | tail -n1)
$ wget "https://www.python.org/ftp/python/${ver}/Python-${ver}.tar.xz"
$ tar xf Python-${ver}.tar.xz
$ cd Python-${ver}
Python-3.12$ ./configure --prefix=/opt --enable-shared
Python-3.12$ make
Python-3.12$ sudo make install
Python-3.12$ LD_LIBRARY_PATH=/opt/lib /opt/bin/python3.12 --version
Python 3.12.5
$ cd ~
```
Both methods install python into `/opt` to avoid interfering with system python installations.

### Enter the repository folder
```
$ cd LogosLinuxInstaller
LogosLinuxInstaller$
```

### Set up and use a virtual environment
Use the following guide or the provided script at `scripts/ensure-venv.sh` to set
up a virtual environment for running and/or building locally.

**Using the script:**
```
./scripts/ensure-venv.sh
```

**Manual setup:**

```
LogosLinuxInstaller$ LD_LIBRARY_PATH=/opt/lib /opt/bin/python3.12 -m venv env # create a virtual env folder called "env" using python3.12's path
LogosLinuxInstaller$ echo "LD_LIBRARY_PATH=/opt/lib" >> env/bin/activate # tell python where to find libs
LogosLinuxInstaller$ echo "export LD_LIBRARY_PATH" >> env/bin/activate
LogosLinuxInstaller$ source env/bin/activate # activate the env
(env) LogosLinuxInstaller$ python --version # verify python version
Python 3.12.5
(env) LogosLinuxInstaller$ python -m tkinter # verify that tkinter test window opens
(env) LogosLinuxInstaller$ pip install -r .[build] # install python packages
(env) LogosLinuxInstaller$ python -m ou_dedetai.main --help # run the script
```

### Building using docker

```bash
$ git clone 'https://github.com/FaithLife-Community/LogosLinuxInstaller.git'
$ cd LogosLinuxInstaller
# docker build -t logosinstaller .
# docker run --rm -v $(pwd):/usr/src/app logosinstaller
```

The built binary will now be in `./dist/oudedetai`.

8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive

# App Requirements
RUN apt update -qq && apt install -y -qq git build-essential gdb lcov pkg-config \
RUN apt-get update -qq \
&& apt-get install -y -qq git build-essential gdb lcov pkg-config \
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
lzma lzma-dev python3-tk tk-dev uuid-dev zlib1g-dev && rm -rf /var/lib/apt/lists/*
lzma lzma-dev python3-tk tk-dev uuid-dev zlib1g-dev \
curl \
&& rm -rf /var/lib/apt/lists/*

# pyenv for guaranteed py 3.12
ENV HOME="/root"
WORKDIR ${HOME}
RUN apt update && apt install -y curl && rm -rf /var/lib/apt/lists/*
RUN curl https://pyenv.run | bash
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
Expand Down
103 changes: 5 additions & 98 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,105 +33,12 @@ See below.

For an installation guide with pictures and video, see the wiki's [Install Guide](https://github.com/FaithLife-Community/LogosLinuxInstaller/wiki/Install-Guide).

## Installing/running from Source (for developers)

You can clone the repo and install the app from source. To do so, you will need to ensure a few prerequisites:
1. Install build dependencies
2. Clone this repository
3. Build/install Python 3.12 and Tcl/Tk
4. Set up a virtual environment

### Install build dependencies

e.g. for debian-based systems:
```
sudo apt-get install git build-essential gdb lcov pkg-config \
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
lzma lzma-dev python3-tk tk-dev uuid-dev zlib1g-dev
```
*See Python's [Build dependencies](https://devguide.python.org/getting-started/setup-building/index.html#build-dependencies) section for further info.*

### Clone this repository
```
git clone 'https://github.com/FaithLife-Community/LogosLinuxInstaller.git'
```

### Install Python 3.12 and Tcl/Tk
Your system might already include Python 3.12 built with Tcl/Tk. This will verify
the installation:
In Summary:
```bash
wget https://github.com/FaithLife-Community/LogosLinuxInstaller/releases/latest/download/oudedetai
chmod +x ./oudedetai
DIALOG=tk ./oudedetai
```
$ python3 --version
Python 3.12.5
$ python3 -m tkinter # should open a basic Tk window
```
If your Python version is < 3.12, then you might want to install 3.12 and tcl/tk
using your system's package manager or compile it from source using the
following guide or the script provided in `scripts/ensure-python.sh`. This is
because the app is built using 3.12 and might have errors if run with other
versions.

**Install & build python 3.12 using the script:**
```
./LogosLinuxInstaller/scripts/ensure-python.sh
```

**Install & build python 3.12 manually:**
```
$ ver=$(wget -qO- https://www.python.org/ftp/python/ | grep -oE '3\.12\.[0-9]+' | sort -u | tail -n1)
$ wget "https://www.python.org/ftp/python/${ver}/Python-${ver}.tar.xz"
$ tar xf Python-${ver}.tar.xz
$ cd Python-${ver}
Python-3.12$ ./configure --prefix=/opt --enable-shared
Python-3.12$ make
Python-3.12$ sudo make install
Python-3.12$ LD_LIBRARY_PATH=/opt/lib /opt/bin/python3.12 --version
Python 3.12.5
$ cd ~
```
Both methods install python into `/opt` to avoid interfering with system python installations.

### Enter the repository folder
```
$ cd LogosLinuxInstaller
LogosLinuxInstaller$
```

### Set up and use a virtual environment
Use the following guide or the provided script at `scripts/ensure-venv.sh` to set
up a virtual environment for running and/or building locally.

**Using the script:**
```
./scripts/ensure-venv.sh
```

**Manual setup:**

```
LogosLinuxInstaller$ LD_LIBRARY_PATH=/opt/lib /opt/bin/python3.12 -m venv env # create a virtual env folder called "env" using python3.12's path
LogosLinuxInstaller$ echo "LD_LIBRARY_PATH=/opt/lib" >> env/bin/activate # tell python where to find libs
LogosLinuxInstaller$ echo "export LD_LIBRARY_PATH" >> env/bin/activate
LogosLinuxInstaller$ source env/bin/activate # activate the env
(env) LogosLinuxInstaller$ python --version # verify python version
Python 3.12.5
(env) LogosLinuxInstaller$ python -m tkinter # verify that tkinter test window opens
(env) LogosLinuxInstaller$ pip install -r requirements.txt # install python packages
(env) LogosLinuxInstaller$ python -m ou_dedetai.main --help # run the script
```

### Building using docker

```
$ git clone 'https://github.com/FaithLife-Community/LogosLinuxInstaller.git'
$ cd LogosLinuxInstaller
# docker build -t logosinstaller .
# docker run --rm -v $(pwd):/usr/src/app logosinstaller
```

The built binary will now be in `./dist/oudedetai`.

## Install guide (possibly outdated)

NOTE: You can run **Ou Dedetai** using the Steam Proton Experimental binary, which often has the latest and greatest updates to make Logos run even smoother. The script should be able to find the binary automatically, unless your Steam install is located outside of your HOME directory.

Expand Down
2 changes: 1 addition & 1 deletion ou_dedetai.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ a = Analysis(
pathex=[],
#binaries=[('/usr/bin/tclsh8.6', '.')],
binaries=[],
datas=[('ou_dedetai/img/*icon.png', 'img')],
datas=[('ou_dedetai/img/*icon.png', 'ou_dedetai/img')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
Expand Down
6 changes: 3 additions & 3 deletions ou_dedetai/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class CLI:
def __init__(self):
self.running = True
self.running: bool = True
self.choice_q = queue.Queue()
self.input_q = queue.Queue()
self.input_event = threading.Event()
Expand Down Expand Up @@ -40,13 +40,13 @@ def install_d3d_compiler(self):
wine.install_d3d_compiler()

def install_dependencies(self):
utils.check_dependencies()
utils.install_dependencies(app=self)

def install_fonts(self):
wine.install_fonts()

def install_icu(self):
wine.install_icu_data_files()
wine.enforce_icu_data_files()

def remove_index_files(self):
control.remove_all_index_files()
Expand Down
73 changes: 37 additions & 36 deletions ou_dedetai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import tempfile
from datetime import datetime
from typing import Optional


LOG_LEVELS = {
Expand Down Expand Up @@ -72,56 +73,56 @@
globals()[key] = val

# Set other run-time variables not set in the env.
ACTION = 'app'
APPDIR_BINDIR = None
APPIMAGE_FILE_PATH = None
authenticated = False
BADPACKAGES = None
ACTION: str = 'app'
APPIMAGE_FILE_PATH: Optional[str] = None
BADPACKAGES: Optional[str] = None # This isn't presently used, but could be if needed.
DEFAULT_CONFIG_PATH = os.path.expanduser(f"~/.config/FaithLife-Community/{name_binary}.json") # noqa: E501
FLPRODUCTi = None
GUI = None
INSTALL_STEP = 0
INSTALL_STEPS_COUNT = 0
FLPRODUCTi: Optional[str] = None
INSTALL_STEP: int = 0
INSTALL_STEPS_COUNT: int = 0
L9PACKAGES = None
LEGACY_CONFIG_FILE = os.path.expanduser("~/.config/Logos_on_Linux/Logos_on_Linux.conf") # noqa: E501
LEGACY_CONFIG_FILES = [
os.path.expanduser("~/.config/FaithLife-Community/Logos_on_Linux.json"), # noqa: E501
os.path.expanduser("~/.config/Logos_on_Linux/Logos_on_Linux.conf") # noqa: E501
]
LLI_AUTHOR = "Ferion11, John Goodman, T. H. Wright, N. Marti"
LLI_CURRENT_VERSION = "4.0.0-beta.2"
LLI_LATEST_VERSION = None
LLI_CURRENT_VERSION = "4.0.0-beta.3"
LLI_LATEST_VERSION: Optional[str] = None
LLI_TITLE = name_app
LOG_LEVEL = logging.WARNING
LOGOS_BLUE = '#0082FF'
LOGOS_GRAY = '#E7E7E7'
LOGOS_WHITE = '#FCFCFC'
# LOGOS_WHITE = '#F7F7F7'
LOGOS_DIR = os.path.dirname(LOGOS_EXE) if LOGOS_EXE else None # noqa: F821
LOGOS_FORCE_ROOT = False
LOGOS_ICON_FILENAME = None
LOGOS_ICON_URL = None
LOGOS_FORCE_ROOT: bool = False
LOGOS_ICON_FILENAME: Optional[str] = None
LOGOS_ICON_URL: Optional[str] = None
LOGOS_LATEST_VERSION_FILENAME = name_binary
LOGOS_LATEST_VERSION_URL = None
LOGOS9_RELEASES = None # used to save downloaded releases list
LOGOS_LATEST_VERSION_URL: Optional[str] = None
LOGOS9_RELEASES = None # used to save downloaded releases list # FIXME: not set #noqa: E501
LOGOS9_WINE64_BOTTLE_TARGZ_NAME = "wine64_bottle.tar.gz"
LOGOS9_WINE64_BOTTLE_TARGZ_URL = f"https://github.com/ferion11/wine64_bottle_dotnet/releases/download/v5.11b/{LOGOS9_WINE64_BOTTLE_TARGZ_NAME}" # noqa: E501
LOGOS10_RELEASES = None # used to save downloaded releases list
MYDOWNLOADS = None
OS_NAME = None
OS_RELEASE = None
PACKAGE_MANAGER_COMMAND_INSTALL = None
PACKAGE_MANAGER_COMMAND_REMOVE = None
PACKAGE_MANAGER_COMMAND_QUERY = None
PACKAGES = None
PASSIVE = None
LOGOS10_RELEASES = None # used to save downloaded releases list # FIXME: not set #noqa: E501
MYDOWNLOADS: Optional[str] = None # FIXME: Should this use ~/.cache?
OS_NAME: Optional[str] = None
OS_RELEASE: Optional[str] = None
PACKAGE_MANAGER_COMMAND_INSTALL: Optional[list[str]] = None
PACKAGE_MANAGER_COMMAND_REMOVE: Optional[list[str]] = None
PACKAGE_MANAGER_COMMAND_QUERY: Optional[list[str]] = None
PACKAGES: Optional[str] = None
PASSIVE: Optional[bool] = None
pid_file = f'/tmp/{name_binary}.pid'
PRESENT_WORKING_DIRECTORY = os.getcwd()
QUERY_PREFIX = None
REBOOT_REQUIRED = None
RECOMMENDED_WINE64_APPIMAGE_FULL_FILENAME = None
RECOMMENDED_WINE64_APPIMAGE_FULL_VERSION = None
RECOMMENDED_WINE64_APPIMAGE_FILENAME = None
RECOMMENDED_WINE64_APPIMAGE_VERSION = None
RECOMMENDED_WINE64_APPIMAGE_BRANCH = None
SUPERUSER_COMMAND = None
VERBUM_PATH = None
PRESENT_WORKING_DIRECTORY: str = os.getcwd()
QUERY_PREFIX: Optional[str] = None
REBOOT_REQUIRED: Optional[str] = None
RECOMMENDED_WINE64_APPIMAGE_FULL_FILENAME: Optional[str] = None
RECOMMENDED_WINE64_APPIMAGE_FULL_VERSION: Optional[str] = None
RECOMMENDED_WINE64_APPIMAGE_FILENAME: Optional[str] = None
RECOMMENDED_WINE64_APPIMAGE_VERSION: Optional[str] = None
RECOMMENDED_WINE64_APPIMAGE_BRANCH: Optional[str] = None
SUPERUSER_COMMAND: Optional[str] = None
VERBUM_PATH: Optional[str] = None
WINETRICKS_URL = "https://raw.githubusercontent.com/Winetricks/winetricks/5904ee355e37dff4a3ab37e1573c56cffe6ce223/src/winetricks" # noqa: E501
WINETRICKS_VERSION = '20220411'
wine_user = None
Expand Down
Loading

0 comments on commit 6e9c521

Please sign in to comment.