summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-18 13:36:52 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-18 13:36:52 +0300
commit2d29615b9e7ebce07b4d8b3745e3515b32c199c0 (patch)
treef334ab0a7f1e411f8cbfe78932fdc48430801a5d /README.md
parentbaf4f8d5b02952e4adfcf60acdd1ac904c132c89 (diff)
Updated README: Notes about iOS
Also cleaned up some styling inconsistencies.
Diffstat (limited to 'README.md')
-rw-r--r--README.md32
1 files changed, 24 insertions, 8 deletions
diff --git a/README.md b/README.md
index a70d27bf..82ac77d8 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,7 @@ The required tools are a C11 compiler (e.g., Clang or GCC), CMake and `pkg-confi
414. Create a build directory. 414. Create a build directory.
425. In your empty build directory, run CMake: ```cmake {path_of_lagrange_sources} -DCMAKE_BUILD_TYPE=Release``` 425. In your empty build directory, run CMake: ```cmake {path_of_lagrange_sources} -DCMAKE_BUILD_TYPE=Release```
436. Build it: ```cmake --build .``` 436. Build it: ```cmake --build .```
447. Now you can run `lagrange`, `lagrange.exe`, or `Lagrange.app`. 447. Now you can run *lagrange*, *lagrange.exe*, or *Lagrange.app*.
45 45
46### Unicode text rendering 46### Unicode text rendering
47 47
@@ -113,18 +113,17 @@ You should use a version of the SDL 2 library that is compiled for native Window
113 Libs: ${libdir}/SDL2.dll -mwindows 113 Libs: ${libdir}/SDL2.dll -mwindows
114 Cflags: -I${incdir} 114 Cflags: -I${incdir}
115 115
116The *-mwindows* option is particularly important as that specifies the target is a GUI application. Also note that you are linking directly against the Windows DLL — do not use any prebuilt .lib files if available, as those as specific to MSVC. 116The `-mwindows` option is particularly important as that specifies the target is a GUI application. Also note that you are linking directly against the Windows DLL — do not use any prebuilt .lib files if available, as those as specific to MSVC.
117 117
118`pkg-config` will find your .pc file if it is on `PKG_CONFIG_PATH` or you place it in a system-wide pkgconfig directory. 118`pkg-config` will find your .pc file if it is on `PKG_CONFIG_PATH` or you place it in a system-wide pkgconfig directory.
119 119
120Once you have compiled a working binary under MSYS2, there is still an additional step required to allow running it directly from the Windows shell: the shared libraries from MSYS2 must be found either via `PATH` or by copying them to the same directory where `lagrange.exe` is located. 120Once you have compiled a working binary under MSYS2, there is still an additional step required to allow running it directly from the Windows shell: the shared libraries from MSYS2 must be found either via `PATH` or by copying them to the same directory where _lagrange.exe_ is located.
121 121
122### Compiling on Raspberry Pi 122### Compiling on Raspberry Pi
123 123
124On Raspberry Pi 4/400, you can compile and run Lagrange just like on a regular desktop PC. Accelerated OpenGL graphics should work fine under X11. 124On Raspberry Pi 4/400, you can compile and run Lagrange just like on a regular desktop PC. Accelerated OpenGL graphics should work fine under X11.
125 125
126On Raspberry Pi 3 or earlier, you should use a version of SDL that is compiled to take advantage of the Broadcom VideoCore OpenGL ES hardware. This provides the best performance when running Lagrange in a console. OpenGL under X11 on Raspberry Pi 2/3 is quite 126On Raspberry Pi 3 or earlier, you should use a version of SDL that is compiled to take advantage of the Broadcom VideoCore OpenGL ES hardware. This provides the best performance when running Lagrange in a console. OpenGL under X11 on Raspberry Pi 2/3 is quite slow/experimental. When running under X11, software rendering is the best choice and the SDL from Raspbian etc. is sufficient.
127slow/experimental. When running under X11, software rendering is the best choice and the SDL from Raspbian etc. is sufficient.
128 127
129The following build options are recommended on Raspberry Pi 2/3: 128The following build options are recommended on Raspberry Pi 2/3:
130 129
@@ -135,13 +134,30 @@ The following build options are recommended on Raspberry Pi 2/3:
135[rel]: https://git.skyjake.fi/gemini/lagrange/releases 134[rel]: https://git.skyjake.fi/gemini/lagrange/releases
136[tf]: https://git.skyjake.fi/skyjake/the_Foundation 135[tf]: https://git.skyjake.fi/skyjake/the_Foundation
137 136
137### Compiling on iOS
138
139Compiling Lagrange on iOS is moderately difficult.
140
141As a prerequisite, you will need to have an [iOS toolchain configuration for CMake](https://github.com/leetal/ios-cmake). CMake is required for Lagrange itself and for the\_Foundation. You will also need [Autotools helpers for iOS](https://github.com/szanni/ios-autotools.git) because HarfBuzz, libiconv, libunistring, and libpcre use Automake. Meson and Ninja are used for GNU FriBidi. The _iconfigure_ script in the Autotools helpers needs to be [patched](ios/iconfigure-osminver.patch).
142
143After these utilities are available, the scripts in _ios/_ can be used as a basis for the build. Unfortunately there is no ready-made high-level script for performing all these steps, so you'll need to adapt them individually to your needs.
144
1451. Meson cross-compilation is controlled with _ios/cross-mac-arm64-ios-arm64.ini_. Modify it to be compatible with your build system and target device.
1462. _ios/deps.sh_ compiles most of the dependencies using Meson, Ninja, and _iconfigure_. Note that the simulator build has not been set up in these scripts, only the `os` build.
1473. Clone [OpenSSL for iPhone](https://github.com/x2on/OpenSSL-for-iPhone.git) and build it with iOS 9.0 as the minimum version. Deploy the static libraries in *$HOME/SDK/ios/$arch/*, or wherever you've set `IOS_DIR` to be.
1484. Create an empty build directory for the\_Foundation and run _ios/cmake-ios-tf.sh_ from there. You may need to adjust the source directory path in the script depending on where you place your build directory.
1495. Now you can `make install` to build and deploy the_Foundation to `IOS_DIR`.
1506. Finally, you can run CMake like in _ios/cmake-ios-lagrange.sh_ to generate an Xcode project that builds the app.
151
152If FriBidi and HarfBuzz are not used (disabling RTL and complex text rendering), the first step can be skipped and the corresponding build steps in _ios/deps.sh_ can be removed. In this case, Meson and Ninja are not needed at all.
153
138## User files 154## User files
139 155
140On Windows, user files are stored in `%HOMEPATH%/AppData/Roaming/fi.skyjake.Lagrange/`, unless one is using the portable distribution and there is a `userdata` subdirectory present in the executable directory. 156On Windows, user files are stored in *%HOMEPATH%/AppData/Roaming/fi.skyjake.Lagrange/*, unless one is using the portable distribution and there is a *userdata/* subdirectory present in the executable directory.
141 157
142On macOS, user files are stored in `~/Library/Application Support/fi.skyjake.Lagrange/`. 158On macOS, user files are stored in *~/Library/Application Support/fi.skyjake.Lagrange/*.
143 159
144On Linux/*BSD/other operating systems, user files stored in `~/.config/lagrange` unless you have customized the XDG directories, in which case the `XDG_CONFIG_HOME` environment variable is used to determine where user files saved. 160On Linux/*BSD/other operating systems, user files stored in _~/.config/lagrange/_ unless you have customized the XDG directories, in which case the `XDG_CONFIG_HOME` environment variable is used to determine where user files saved.
145 161
146The usage and contents of the user files are described in the Help document. You can delete one or more of the files while Lagrange is not running to reset the corresponding data to the default/empty state. 162The usage and contents of the user files are described in the Help document. You can delete one or more of the files while Lagrange is not running to reset the corresponding data to the default/empty state.
147 163