eql5-sfos/README.org
Renaud Casenave-Péré 54b9f4511d Typo in readme
2021-12-10 21:49:31 +01:00

97 lines
2.8 KiB
Org Mode
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This package is here to help bootstrap application development for Sailfish OS
using ecl and eql5.
* Dependencies
Youll need ecl and eql5 installed in the build engine that comes with sfos sdk.
These are available through my repository on openrepos.net. You can activate it
and install the packages with the following command:
#+BEGIN_SRC sh
rpm --import https://sailfish.openrepos.net/openrepos.key
zypper ar -f https://sailfish.openrepos.net/razcampagne/personal-main.repo
zypper in eql5
#+END_SRC
* Build and deploy
You can use the build button in qtcreator or do this manually in the sdk engine:
#+BEGIN_SRC sh
qmake eql5-sfos.pro
make
#+END_SRC
But the way I recommend to do it is by using the command-line tool sfdk that
comes with the sdk. Use the following command for a comprehensive manual:
#+BEGIN_SRC sh
sfdk --help-building
#+END_SRC
The TL;DR would be one of the following:
#+BEGIN_SRC sh
sfdk build
#+END_SRC
Or,
#+BEGIN_SRC sh
sfdk qmake
sfdk make
sfdk make-install
sfdk package
#+END_SRC
You also have the option to build against ecl and eql5 statically to distribute
your application without the need to depend on development packages. You can do
this by configuring qmake like so:
#+BEGIN_SRC sh
sfdk qmake -- 'CONFIG += standalone'
#+END_SRC
Once the target and device options have been set, you just have to issue the command:
#+BEGIN_SRC sh
sfdk deploy
#+END_SRC
This will compile and build the package and send it to your phone as a rpm.
* Attach a REPL
Upon initialization of the application, a slynk server is created with the
port 4005. You just have to fire up emacs and connect to it using sly-connect.
Only sly-fancy contribs are supported for now so youll have to disable the
others you may have configured for it to work with this application.
If you wish to disable this feature, you can configure qmake like so:
#+BEGIN_SRC sh
sfdk qmake -- 'CONFIG += norepl'
#+END_SRC
Note that statically linking ecl and eql5 will also disable the repl.
* Reload QML files
You can find a file `webserver.sh` in the repository which will launch a simple
http server. You can then edit the qml files on your host machine and issue the
following command in the application REPL:
#+BEGIN_SRC common-lisp
(reload-qml "http://host-ip-address:8000")
#+END_SRC
This will reload all qml files but not the ones packaged on the device, the ones
on your host system, served by the http server.
You can even do that directly in emacs with the following code:
#+BEGIN_SRC emacs-lisp
(let ((httpd-port 8000)) ; default 8080 port is already used by the sdk build engine
(call-interactively 'httpd-serve-directory))
#+END_SRC
* Customize
The code included in this repository is voluntarily barebone. Fill free to use
it to bootstrap your application development and rename or replace files,
packages to better suit your needs. You can even replace slynk with swank if you
prefer.