Skip to content

Repository files navigation

eudplib : EUD python library

eudplib is a StarCraft Use Map Setting(UMS) map tool library for Python programming language.

Fork of https://github.com/phu54321/eudplib

For easy-to-use executable, see https://github.com/armoha/euddraft/releases

Features

  • Support opening (unprotected) map and extracting scenario.chk data
  • Powerful trigger scripting
  • Edit input map to compile output EUD map
  • epScript, scripting language for StarCraft Trigger similar to JavaScript

Where is the issue tracker?

The eudplib issue tracker lives in euddraft repository.

Since euddraft is standalone distribution for Python, eudplib, freeze map protector and epTrace line profiler, it's convenient to use a single issue tracker for both.

Building from source

eudplib has two native components:

  • the _rust Python extension (eudplib.bindings._rust), built from src/rust with maturin during pip install.
  • the epScript compiler shared library (libepScriptLib), a C++ library loaded through ctypes at runtime under the platform-specific name (libepScriptLib.so on Linux, libepScriptLib.dylib on macOS, libepScriptLib.dll on Windows).

pip install . (and pip install -e .) build libepScriptLib automatically through a custom PEP 517 backend, so no extra steps are needed to install or develop the package.

The steps below build the library manually, e.g. when using maturin develop directly (which bypasses the PEP 517 backend).

Prerequisites

  • Python >= 3.10
  • Rust toolchain (for the _rust extension)
  • CMake >= 3.6 and a C++ compiler (MSVC on Windows, g++ on Linux, clang on macOS)
  • Python development headers, needed to configure the pyepScript pybind11 binding (e.g. python3-dev on Debian/Ubuntu; already available on the GitHub Actions runners)

The parser parser/epparser.cpp is generated by lemon2 (committed as lemon2.exe on Windows); on other platforms it must be compiled from lemon2.c first. Alternatively, run python src/epscript/build_epscript.py, which does all of the following steps.

Build libepScriptLib

Linux / macOS

git clone https://github.com/armoha/eudplib --recursive
cd eudplib/src/epscript
cc -std=gnu89 -O2 -o lemon2 lemon2.c          # parser generator (not needed on Windows)
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target epScriptLib
cp build/libepScriptLib.so ../eudplib/epscript/      # Linux
# cp build/libepScriptLib.dylib ../eudplib/epscript/ # macOS

Windows

git clone https://github.com/armoha/eudplib --recursive
cd eudplib\src\epscript
cmake -S . -B build -A x64
cmake --build build --target epScriptLib --config Release
copy build\Release\epScriptLib.dll ..\eudplib\epscript\libepScriptLib.dll

Note: the CMake target is named epScriptLib, so on Windows the produced file is epScriptLib.dll; it must be renamed to libepScriptLib.dll to match what eudplib.epscript.epscompile loads.

Install the package

pip install .

For development, install in editable mode instead:

pip install -e .

About

StarCraft Use Map Setting(UMS) map tool library

Resources

Stars

22 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages