Commit Graph

167 Commits

Author SHA1 Message Date
Simon Howard 24650af7d9 Add SHA256 checking for downloads.
Since we're downloading arbitrary executable code from websites and
running it, we should at least have some confidence it's the right
thing we're running.
2016-07-08 20:41:02 -04:00
Simon Howard b712c2d18a Stop using chocolate-doom.org download mirrors.
Download these from the maintainers' websites where possible, and
document in a couple of cases why we're still using the mirror. In the
future we can possibly make an automated/generic mechanism for providing
a mirror for files used by chocpkg.
2016-07-08 19:45:30 -04:00
Simon Howard a61d6da035 Upgrade download URLs to https:.
Most packages are available via https download now.
2016-07-08 19:28:35 -04:00
Simon Howard 8f4d801452 Exit with an error when autotools is missing.
If we check out from a VCS repo and configure is missing, we need to
run autoreconf to generate it. But check if autoreconf is actually
installed and exit with a useful error if it isn't.
2016-07-08 18:57:27 -04:00
Simon Howard 85d3254b64 Add package definitions for autotools utils. 2016-07-08 18:43:28 -04:00
Simon Howard f9231dc434 Oops. 2016-06-19 20:48:57 -04:00
Simon Howard abb68241a3 Use ${!array[@]} syntax to iterate over arrays.
Bash 3 accepts ${array[@]:0} but this is invalid in bash 4 for empty
arrays. Instead, use ${!array[@]} to get indexes into the array and
look up entries using them.
2016-06-19 20:46:45 -04:00
Simon Howard a5917ce635 Exit with error if package not specified.
Commands which act on a package must have a package name specified. If
no package is specified, we should exit with a helpful error.
2016-06-19 20:21:08 -04:00
Simon Howard 2820b9a1d9 Use bash array syntax for DEPENDENCIES.
Using an array is better than an expanded string.
2016-06-18 16:31:18 -04:00
Simon Howard 7c11c2a33b Don't assume every package has stable variant.
The chocolate-doom package currently only has a latest variant, so
this assumption is incorrect. Instead only make this assumption if
the package file declares no variants. Add variant list to the 'info'
command output.
2016-06-15 19:39:35 -04:00
Simon Howard dcb99e1b11 Allow package overrides for default variant.
By default we build the stable variant but provide a user-editable
list of packages which will be built at the latest variant instead.
Rename chocolate-doom-git package to chocolate-doom and have it use
the latest variant for the current Git build.
2016-06-15 19:26:20 -04:00
Simon Howard f0bd215fb5 Add sanity checking for variants.
Any variant name can be specified on the command line, but only
certain variants will be supported by a given package. Detect which
are valid for a given package and exit with an error if a request is
made for an invalid variant.
2016-06-15 19:13:57 -04:00
Simon Howard ca536950f8 Add variants support.
It's nice to be able to build from source control HEAD, and
especially for packages under than Chocolate Doom itself. As a start,
define "latest" variants for all the SDL2 packages.
2016-06-15 19:01:48 -04:00
Simon Howard 72f8e10c44 Add module for fetching via hg.
Some of the SDL2 libraries are stored in Mercurial rather than Git.
2016-06-14 23:49:45 -04:00
Simon Howard afc08e84ff Fix git URL for chocolate-doom-git. 2016-06-05 15:36:46 -04:00
Simon Howard a3a88dfc9d Add extra configure flags for building SDL2_image.
Slim down the library as much as possible, and link directly against
libpng rather than searching for it at runtime (so that the OS X
package building code will find libpng correctly).
2016-05-08 19:40:42 -04:00
Simon Howard db2f7268bd Add SDL2_image package.
Since chocolate-doom/chocolate-doom@07afb7749f, sdl2-branch now
depends on SDL2_image, so we need this as a dependency package.
2016-05-08 19:20:28 -04:00
Simon Howard 131faedfa6 Extend type: syntax to allow target: prefix too.
This is important for pkgdef files like SDL2_mixer which recursively
invoke chocpkg to check if a soft dependent package is installed. In
this case it's important to explicitly prefix the package type to
pass it through to the recursed instance.
2016-03-05 21:59:19 -05:00
Simon Howard b1ac826648 Remove debug message left in by mistake. 2016-03-05 15:41:58 -05:00
Simon Howard fb728473c9 Don't set package-group as a PACKAGE_TYPE.
Since package groups can theoretically now be installed as
native:package-group as well, make PACKAGE_TYPE only ever have a value
of "target" or "native". For a native install it's important we
transform the names of all dependencies to have the native: prefix.

It doesn't matter if we uselessly set PACKAGE_INSTALL_DIR and
PACKAGE_BUILD_DIR for a package group anyway, since they're not used
anyway.
2016-03-05 15:32:07 -05:00
Simon Howard 4dce741959 Update pkg-config install message. 2016-03-05 15:20:29 -05:00
Simon Howard 14bef92feb Remove pinning of a package to a PACKAGE_TYPE.
Previously a particular package could only ever be installed to target
or native. Instead, allow any package to be installed to either, with
target being the default. Native packages can only ever have native
dependencies, but target packages can depend on native ones in order to
install tools which they need for their build process.
2016-03-05 15:15:50 -05:00
Simon Howard e6a0dfda11 Add packages for fluidsynth. 2016-02-28 18:54:30 -05:00
Simon Howard 5c60dcdb4a Fix error with unbound variable. 2016-02-28 18:15:50 -05:00
Simon Howard a0ef6b6fac Add 'chocpkg shell' to start a shell.
Set up the build environment for a package and then invoke bash; allows
the configure scripts etc. to be manually run for debugging purposes.
2016-02-28 18:14:10 -05:00
Simon Howard 05e1de380b Include install/bin in PATH when building for target.
This matches the existing logic for ACLOCAL_PATH, and some config
macros check for installed tools.
2016-02-28 18:13:49 -05:00
Simon Howard 537df0751c Re-run autoreconf if configure.ac has been changed.
Because we have to set up a particular environment before running
autoreconf, it's desirable to be able to do this by running chocpkg
build. However, to support this use case we need to be detect when the
configure script is out of date. Make the logic for when to run
autoreconf take this into account, rather than just checking for when
the file doesn't exist.
2016-02-25 21:55:05 -05:00
Simon Howard 08ef9ca39c Output 'chocpkg info' all at once.
Generating the output can be slow, so gather the whole output and
write it at once.
2016-02-25 21:20:38 -05:00
Simon Howard 4f5c9510c3 Define a new PACKAGE_TYPE for package groups.
Technically these are not native or target type packages, as we are
not building anything; they may be made up of many packages of
different types. So make sure that 'chocpkg info' shows something
distinct and different for this kind of package.
2016-02-25 20:33:42 -05:00
Simon Howard e66e81775f Use 'dependencies' function, don't set DEPENDENCIES. 2016-02-25 20:29:52 -05:00
Simon Howard 0f670e5da6 Remove duplicated 'info' command handling.
This is now handled by the first-level command parsing.
2016-02-25 20:26:29 -05:00
Simon Howard f8d3c2f20a Add COPYING. 2016-02-25 20:23:01 -05:00
Simon Howard 724eedad45 Add extra package info commands.
The new commands are: info, packages and dependencies. The main one
is 'chocpkg info' which allows a description of a package (or of all
packages) to be shown, along with its status.
2016-02-25 20:15:13 -05:00
Simon Howard 128a9d35fd Add ability for packages to provide a description.
It's nice to be able to get some idea of what a package does.
2016-02-25 20:13:52 -05:00
Simon Howard 158133572f Replace case with if and [[ = syntax. 2016-02-24 21:46:43 -05:00
Simon Howard 0225fd6f7d Get rid of pattern_match function.
This functionality is built into bash through the [[..]] syntax.
2016-02-24 21:24:09 -05:00
Simon Howard 4ecf868faa Fix package groups. 2016-02-24 00:16:01 -05:00
Simon Howard b6540c0182 Remove PACKAGE_VERSION.
The only place this is needed is when determining the directory name
that the tar file will be extracted to. This can be done by examining
the .tar file name without needing to know the version itself.
2016-02-23 23:58:08 -05:00
Simon Howard 23052af867 Add SDL2 as a dependency for SDL2_*. 2016-02-23 22:34:01 -05:00
Simon Howard b0d8289d5e Add missing space when setting DEPENDENCIES var. 2016-02-23 22:33:16 -05:00
Simon Howard 33306ccdb4 Fold set_pkgconfig_paths into setup_build_environment.
Both of these set environment variables that allow libraries etc. to
be located. It's quite plausible that some implementations of the
check_installed function might depend on values of CFLAGS, LDFLAGS and
so on to check if a library is installed. Therefore, just set all these
variables in a single common function only invoked just before build, or
before performing an 'installed' check.
2016-02-23 22:30:34 -05:00
Simon Howard 280ef8dd89 Automatically install pkg-config when needed.
Every package checked with pkg-config implicitly requires it as a
dependency. Add it as a dependency when installing the pkg-config
module.
2016-02-23 22:18:32 -05:00
Simon Howard 658b94e635 Don't set environment variables until build.
The pkg-config variables can affect how a package is discovered, and if
set by a package that depends on another, could lead to the recursive
call to chocpkg producing the wrong result. Instead, set only when
specificly needed (by build or check_installed), and always invoke
commands by recursively invoking the script, never by function call.
2016-02-23 22:02:48 -05:00
Simon Howard 4876563b75 Don't use realpath, as it is non-standard.
This appears to be a GNU-specific utility and doesn't exist on OS X.
2016-02-23 22:00:20 -05:00
Simon Howard ea6d80c4bf Remove setup.sh.
This has turned out to not do very much, and adds an annoying initial
stage before building. Just move this logic into the main script
instead, and get rid of it.
2016-02-22 05:06:22 +00:00
Simon Howard 3ad8b4a563 Do a git pull instead of git clone when appropriate.
When building a git package, invoke git pull if we already did a
previous build and have the checkout already.
2016-02-18 23:44:35 -05:00
Simon Howard b3bce89f50 Run autoreconf from autotools module.
We can reasonably determine that autoreconf needs to be run if the
configure script does not exist.
2016-02-18 23:26:06 -05:00
Simon Howard df955bf2b7 Split out chocpkg script into modules.
These modules encapsulate individual pieces of functionality and make
the code far more maintainable. This is a pretty big refactoring but
overall a big win.
2016-02-18 23:12:07 -05:00
Simon Howard fdba92aae9 Fix cross-compile of zlib.
zlib's configure script is hand-rolled and works differently to the
usual autotools ones.
2016-02-18 02:03:44 -05:00
Simon Howard 025423c7a5 Add package for zlib.
This is a dependency of libpng.
2016-02-18 01:55:19 -05:00