Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation: package.mk #2659

Merged
merged 5 commits into from
May 28, 2018
Merged

documentation: package.mk #2659

merged 5 commits into from
May 28, 2018

Conversation

InuSasha
Copy link
Member

@InuSasha InuSasha commented Apr 21, 2018

Since the last changes on the build system, we need an update to our documentation.
I prefer, to place it in github instead of wiki, because it is easier to find for developers (as special new developers)
After finishing/merging this, we should link the wiki to this location.

Actual it is"Work in progress"
Open Thinks, which has to be done first:

  • description for PKG_NEEDS_UNPACK
  • functions
  • spelling check
  • 2 package.mk templates (for non-addon and addon)
    incl. how to add a new package
  • mega-squash :) (i had to look, how github parse the markdown)

I copied most from wiki and the readme in packages/addons

@awiouy
Copy link
Collaborator

awiouy commented Apr 21, 2018

PKG_LONGDESC and PKG_SHORTDESC are only used for addons, to populate addon.xml file.
However, all packages must have PKG_LONGDESC, for documentation.

In summary:

  • addons must have both PKG_LONGDESC and PKG_SHORTDESC
  • other packages must have PKG_LONGDESC

@InuSasha
Copy link
Member Author

InuSasha commented Apr 21, 2018

so PKG_SHORTDESC is only required for addons?

edit: push a change for that (required: no, yes for addons)

@InuSasha
Copy link
Member Author

InuSasha commented Apr 21, 2018

I added part "Add a new package to the Image"
and two templates for the package.mk.
(The package.mk.addon_template replaces the README.md from packages/addons.
Before one is asking, we have two addon location under packages/, now: addons and mediacenter/kodi-binary-addons)

Three variables needs a description (which i can not fill):

  • PKG_DISCLAIMER
  • PKG_NEED_UNPACK
  • PKG_ADDON_IS_STANDALONE

Now, i put down my pencil and wait for responses.

@InuSasha
Copy link
Member Author

  • PKG_DISCLAIMER and PKG_ADDON_IS_STANDALONE described.
  • all squashed

################################################################################

PKG_NAME="[package name]"
PKG_VERSION="[package upstream version]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"[package version identifier or unique githash]"

PKG_SITE="[url to the upstream project, e.g. http://exmaple.com/libexample"
PKG_URL="[download url, e.g. https://github.com/example/libexample/archive/$PKG_VERSION.tar.gz]"
# PKG_MAINTAINER="John Doe (email)" # if you want to be know as maintainer for a addon
PKG_DEPENDS_TARGET="[needed packages for build, e.g. toolchain zlib openssl]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"[build system dependencies, e.g. toolchain zlib openssl]"

# PKG_MAINTAINER="John Doe (email)" # if you want to be know as maintainer for a addon
PKG_DEPENDS_TARGET="[needed packages for build, e.g. toolchain zlib openssl]"
PKG_SECTION="[location under packages, e.g. database]"
PKG_SHORTDESC="[short description (mostly find at the upstrem project), e.g. libexample: library to calculate examples]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"[short description of the package, e.g. libexample: library to calculate examples]"

PKG_DEPENDS_TARGET="[needed packages for build, e.g. toolchain zlib openssl]"
PKG_SECTION="[location under packages, e.g. database]"
PKG_SHORTDESC="[short description (mostly find at the upstrem project), e.g. libexample: library to calculate examples]"
PKG_LONGDESC="[long description (mostly find at the upstrem project), e.g. libexample: this project is created for case x and y, to do it, in a best way...]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"[long description of the package, often taken from the package/project website, e.g. libexample: this project is created to calculate examples for x and y, with maximum efficiency and fewer errors]"

PKG_LICENSE="[license of the upstream project]"
PKG_SITE="[url to the upstream project, e.g. http://exmaple.com/libexample"
PKG_URL="[download url, e.g. https://github.com/example/libexample/archive/$PKG_VERSION.tar.gz]"
# PKG_MAINTAINER="John Doe (email)" # if you want to be know as maintainer for a addon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"John Doe" # Full name or forum/GitHub nickname, if you want to be identified as the addon maintainer

^ we should stop using emails, it results in text-length issues in the Kodi GUI and it's just a bad idea to have emails collected these days (privacy, GDPR, etc.)


## Variables
All avialible variable, to control the build behavoir of your package.
Please use these in the order, listed here.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To control the build behaviour of your package, use variables in the top-down order listed here.

