Commit 2c75ea12 authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge branch 'moved-to-gnome' into 'master'

README: Explain that we moved to GNOME

See merge request !867
parents 2a8d52e1 1c4778d1
(
(c-mode . (
(c-file-style . "linux")
(indent-tabs-mode . nil)
(c-basic-offset . 2)
))
(setq auto-mode-alist (cons '("\\.ui$" . nxml-mode) auto-mode-alist))
(nxml-mode . (
(indent-tabs-mode . nil)
))
(css-mode . (
(css-indent-offset . 2)
))
)
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[meson.build]
indent_size = 2
tab_size = 2
indent_style = space
[*.{c,h,c.in,h.in}]
indent_size = 2
tab_size = 2
indent_style = space
max_line_length = 80
[*.css]
indent_size = 2
tab_size = 2
indent_style = space
[*.xml]
indent_size = 2
tab_size = 2
indent_style = space
.zanata-cache/
_build
TAGS
tags
vgdump
*.swp
*~
\#*#
.\#*
/subprojects/glib
/subprojects/libhandy
.vscode/
*.gcov
debian/phosh.service
debian/sm.puri.Phosh.service
debian/sm.puri.Phosh.target
debian/files
debian/*.substvars
debian/*debhelper*
debian/phosh/
debian/phosh-osk-stub/
debian/tmp/
include:
- 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-definitions.yml'
stages:
- build
- test+docs
- package
variables:
DEPS: build-essential git wget gcovr
EXP_DEPS: libhandy-1-dev/experimental libhandy-1-0/experimental gir1.2-handy-1/experimental libgladeui-common/experimental
WANT_BUILD_DEPS: "true"
XVFB_RUN: xvfb-run -a -s -noreset
COMMON_BUILD_OPTS: -Db_coverage=true --werror
ALPINE_EDGE_DEPS: alpine-sdk elogind-dev feedbackd-dev gcr-dev git glib-dev gnome-desktop-dev
gtk+3.0-dev libgudev-dev libhandy1-dev gcr-dev libsecret-dev gcovr linux-pam-dev
meson musl-dev networkmanager-dev ninja polkit-elogind-dev pulseaudio-dev
upower-dev wayland-dev wayland-protocols
.bullseye_vars: &bullseye_vars
variables:
DIST: bullseye
BUILD_OPTS: -Dphoc_tests=enabled -Dg_tests=true ${COMMON_BUILD_OPTS}
.build_step: &build_step
script:
- git submodule update --recursive
- 'echo "Build opts: ${BUILD_OPTS}"'
- meson ${BUILD_OPTS} . _build
- ninja -C _build
.test_step: &test_step
script:
- export LC_ALL=C.UTF-8
- ${XVFB_RUN} ninja -C _build test
- ninja -C _build coverage
# For the smoke tests we also want debug packages, phoc,
# weston-info, gdb, valgrind, ...
.smoketest_vars:
variables: &smoketest_vars
DIST: bullseye
DEPS: phoc wget gnome-session-bin gdb weston valgrind
libhandy-1-0-dbgsym libgtk-3-0-dbgsym libglib2.0-0-dbgsym
dconf-gsettings-backend-dbgsym libfeedback-0.0-0-dbgsym
xvfb imagemagick
EXP_DEPS: libhandy-1-0-dbgsym/experimental-debug libhandy-1-0/experimental
WANT_BUILD_DEPS: "false"
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install wget ca-certificates gnupg eatmydata
- echo "deb http://debug.mirrors.debian.org/debian-debug/ ${DIST}-debug main" > /etc/apt/sources.list.d/debug.list
- echo "deb http://debug.mirrors.debian.org/debian-debug/ experimental-debug main" >> /etc/apt/sources.list.d/debug.list
- echo "deb http://deb.debian.org/debian/ experimental main" > /etc/apt/sources.list.d/exp.list
- eatmydata apt-get -y update
- eatmydata apt-get -y install $EXP_DEPS
- '[ "$WANT_BUILD_DEPS" != "true" ] || eatmydata apt-get -y build-dep .'
- eatmydata apt-get -y install $DEPS
# Forecully drop lcov so gcovr is used
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987818
- eatmydata dpkg --force-depends --remove lcov
- ulimit -c unlimited
.tags: &tags
tags:
- librem5
build:native-debian-bullseye:
<<: *tags
stage: build
image: debian:bullseye
<<: *bullseye_vars
<<: *build_step
artifacts:
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
build:cross-debian-bullseye:i386:
<<: *tags
stage: build
image: debian:bullseye
allow_failure: true
variables:
EXP_DEPS: libhandy-1-dev:i386/experimental libhandy-1-0:i386/experimental gir1.2-handy-1:i386/experimental
before_script:
- export DEBIAN_FRONTEND=noninteractive
- echo "deb [arch=i386] http://deb.debian.org/debian/ testing main" > /etc/apt/sources.list.d/i386.list
- echo "deb [arch=amd64 arch=i386] http://deb.debian.org/debian/ experimental main" >> /etc/apt/sources.list.d/exp.list
- apt-get -y update
- apt-get -y install eatmydata
- dpkg --add-architecture i386
- eatmydata apt-get -y update
- eatmydata apt-get -y -o APT::Immediate-Configure=false install $EXP_DEPS
- DEB_BUILD_PROFILES=nodoc,nocheck eatmydata apt-get -y -a i386 -o APT::Immediate-Configure=false build-dep .
- eatmydata apt-get -y install $DEPS crossbuild-essential-i386
script:
- git submodule update --recursive
- 'echo "Build opts: ${COMMON_BUILD_OPTS}"'
- /usr/share/meson/debcrossgen --arch i386 -o cross-i386.txt
- meson ${COMMON_BUILD_OPTS} . _build --cross-file cross-i386.txt
- ninja -C _build
artifacts:
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
unit-test:native-debian-bullseye:
<<: *tags
stage: test+docs
image: debian:bullseye
needs:
- build:native-debian-bullseye
<<: *bullseye_vars
<<: *test_step
coverage: '/^lines:\s+([\d.]+\%)\s+/'
artifacts:
when: always
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
build-gtkdoc:
<<: *tags
image: debian:bullseye
stage: test+docs
variables:
DIST: bullseye
BUILD_OPTS: -Dgtk_doc=true ${COMMON_BUILD_OPTS}
script:
- git clean -dfx
- 'echo "Build opts: ${BUILD_OPTS}"'
- meson ${BUILD_OPTS} . _build
- ninja -C _build
- tools/doc-check
- mv _build/docs/html/ _reference/
artifacts:
paths:
- _reference
except:
variables:
- $PKG_ONLY == "1"
check-po:
<<: *tags
stage: test+docs
image: debian:bullseye
needs:
- build:native-debian-bullseye
before_script:
- apt-get -y update
- apt-get -y install intltool gettext
<<: *bullseye_vars
script:
- tools/check-po
except:
variables:
- $PKG_ONLY == "1"
check-license-headers:
<<: *tags
stage: test+docs
image: debian:bullseye
needs:
- build:native-debian-bullseye
<<: *bullseye_vars
script:
# Checks .c and .h files begin with a license header as
# defined in HACKING.md
- ./tools/check-license-headers.py
except:
variables:
- $PKG_ONLY == "1"
build:native-alpinelinux-edge:
<<: *tags
stage: build
image: alpine:edge
allow_failure: true
before_script:
- echo "https://alpine.global.ssl.fastly.net/alpine/edge/testing" >> /etc/apk/repositories
- apk -q add $ALPINE_EDGE_DEPS
artifacts:
paths:
- _build
script:
- git submodule update --recursive
- meson --werror . _build
- ninja -C _build
except:
variables:
- $PKG_ONLY == "1"
unit-test:native-alpinelinux-edge:
<<: *tags
stage: test+docs
image: alpine:edge
allow_failure: true
needs:
- build:native-alpinelinux-edge
before_script:
- echo "https://alpine.global.ssl.fastly.net/alpine/edge/testing" >> /etc/apk/repositories
- apk -q add xvfb-run $ALPINE_EDGE_DEPS
script:
- export LC_ALL=C.UTF-8
- ${XVFB_RUN} ninja -C _build test
artifacts:
when: always
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
package:deb-pureos-byzantium:arm64:
tags:
- librem5:arm64
before_script: []
variables:
L5_DOCKER_IMAGE: pureos/byzantium
extends: .l5-build-debian-package
# What problem did you encounter
## What is the current behaviour?
## What is the expected behaviour?
## How to reproduce
Please provide steps to reproduce the issue. If it's a graphical issue please
attach screenshot.
# Which version did you encounter the bug in?
- [ ] I Compiled it myself. If you compiled phosh from source please provide the
git revision via e.g. by running ``git log -1 --pretty=oneline`` and pasting
the output below.
- [ ] I used the precompiled Debian package (e.g. by running a prebuilt
image). Please paste the output oof ``dpkg -s phosh`` below.
```
Phosh Version:
```
# What hardware are you running phosh on?
- [ ] amd64 qemu image
- [ ] Librem5 devkit
- [ ] nested compositor. If so please give the full command you start phosh
with.
- [ ] other (please elaborte)
# Releveant logfiles
Please provide relevant logs. You can e.g. the logs since last boot read
with ``journalctl -b 0``.
[submodule "subprojects/gvc"]
path = subprojects/gvc
url = https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
This diff is collapsed.
Building
========
For build instructions see the README.md
Pull requests
=============
Before filing a pull request run the tests:
```sh
ninja -C _build test
```
Use descriptive commit messages, see
https://wiki.gnome.org/Git/CommitMessages
and check
https://wiki.openstack.org/wiki/GitCommitMessages
for good examples.
Coding Style
============
We're mostly using [libhandy's Coding Style][1].
These are the differences:
- We're not picky about GTK+ style function argument indentation, that is
having multiple arguments on one line is also o.k.
- For callbacks we additionally allow for the `on_<action>` pattern e.g.
`on_nm_signal_strength_changed()` since this helps to keep the namespace
clean.
- Since we're not a library we usually use `G_DEFINE_TYPE` instead of
`G_DEFINE_TYPE_WITH_PRIVATE` (except when we need a deriveable
type) since it makes the rest of the code more compact.
Source file layout
------------------
We use one file per GObject. It should be named like the GObject without
the phosh prefix, lowercase and '_' replaced by '-'. So a hypothetical
`PhoshThing` would go to `src/thing.c`. If there are likely name
clashes add the `phosh-` prefix (see e.g. `phosh-wayland.c`). The
individual C files should be structured as (top to bottom of file):
- License boilerplate
```c
/*
* Copyright (C) year copyright holder
*
* SPDX-License-Identifier: GPL-3-or-later
* Author: you <youremail@example.com>
*/
```
- A log domain
```C
#define G_LOG_DOMAIN "phosh-thing"
```
Usually the filename with `phosh-` prefix.
- `#include`s:
Phosh ones go first, then glib/gtk, then generic C headers. These blocks
are separated by newline and each sorted alphabetically:
```
#define G_LOG_DOMAIN "phosh-settings"
#include "settings.h"
#include "shell.h"
#include <gio/gdesktopappinfo.h>
#include <glib/glib.h>
#include <math.h>
```
This helps to detect missing headers in includes.
- docstring
- property enum
```c
enum {
PROP_0,
PROP_FOO,
PROP_BAR,,
LAST_PROP
};
static GParamSpec *props[LAST_PROP];
```
- signal enum
```c
enum {
FOO_HAPPENED,
BAR_TRIGGERED,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0 };
```
- type definitions
```c
typedef struct _PhoshThing {
GObject parent;
...
} PhoshThing;
G_DEFINE_TYPE (PhoshThing, phosh_thing, G_TYPE_OBJECT)
```
- private methods and callbacks (these can also go at convenient
places above `phosh_thing_constructed ()`
- `phosh_thing_set_property ()`
- `phosh_thing_get_property ()`
- `phosh_thing_constructed ()`
- `phosh_thing_dispose ()`
- `phosh_thing_finalize ()`
- `phosh_thing_class_init ()`
- `phosh_thing_init ()`
- `phosh_thing_new ()`
- Public methods, all starting with the object name(i.e. `phosh_thing_`)
The reason public methods go at the bottom is that they have declarations in
the header file and can thus be referenced from anywhere else in the source
file.
CSS Theming
===========
For custom widget always set the css name using `gtk_widget_class_set_css_name ()`.
There's no need set an (additional) style class in the ui file.
*Good*:
```c
static void
phosh_lockscreen_class_init (PhoshLockscreenClass *klass)
{
gtk_widget_class_set_css_name (widget_class, "phosh-lockscreen");
}
```
*Bad*:
```xml
<template class="PhoshLockscreen" parent="…">
<style>
<class name="phosh-lockscreen"/>
</style>
</template>
```
[1]: https://source.puri.sm/Librem5/libhandy/blob/master/HACKING.md#coding-style
phosh 0.12.1
------------
Released: July 2021
* Fix defaults for favorites
* Append 'Phosh' to XDG_CURRENT_DESKOP for the system unit too so overrides get
applied even when not using a display manager
* Bring search bar closer to designs again
* Simplify tests and test calls-manager. Fix leaks spotted by those.
* Don't claim accelerometer when rotation lock is on reducing iio-sensor-proxy
wakeups considerably
* i18n updates: uk, it, sv
phosh 0.12.0
------------
Released: June 2021
* Only enable proximity sensor on active calls, unblank screen on incoming
calls. This needs at least gnome-calls 0.3.4 and either one of
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3614
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2120
* Implement most parts of org.Gtk.MountOperationHandler to handle
encrypted volume mounts in e.g. nautilus.
* Show adaptive apps in mobile mode and all apps in docked mode. This
can be toggled via the sm.puri.phosh.PhoshAppFilterModeFlags GSetting.
phosh 0.11.0
------------
Released: May 2021
* Wifi/WWAN/BT quick settings toggle on/off, long press opens Settings
* Initial support for gnome-session --systemd
* Torch brightness slider
* Allow to show battery percentage in top bar
* Fixes modal-dialog keyboard navigation
* Fixes crash with ja locale
# Phosh
a pure wayland shell for mobile devices like Purism's Librem 5.
As of 2021-08-02 Upstream development moved to GNOME's gitlab. The new location for code
and issues is at https://gitlab.gnome.org/World/Phosh/phosh.
## License
phosh is licensed under the GPLv3+.
## Getting the source
```sh
git clone https://source.puri.sm/Librem5/phosh
cd phosh
```
The master branch has the current development version.
## Dependencies
On a Debian based system run
```sh
sudo apt-get -y install build-essential
sudo apt-get -y build-dep .
```
For an explicit list of dependencies check the `Build-Depends` entry in the
[debian/control][] file.
If your distro doesn't ship [libhandy](https://source.puri.sm/Librem5/libhandy)
you need to build that from source. More details are in the [gitlab-ci.yml][]
file.
## Building
We use the meson (and thereby Ninja) build system for phosh. The quickest
way to get going is to do the following:
meson . _build
ninja -C _build
ninja -C _build install
# Testing
To run the tests run
ninja -C _build test
For details see the *.gitlab-ci.yml* file.
There are some thorough tests not run during CI which can e.g. be run via
gtester -m thorough _build/tests/test-idle-manager
## Running
### Running from the source tree
When running from the source tree start the compositor *[phoc][]*.
Then start *phosh* using:
_build/run -U
or in one command:
../phoc/_build/run -E '_build/run -U' -C ./data/phoc.ini
When running nested it's recommended to skip the `gnome-session` setup:
SKIP_GNOME_SESSION=1 ../phoc/_build/run -E '_build/run -U' -C ./data/phoc.ini
This will make sure the needed gsettings schema is found. The '-U' option makes
sure the shell is not locked on startup so you can test with arbitrary
passwords.
This works on hardware as well as nested on other desktop environments. The
result should look something like this:
![phosh](screenshots/phosh.png)
### Running from the Debian packages
If you're running a display manager like GDM or LightDM you can select the
`Phosh` session from the display managers menu. If you want run without a
display manager but nevertheless start phosh at system boot there's a systemd
unit file in */lib/systemd/system/phosh* which is disabled by default:
systemctl enable phosh
systemctl start phosh
This runs *phosh* as the user with user id 1000 (which needs to exist). If you
don't have that user and don't want to create one you can make systemd
run *phosh* as any user by using an override file:
$ cat /etc/systemd/system/phosh.service.d/override.conf
[Service]
User=<your_user>
All of the above use the `/usr/bin/phosh` script to start compositor and shell
under the hood so if you just want to start phosh from the system console once
invoke that script directly.
# Translations
This is handled via GNOMEs infra, see
<https://wiki.gnome.org/TranslationProject> and
<https://l10n.gnome.org/module/phosh/>.
# Getting in Touch
* Issue tracker: https://source.puri.sm/Librem5/phosh
* Mailing list: https://lists.community.puri.sm/listinfo/librem-5-dev
* Matrix: https://im.puri.sm/#/room/#phosh:talk.puri.sm
* XMPP: phosh@conference.sigxcpu.org
For details see the [developer documentation](https://developer.puri.sm/Contact.html).
[gitlab-ci.yml]: https://source.puri.sm/Librem5/phosh/blob/master/.gitlab-ci.yml
[debian/control]: https://source.puri.sm/Librem5/phosh/blob/master/debian/control
[phoc]: https://source.puri.sm/Librem5/phoc
The packaging for the Librem 5 and PureOS
lives at https://source.puri.sm/Librem5/debs/pkg-phosh.