chocpkg/pkgdef
Simon Howard 2b701b84c1 Add package definition for SDL Sopwith.
Okay, not really Chocolate Doom related, but this is for my own
convenience.
2022-04-29 00:24:02 -04:00
..
README.md Reformat into sections for clarity. 2017-01-07 22:03:17 +01:00
SDL2.sh Bump SDL to v2.0.12. 2020-04-03 12:06:57 +02:00
SDL2_mixer.sh Let SDL2_Mixer prefer libmpg123 over libmad. 2020-04-03 12:34:43 +02:00
SDL2_net.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
autoconf.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
automake.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
autotools.sh Add package definitions for autotools utils. 2016-07-08 18:43:28 -04:00
chocolate-doom.sh Bump stable version to 3.0.1 2020-06-24 23:26:48 -04:00
cndoom.sh Competition Doom package v3. 2019-08-09 21:08:47 +02:00
crispy-doom.sh Add crispy-doom package. 2017-10-11 22:10:19 -04:00
directx-devel.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
emscripten.sh Don't cd to source emsdk script. 2018-10-01 21:48:53 -04:00
extra-libs.sh Add ability for packages to provide a description. 2016-02-25 20:13:52 -05:00
flac.sh Don't build libFLAC++ 2020-06-25 00:01:26 -04:00
fluidsynth.sh Change URLs to point at chocpkg-mirrors repo. 2019-03-03 00:14:41 -05:00
gettext.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
glib.sh Change URLs to point at chocpkg-mirrors repo. 2019-03-03 00:14:41 -05:00
libffi.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
libmad.sh Update libmad pkgdef to use Git repo. 2019-02-28 21:09:47 -05:00
libmpg123.sh Update libmpg123 to v1.26.3 2020-07-22 12:15:24 +02:00
libogg.sh Update URL for libogg. 2019-03-02 11:32:24 -05:00
libpng.sh Change URLs to point at chocpkg-mirrors repo. 2019-03-03 00:14:41 -05:00
libsamplerate.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
libtool.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
libvorbis.sh Update URL for libvorbis package. 2018-01-03 23:43:37 +01:00
markdown.sh Add package for Markdown converter. 2017-01-07 21:01:44 +01:00
pkg-config.sh Add SHA256 checking for downloads. 2016-07-08 20:41:02 -04:00
sdl-sopwith.sh Add package definition for SDL Sopwith. 2022-04-29 00:24:02 -04:00
zlib.sh Add 'latest' build variants for several libraries. 2017-02-18 21:07:35 -05:00

README.md

Package files are shell scripts which set variables and call well-defined functions to describe how to build the package.

Modules

chocpkg is divided into modules which provide specific functionality. Modules are installed by calling certain dedicated functions. Usually, your package should install a check module, a fetch module and a build module.

Check modules

Check modules are modules which determine whether the package is installed on the system (may have been installed by chocpkg itself or the system package manager). If a check module is not installed, the default is to always assume the package is not installed:

check_pkgconfig

check_pkgconfig invokes pkg-config to determine if the package is installed. The name of the pkg-config .pc file must be provided as an argument to check_pkgconfig; for example:

check_pkgconfig SDL2

check_tool

check_tool checks if a particular tool is installed in $PATH to determine if the package is installed. The name of the tool must be provided as an argument to check_tool; for example:

check_tool gnome-terminal

Fetch modules

Fetch modules specify how to retrieve the package from the Internet:

fetch_download

fetch_download downloads the package from a URL specified as an argument. The file to be downloaded is assumed to be a well-formed tar.gz file with all its contents in a directory that matches the package name; if this is not the case, the variable $IS_TAR_BOMB should be set to true.

Example use:

fetch_download http://example.com/example-pkg.tar.gz
IS_TAR_BOMB=true

fetch_git

fetch_git downloads the package from a Git repository at the URL given as an argument. The branch master will be checked out by default; this can be overriden by providing the branch name as a second argument to fetch_git.

Example use:

fetch_git http://example.com/example.git my-neato-branch

Build modules

Build modules specify how to build the package after it is fetched:

build_autotools

build_autotools builds the package assuming that it is laid out as a standard autotools package (ie. ./configure; make; make install). Extra arguments passed to the function will be passed through to configure.

Example use:

build_autotools --disable-broken-feature

Variants

Variants allow building of different versions of the same package. An example is "latest stable release" vs. "latest version from source repository". The default variant is called stable. A variant can be specified on the command line with a suffix, for example, to build the variant latest of package neato-lib:

chocpkg install neato-lib/latest

In package files the variant function is used for conditional code that is only executed for a particular variant. Usually this is used to select a fetch module. For example:

variant stable fetch_download http://example.com/neato-lib-0.0.1.tar.gz
variant latest fetch_git git://example.com/neato-lib.git
variant frob-branch fetch_git git://example.com/neato-lib.git frob-branch

By convention, the stable variant is "the most recent stable release of the package" while the latest variant is "the latest version in the source control repository".

Other modules and functions

dependencies

Arguments provided to the dependencies function are the names of other packages to install before trying to build this one.

Example use:

dependencies other-package neato-lib

package_group

package_group specifies that this is not really a package that should be built; rather, it just specifies a number of other packages to build.

Example use:

# File contains no other lines
package_group neato-lib dumbo-lib

Advanced builds

Complicated packages can require custom build steps. The following functions can therefore be overridden in the package file in exceptional circumstances. These are essentially the functions implemented by the modules described above.

  • do_fetch: the function which is invoked to fetch the package from the Internet. The fetched package is placed into $PACKAGE_BUILD_DIR for build.

  • prebuild_setup: define a function with this name to execute special setup commands in the root of a package just before it is built.

  • do_build: the function which is invoked to build the package.

  • do_install: the function which is invoked to install the package after it has been built. This function should install built files from $PACKAGE_BUILD_DIR into $PACKAGE_INSTALL_DIR.