libreoffice-online/ios/README
Tor Lillqvist bd00d9fd05 Get rid of use of GNU libtool
It is is complicated enough to build the iOS app. Requiring GNU
libtool brings with it the risk of polluting the command environment
as there already is a completely different command in macOS with the
same name, /usr/bin/libtool. And as GNU libtool was used only to build
the unit tests for the "normal" server-based Online that are built and
run only on Linux anyway, we don't really need any of the
"portability" that GNU libtool brings.

Without GNU libtool, we compile all the $(wsd_sources) (see
test/Makefile.am) that the unit-* tests use into a single object file,
WsdSources.o. (Because they need to be compiled as PIC we can't use
the already compiled object files for the Online server programs.)
This required some additional minor changes to a few source files.

Change-Id: I20a2c523170376fa4c1a0d9d8d6b693a9779376f
Reviewed-on: https://gerrit.libreoffice.org/72840
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-05-24 09:50:16 +02:00

98 lines
3.3 KiB
Text

How to build the iOS app:
1) First you need to build the LibreOffice core code for iOS. Put in
your autogen.input something like this:
--enable-debug
--enable-dbgutil
--enable-werror
--with-distro=LibreOfficeiOS
and build "normally". (Naturally, no unit tests will be run when
cross-compiling LibreOffice.) Of course there is no requirement to use
those --enable options; as a minimum, just
--with-distro=LibreOfficeiOS should work.
This will produce a large number of static archives (.a) here and
there in instdir and workdir, but no app that can be run as such. (You
can see a list of them in
workdir/CustomTarget/ios/ios-all-static-libs.list)
2) Do a separate clone of the online repo on macOS, but don't do any
autogen.sh, configure, or make, or open the Mobile Xcode project there
yet. We call this the app folder.
3) Here the instructions split. tml uses the first way, mmeeks tried
to use the second way. The paths will join again at step 4.
EITHER:
3a) On a Linux machine: Do a separate clone of the online repo, run
autogen.sh, and configure it with the --enable-iosapp option:
./configure --enable-iosapp --with-iosapp-name="My Own Mobile LibreOffice"
Then run make. That will produce files in loleaflet/dist, nothing
else. Copy those to the corresponding folder in the app folder from
step 2. This is how I do it:
make clean && make && tar cf - loleaflet/dist | ssh misan.local 'cd lo/online-ios-device && rm -rf loleaflet/dist && tar xvf -'
where misan.local is the macOS machine where I build the app, and
~/lo/online-ios-device is the app folder from step 2.
Then back to the Mac:
As you were able to build LibreOffice in step 1, you must already have
GNU autoconf installed on the Mac. Install also GNU automake.
Preferrably from sources, to make sure a potential installation of
brew or similar will not pollute your environment with unknown stuff.
Installing autoconf and automake in the default /usr/local, which is
in $PATH, is not really risky. (Unlike some other GNUish tools, like
libtool and pkg-config, which might mess up your LibreOffice build.)
Run the autogen.sh script in the app folder:
./autogen.sh
OR:
3b) Install brew: https://brew.sh/
Then:
brew install npm
./autogen.sh
sudo python -m ensurepip --default-pip
sudo pip install polib lxml
make ; make
Then run:
./autogen.sh
Now the instructions join again:
4) In the app folder from step 2, edit the
ios/Mobile.xcodeproj/project.pbxproj file in your favourite text
editor. Change LOSRCDIR and all instances of "../ios-device" to refer
the the LibreOffice core source directory from step 1.
5) In the app folder, run:
./configure --enable-iosapp --with-iosapp-name="My Own Mobile LibreOffice" --with-lo-builddir=$HOME/lo/ios --with-poco-includes=/opt/ios-poco/include --with-poco-libs=/opt/ios-poco/lib
The configure script puts the app name as the CFBundleDisplayName
property into the ios/Mobile/Info.plist file, and sets up some
symbolic links that point to the LibreOffice core source and build
directories (which typically will be the same, of course).
6) Before opening the Xcode project for the first time
- seriously consider disabling source code indexing, this
spawns a vast number of git processes, and consumes huge
amounts of CPU & memory:
Xcode -> Preferences, "Source Control", uncheck "Enable Source Control"
7) Now you can open the Mobile Xcode project, build it, and run it.