summaryrefslogtreecommitdiffstats
path: root/README
blob: 42061c01a1c70097d1e4579f29a5adf40abdec95 (plain)
1
README.md
ght .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#
# AGL application systemd unit installation class
#

# Systemd template unit
# * agl-app, agl-app-web, agl-app-flutter valid
AGL_APP_TEMPLATE ?= "agl-app"

# Application ID
# This is what the application will be referred to in the list
# exposed to clients by applaunchd, and generally ends up as the
# identifier used by agl-compositor for application surface
# activation.
AGL_APP_ID ?= "${BPN}"

# Application display name
AGL_APP_NAME ?= "${AGL_APP_ID}"

# Application executable
# * agl-app template only
# Use if the application ID and the executable name are both
# different from the package name and each other as well.
AGL_APP_EXEC ?= "${AGL_APP_ID}"

# Web application bundle directory (non-absolute, so directory
# name under /usr/lib/wam_apps)
# * agl-app-web template only
# Use if the web application bundle installs to a directory that
# is not the same as the package name.
AGL_APP_WAM_DIR ?= "${BPN}"

do_install:append () {
    install -d ${D}${systemd_system_unitdir}
    ln -s ${AGL_APP_TEMPLATE}\@.service \
        ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service

    # NOTE: Unit & Service changes could potentially be collected
    #       and a single override .conf created, but things will be
    #       kept simple for now.

    if [ "${AGL_APP_EXEC}" != "${AGL_APP_ID}" ]; then
        install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
        cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/exec.conf
	[Service]
	ExecStart=
	ExecStart=${AGL_APP_EXEC}
	EOF
    fi

    if [ "${AGL_APP_NAME}" != "${AGL_APP_ID}" ]; then
        install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
        cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/name.conf
	[Unit]
	Description=
	Description=${AGL_APP_NAME}
	EOF
    fi

    if [ "${AGL_APP_TEMPLATE}" = "agl-app-web" -a "${AGL_APP_ID}" != "${BPN}" ]; then
        # The application ID does not necessarily match the package name
        # used in the WAM install hierarchy, and the IDs are hard-coded in
        # some of the web apps, so if necessary create an override for the
        # environment variable used in place of directly deriving from %i
        # (which will always be the app id).
        install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
        cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/wam.conf
	[Service]
	Environment=AGL_APP_WAM_DIR=${AGL_APP_WAM_DIR}
	EOF
    fi

    if [ "${AGL_APP_TEMPLATE}" = "agl-app-flutter" ]; then
       # Install icon if present
       if [ -f ${S}/package/${AGL_APP_ID}.svg ]; then
          install -d ${D}${datadir}/icons/hicolor/scalable
          install -m 0644 ${S}/package/${AGL_APP_ID}.svg ${D}${datadir}/icons/hicolor/scalable/
       fi
   fi
}

FILES:${PN}:append = " ${systemd_system_unitdir} ${datadir}/icons"

RDEPENDS:${PN}:append = " applaunchd-template-${AGL_APP_TEMPLATE}"