1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Add split packages and cross-bootstrapping support to tix-build(8).

pkg.use-bootstrap can now be set to true to add a bootstrap phase to
cross-builds. I.e. the package is built for the native platform and
installed to a temporary location, which is in the PATH during the
actual cross-compilation. This feature is useful for some misbehaving
ports that can cross-compile, but require the exact same version of the
software installed locally. The bootstrap build is controlled with the
bootstrap.foo variables rather than the normal pkg.foo variables.

pkg.source-package can now be set to the name of another package, whose
source code is built using the current tixbuildinfo. This feature allows
providing multiple packages using the same source code package. By
default, the source code of the source package is assumed to be in
../${pkg.source-package}, but this can be overridden with the option
--source-directory.

pkg.alias-of can now be set to the name of another package to specify
that this package is an alias of the other package, creating an empty
binary package depending on the real package.

pkg.subdir support has been fixed in the clean and post-install phases.

pkg-config support has been improved and PKG_CONFIG is now set to
$HOST-pkg-config and PKG_CONFIG_FOR_BUILD is set to pkg-config.

tix-build has been refactored as needed and generally cleaned up. Error
handling, such as on allocations, have been added in a lot of cases. The
support for FOO_FOR_BUILD variables have been unified and simplified.
Appending to PATH now correctly handles the empty PATH.
This commit is contained in:
Jonas 'Sortie' Termansen 2016-12-26 13:59:51 +01:00
parent 0cf88fd58a
commit 9bbdb791af
4 changed files with 768 additions and 494 deletions

View file

@ -84,8 +84,8 @@ fi
get_package_dependencies_raw() {( get_package_dependencies_raw() {(
PACKAGE_DIR=$(echo $1 | grep -Eo '^[^\.]*') PACKAGE_DIR=$(echo $1 | grep -Eo '^[^\.]*')
! [ -f "$SORTIX_PORTS_DIR/$PACKAGE_DIR/tixbuildinfo" ] || ! [ -f "$SORTIX_PORTS_DIR/$PACKAGE_DIR/tixbuildinfo" ] ||
grep -E "^pkg\.build-libraries=.*" "$SORTIX_PORTS_DIR/$PACKAGE_DIR/tixbuildinfo" | \ grep -E "^(pkg\.build-libraries|pkg\.alias-of)=.*" "$SORTIX_PORTS_DIR/$PACKAGE_DIR/tixbuildinfo" | \
sed 's/^pkg\.build-libraries=//' sed 's/^[^=]*=//'
)} )}
# Detect the build-time dependencies for a package with missing optional # Detect the build-time dependencies for a package with missing optional
@ -151,12 +151,15 @@ strip_tix() {
# Build all the packages (if needed) and otherwise install them. # Build all the packages (if needed) and otherwise install them.
for PACKAGE in $PACKAGES; do for PACKAGE in $PACKAGES; do
if ! [ -f "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" ]; then if ! [ -f "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" ]; then
SOURCE_PACKAGE=$(grep -E "^pkg.source-package=" "$SORTIX_PORTS_DIR/$PACKAGE/tixbuildinfo" | \
sed 's/^[^=]*=//')
tix-build \ tix-build \
--sysroot="$SYSROOT" \ --sysroot="$SYSROOT" \
--host=$HOST \ --host=$HOST \
--prefix= \ --prefix= \
--destination="$SORTIX_REPOSITORY_DIR" \ --destination="$SORTIX_REPOSITORY_DIR" \
--generation=2 \ --generation=2 \
${SOURCE_PACKAGE:+--source-package "$SORTIX_PORTS_DIR/$SOURCE_PACKAGE"} \
"$SORTIX_PORTS_DIR/$PACKAGE" "$SORTIX_PORTS_DIR/$PACKAGE"
strip_tix "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" strip_tix "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz"
fi fi

View file

@ -59,6 +59,45 @@ releasing Sortix x.y, foo." to allow the maintainer to easily
.Xr grep 1 .Xr grep 1
for it after a release. for it after a release.
.Sh CHANGES .Sh CHANGES
.Ss Add split packages and cross-bootstrapping support to tix-build(8)
.Xr tix-build 8
has gained a number of features that will soon be required in order to build
certain ports. In particular, it now supports the
.Sy pkg.use-bootstrap ,
.Sy pkg.source-package ,
and
.Sy pkg.alias-of
variables; bugs in the
.Sy pkg.subdir
variable have been fixed; and a
.Fl \-source-directory
option has been added.
.Xr tix-build 8
must be upgraded before building ports using any of those feature.
.Bd -literal
cd /src/tix &&
make clean &&
make install
.Ed
.Pp
If not developing natively, set
.Ev PREFIX
to the desired location.
.Pp
If the new program isn't used, ports may fail to build due to local software not
being the exact same version
.Sy ( pkg.use-bootstrap ) ,
clean or post-install in the wrong subdirectory
.Sy ( pkg.subdir) ,
the
.Fl \-source-directory
option not being recognized or failing to locate the source code
.Sy ( pkg.source-package) ,
stopping because
.Sy pkg.build-system
isn't set
.Sy ( pkg.alias-of) ,
or other mysterious circumstances.
.Ss Add German keyboard layout. .Ss Add German keyboard layout.
The The
.Xr kblayout-compiler 1 .Xr kblayout-compiler 1

File diff suppressed because it is too large Load diff

View file

@ -105,6 +105,8 @@ string_array_t GetPackageDependencies(params_t* params, const char* pkg_name)
const char* deps = dictionary_get_def(&tixinfo, "pkg.runtime-deps", ""); const char* deps = dictionary_get_def(&tixinfo, "pkg.runtime-deps", "");
string_array_append_token_string(&ret, deps); string_array_append_token_string(&ret, deps);
const char* alias = dictionary_get_def(&tixinfo, "pkg.alias-of", "");
string_array_append_token_string(&ret, alias);
string_array_reset(&tixinfo); string_array_reset(&tixinfo);