| PKG_VERSION | - | yes | Version of the packaged software application |
| PKG_SHA256 | - | yes | SHA256 hashsum of the application download file |
| PKG_ARCH | any | no | Architectures for which the package builds. `any` or a space separated list of `aarch64`, `arm` or `x86_64` |
| PKG_LICENSE | - | yes | License of the software application. [Reference](https://github.com/LibreELEC/LibreELEC.tv/tree/master/licenses) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be agreed in the team, but I think we should use SPDX notation for this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i leave it for, now. we can change this later. (But i am pro for SPDX)

| PKG_MAINTAINER | - | no | Your name |
| PKG_DEPENDS_BOOTSTRAP<br>PKG_DEPENDS_HOST PKG_DEPENDS_INIT PKG_DEPENDS_TARGET | - | no | A space separated list of name of packages required to build the software application |
| PKG_SECTION | - | no | virtual if the package only defines dependencies |
| PKG_SHORTDESC | - | no<br>yes&nbsp;for&nbsp;addons | Short description of the application software used in various parts of Kodi |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Short description of the software package"

| PKG_DEPENDS_BOOTSTRAP<br>PKG_DEPENDS_HOST PKG_DEPENDS_INIT PKG_DEPENDS_TARGET | - | no | A space separated list of name of packages required to build the software application |
| PKG_SECTION | - | no | virtual if the package only defines dependencies |
| PKG_SHORTDESC | - | no<br>yes&nbsp;for&nbsp;addons | Short description of the application software used in various parts of Kodi |
| PKG_LONGDESC | - | yes | Long description of the application software used in various parts of Kodi |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Long description of the package including purpose or function within LibreELEC or Kodi"

#### Universal Build Option
| Variable | Default | Required |Description |
|-------------|---------|----------|------------|
| PKG_SOURCE_DIR | - | no | Name of the folder to which the source of the software application unpacks. Should only be specified if the source of the software application unpacks to a folder whose name does not start with `$PKG_NAME` |
Copy link
Member

@chewitt chewitt May 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force the folder name that application sources are unpacked to. Used when sources do not automatically unpack to a folder with the PKG_NAME-PKG_VERSION naming convention.

| Variable | Default | Required |Description |
|-------------|---------|----------|------------|
| PKG_SOURCE_DIR | - | no | Name of the folder to which the source of the software application unpacks. Should only be specified if the source of the software application unpacks to a folder whose name does not start with `$PKG_NAME` |
| PKG_SOURCE_NAME | - | no | Name of the file of the source of the software application. Should only be specified if the source of the software application is not the basename of PKG_URL |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force the filename of the application sources. Used when the filename is not the basename of PKG_URL

|-------------|---------|----------|------------|
| PKG_SOURCE_DIR | - | no | Name of the folder to which the source of the software application unpacks. Should only be specified if the source of the software application unpacks to a folder whose name does not start with `$PKG_NAME` |
| PKG_SOURCE_NAME | - | no | Name of the file of the source of the software application. Should only be specified if the source of the software application is not the basename of PKG_URL |
| PKG_PATCH_DIRS | - | no | Change the path for pachtes, to apply to source. Normally the path `./patches` is used. Is this variable is set, the normal path will extended with the value of this variable as a subdirectory: `./patches/${PKG_PATCH_DIRS}` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patches in ./patches are automatically applied after package unpack. Use this option to include patches from an additional folder, e.g. ./patches/$PKG_PATCH_DIRS

| PKG_SOURCE_NAME | - | no | Name of the file of the source of the software application. Should only be specified if the source of the software application is not the basename of PKG_URL |
| PKG_PATCH_DIRS | - | no | Change the path for pachtes, to apply to source. Normally the path `./patches` is used. Is this variable is set, the normal path will extended with the value of this variable as a subdirectory: `./patches/${PKG_PATCH_DIRS}` |
| PKG_NEED_UNPACK | - | no | ??? can anyone explane, i have no idea. |
| PKG_TOOLCHAIN | auto | no | Control which of the build toolchains is used. For detailed information, see the [Reference](#toolchain-options). |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Control which build toolchain is used. For detailed information, see [reference]

| PKG_NEED_UNPACK | - | no | ??? can anyone explane, i have no idea. |
| PKG_TOOLCHAIN | auto | no | Control which of the build toolchains is used. For detailed information, see the [Reference](#toolchain-options). |
| PKG_BUILD_FLAGS | - | no | A Space seperated list of flags, which control often used build modification. Flags can be enabled or disables with a prefixed `+`/`-`. For detailed information, see the [Reference](#build_flags-options). |
| PKG_PYTHON_VERSION | python2.7 | no | Defines the Python version, which should use. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define the Python version to be used

| PKG_TOOLCHAIN | auto | no | Control which of the build toolchains is used. For detailed information, see the [Reference](#toolchain-options). |
| PKG_BUILD_FLAGS | - | no | A Space seperated list of flags, which control often used build modification. Flags can be enabled or disables with a prefixed `+`/`-`. For detailed information, see the [Reference](#build_flags-options). |
| PKG_PYTHON_VERSION | python2.7 | no | Defines the Python version, which should use. |
| PKG_IS_KERNEL_PKG | - | no | Set it to `yes`, for packages which include linux kernel modules |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set to yes for packages that include Linux kernel modules


#### Addons
These options only needed, when the package is build as an addon.
"Required" column is focus addon packages, only. When the package is no addon, none of these options is required.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional options used when the package builds an addon.

^ only this line is needed

| PKG_PATCH_DIRS | - | no | Change the path for pachtes, to apply to source. Normally the path `./patches` is used. Is this variable is set, the normal path will extended with the value of this variable as a subdirectory: `./patches/${PKG_PATCH_DIRS}` |
| PKG_NEED_UNPACK | - | no | ??? can anyone explane, i have no idea. |
| PKG_TOOLCHAIN | auto | no | Control which of the build toolchains is used. For detailed information, see the [Reference](#toolchain-options). |
| PKG_BUILD_FLAGS | - | no | A Space seperated list of flags, which control often used build modification. Flags can be enabled or disables with a prefixed `+`/`-`. For detailed information, see the [Reference](#build_flags-options). |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/seperated/separated (also repeated in line 117)
", which control often used build modification." - maybe instead: "with which to fine-tune the build process."?
s/disables/disabled - "Flags can be enabled or disabled with a + or - prefix." may also read a little more easily.

| PKG_SOURCE_DIR | - | no | Name of the folder to which the source of the software application unpacks. Should only be specified if the source of the software application unpacks to a folder whose name does not start with `$PKG_NAME` |
| PKG_SOURCE_NAME | - | no | Name of the file of the source of the software application. Should only be specified if the source of the software application is not the basename of PKG_URL |
| PKG_PATCH_DIRS | - | no | Change the path for pachtes, to apply to source. Normally the path `./patches` is used. Is this variable is set, the normal path will extended with the value of this variable as a subdirectory: `./patches/${PKG_PATCH_DIRS}` |
| PKG_NEED_UNPACK | - | no | ??? can anyone explane, i have no idea. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space separated list of files or folders to include in package stamp calculation. If the stamp is invalidated through changes to package files or dependent files/folders the package is cleaned and rebuilt. e.g. PKG_NEED_UNPACK="$(get_pkg_directory linux)" will trigger clean/rebuild of a Linux kernel driver package when a change to the linux kernel package is detected.

| Variable | Default | Required |Description |
|-------------|---------|----------|------------|
| PKG_REV | - | yes | The revision number of the addon. Increase on every version. Currently starts at `100`. Please place this variable under `PKG_VERSION` |
| PKG_IS_ADDON | no | yes | Have to set to `yes` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be set to yes


| Variable | Default | Required |Description |
|-------------|---------|----------|------------|
| PKG_REV | - | yes | The revision number of the addon. Increase on every version. Currently starts at `100`. Please place this variable under `PKG_VERSION` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revision number of the addon (starts at 100). Must be placed after PKG_VERSION. Must be incremented for each new version else Kodi clients will not detect version change and download the updated addon.

@InuSasha
Copy link
Member Author

merged your fixes. many thanks @chewitt

PKG_SHA256="[sha256 hash of the source file, downloaded from PKG_URL]"
PKG_ARCH="any"
PKG_LICENSE="[license of the upstream project]"
PKG_SITE="[url to the upstream project, e.g. http://exmaple.com/libexample"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exmaple.com is misspelled

@InuSasha
Copy link
Member Author

a "good to go" from me.

@CvH CvH merged commit 0214c6a into LibreELEC:master May 28, 2018
@InuSasha InuSasha deleted the doc/package branch May 29, 2018 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants