Commit graph

57 commits

Author SHA1 Message Date
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
Simon Howard
09a1ff9b8c Add support for package groups.
This conveniently allows a whole set of packages to be installed from
a single command, without needing an actual package to be built that
depends on them all.
2016-02-18 01:42:58 -05:00
Simon Howard
2deaf2af97 Remove PACKAGE_SOURCE_TYPE from pkgdefs.
This can be inferred from other variables.
2016-02-18 01:18:09 -05:00
Simon Howard
640ec85956 Add README describing the package file format. 2016-02-18 01:04:11 -05:00
Simon Howard
fda69b6ee1 Add variable for passing options to make.
Include a commented-out example of how to use -j to do multicore builds.
2016-02-18 00:37:46 -05:00
Simon Howard
fd7fec926b Invoke autoreconf instead of autogen.sh.
autogen.sh implicitly runs configure, which we want chocpkg to do
itself, with appropriate arguments for cross-complication etc.
2016-02-18 05:28:33 +00:00
Simon Howard
2aa6068540 Change mingw BUILD_HOST example to mingw64. 2016-02-18 05:03:40 +00:00
Simon Howard
a85f1d8370 Pass --disable-directx when building SDL2.
Not sure what the practical upshot of this is yet, but it at least
allows it to build successfully. I've been unable to get it to build
with DirectX support enabled yet because the compiler complains about
missing header definitions for LPDIRECTINPUTDEVICE8 and related
functions.
2016-02-18 05:01:49 +00:00
Simon Howard
5205c53036 Bump SDL2 version to 2.0.4. 2016-02-17 23:05:59 -05:00
Simon Howard
74a03eae81 Add directx-devel package.
This is a tricky package to support, since the tar file is improperly
structured and it is not an autotools package. Refactor slightly and
add IS_TAR_BOMB option for this kind of use case.
2016-02-17 23:03:42 -05:00
Simon Howard
6543f57fd4 Fix cross-compile.
Now that buildenv.sh is mostly just for setting BUILD_HOST, include
it early in the chocpkg initialization/startup. Set PKG_CONFIG_LIBDIR
as part of configure_for_package - this needs to be set before we
invoke pkg-config to check if the package is installed on the system
already, otherwise we can pick up a system package rather than the
one for the target architecture.
2016-02-17 22:20:28 -05:00