Skip to content

Commit bc936f3

Browse files
committed
Add packaging documentation to README
In particular document how to properly use the luajit subproject.
1 parent 548ec19 commit bc936f3

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,32 @@ sudo apt install build-essential pkg-config meson ninja-build gettext intltool l
103103
#### Build Aegisub
104104

105105
``` bash
106-
meson setup build --prefix=/usr/local --buildtype=release --strip -Dsystem_luajit=false
106+
meson setup build --prefix=/usr/local --buildtype=release --strip -Dsystem_luajit=false -Ddefault_library=static
107107
meson compile -C build
108108
meson install -C build --skip-subprojects luajit
109109
```
110110

111+
#### Packaging
112+
If you are packaging Aegisub for a Linux distribution, here are a few things you may need to know:
113+
- Aegisub cannot be built with LTO (See: https://github.com/TypesettingTools/Aegisub/issues/290).
114+
- Aegisub depends on LuaJIT and *requires* LuaJIT to be build with Lua 5.2 compatibility enabled.
115+
We are aware that most distributions do not compile LuaJIT with this flag, and that this complicates packaging for them, see https://github.com/TypesettingTools/Aegisub/issues/239 for a detailed discussion of the situation.
116+
117+
Like for its other dependencies, Aegisub includes a meson subproject for LuaJIT that can be used to statically link a version of LuaJIT with 5.2 compatibility.
118+
For distributions that do not allow downloading additional sources at build time, the downloaded LuaJIT subproject is included in the source tarballs distributed with releases.
119+
120+
The following commands are an example for how to build Aegisub with the goal of creating a distribution package:
121+
122+
```bash
123+
meson subprojects download luajit # Or use the tarball
124+
meson subprojects packagefiles --apply luajit
125+
126+
meson setup builddir --wrap-mode=nodownload --prefix=/usr --buildtype=release -Dsystem_luajit=false -Ddefault_library=static -Dtests=false
127+
128+
meson compile -C builddir
129+
meson install -C builddir --skip-subprojects luajit
130+
```
131+
111132
## Updating Moonscript
112133

113134
From within the Moonscript repository, run `bin/moon bin/splat.moon -l moonscript moonscript/ > bin/moonscript.lua`.

0 commit comments

Comments
 (0)