Emacsbridge
|
The following table contains the Qt versions suitable for compiling emacsbridge:
OS | Version | State |
---|---|---|
Android | 5.15.1 | recommended |
Android | 5.15.0 | minimum |
PC | 5.14.x | minimum |
PC | 5.15.x | recommended |
PC | 5.13.0 | compiles, works mostly, but not recommended |
For building on PC compiling Qt is straightforward, and your distribution might already have a correct version. The following packages should pull in all the other required dependencies for building:
The package names are for OpenSuSE, other distributions should have similar naming.
To build for Android an Android development environment needs to be set up. It should work with Android Studio or similar, below is a summary on how to setup a non-GUI build environment.
Emacsbridge requires qthttpserver, which is included as a submodule. qthttpserver also has submodules. The following snippet clones the repository and initializes all submodules:
Now the code can be configured for qmake - for Android the qmake from inside the Android Qt tree needs to be called.
The source repository contains a build helper (build.sh
). Outside of simple Linux builds using that might be easiest.
Variables controlling the build include:
arm64-v8a x86_64 armeabi-v7a
android-29
. When targetting Play store the version from the script generally is the one which has to be used.5.15.1
$HOME/qt/qt${QT_VERSION}-${ANDROID_SDK_VERSION}/bin
$HOME/qt/qt${QT_VERSION}-mingw64/bin
x86_64-w64-mingw32-objdump
/usr/x86_64-w64-mingw32/sys-root/mingw/bin
platforms
build
clang++
clang++
To see what goes over the local socket, start socat and adjust socket address:
Building for Android and Windows requires a proper cross-compiled toolchain,
The application is separated into a client and a server part, communicating via Qt Remote Objects
Emacsbridge starts up with some open settings endpoints to make initial configuration easier. To set the connection up,
Icons bundled with the application. Served without modification, directory index is enabled. No authentication required.
Lisp files bundled with the application. Served without modification, directory index is enabled. No authentication required.
Files served from a local directory, as set in the serversettings.ini
in the http/localDir
key. Per default this is not configured.
Expects JSON data in a POST request, with a valid auth token. The method for which JSON data is sent must be specified in the method
header. Only available after initial setup has been completed. The following methods are available:
name | required | default |
---|---|---|
in-drawer | no | false |
qmlData | yes | |
qmlFile | yes | |
title | no | qmlFile |
name | required | default |
---|---|---|
title | no | "Missing notification title" |
text | no | "Missing notification text" |
name | required | default |
---|---|---|
action | no | |
data | no | |
package | no | |
class | no | |
extra | no | |
startType | no | "activity" |
Shell scripts bundled with the application. Served with simple template expansion, directory index is enabled.
Returns a page reporting the setup status of the connection to Emacs in human friendly text. No authentication required.
First the directory structure gets prepared, and some variables need to be set. The SDK directory used here is ~/
.android/sdk:
Next the command line tools need to be downloaded from the Android SDK download page in the 'Command line tools only' section, and extracted:
Now sdkmanager can be used to initialize the SDK and download required packages:
Next Qt needs to be Downloaded (5.15.1 mirror list), extracted and built:
The Windows version is highly experimental, seems to segfault due to issues with Qt remote objects, and probably won't see any work unless I'm very bored or somebody is interested in actually using it on Windows. Therefore the following just contains a few pointers for a chance to have a build environment.
A Visual Studio build might have the best chances to actually work, but probably will require code changes. MinGW compiles without code changes. On OpenSuSE probably the following packages are required:
With those installed this should provide a more or less working build of Qt for Windows: