daelvn
11/14/2017 - 11:37 AM

thyres/eon

thyres/eon

# Thýres Eon

Eon is a platform-agnostic package manager and build system.

$eon I thyres/core:eon.libd

Sources

Sources are written in ESL 1 (Eon Specification Language) They require a @ Source header, and the name of the subsequent tables must be the sources. Each source table needs a base key.

# ESL 1
@ Source
thyres:
  - base: "https://thyres.galaxi.ga/eon/:b/all/:u"

In the base key, :b is replaced by the branch. "source/branch:uri", :u is replaced with the URI.

A source may include a script for fuzzy-searching packages, as mantaining a package index, such as the one seen in Eopkg, would be unmantainable. This script should be able to handle the following requests (Assuming you use a RewriteEngine):

GET /:branch/list -- Returns a list of all packages
GET /:branch/search/:uri -- Searches for an exact URI
GET /:branch/fuzzy/:package -- Fuzzy-searches a package
GET /:branch/identify/:package -- Get information about a package

Source flags start with S

  • Sa source name : Adds a source under a name.
  • Sr name : Removes a source
  • Se name source : Edits a source

Creating a package

Structure

package-name/
  source/
    (source files)
  eon/
    install.esl
    target.esl
  package.esl

package.esl

The root of the package requires a package.esl file, that contains all the information of the package, and the places that all files are located in.

# ESL 1
@ Package
name: "example-package"
description: "This is an example package."
version: "latest"
author: "user:email@example.com"

url: "https://thyres.galaxi.ga/eon/branch/all/uri/"
license: "MIT"

arch:
  - "cc/thyres"
  - "cc/cos"
  - "apollo"

depend:
  - "source/branch:uri"
@ Tags
tags:
  - source: "source/" # Files to be compiled
  - eon: "eon/" # Files required for Eon
  - lib: "lib/" # Dependencies not on Eon

eon/targets.esl

This targets file will get the tags from package.esl, and assign target folders to each one of them.

# ESL 1
@ Targets
source: "/bin/"
eon: "/opt/package/eon/"
lib: "/lib/"

eon/install.esl

This is the install file, and it contains a taskset, a set of functions to be run when installing. You can define tasksets, that are ordered lists of the tasks to run. While packages are being installed, they are located in /opt/package/ or EON_PATH/opt/package.

Architecture

There is a global key, arch, that specifies a Lua function that can be used to determine the architecture. By convention, you may use the _ARCH global variable.

arch: "_ARCH"

Checks

There is a @ Checks header, used to determine what target should be used for each arch. Each key will be a possible arch, and the value a list of Eon flags and the name of the taskset.

@ Checks
cc:
  - I: "Icc"
  - R: "Rcc"

Taskset

Under the @ Tasksets header, you can define the tasksets, by convention, they usually are named (flag)(arch), such as Ithyres (install in the Thýres platform) orRapollo (remove in the A1004 platform), but it is not necessary. Each taskset has a list of tasks, those are defined under the @ Tasks header.

@ Tasksets
Ithyres:
  - "thyres/prebuild"
  - "thyres/build"
  - "thyres/install"
  - "thyres/postinstall"
Rthyres:
  - "thyres/clean"

Tasks

The Tasks must have a runner or lua-runner key. runner is the command that the argl list of commands will be passed to, one by one. lua-runner will contain anything that can be run in Lua. :c will be replaced by the command in both cases, if needed. The most common tasks are:

arch/prebuild -- Used to prepare the environment and run checks
arch/build -- Used to build the necessary files
arch/install -- Used to move the files to their locations
arch/postinstall -- Used to clean now useless files
arch/clean -- Used to uninstall

arch/prebuild

Used to prepare the environment and run checks. Such as checking for folders, and setting global variables that may be required by the next step.

arch/build

Used to compile the necessary files, moving them to an (automatically set) package folder. The build folder of the package is located in /opt/package/build/, or, in case it doesn't exist. EON_PATH/opt/package/build/. You can move the compiled files to :o/build/, you can use the targets with $target, and tags with #tag:

arch/build:
  - runner: "shell"
  - argl:
    - "nightc #source/file.ni :o/build/file.x"
arch/install

In this task, files can be moved to targets. Sometimes this steps requires root privileges.

arch/postinstall

This is used to clean the /opt/package folder after it's finished installing. This is possible since the package.esl and eon/* files are moved to the Eon cache. You can, however, have a different task, such as arch/keep, that will remove the sources from /opt/package/, but will keep the eon/ folder.

arch/clean

This is used to uninstall the package from the system, keeping the configuration files for a possible reinstall.

arch/remove

This task, however, removes the configuration files, too.

Flags

* denotes the default flag

I package(s) - Install

  • e* - Reinstall a package
  • t task - Run a single task
  • r - Remove the files in /opt/package/ after install.
  • a arch - Use a different arch

R package(s) - Remove (arch/clean)

  • c - Remove the configuration files too. (arch/remove)
  • w - Removes all the package following a Lua pattern

L name(s) - Local

Note: An update flag is not needed, as there are no package lists, this is all handled by the source script, that should be updated by the host.

  • t* task - Runs a single task
  • e - Reinstall a package
  • u package(s) - Upgrade packages, if none, upgrades all.
  • i - List local packages
  • b source/branch - List local packages from a branch
  • s name - Search in the local packages
  • w name - Search packages with a Lua pattern

S - Source

  • a source name - Adds a source
  • r name - Removes a source
  • e name source - Edits a source
  • l name - Lists all packages in a source
  • b name/branch - Lists all packages in a source and branch
  • s* package name - Searches for a package in a group, if name is not specified, it will search in all sources.

C - Configuration

  • h* - Get help. Can be combined with other flags to know more about them.

Examples

List local packages

$eon Li

List local packages from a branch

$eon Lb thyres/core

Search in the local packages

$eon Lw x-*

Install a package

$eon I thyres/core:eon.libd

Remove a package and configuration files

$eon Rc eon.libd

Utility scripts

Utility scripts are not actually packages, they are just install.esl files that can be used to do certain tasks. For example, you can have a custom task, cleantmp, that removes every file in /tmp. You can run it remotely, like you can do with pastebin run $eon Itr example/scripts:eon.cleaner cleantmp

Install all the packages in a branch

This is a demonstration of how you can combine flags. $eon SbI thyres/desktop

Remove all x-* packages

$eon Rw x-*