From 5404a8fd7dbf6071eb59e108058d7f7cd5ef5976 Mon Sep 17 00:00:00 2001 From: clayton craft Date: Mon, 24 Jul 2017 13:55:55 -0700 Subject: [PATCH] De-couple weston from postmarketos-base (#233) Thanks, craftyguy! - UI is selectable with `pmbootstrap init`. Currently only 'weston' and 'none' are options. It'll automatically pick up any new `postmarketos-ui-*` packages added at later dates. - splits off weston packages install from postmarketos-base and puts them into postmarketos-ui-weston. Also note that NO weston packages are installed by "pmbootstrap install" by default unless the user selects a ui in the `init` - configuration of weston is now in postmarketos-ui-weston. - the demos have been spun off to `postmarketos-demos`, and `postmarketos-ui-weston` lists this package as a dependency. --- postmarketos-base/APKBUILD | 11 ++---- .../postmarketos-base.post-install | 39 ------------------- postmarketos-demos/APKBUILD | 4 +- postmarketos-ui-weston/APKBUILD | 21 ++++++++++ .../postmarketos-ui-weston.post-install | 39 +++++++++++++++++++ .../start_weston.sh | 0 6 files changed, 66 insertions(+), 48 deletions(-) create mode 100644 postmarketos-ui-weston/APKBUILD create mode 100644 postmarketos-ui-weston/postmarketos-ui-weston.post-install rename postmarketos-base/profile.sh => postmarketos-ui-weston/start_weston.sh (100%) diff --git a/postmarketos-base/APKBUILD b/postmarketos-base/APKBUILD index c55f273b7..3d320f6ab 100644 --- a/postmarketos-base/APKBUILD +++ b/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base -pkgver=1 -pkgrel=10 +pkgver=2 +pkgrel=1 pkgdesc="Meta package for minimal postmarketos base" url="https://github.com/postmarketOS" arch="noarch" @@ -10,14 +10,11 @@ tmux htop nano postmarketos-mkinitfs eudev sudo" makedepends="" install="$pkgname.post-install" subpackages="" -source="profile.sh sudoers" +source="sudoers" options="!check" package() { - install -D -m644 "$srcdir"/profile.sh \ - "$pkgdir"/etc/profile.d/postmarketos.sh || return 1 install -D -m644 "$srcdir"/sudoers \ "$pkgdir"/etc/sudoers.d/postmarketos } -sha512sums="c58547a8e3f184f97aabb746b6b2d4e84292809d00c2fbd16e4051f142246798cdf26a7a5861d632afaf2c103d47045aa3ba7b740157c2f0f9c2a404716252b0 profile.sh -c6de3b44bc45b9f9c641a7e34c69a481ee39b99ac0251cd28f2b3aae49c1a8d1ca448f4936b7942b1a8b8f7c18a5415c938098765ed8cf08456543800160e64b sudoers" +sha512sums="c6de3b44bc45b9f9c641a7e34c69a481ee39b99ac0251cd28f2b3aae49c1a8d1ca448f4936b7942b1a8b8f7c18a5415c938098765ed8cf08456543800160e64b sudoers" diff --git a/postmarketos-base/postmarketos-base.post-install b/postmarketos-base/postmarketos-base.post-install index a9cdf8209..ddd3dca4e 100644 --- a/postmarketos-base/postmarketos-base.post-install +++ b/postmarketos-base/postmarketos-base.post-install @@ -48,42 +48,3 @@ if ! apk audit /etc | grep -q etc/motd; then echo '' } >/etc/motd fi - - -# This section generates weston.ini with options from /etc/deviceinfo (if present) -# This functionality is a strong candidate for belonging in another package (e.g. weston), but -# since postmarketos-base owns weston.ini, this will have to do for now. - -weston_config="/etc/xdg/weston/weston.ini" - -mkdir -p /etc/xdg/weston - -# If weston.ini exists, no modifications to it will be made -if [ ! -f $weston_config ]; then - - ### [Core] - echo "[core]" >> $weston_config - # modules - # Note: Default to loading NO modules if none specified - if [ -n "$deviceinfo_weston_core_modules" ]; then - echo "modules=$deviceinfo_weston_core_modules" >> $weston_config - fi - # backend - if [ -n "$deviceinfo_weston_core_backend" ]; then - echo "backend=$deviceinfo_weston_core_backend" >> $weston_config - else - # Default backend for PMOS, if none specified - echo "backend=fbdev-backend.so" >> $weston_config - fi - - ### [Keyboard] - echo "[keyboard]" >> $weston_config - # keymap_rules - if [ -n "$deviceinfo_weston_keymap_rules" ]; then - echo "keymap_rules=$deviceinfo_weston_keymap_rules" >> $weston_config - fi - # keymap_model - if [ -n "$deviceinfo_weston_keymap_model" ]; then - echo "keymap_model=$deviceinfo_weston_keymap_model" >> $weston_config - fi -fi diff --git a/postmarketos-demos/APKBUILD b/postmarketos-demos/APKBUILD index afa503987..cc7575f77 100644 --- a/postmarketos-demos/APKBUILD +++ b/postmarketos-demos/APKBUILD @@ -1,11 +1,11 @@ pkgname=postmarketos-demos pkgver=4 -pkgrel=2 +pkgrel=3 pkgdesc="Simple touch menu for a few demo programs" url="https://github.com/postmarketOS" arch="all" license="GPL3+" -depends="weston-clients" +depends="weston-xwayland" makedepends="gtk+3.0-dev" subpackages="" source="main.c Makefile" diff --git a/postmarketos-ui-weston/APKBUILD b/postmarketos-ui-weston/APKBUILD new file mode 100644 index 000000000..0ac25424a --- /dev/null +++ b/postmarketos-ui-weston/APKBUILD @@ -0,0 +1,21 @@ +pkgname=postmarketos-ui-weston +pkgver=1 +pkgrel=1 +pkgdesc="Meta package for weston" +url="https://github.com/postmarketOS" +arch="noarch" +license="GPL3+" +depends="weston-clients weston weston-shell-desktop weston-backend-fbdev + weston-backend-drm weston-backend-x11 weston-terminal + weston-xwayland xorg-server-xwayland postmarketos-demos" +makedepends="" +install="$pkgname.post-install" +subpackages="" +source="start_weston.sh" +options="!check" + +package() { + install -D -m644 "$srcdir"/start_weston.sh \ + "$pkgdir"/etc/profile.d/start_weston.sh || return 1 +} +sha512sums="c58547a8e3f184f97aabb746b6b2d4e84292809d00c2fbd16e4051f142246798cdf26a7a5861d632afaf2c103d47045aa3ba7b740157c2f0f9c2a404716252b0 start_weston.sh" diff --git a/postmarketos-ui-weston/postmarketos-ui-weston.post-install b/postmarketos-ui-weston/postmarketos-ui-weston.post-install new file mode 100644 index 000000000..a12da2df2 --- /dev/null +++ b/postmarketos-ui-weston/postmarketos-ui-weston.post-install @@ -0,0 +1,39 @@ +#!/bin/sh + +. /etc/deviceinfo + +# This section generates weston.ini with options from /etc/deviceinfo (if present) + +weston_config="/etc/xdg/weston/weston.ini" + +mkdir -p /etc/xdg/weston + +# If weston.ini exists, no modifications to it will be made +if [ ! -f $weston_config ]; then + + ### [Core] + echo "[core]" >> $weston_config + # modules + # Note: Default to loading NO modules if none specified + if [ -n "$deviceinfo_weston_core_modules" ]; then + echo "modules=$deviceinfo_weston_core_modules" >> $weston_config + fi + # backend + if [ -n "$deviceinfo_weston_core_backend" ]; then + echo "backend=$deviceinfo_weston_core_backend" >> $weston_config + else + # Default backend for PMOS, if none specified + echo "backend=fbdev-backend.so" >> $weston_config + fi + + ### [Keyboard] + echo "[keyboard]" >> $weston_config + # keymap_rules + if [ -n "$deviceinfo_weston_keymap_rules" ]; then + echo "keymap_rules=$deviceinfo_weston_keymap_rules" >> $weston_config + fi + # keymap_model + if [ -n "$deviceinfo_weston_keymap_model" ]; then + echo "keymap_model=$deviceinfo_weston_keymap_model" >> $weston_config + fi +fi diff --git a/postmarketos-base/profile.sh b/postmarketos-ui-weston/start_weston.sh similarity index 100% rename from postmarketos-base/profile.sh rename to postmarketos-ui-weston/start_weston.sh