Building

Requirements for building

  1. Cython
  2. Visual Studio 2017

Instructions

  1. Copy lua_launcher\gpython_launcher directory to garrysmod\addons directory.
  2. Open command prompt, cd to python_extensions directory and run setup.py build_ext --inplace.
  3. Move all files with .pyd extension in python_extensions directory to garrysmod\gpython directory.
  4. Copy python_extensions\gmod directory to garrysmod\gpython\gmod (so there is a bunch of .py files in garrysmod\gpython\gmod directory).
  5. Open GPython.sln with Visual Studio and build the solution.
  6. Move gmsv_gpython_win32.dll and gmcl_gpython_win32.dll from bin_modules\build directory to garrysmod\lua\bin directory.
  7. Move gpython.dll to Garry’s Mod’s root directory (where hl2.exe resides).

Final directory structure should looks like this:

...\SteamApps\GarrysMod\ ─┬─ hl2.exe
                          ├─ ...
                          ├─ gpython.dll
                          ├─ garrysmod\ ─┬─ addons\ ─── gpython_launcher\ ─┬─ addon.json
                          │              │                                 └─ lua\ ───── ...
                          │              └─ lua\ ────── bin\ ──────────────┬─ gmsv_gpython_win32.dll
                          │                                                └─ gmcl_gpython_win32.dll
                          └─ gpython\ ───┬─ luastack.cpXX-win32.pyd
                                         └─ gmod\ ─────────────────────────┬─ __init__.py
                                                                           ├─ lua.py
                                                                           ├─ ...
                                                                          ...