python3-pandas: remove unnecessary INSTALL.msg
This commit is contained in:
commit
666e9cf812
309 changed files with 24911 additions and 0 deletions
206
CONTRIBUTING.md
Normal file
206
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,206 @@
|
|||
# Contributing to void-packages
|
||||
|
||||
void-packages is the backbone of the Void Linux distribution. It contains all the definitions to build packages from source.
|
||||
|
||||
This document describes how you, as a contributor, can help with adding packages, correcting bugs and adding features to void-packages.
|
||||
|
||||
## Package Requirements
|
||||
|
||||
To be included in the Void repository, software must meet at least one of the following requirements.
|
||||
Exceptions to the list are possible, and might be accepted, but are extremely unlikely.
|
||||
If you believe you have an exception, start a PR and make an argument for why that particular piece of software,
|
||||
while not meeting any of the following requirements, is a good candidate for the Void packages system.
|
||||
|
||||
1. **System**: The software should be installed system-wide, not per-user.
|
||||
|
||||
1. **Compiled**: The software needs to be compiled before being used, even if it is software that is not needed by the whole system.
|
||||
|
||||
1. **Required**: Another package either within the repository or pending inclusion requires the package.
|
||||
|
||||
In particular, new themes are highly unlikely to be accepted.
|
||||
Simple shell scripts are unlikely to be accepted unless they provide considerable value to a broad user base.
|
||||
New fonts may be accepted if they provide value beyond aesthetics (e.g. they contain glyphs for a script missing in already packaged fonts).
|
||||
|
||||
Browser forks, including those based on Chromium and Firefox, are generally not accepted.
|
||||
Such forks require heavy patching, maintenance and hours of build time.
|
||||
|
||||
Software need to be used in version announced by authors as ready to use by the general public - usually called releases.
|
||||
Betas, arbitrary VCS revisions, templates using tip of development branch taken at build time and releases created by the package maintainer won't be accepted.
|
||||
|
||||
## Creating, updating, and modifying packages in Void by yourself
|
||||
|
||||
If you really want to get a new package or package update into Void Linux, we recommend you contribute it yourself.
|
||||
|
||||
We provide a [comprehensive Manual](./Manual.md) on how to create new packages.
|
||||
There's also a [manual for xbps-src](./README.md), which is used to build package files from templates.
|
||||
|
||||
For this guide, we assume you have basic knowledge about [git](http://git-scm.org), as well as a [GitHub Account](http://github.com) with [SSH set up](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
|
||||
|
||||
You should also [set the email](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address) on your GitHub account and in git so your commits are associated with your GitHub account properly.
|
||||
|
||||
To get started, [fork](https://help.github.com/articles/fork-a-repo) the void-linux `void-packages` git repository on GitHub and clone it:
|
||||
|
||||
$ git clone git@github.com:<user>/void-packages.git
|
||||
|
||||
To keep your forked repository up to date, setup the `upstream` remote to pull in new changes:
|
||||
|
||||
$ git remote add upstream https://github.com/void-linux/void-packages.git
|
||||
$ git pull --rebase upstream master
|
||||
|
||||
This can also be done with the `github-cli` tool:
|
||||
|
||||
$ gh repo fork void-linux/void-packages
|
||||
$ gh repo clone <user>/void-packages
|
||||
|
||||
This automatically sets up the `upstream` remote, so `git pull --rebase upstream master` can still be used to keep your fork up-to-date.
|
||||
|
||||
Using the GitHub web editor for making changes is strongly discouraged, because you will need to clone the repo anyways to edit and test your changes.
|
||||
|
||||
using the the `master` branch of your fork for contributing is also strongly discouraged.
|
||||
It can cause many issues with updating your pull request (also called a PR), and having multiple PRs open at once.
|
||||
To create a new branch:
|
||||
|
||||
$ git checkout master -b <a-descriptive-name>
|
||||
|
||||
### Creating a new template
|
||||
|
||||
You can use the helper tool `xnew`, from the [xtools](https://github.com/leahneukirchen/xtools) package, to create new templates:
|
||||
|
||||
$ xnew pkgname subpkg1 subpkg2 ...
|
||||
|
||||
Templates must have the name `void-packages/srcpkgs/<pkgname>/template`, where `pkgname` is the same as the `pkgname` variable in the template.
|
||||
|
||||
For deeper insights on the contents of template files, please read the [manual](./Manual.md), and be sure to browse the existing template files in the `srcpkgs` directory of this repository for concrete examples.
|
||||
|
||||
### Updating a template
|
||||
|
||||
At minimum, a template update will consist of changing `version` and `checksum`, if there was an upstream version change, and/or `revision`, if a template-specific change (e.g. patch, correction, etc.) is needed.
|
||||
Other changes to the template may be needed depending on what changes the upstream has made.
|
||||
|
||||
The checksum can be updated automatically with the `xgensum` helper from the [xtools](https://github.com/leahneukirchen/xtools) package:
|
||||
|
||||
$ xgensum -i <pkgname>
|
||||
|
||||
### Committing your changes
|
||||
|
||||
After making your changes, please check that the package builds successfully. From the top level directory of your local copy of the `void-packages` repository, run:
|
||||
|
||||
$ ./xbps-src pkg <pkgname>
|
||||
|
||||
Your package must build successfully for at least x86, but we recommend also trying a cross-build for armv6l* as well, e.g.:
|
||||
|
||||
$ ./xbps-src -a armv6l pkg <pkgname>
|
||||
|
||||
When building for `x86_64*` or `i686`, building with the `-Q` flag or with `XBPS_CHECK_PKGS=yes` set in `etc/conf` (to run the check phase) is strongly encouraged.
|
||||
Also, new packages and updates will not be accepted unless they have been runtime tested by installing and running the package.
|
||||
|
||||
When you've finished working on the template file, please check it with `xlint` helper from the [xtools](https://github.com/leahneukirchen/xtools) package:
|
||||
|
||||
$ xlint template
|
||||
|
||||
If `xlint` reports any issues, resolve them before committing.
|
||||
|
||||
Once you have made and verified your changes to the package template and/or other files, make one commit per package (including all changes to its sub-packages). Each commit message should have one of the following formats:
|
||||
|
||||
* for new packages, use `New package: <pkgname>-<version>` ([example](https://github.com/void-linux/void-packages/commit/8ed8d41c40bf6a82cf006c7e207e05942c15bff8)).
|
||||
|
||||
* for package updates, use `<pkgname>: update to <version>.` ([example](https://github.com/void-linux/void-packages/commit/c92203f1d6f33026ae89f3e4c1012fb6450bbac1)).
|
||||
|
||||
* for template modifications without a version change, use `<pkgname>: <reason>` ([example](https://github.com/void-linux/void-packages/commit/ff39c912d412717d17232de9564f659b037e95b5)).
|
||||
|
||||
* for package removals, use `<pkgname>: remove package` and include the removal reason in the commit body ([example](https://github.com/void-linux/void-packages/commit/4322f923bdf5d4e0eb36738d4f4717d72d0a0ca4)).
|
||||
|
||||
* for changes to any other file, use `<filename>: <reason>` ([example](https://github.com/void-linux/void-packages/commit/e00bea014c36a70d60acfa1758514b0c7cb0627d),
|
||||
[example](https://github.com/void-linux/void-packages/commit/93bf159ce10d8e474da5296e5bc98350d00c6c82), [example](https://github.com/void-linux/void-packages/commit/dc62938c67b66a7ff295eab541dc37b92fb9fb78), [example](https://github.com/void-linux/void-packages/commit/e52317e939d41090562cf8f8131a68772245bdde))
|
||||
|
||||
If you want to describe your changes in more detail, explain in the commit body (separated from the first line with a blank line) ([example](https://github.com/void-linux/void-packages/commit/f1c45a502086ba1952f23ace9084a870ce437bc6)).
|
||||
|
||||
`xbump`, available in the [xtools](https://github.com/leahneukirchen/xtools) package, can be used to commit a new or updated package:
|
||||
|
||||
$ xbump <pkgname> <git commit options>
|
||||
|
||||
`xrevbump`, also available in the [xtools](https://github.com/leahneukirchen/xtools) package, can be used to commit a template modification for a package:
|
||||
|
||||
$ xrevbump '<message>' <pkgnames...>
|
||||
|
||||
`xbump` and `xrevbump` will use `git commit` to commit the changes with the appropriate commit message. For more fine-grained control over the commit, specific options can be passed to `git commit` by adding them after the package name.
|
||||
|
||||
### Starting a pull request
|
||||
|
||||
Once you have successfully built the package, you can [create a pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request). Pull requests are also known as PRs.
|
||||
|
||||
Most pull requests should only contain a single package and dependencies which are not part of void-packages yet.
|
||||
|
||||
If you make updates to packages containing a soname bump, you also need to update `common/shlibs` and revbump all packages that are dependant.
|
||||
There should be a commit for each package revbump, and those commits should be part of the same pull request.
|
||||
|
||||
When you make changes to your pull request, please *do not close and reopen your pull request*. Instead, just [forcibly git push](#review), overwriting any old commits. Closing and opening your pull requests repeatedly spams the Void maintainers.
|
||||
|
||||
#### Continuous Integration
|
||||
|
||||
Pull requests are automatically submitted for Continuous Integration (CI) testing to ensure packages build and pass their tests (on native builds) on various combinations of C library and architecture.
|
||||
Packages that take longer than 120 minutes or need more than 14G of storage to complete their build (for example, Firefox or the Linux kernel) will fail CI and should include `[ci skip]` in the PR title or body (the comment field when the PR is being opened) to avoid wasting CI builder time.
|
||||
Use your best judgment on build times based on your local building experience. If you skip CI when submitting a PR, please build and cross-build for a variety of architectures locally, with both glibc and musl, and note your local results in PR comments.
|
||||
Make sure to cover 64-bit and 32-bit architectures.
|
||||
|
||||
If you notice a failure in CI that didn't happen locally, that is likely because you didn't run tests locally.
|
||||
Use `./xbps-src -Q pkg <package>` to do so.
|
||||
Some tests won't work in the CI environment or at all, and their templates should encode this information using the `make_check` variable.
|
||||
|
||||
Continuous Integration will also check if the templates you have changed
|
||||
comply with the our guidelines. At the moment not all packages comply with the rules, so if you update a package, it may report errors about places you haven't touched. Please feel free to fix those errors too.
|
||||
|
||||
#### Review
|
||||
|
||||
It's possible (and common) that a pull request will contain mistakes or reviewers will ask for additional tweaks.
|
||||
Reviewers will comment on your pull request and point out which changes are needed before the pull request can be merged.
|
||||
|
||||
Most PRs will have a single commit, as seen [above](#committing-your-changes), so if you need to make changes to the commit and already have a pull request open, you can use the following commands:
|
||||
|
||||
$ git add <file>
|
||||
$ git commit --amend
|
||||
$ git push -f
|
||||
|
||||
A more powerful way of modifying commits than using `git commit --amend` is with [git-rebase](https://git-scm.com/docs/git-rebase#_interactive_mode), which allows you to join, reorder, change description of past commits and more.
|
||||
|
||||
Alternatively, if there are issues with your git history, you can make another branch and push it to the existing PR:
|
||||
|
||||
$ git checkout master -b <attempt2>
|
||||
$ # do changes anew
|
||||
$ git push -f <fork> <attempt2>:<branch-of-pr>
|
||||
|
||||
#### Closing the pull request
|
||||
|
||||
Once you have applied all requested changes, the reviewers will merge your request.
|
||||
|
||||
If the pull request becomes inactive for some days, the reviewers may or may not warn you when they are about to close it.
|
||||
If it stays inactive further, it will be closed.
|
||||
|
||||
Please abstain from temporarily closing a pull request while revising the templates. Instead, leave a comment on the PR describing what still needs work, [mark it as a draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft), or add "[WIP]" to the PR title. Only close your pull request if you're sure you don't want your changes to be included.
|
||||
|
||||
#### Publishing the package
|
||||
|
||||
Once the reviewers have merged the pull request, our [build server](http://build.voidlinux.org) is automatically triggered and builds
|
||||
all packages in the pull request for all supported platforms. Upon completion, the packages are available to all Void Linux users.
|
||||
|
||||
## Testing Pull Requests
|
||||
|
||||
While it is the responsibility of the PR creator to test changes before sending it, one person can't test all configuration options, usecases, hardware, etc.
|
||||
Testing new package submissions and updates is always helpful, and is a great way to get started with contributing.
|
||||
First, [clone the repository](https://github.com/void-linux/void-packages#quick-start) if you haven't done so already.
|
||||
Then check out the pull request, either with `github-cli`:
|
||||
|
||||
$ gh pr checkout <number>
|
||||
|
||||
Or with `git`:
|
||||
|
||||
If your local void-packages repository is cloned from your fork, you may need to add the main repository as a remote first:
|
||||
|
||||
$ git remote add upstream https://github.com/void-linux/void-packages.git
|
||||
|
||||
Then fetch and check out the PR (replacing `<remote>` with either `origin` or `upstream`):
|
||||
|
||||
$ git fetch <remote> pull/<number>/head:<branch-name>
|
||||
$ git checkout <branch-name>
|
||||
|
||||
Then [build and install](https://github.com/void-linux/void-packages#building-packages) the package and test its functionality.
|
23
COPYING
Normal file
23
COPYING
Normal file
|
@ -0,0 +1,23 @@
|
|||
Copyright (c) 2008-2020 Juan Romero Pardines and contributors
|
||||
Copyright (c) 2017-2022 The Void Linux team and contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
6
common/build-helper/cmake-wxWidgets-gtk3.sh
Normal file
6
common/build-helper/cmake-wxWidgets-gtk3.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
if [ "$CROSS_BUILD" ]; then
|
||||
export WX_CONFIG=${XBPS_WRAPPERDIR}/wx-config-gtk3
|
||||
else
|
||||
export WX_CONFIG=/usr/bin/wx-config-gtk3
|
||||
fi
|
||||
configure_args+=" -DwxWidgets_CONFIG_EXECUTABLE=${WX_CONFIG} "
|
42
common/build-helper/gir.sh
Normal file
42
common/build-helper/gir.sh
Normal file
|
@ -0,0 +1,42 @@
|
|||
#
|
||||
# gir - build-helper for gobject-introspection
|
||||
#
|
||||
# This build-helper is used for packages that make use of
|
||||
# the GObject introspection middleware layer.
|
||||
#
|
||||
|
||||
# Check if the 'gir' build_option is set or if there is no
|
||||
# 'gir' build_option.
|
||||
if [ "$build_option_gir" ] || [[ $build_options != *"gir"* ]]; then
|
||||
if [[ $hostmakedepends != *"gobject-introspection"* ]]; then
|
||||
# Provide the host tooling, g-ir-scanner, g-ir-compiler
|
||||
# and its wrappers.
|
||||
hostmakedepends+=" gobject-introspection"
|
||||
fi
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
# Required for running binaries produced from g-ir-compiler
|
||||
# via g-ir-scanner-qemuwrapper
|
||||
hostmakedepends+=" qemu-user-static"
|
||||
|
||||
# Required for running the g-ir-scanner-lddwrapper
|
||||
hostmakedepends+=" prelink-cross"
|
||||
|
||||
if [[ $makedepends != *"gobject-introspection"* ]]; then
|
||||
# Provide basic .gir types like GLib, GObject, DBus, Gio, cairo
|
||||
# and tooling like g-ir-compiler
|
||||
makedepends+=" gobject-introspection"
|
||||
fi
|
||||
|
||||
export VAPIGEN_VAPIDIRS=${XBPS_CROSS_BASE}/usr/share/vala/vapi
|
||||
export VAPIGEN_GIRDIRS=${XBPS_CROSS_BASE}/usr/share/gir-1.0
|
||||
|
||||
# Provide some packages in hostmakedepends if they are in makedepends
|
||||
for f in gtk+3-devel python3-gobject-devel; do
|
||||
if [[ $makedepends == *"${f}"* ]]; then
|
||||
hostmakedepends+=" ${f}"
|
||||
fi
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
fi
|
37
common/build-helper/numpy.sh
Normal file
37
common/build-helper/numpy.sh
Normal file
|
@ -0,0 +1,37 @@
|
|||
#
|
||||
# numpy - build-helper for packages that compile against python3-numpy
|
||||
#
|
||||
# This build-helper makes sure packages can find python3-numpy libraries and
|
||||
# headers on the target architecture rather than the host, as well as making
|
||||
# sure the gfortran cross compiler is properly identified.
|
||||
|
||||
# Even for cross compilation, numpy should be available on the host to ensure
|
||||
# that the host interpreter doesn't complain about missing deps
|
||||
if [[ $hostmakedepends != *"python3-numpy"* ]]; then
|
||||
hostmakedepends+=" python3-numpy"
|
||||
fi
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
if [[ $makedepends != *"python3-numpy"* ]]; then
|
||||
makedepends+=" python3-numpy"
|
||||
fi
|
||||
|
||||
# python3-setuptools finds numpy libs and headers on the host first;
|
||||
# adding search paths up front allows the target to take priority
|
||||
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_sitelib}/numpy/core/include"
|
||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_sitelib}/numpy/core/lib"
|
||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_sitelib}/numpy/random/lib"
|
||||
|
||||
# distutils from python3-numpy looks to environment variables F77 and
|
||||
# F90 rather than the XBPS-set FC
|
||||
export F77="${FC}"
|
||||
export F90="${FC}"
|
||||
|
||||
# When compiling and linking FORTRAN, distutils from python3-numpy
|
||||
# refuses respect any linker name except "gfortran"; symlink to the
|
||||
# cross-compiler to that the right linker and compiler will be used
|
||||
if _gfortran=$(command -v "${FC}"); then
|
||||
ln -sf "${_gfortran}" "${XBPS_WRAPPERDIR}/gfortran"
|
||||
fi
|
||||
unset _gfortran
|
||||
fi
|
16
common/build-helper/python3.sh
Normal file
16
common/build-helper/python3.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
# fix building non-pure-python modules on cross
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
export PYPREFIX="$XBPS_CROSS_BASE"
|
||||
export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||
export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||
export LDSHARED="${CC} -shared $LDFLAGS"
|
||||
export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
|
||||
export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
|
||||
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
||||
[ -f "$f" ] || continue
|
||||
f=${f##*/}
|
||||
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
||||
done
|
||||
[ -n "$_PYTHON_SYSCONFIGDATA_NAME" ] && export _PYTHON_SYSCONFIGDATA_NAME
|
||||
fi
|
14
common/build-helper/qemu.sh
Normal file
14
common/build-helper/qemu.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
if [ "$CROSS_BUILD" ]; then
|
||||
export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
|
||||
if [[ $hostmakedepends != *"qemu-user-static"* ]]; then
|
||||
hostmakedepends+=" qemu-user-static"
|
||||
fi
|
||||
fi
|
||||
|
||||
vtargetrun() {
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
"/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static" "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
}
|
95
common/build-helper/qmake.sh
Normal file
95
common/build-helper/qmake.sh
Normal file
|
@ -0,0 +1,95 @@
|
|||
# This build-helper sets up qmake’s cross environment
|
||||
# in cases the build-style is mixed,
|
||||
# e.g. when in a gnu-configure style the configure
|
||||
# script calls qmake or a makefile in a gnu-makefile style,
|
||||
# respectively.
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
mkdir -p "${XBPS_WRAPPERDIR}/target-spec/linux-g++"
|
||||
cat > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qmake.conf" <<_EOF
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
CONFIG += incremental no_qt_rpath
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
|
||||
include(/usr/lib/qt5/mkspecs/common/linux.conf)
|
||||
include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
|
||||
include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
|
||||
|
||||
QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
|
||||
QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
|
||||
QMAKEMODULES = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/modules
|
||||
QMAKE_CC = ${CC}
|
||||
QMAKE_CXX = ${CXX}
|
||||
QMAKE_LINK = ${CXX}
|
||||
QMAKE_LINK_C = ${CC}
|
||||
QMAKE_LINK_SHLIB = ${CXX}
|
||||
|
||||
QMAKE_AR = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
|
||||
QMAKE_OBJCOPY = ${OBJCOPY}
|
||||
QMAKE_NM = ${NM} -P
|
||||
QMAKE_STRIP = ${STRIP}
|
||||
|
||||
QMAKE_CFLAGS = ${CFLAGS}
|
||||
QMAKE_CXXFLAGS = ${CXXFLAGS}
|
||||
QMAKE_LFLAGS = ${LDFLAGS}
|
||||
load(qt_config)
|
||||
_EOF
|
||||
echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qplatformdefs.h"
|
||||
|
||||
cat > "${XBPS_WRAPPERDIR}/qt.conf" <<_EOF
|
||||
[Paths]
|
||||
Sysroot=${XBPS_CROSS_BASE}
|
||||
Prefix=${XBPS_CROSS_BASE}/usr
|
||||
ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
|
||||
Data=${XBPS_CROSS_BASE}/usr/share/qt5
|
||||
Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
|
||||
Headers=${XBPS_CROSS_BASE}/usr/include/qt5
|
||||
Libraries=${XBPS_CROSS_BASE}/usr/lib
|
||||
LibraryExecutables=/usr/lib/qt5/libexec
|
||||
Binaries=/usr/lib/qt5/bin
|
||||
Tests=${XBPS_CROSS_BASE}/usr/tests
|
||||
Plugins=/usr/lib/qt5/plugins
|
||||
Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/imports
|
||||
Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/qml
|
||||
Translations=${XBPS_CROSS_BASE}/usr/share/qt5/translations
|
||||
Settings=${XBPS_CROSS_BASE}/etc/xdg
|
||||
Examples=${XBPS_CROSS_BASE}/usr/share/qt5/examples
|
||||
HostPrefix=/usr
|
||||
HostData=/usr/lib/qt5
|
||||
HostBinaries=/usr/lib/qt5/bin
|
||||
HostLibraries=/usr/lib
|
||||
Spec=linux-g++
|
||||
TargetSpec=$XBPS_WRAPPERDIR/target-spec/linux-g++
|
||||
_EOF
|
||||
|
||||
# create the qmake-wrapper here because it only
|
||||
# makes sense together with the qmake build-helper
|
||||
# and not to interfere with e.g. the qmake build-style
|
||||
#
|
||||
# + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS
|
||||
# + hardening flags will be picked up from environment variables
|
||||
cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF
|
||||
#!/bin/sh
|
||||
exec /usr/lib/qt5/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt.conf" \\
|
||||
QMAKE_CFLAGS+="\${CFLAGS}" \\
|
||||
QMAKE_CXXFLAGS+="\${CXXFLAGS}" \\
|
||||
QMAKE_LFLAGS+="\${LDFLAGS}"
|
||||
_EOF
|
||||
else
|
||||
cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF
|
||||
#!/bin/sh
|
||||
exec /usr/lib/qt5/bin/qmake \
|
||||
"\$@" \
|
||||
PREFIX=/usr \
|
||||
QT_INSTALL_PREFIX=/usr \
|
||||
LIB=/usr/lib \
|
||||
QMAKE_CC="$CC" QMAKE_CXX="$CXX" \
|
||||
QMAKE_LINK="$CXX" QMAKE_LINK_C="$CC" \
|
||||
QMAKE_CFLAGS+="\${CFLAGS}" \
|
||||
QMAKE_CXXFLAGS+="\${CXXFLAGS}" \
|
||||
QMAKE_LFLAGS+="\${LDFLAGS}" \
|
||||
CONFIG+=no_qt_rpath
|
||||
_EOF
|
||||
fi
|
||||
chmod 755 ${XBPS_WRAPPERDIR}/qmake
|
||||
cp -p ${XBPS_WRAPPERDIR}/qmake{,-qt5}
|
53
common/build-helper/rust.sh
Normal file
53
common/build-helper/rust.sh
Normal file
|
@ -0,0 +1,53 @@
|
|||
# Define equivalent of TOML config in environment
|
||||
# [build]
|
||||
# jobs = $XBPS_MAKEJOBS
|
||||
export CARGO_BUILD_JOBS="$XBPS_MAKEJOBS"
|
||||
export CARGO_HOME="/host/cargo"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
# Define equivalent of TOML config in environment
|
||||
# [target.${RUST_TARGET}]
|
||||
# linker = ${CC}
|
||||
_XBPS_CROSS_RUST_TARGET_ENV="${XBPS_CROSS_RUST_TARGET^^}"
|
||||
_XBPS_CROSS_RUST_TARGET_ENV="${_XBPS_CROSS_RUST_TARGET_ENV//-/_}"
|
||||
export CARGO_TARGET_${_XBPS_CROSS_RUST_TARGET_ENV}_LINKER="$CC"
|
||||
unset _XBPS_CROSS_RUST_TARGET_ENV
|
||||
|
||||
# Define equivalent of TOML config in environment
|
||||
# [build]
|
||||
# target = ${RUST_TARGET}
|
||||
export CARGO_BUILD_TARGET="$RUST_TARGET"
|
||||
|
||||
# If cc-rs needs to build host binaries, it guesses the compiler and
|
||||
# uses default (wrong) flags unless they are specified explicitly;
|
||||
# innocuous flags are used here just to disable its defaults
|
||||
export HOST_CC="gcc"
|
||||
export HOST_CFLAGS="-O2"
|
||||
|
||||
# Crates that use bindgen via build.rs are not cross-aware unless these are set
|
||||
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=${XBPS_CROSS_BASE} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
else
|
||||
unset CARGO_BUILD_TARGET
|
||||
fi
|
||||
|
||||
# For cross-compiling rust -sys crates
|
||||
export PKG_CONFIG_ALLOW_CROSS=1
|
||||
|
||||
# gettext-rs
|
||||
export GETTEXT_BIN_DIR=/usr/bin
|
||||
export GETTEXT_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib/gettext"
|
||||
export GETTEXT_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
|
||||
|
||||
# libssh2-sys
|
||||
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
||||
|
||||
# sodium-sys
|
||||
export SODIUM_LIB_DIR="${XBPS_CROSS_BASE}/usr/include"
|
||||
export SODIUM_INC_DIR="${XBPS_CROSS_BASE}/usr/lib"
|
||||
export SODIUM_SHARED=1
|
||||
|
||||
# openssl-sys
|
||||
export OPENSSL_NO_VENDOR=1
|
||||
|
||||
# pcre2-sys, only necessary for musl targets
|
||||
export PCRE2_SYS_STATIC=0
|
17
common/build-profiles/README
Normal file
17
common/build-profiles/README
Normal file
|
@ -0,0 +1,17 @@
|
|||
BUILD PROFILES
|
||||
==============
|
||||
|
||||
This directory contains build profiles to set properties on native builds
|
||||
for a specific architecture:
|
||||
|
||||
- XBPS_TRIPLET (the compiler triplet)
|
||||
- XBPS_CFLAGS (C compiler flags for host compiler)
|
||||
- XBPS_CXXFLAGS (C++ compiler flags for the host compiler)
|
||||
- XBPS_FFLAGS (Fortran compiler flags for the host compiler)
|
||||
- XBPS_RUST_TARGET (the compiler triplet for usage by cargo)
|
||||
- XBPS_ZIG_TARGET (the arch-os-abi target triplet for zig)
|
||||
- XBPS_ZIG_CPU (the cpu/feature set for zig)
|
||||
|
||||
These properties are also set in a cross environment, but the compiler
|
||||
flags are not added into the global flags. XBPS_RUST_TARGET is also
|
||||
exposed as RUST_BUILD instead of RUST_TARGET.
|
7
common/build-profiles/aarch64-musl.sh
Normal file
7
common/build-profiles/aarch64-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv8-a"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="aarch64-unknown-linux-musl"
|
||||
XBPS_RUST_TARGET="$XBPS_TRIPLET"
|
||||
XBPS_ZIG_TARGET="aarch64-linux-musl"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/aarch64.sh
Normal file
7
common/build-profiles/aarch64.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv8-a"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="aarch64-unknown-linux-gnu"
|
||||
XBPS_RUST_TARGET="$XBPS_TRIPLET"
|
||||
XBPS_ZIG_TARGET="aarch64-linux-gnu"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/armv6l-musl.sh
Normal file
7
common/build-profiles/armv6l-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="armv6l-linux-musleabihf"
|
||||
XBPS_RUST_TARGET="arm-unknown-linux-musleabihf"
|
||||
XBPS_ZIG_TARGET="arm-linux-musleabihf"
|
||||
XBPS_ZIG_CPU="generic+v6"
|
7
common/build-profiles/armv6l.sh
Normal file
7
common/build-profiles/armv6l.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="armv6l-unknown-linux-gnueabihf"
|
||||
XBPS_RUST_TARGET="arm-unknown-linux-gnueabihf"
|
||||
XBPS_ZIG_TARGET="arm-linux-gnueabihf"
|
||||
XBPS_ZIG_CPU="generic+v6"
|
7
common/build-profiles/armv7l-musl.sh
Normal file
7
common/build-profiles/armv7l-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_CXXFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="armv7l-linux-musleabihf"
|
||||
XBPS_RUST_TARGET="armv7-unknown-linux-musleabihf"
|
||||
XBPS_ZIG_TARGET="arm-linux-musleabihf"
|
||||
XBPS_ZIG_CPU="generic+v7a+vfp3"
|
7
common/build-profiles/armv7l.sh
Normal file
7
common/build-profiles/armv7l.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="armv7l-unknown-linux-gnueabihf"
|
||||
XBPS_RUST_TARGET="armv7-unknown-linux-gnueabihf"
|
||||
XBPS_CROSS_ZIG_TARGET="arm-linux-gnueabihf"
|
||||
XBPS_CROSS_ZIG_CPU="generic+v7a+vfp3"
|
3
common/build-profiles/bootstrap.sh
Normal file
3
common/build-profiles/bootstrap.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_FFLAGS="-fPIC -pipe"
|
7
common/build-profiles/i686-musl.sh
Normal file
7
common/build-profiles/i686-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=i686"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="i686-linux-musl"
|
||||
XBPS_RUST_TARGET="i686-unknown-linux-musl"
|
||||
XBPS_ZIG_TARGET="i686-linux-musl"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/i686.sh
Normal file
7
common/build-profiles/i686.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=i686"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="i686-pc-linux-gnu"
|
||||
XBPS_RUST_TARGET="i686-unknown-linux-gnu"
|
||||
XBPS_ZIG_TARGET="i386-linux-gnu"
|
||||
XBPS_ZIG_CPU="_i686+sse2"
|
7
common/build-profiles/ppc-musl.sh
Normal file
7
common/build-profiles/ppc-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=G4"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpc-linux-musl"
|
||||
XBPS_RUST_TARGET="powerpc-unknown-linux-musl"
|
||||
XBPS_ZIG_TARGET="powerpc-linux-musl"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/ppc.sh
Normal file
7
common/build-profiles/ppc.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=G4"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpc-linux-gnu"
|
||||
XBPS_RUST_TARGET="powerpc-unknown-linux-gnu"
|
||||
XBPS_ZIG_TARGET="powerpc-linux-gnu"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/ppc64-musl.sh
Normal file
7
common/build-profiles/ppc64-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mcpu=970 -mtune=power9"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpc64-unknown-linux-musl"
|
||||
XBPS_RUST_TARGET="$XBPS_TRIPLET"
|
||||
XBPS_ZIG_TARGET="powerpc64-linux-musl"
|
||||
XBPS_ZIG_CPU="970"
|
7
common/build-profiles/ppc64.sh
Normal file
7
common/build-profiles/ppc64.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mcpu=970 -mtune=power9"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpc64-unknown-linux-gnu"
|
||||
XBPS_RUST_TARGET="$XBPS_TRIPLET"
|
||||
XBPS_ZIG_TARGET="powerpc64-linux-gnu"
|
||||
XBPS_ZIG_CPU="970"
|
7
common/build-profiles/ppc64le-musl.sh
Normal file
7
common/build-profiles/ppc64le-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=power9"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpc64le-unknown-linux-musl"
|
||||
XBPS_RUST_TARGET="$XBPS_TRIPLET"
|
||||
XBPS_ZIG_TARGET="powerpc64le-linux-musl"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/ppc64le.sh
Normal file
7
common/build-profiles/ppc64le.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=power9"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpc64le-unknown-linux-gnu"
|
||||
XBPS_RUST_TARGET="$XBPS_TRIPLET"
|
||||
XBPS_ZIG_TARGET="powerpc64le-linux-gnu"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/ppcle-musl.sh
Normal file
7
common/build-profiles/ppcle-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mcpu=power8 -mtune=power9"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpcle-linux-musl"
|
||||
XBPS_RUST_TARGET="powerpcle-unknown-linux-musl"
|
||||
XBPS_ZIG_TARGET="powerpcle-linux-musl"
|
||||
XBPS_ZIG_CPU="pwr8"
|
7
common/build-profiles/ppcle.sh
Normal file
7
common/build-profiles/ppcle.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mcpu=power8 -mtune=power9"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="powerpcle-linux-gnu"
|
||||
XBPS_RUST_TARGET="powerpcle-unknown-linux-gnu"
|
||||
XBPS_ZIG_TARGET="powerpcle-linux-gnu"
|
||||
XBPS_ZIG_CPU="pwr8"
|
7
common/build-profiles/x86_64-musl.sh
Normal file
7
common/build-profiles/x86_64-musl.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=generic"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="x86_64-unknown-linux-musl"
|
||||
XBPS_RUST_TARGET="${XBPS_TRIPLET}"
|
||||
XBPS_ZIG_TARGET="x86_64-linux-musl"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-profiles/x86_64.sh
Normal file
7
common/build-profiles/x86_64.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
XBPS_TARGET_CFLAGS="-mtune=generic"
|
||||
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS"
|
||||
XBPS_TRIPLET="x86_64-unknown-linux-gnu"
|
||||
XBPS_RUST_TARGET="${XBPS_TRIPLET}"
|
||||
XBPS_ZIG_TARGET="x86_64-linux-gnu"
|
||||
XBPS_ZIG_CPU="baseline"
|
7
common/build-style/R-cran.sh
Normal file
7
common/build-style/R-cran.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# This helper is for templates using R-cran.
|
||||
#
|
||||
do_install() {
|
||||
mkdir -p ${DESTDIR}/usr/lib/R/library
|
||||
( cd .. && R CMD INSTALL -l ${DESTDIR}/usr/lib/R/library ${pkgname#R-cran-} )
|
||||
}
|
12
common/build-style/README
Normal file
12
common/build-style/README
Normal file
|
@ -0,0 +1,12 @@
|
|||
BUILD STYLES
|
||||
============
|
||||
|
||||
These shell snippets provide support for multiple build systems, i.e GNU configure,
|
||||
CMake, etc. A build style file must provide at least the following functions:
|
||||
|
||||
- do_configure
|
||||
- do_build
|
||||
- do_install
|
||||
|
||||
If a source package defines its own do_xxx() function, the function defined in
|
||||
the build style file is simply ignored.
|
27
common/build-style/cargo.sh
Normal file
27
common/build-style/cargo.sh
Normal file
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# This helper is for building rust projects which use cargo for building
|
||||
#
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=cargo auditable}
|
||||
|
||||
${make_cmd} build --release --target ${RUST_TARGET} ${configure_args}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
: ${make_cmd:=cargo auditable}
|
||||
|
||||
${make_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
|
||||
${make_check_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=cargo auditable}
|
||||
: ${make_install_args:=--path .}
|
||||
|
||||
${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \
|
||||
--offline --locked ${configure_args} ${make_install_args}
|
||||
|
||||
rm -f "${DESTDIR}"/usr/.crates.toml
|
||||
rm -f "${DESTDIR}"/usr/.crates2.json
|
||||
}
|
136
common/build-style/cmake.sh
Normal file
136
common/build-style/cmake.sh
Normal file
|
@ -0,0 +1,136 @@
|
|||
#
|
||||
# This helper is for templates using cmake.
|
||||
#
|
||||
do_configure() {
|
||||
local cmake_args=
|
||||
[ ! -d ${cmake_builddir:=build} ] && mkdir -p ${cmake_builddir}
|
||||
cd ${cmake_builddir}
|
||||
|
||||
if [ -z "$CHROOT_READY" ]; then
|
||||
cat >bootstrap.cmake <<_EOF
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
SET(CMAKE_C_COMPILER ${CC})
|
||||
SET(CMAKE_CXX_COMPILER ${CXX})
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH "${XBPS_MASTERDIR}/usr;${XBPS_MASTERDIR}")
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
_EOF
|
||||
configure_args+=" -DCMAKE_TOOLCHAIN_FILE=bootstrap.cmake"
|
||||
elif [ "$CROSS_BUILD" ]; then
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
x86_64*) _CMAKE_SYSTEM_PROCESSOR=x86_64 ;;
|
||||
i686*) _CMAKE_SYSTEM_PROCESSOR=x86 ;;
|
||||
aarch64*) _CMAKE_SYSTEM_PROCESSOR=aarch64 ;;
|
||||
arm*) _CMAKE_SYSTEM_PROCESSOR=arm ;;
|
||||
mips*) _CMAKE_SYSTEM_PROCESSOR=mips ;;
|
||||
ppc64le*) _CMAKE_SYSTEM_PROCESSOR=ppc64le ;;
|
||||
ppc64*) _CMAKE_SYSTEM_PROCESSOR=ppc64 ;;
|
||||
ppcle*) _CMAKE_SYSTEM_PROCESSOR=ppcle ;;
|
||||
ppc*) _CMAKE_SYSTEM_PROCESSOR=ppc ;;
|
||||
*) _CMAKE_SYSTEM_PROCESSOR=generic ;;
|
||||
esac
|
||||
cat > cross_${XBPS_CROSS_TRIPLET}.cmake <<_EOF
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
SET(CMAKE_C_COMPILER ${CC})
|
||||
SET(CMAKE_CXX_COMPILER ${CXX})
|
||||
SET(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
SET(CMAKE_SYSTEM_PROCESSOR ${_CMAKE_SYSTEM_PROCESSOR})
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH "${XBPS_CROSS_BASE}/usr;${XBPS_CROSS_BASE}")
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
_EOF
|
||||
cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=${wrksrc}/${build_wrksrc}/${cmake_builddir}/cross_${XBPS_CROSS_TRIPLET}.cmake"
|
||||
fi
|
||||
cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
|
||||
cmake_args+=" -DCMAKE_BUILD_TYPE=None"
|
||||
cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
|
||||
cmake_args+=" -DCMAKE_INSTALL_SYSCONFDIR=/etc"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
cmake_args+=" -DQT_HOST_PATH=/usr"
|
||||
# QT_HOST_PATH isn't enough in my system,
|
||||
# which have binfmts support on and off
|
||||
cmake_args+=" -DQT_HOST_PATH_CMAKE_DIR=/usr/lib/cmake"
|
||||
fi
|
||||
|
||||
if [[ $build_helper = *"qemu"* ]]; then
|
||||
echo "SET(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static)" \
|
||||
>> cross_${XBPS_CROSS_TRIPLET}.cmake
|
||||
fi
|
||||
|
||||
cmake_args+=" -DCMAKE_INSTALL_SBINDIR=bin"
|
||||
|
||||
export CMAKE_GENERATOR="${CMAKE_GENERATOR:-Ninja}"
|
||||
# Remove -pipe: https://gitlab.kitware.com/cmake/cmake/issues/19590
|
||||
CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" \
|
||||
cmake ${cmake_args} ${configure_args} \
|
||||
${LIBS:+-DCMAKE_C_STANDARD_LIBRARIES="$LIBS"} \
|
||||
${LIBS:+-DCMAKE_CXX_STANDARD_LIBRARIES="$LIBS"} \
|
||||
${wrksrc}/${build_wrksrc}
|
||||
|
||||
# Replace -isystem with -I
|
||||
if [ "$CMAKE_GENERATOR" = "Unix Makefiles" ]; then
|
||||
find . -name flags.make -exec sed -i -e 's/-isystem/-I/g' "{}" +
|
||||
elif [ "$CMAKE_GENERATOR" = Ninja ]; then
|
||||
sed -i -e 's/-isystem/-I/g' build.ninja
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=ninja}
|
||||
|
||||
cd ${cmake_builddir:=build}
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
: ${make_cmd:=ninja}
|
||||
|
||||
cd ${cmake_builddir:=build}
|
||||
|
||||
if [ -z "$make_check_target" ]; then
|
||||
case $make_cmd in
|
||||
make)
|
||||
if make -q test 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
if [ $? -eq 2 ]; then
|
||||
msg_warn 'No target to "make test".\n'
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
ninja)
|
||||
if ! ninja -t query test >/dev/null 2>&1; then
|
||||
msg_warn 'No target to "ninja test".\n'
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
msg_warn "Can't run tests with '$make_cmd', define do_check.\n"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
: ${make_check_target:=test}
|
||||
|
||||
${make_check_pre} ${make_cmd} ${makejobs} ${make_check_args} ${make_check_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=ninja}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
cd ${cmake_builddir:=build}
|
||||
DESTDIR=${DESTDIR} ${make_cmd} ${make_install_args} ${make_install_target}
|
||||
}
|
40
common/build-style/configure.sh
Normal file
40
common/build-style/configure.sh
Normal file
|
@ -0,0 +1,40 @@
|
|||
#
|
||||
# This helper is for templates using configure scripts (not generated
|
||||
# by the GNU autotools).
|
||||
#
|
||||
do_configure() {
|
||||
: ${configure_script:=./configure}
|
||||
|
||||
${configure_script} ${configure_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
if [ -z "$make_cmd" ] && [ -z "$make_check_target" ]; then
|
||||
if make -q check 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
if [ $? -eq 2 ]; then
|
||||
msg_warn 'No target to "make check".\n'
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
: ${make_cmd:=make}
|
||||
: ${make_check_target:=check}
|
||||
|
||||
${make_check_pre} ${make_cmd} ${makejobs} ${make_check_args} ${make_check_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
|
||||
}
|
12
common/build-style/fetch.sh
Normal file
12
common/build-style/fetch.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# fetch build_style: fetches and copies files to ${wrksrc}.
|
||||
|
||||
do_extract() {
|
||||
local f curfile
|
||||
|
||||
mkdir -p "${wrksrc}"
|
||||
for f in ${distfiles}; do
|
||||
curfile="${f#*>}"
|
||||
curfile="${curfile##*/}"
|
||||
cp ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${curfile} "${wrksrc}/${curfile}"
|
||||
done
|
||||
}
|
68
common/build-style/gem.sh
Normal file
68
common/build-style/gem.sh
Normal file
|
@ -0,0 +1,68 @@
|
|||
#
|
||||
# This helper is for templates using gem files from RubyGems.
|
||||
#
|
||||
do_install() {
|
||||
: ${gem_cmd:=gem}
|
||||
|
||||
local _GEMDIR _INSTDIR
|
||||
|
||||
_GEMDIR=$($gem_cmd env gemdir)
|
||||
_INSTDIR=${DESTDIR}/${_GEMDIR}/gems/${pkgname#ruby-}-${version}
|
||||
|
||||
$gem_cmd install \
|
||||
--local \
|
||||
--install-dir ${DESTDIR}/${_GEMDIR} \
|
||||
--bindir ${DESTDIR}/usr/bin \
|
||||
--ignore-dependencies \
|
||||
--no-document \
|
||||
--verbose \
|
||||
${XBPS_SRCDISTDIR}/${pkgname}-${version}/${pkgname#ruby-}-${version}.gem
|
||||
|
||||
# Remove cache
|
||||
rm -rf ${DESTDIR}/${_GEMDIR}/cache
|
||||
|
||||
# Remove ext directory. they are only source code and configuration
|
||||
# The actual extensions are guarded in an arch path
|
||||
rm -rf ${_INSTDIR}/ext
|
||||
|
||||
# Remove installed tests and benchmarks
|
||||
rm -rf ${_INSTDIR}/{test,tests,autotest,benchmark,benchmarks,script,examples,demo}
|
||||
|
||||
# Remove files shipped on the root of the gem, most of the time they are useless
|
||||
find ${_INSTDIR} -maxdepth 1 -type f -delete
|
||||
|
||||
# Remove unnecessary files
|
||||
find ${DESTDIR}/${_GEMDIR}/extensions \( -name mkmf.log -o -name gem_make.out \) -delete
|
||||
|
||||
# Place manpages in usr/share/man/man[0-9]
|
||||
if [ -d ${_INSTDIR}/man ]; then
|
||||
find ${_INSTDIR}/man -type f -name '*.[0-8n]' | while read -r m; do
|
||||
vman ${m}
|
||||
done
|
||||
fi
|
||||
|
||||
rm -rf "${_INSTDIR}/man"
|
||||
|
||||
# Place executables in /usr/bin
|
||||
if [ -d "${_INSTDIR}/bin" ]; then
|
||||
for f in "${_INSTDIR}"/bin/*; do
|
||||
vbin "${f}"
|
||||
done
|
||||
fi
|
||||
|
||||
rm -rf ${_INSTDIR}/bin
|
||||
|
||||
# Place conf files in their places
|
||||
if [ -d ${_INSTDIR}/etc ]; then
|
||||
find ${_INSTDIR}/etc -type f | while read -r c; do
|
||||
vmkdir ${c%/*}/
|
||||
mv ${c} "${DESTDIR}/${c##*${_INSTDIR}/etc/}/"
|
||||
done
|
||||
fi
|
||||
|
||||
rm -rf ${_INSTDIR}/etc
|
||||
|
||||
# Ignore the ~> operator, replace it with >=
|
||||
sed 's|~>|>=|g' \
|
||||
-i ${DESTDIR}/${_GEMDIR}/specifications/${pkgname#ruby-}-${version}.gemspec
|
||||
}
|
190
common/build-style/gemspec.sh
Normal file
190
common/build-style/gemspec.sh
Normal file
|
@ -0,0 +1,190 @@
|
|||
#
|
||||
# This helper is for templates using gemspec files from upstream or Rubygems.
|
||||
#
|
||||
do_build() {
|
||||
: ${gem_cmd:=gem}
|
||||
: ${gemspec:=${pkgname#ruby-}.gemspec}
|
||||
|
||||
# Fix packages that keep Gem.gemspec as the name instead of the proper
|
||||
# $pkgname.gemspec
|
||||
if [ -f Gem.gemspec ]; then
|
||||
gemspec=Gem.gemspec
|
||||
fi
|
||||
|
||||
if [ -f .gemspec ]; then
|
||||
gemspec=.gemspec
|
||||
fi
|
||||
|
||||
# Hardcode name and version just in case they try something funny like
|
||||
# requiring RELEASE to be on the environment to not append -rc0 to version
|
||||
# Some even forget to update the version in the gemspec after releasing
|
||||
sed -ri "s|(\.name .*)=.*|\1 = \"${pkgname#ruby-}\"|g" $gemspec
|
||||
sed -ri "s|(\.version .*)=.*|\1 = \"${version}\"|g" $gemspec
|
||||
|
||||
# Replace use of `git ls-files` with find, use printf so we can print without starting
|
||||
# dot-slash path
|
||||
sed -i 's|`git ls-files`|`find . -type f -printf "%P\\n"`|g' $gemspec
|
||||
|
||||
# Sadly ruby isn't capable of handling nullbytes in a command so we have to use
|
||||
# -print0, then try using sed to remove the suffix
|
||||
# The end result is:
|
||||
# `find . -type f -print0 | sed -e "s@\\./@@g"`
|
||||
sed -i 's|`git ls-files -z`|`find . -type f -print0 \| sed -e "s@\\\\./@@g"`|g' $gemspec
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
|
||||
local _TARGET_PLATFORM
|
||||
|
||||
_TARGET_PLATFORM="$(ruby -r \
|
||||
$(find ${XBPS_CROSS_BASE}/usr/lib/ruby -iname rbconfig.rb) \
|
||||
-e 'puts RbConfig::CONFIG["arch"]' 2>/dev/null)"
|
||||
|
||||
# Patch all instances of extconf that use create_makefile
|
||||
for f in $(find . -type f -name 'extconf.rb'); do
|
||||
if [ ! -f ${f}.orig ]; then
|
||||
# Create a .extconf file that forces the Makefile to use our environment
|
||||
# this allows us to cross-compile like it is done with meson cross-files
|
||||
cat<<EOF>append
|
||||
\$CPPFLAGS = ENV['CPPFLAGS'] if ENV['CPPFLAGS']
|
||||
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
||||
RbConfig::MAKEFILE_CONFIG['CXX'] = ENV['CXX'] if ENV['CXX']
|
||||
RbConfig::MAKEFILE_CONFIG['LD'] = ENV['LD'] if ENV['LD']
|
||||
RbConfig::MAKEFILE_CONFIG['CFLAGS'] = ENV['CFLAGS'] if ENV['CFLAGS']
|
||||
RbConfig::MAKEFILE_CONFIG['CPPFLAGS'] = ENV['CPPFLAGS'] if ENV['CPPFLAGS']
|
||||
RbConfig::MAKEFILE_CONFIG['CXXFLAGS'] = ENV['CXXFLAGS'] if ENV['CXXFLAGS']
|
||||
EOF
|
||||
cat $f > append2
|
||||
# Use sed and enable verbose mode
|
||||
cat<<EOF>>append2
|
||||
system("sed -i 's|^V =.*|V = 1|' Makefile")
|
||||
system("sed -i 's|^CFLAGS.*|CFLAGS = \$(CCDLFLAGS) ${VOID_TARGET_CFLAGS} \$(ARCH_FLAG)|' Makefile")
|
||||
system("sed -i 's|^topdir.*|topdir = ${XBPS_CROSS_BASE}/usr/include/ruby-\$(ruby_version)|' Makefile")
|
||||
system("sed -i 's|^hdrdir.*|hdrdir = ${XBPS_CROSS_BASE}/usr/include/ruby-\$(ruby_version)|' Makefile")
|
||||
system("sed -i 's|^arch_hdrdir.*|arch_hdrdir = ${XBPS_CROSS_BASE}/usr/include/ruby-\$(ruby_version)/\$(arch)|' Makefile")
|
||||
system("sed -i 's|^arch =.*|arch = ${_TARGET_PLATFORM}|' Makefile")
|
||||
system("sed -i 's|^dldflags =.*|dldflags = ${LDFLAGS}|' Makefile")
|
||||
EOF
|
||||
|
||||
# Create a backup which we will restore later
|
||||
cp $f ${f}.orig
|
||||
|
||||
# Patch extconf.rb for cross compile
|
||||
cat append append2 > $f
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# If we are downloading a gem file then create a spec out of it
|
||||
for f in $distfiles; do
|
||||
if [ "${f##*.}" = "gem" ]; then
|
||||
$gem_cmd spec \
|
||||
"${XBPS_SRCDISTDIR}/${pkgname}-${version}/${f##*/}" \
|
||||
--ruby > $gemspec
|
||||
fi
|
||||
done
|
||||
|
||||
sed 's|~>|>=|g' -i $gemspec
|
||||
|
||||
$gem_cmd build --verbose ${gemspec}
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
# Restore previous extconf.rb which we ship.
|
||||
find . -type f -name 'extconf.rb.orig' | while read -r f; do
|
||||
mv $f ${f%.*}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${gem_cmd:=gem}
|
||||
|
||||
local _GEMDIR _INSTDIR
|
||||
|
||||
_GEMDIR=$($gem_cmd env gemdir)
|
||||
_INSTDIR=${DESTDIR}/${_GEMDIR}/gems/${pkgname#ruby-}-${version}
|
||||
|
||||
# Ruby is very eager to add CFLAGS everywhere there is a compilation
|
||||
# but we do both cross compilation of the modules and host compilation
|
||||
# for checks, so unset CFLAGS and keep it in a separate value.
|
||||
# We will manually pass CFLAGS as VOID_TAGET_CFLAGS to cross-compilation
|
||||
# And ruby will use rbconfig.rb to get the proper CFLAGS for host compilation
|
||||
VOID_TARGET_CFLAGS="$CFLAGS"
|
||||
export VOID_TARGET_CFLAGS
|
||||
unset CFLAGS
|
||||
|
||||
$gem_cmd install \
|
||||
--local \
|
||||
--install-dir ${DESTDIR}/${_GEMDIR} \
|
||||
--bindir ${DESTDIR}/usr/bin \
|
||||
--ignore-dependencies \
|
||||
--no-document \
|
||||
--verbose \
|
||||
"${pkgname#ruby-}-${version}.gem" \
|
||||
-- $configure_args
|
||||
|
||||
# Remove cache
|
||||
rm -rf ${DESTDIR}/${_GEMDIR}/cache
|
||||
|
||||
# Remove ext directory, they are only source code and configuration
|
||||
# The actual extensions are in a arch path guarded
|
||||
rm -rf ${_INSTDIR}/ext
|
||||
|
||||
# Remove duplicated library that is available in a arch guarded
|
||||
# extension
|
||||
rm -rf ${_INSTDIR}/lib/*.so
|
||||
|
||||
# Remove installed tests and benchmarks
|
||||
rm -rf ${_INSTDIR}/{test,tests,autotest,benchmark,benchmarks,script,examples,demo}
|
||||
|
||||
# Remove files shipped on the root of the gem, most of the time they are useless
|
||||
find ${_INSTDIR} -maxdepth 1 -type f -delete
|
||||
|
||||
# Remove unnecessary files
|
||||
find ${DESTDIR}/${_GEMDIR}/extensions \( -name mkmf.log -o -name gem_make.out \) -delete
|
||||
|
||||
# Place manpages in usr/share/man/man[0-9]
|
||||
if [ -d ${_INSTDIR}/man ]; then
|
||||
find ${_INSTDIR}/man -type f -name '*.[0-8n]' | while read -r m; do
|
||||
vman ${m}
|
||||
done
|
||||
fi
|
||||
|
||||
rm -rf "${_INSTDIR}/man"
|
||||
|
||||
# Place executables in /usr/bin
|
||||
if [ -d "${_INSTDIR}/bin" ]; then
|
||||
for f in "${_INSTDIR}"/bin/*; do
|
||||
vbin "${f}"
|
||||
done
|
||||
fi
|
||||
|
||||
rm -rf ${_INSTDIR}/bin
|
||||
|
||||
# Place conf files in their places
|
||||
if [ -d ${_INSTDIR}/etc ]; then
|
||||
find ${_INSTDIR}/etc -type f | while read -r c; do
|
||||
vmkdir ${c%/*}/
|
||||
mv ${c} "${DESTDIR}/${c##*${_INSTDIR}/etc/}/"
|
||||
done
|
||||
fi
|
||||
|
||||
rm -rf ${_INSTDIR}/etc
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
|
||||
local _TARGET_PLATFORM _TARGET_EXT_DIR
|
||||
|
||||
# Get arch of the target and host platform by reading the rbconfig.rb
|
||||
# of the cross ruby
|
||||
_TARGET_PLATFORM="$(ruby -r \
|
||||
$(find ${XBPS_CROSS_BASE}/usr/lib/ruby -iname rbconfig.rb) \
|
||||
-e 'puts RbConfig::CONFIG["arch"]' 2>/dev/null)"
|
||||
|
||||
# Path to the extensions on a package, ruby installs against the platform
|
||||
# of the host, so we have to move them to the correct place
|
||||
_TARGET_EXT_DIR="${DESTDIR}/${_GEMDIR}/extensions/${_TARGET_PLATFORM}"
|
||||
|
||||
find ${DESTDIR}/${_GEMDIR}/extensions -maxdepth 1 -type d \
|
||||
-exec mv '{}' ${_TARGET_EXT_DIR} \;
|
||||
fi
|
||||
}
|
41
common/build-style/gnu-configure.sh
Normal file
41
common/build-style/gnu-configure.sh
Normal file
|
@ -0,0 +1,41 @@
|
|||
#
|
||||
# This helper is for templates using GNU configure scripts.
|
||||
#
|
||||
do_configure() {
|
||||
: ${configure_script:=./configure}
|
||||
|
||||
export lt_cv_sys_lib_dlsearch_path_spec="/usr/lib64 /usr/lib32 /usr/lib /lib /usr/local/lib"
|
||||
${configure_script} ${configure_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
export lt_cv_sys_lib_dlsearch_path_spec="/usr/lib64 /usr/lib32 /usr/lib /lib /usr/local/lib"
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
if [ -z "$make_cmd" ] && [ -z "$make_check_target" ]; then
|
||||
if make -q check 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
if [ $? -eq 2 ]; then
|
||||
msg_warn 'No target to "make check".\n'
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
: ${make_cmd:=make}
|
||||
: ${make_check_target:=check}
|
||||
|
||||
${make_check_pre} ${make_cmd} ${makejobs} ${make_check_args} ${make_check_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
|
||||
}
|
43
common/build-style/gnu-makefile.sh
Normal file
43
common/build-style/gnu-makefile.sh
Normal file
|
@ -0,0 +1,43 @@
|
|||
#
|
||||
# This helper is for templates using GNU Makefiles.
|
||||
#
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
if [ -z "$make_use_env" ]; then
|
||||
${make_cmd} \
|
||||
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
|
||||
CPP="$CPP" AS="$AS" OBJCOPY="$OBJCOPY" OBJDUMP="$OBJDUMP" \
|
||||
CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \
|
||||
PREFIX=/usr prefix=/usr \
|
||||
${makejobs} ${make_build_args} ${make_build_target}
|
||||
else
|
||||
export PREFIX=/usr prefix=/usr
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
fi
|
||||
}
|
||||
|
||||
do_check() {
|
||||
if [ -z "$make_cmd" ] && [ -z "$make_check_target" ]; then
|
||||
if make -q check 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
if [ $? -eq 2 ]; then
|
||||
msg_warn 'No target to "make check".\n'
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
: ${make_cmd:=make}
|
||||
: ${make_check_target:=check}
|
||||
|
||||
${make_check_pre} ${make_cmd} ${makejobs} ${make_check_args} ${make_check_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
${make_cmd} STRIP=true PREFIX=/usr prefix=/usr DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
|
||||
}
|
56
common/build-style/go.sh
Normal file
56
common/build-style/go.sh
Normal file
|
@ -0,0 +1,56 @@
|
|||
#
|
||||
# This helper is for templates for Go packages.
|
||||
#
|
||||
|
||||
do_configure() {
|
||||
# $go_import_path must be set, or we can't link $PWD into $GOSRCPATH
|
||||
# nor build from modules
|
||||
if [ -z "$go_import_path" ]; then
|
||||
msg_error "\"\$go_import_path\" not set on $pkgname template.\n"
|
||||
fi
|
||||
|
||||
# This isn't really configuration, but its needed by packages
|
||||
# that do unusual things with the build where the expect to be
|
||||
# able to cd into the $GOSRCPATH
|
||||
if [ "${go_mod_mode}" != "off" ] && [ -f go.mod ]; then
|
||||
# Skip GOPATH symlink for Go modules
|
||||
msg_normal "Building $pkgname using Go modules.\n"
|
||||
else
|
||||
mkdir -p ${GOSRCPATH%/*}/
|
||||
ln -fs "$PWD" "${GOSRCPATH}"
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
# remove -s and -w from go_ldflags, we should let xbps-src strip binaries itself
|
||||
for wd in $go_ldflags; do
|
||||
if [ "$wd" == "-s" ] || [ "$wd" == "-w" ]; then
|
||||
msg_error "$pkgname: remove -s and -w from go_ldflags\n"
|
||||
fi
|
||||
done
|
||||
|
||||
go_package=${go_package:-$go_import_path}
|
||||
# Build using Go modules if there's a go.mod file
|
||||
if [ "${go_mod_mode}" != "off" ] && [ -f go.mod ]; then
|
||||
if [ -z "${go_mod_mode}" ] && [ -d vendor ]; then
|
||||
msg_normal "Using vendor dir for $pkgname Go dependencies.\n"
|
||||
go_mod_mode=vendor
|
||||
elif [ "${go_mod_mode}" = "default" ]; then
|
||||
# Allow templates to explicitly opt into the go tool's
|
||||
# default behavior.
|
||||
go_mod_mode=
|
||||
fi
|
||||
go install -p "$XBPS_MAKEJOBS" -mod="${go_mod_mode}" -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
|
||||
else
|
||||
# Otherwise, build using GOPATH
|
||||
go get -p "$XBPS_MAKEJOBS" -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
for f in ${GOPATH}/bin/* ${GOPATH}/bin/**/*; do
|
||||
if [ -f "$f" ] && [ -x "$f" ]; then
|
||||
vbin "$f"
|
||||
fi
|
||||
done
|
||||
}
|
37
common/build-style/haskell-stack.sh
Normal file
37
common/build-style/haskell-stack.sh
Normal file
|
@ -0,0 +1,37 @@
|
|||
#
|
||||
# This helper is for templates built using Haskell stack.
|
||||
#
|
||||
# make_build_args="stack-build-flags"
|
||||
# stackage="lts-X.Y" # or include a stack.yaml in $FILESDIR
|
||||
#
|
||||
do_build() {
|
||||
# use --skip-ghc-check to really force stack to use the ghc in the system
|
||||
# --system-ghc still downloads if stackage ghc version does not match ours
|
||||
# this fails on all platforms other than x86_64 glibc when we bump ghc
|
||||
local _stack_args="--system-ghc --skip-ghc-check"
|
||||
|
||||
if [ -f "${FILESDIR}/stack.yaml" ]; then
|
||||
msg_normal "Using stack config in stack.yaml.\n"
|
||||
cp "${FILESDIR}/stack.yaml" .
|
||||
elif [ -z "$stackage" -a -f "stack.yaml" ]; then
|
||||
msg_normal "Using stack.yaml from downloaded source.\n"
|
||||
else
|
||||
if [ -z "$stackage" ]; then
|
||||
msg_error "Stackage version not set in \$stackage.\n"
|
||||
fi
|
||||
msg_normal "Using stackage resolver ${stackage}.\n"
|
||||
STACK_ROOT="$wrksrc/.stack" \
|
||||
stack init ${_stack_args} --force --resolver ${stackage}
|
||||
fi
|
||||
|
||||
STACK_ROOT="$wrksrc/.stack" stack ${_stack_args} ${makejobs} build \
|
||||
${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
local _stack_args="--system-ghc --skip-ghc-check"
|
||||
|
||||
vmkdir usr/bin
|
||||
STACK_ROOT="$wrksrc/.stack" stack ${_stack_args} install \
|
||||
${make_build_args} --local-bin-path=${DESTDIR}/usr/bin
|
||||
}
|
150
common/build-style/meson.sh
Normal file
150
common/build-style/meson.sh
Normal file
|
@ -0,0 +1,150 @@
|
|||
#
|
||||
# This helper is for templates using meson.
|
||||
#
|
||||
do_patch() {
|
||||
: ${meson_crossfile:=xbps_meson.cross}
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
_MESON_TARGET_ENDIAN=little
|
||||
# drop the -musl suffix to the target cpu, meson doesn't recognize it
|
||||
_MESON_TARGET_CPU=${XBPS_TARGET_MACHINE/-musl/}
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
mips|mips-musl|mipshf-musl)
|
||||
_MESON_TARGET_ENDIAN=big
|
||||
_MESON_CPU_FAMILY=mips
|
||||
;;
|
||||
armv*)
|
||||
_MESON_CPU_FAMILY=arm
|
||||
;;
|
||||
i686*)
|
||||
_MESON_CPU_FAMILY=x86
|
||||
;;
|
||||
ppc64le*)
|
||||
_MESON_CPU_FAMILY=ppc64
|
||||
;;
|
||||
ppc64*)
|
||||
_MESON_TARGET_ENDIAN=big
|
||||
_MESON_CPU_FAMILY=ppc64
|
||||
;;
|
||||
ppcle*)
|
||||
_MESON_CPU_FAMILY=ppc
|
||||
;;
|
||||
ppc*)
|
||||
_MESON_TARGET_ENDIAN=big
|
||||
_MESON_CPU_FAMILY=ppc
|
||||
;;
|
||||
*)
|
||||
# if we reached here that means that the cpu and cpu_family
|
||||
# are the same like 'x86_64' and 'aarch64'
|
||||
_MESON_CPU_FAMILY=${_MESON_TARGET_CPU}
|
||||
;;
|
||||
esac
|
||||
|
||||
# Record cross-compiling information in cross file.
|
||||
# CFLAGS and LDFLAGS must be set as c_args and c_link_args.
|
||||
cat > ${meson_crossfile} <<EOF
|
||||
[binaries]
|
||||
c = '${CC}'
|
||||
cpp = '${CXX}'
|
||||
ar = '${XBPS_CROSS_TRIPLET}-gcc-ar'
|
||||
nm = '${NM}'
|
||||
ld = '${LD}'
|
||||
strip = '${STRIP}'
|
||||
readelf = '${READELF}'
|
||||
objcopy = '${OBJCOPY}'
|
||||
pkgconfig = '${PKG_CONFIG}'
|
||||
rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROSS_BASE}/usr']
|
||||
g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
|
||||
g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
|
||||
g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
|
||||
llvm-config = '/usr/bin/llvm-config'
|
||||
cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
|
||||
|
||||
[properties]
|
||||
needs_exe_wrapper = true
|
||||
|
||||
[built-in options]
|
||||
c_args = ['$(echo ${CFLAGS} | sed -r "s/\s+/','/g")']
|
||||
c_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
|
||||
|
||||
cpp_args = ['$(echo ${CXXFLAGS} | sed -r "s/\s+/','/g")']
|
||||
cpp_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
|
||||
|
||||
[host_machine]
|
||||
system = 'linux'
|
||||
cpu_family = '${_MESON_CPU_FAMILY}'
|
||||
cpu = '${_MESON_TARGET_CPU}'
|
||||
endian = '${_MESON_TARGET_ENDIAN}'
|
||||
EOF
|
||||
if [[ $build_helper = *"qemu"* ]]; then
|
||||
sed -e "/\[binaries\]/ a exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'" \
|
||||
-i ${meson_crossfile}
|
||||
fi
|
||||
|
||||
unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN
|
||||
fi
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
: ${meson_cmd:=meson}
|
||||
: ${meson_builddir:=build}
|
||||
: ${meson_crossfile:=xbps_meson.cross}
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
configure_args+=" --cross-file=${meson_crossfile}"
|
||||
fi
|
||||
|
||||
# binutils ar needs a plugin when LTO is used on static libraries, so we
|
||||
# have to use the gcc-ar wrapper that calls the correct plugin.
|
||||
# As seen in https://github.com/mesonbuild/meson/issues/1646 (and its
|
||||
# solution, https://github.com/mesonbuild/meson/pull/1649), meson fixed
|
||||
# issues with static libraries + LTO by defaulting to gcc-ar themselves.
|
||||
# We also force gcc-ar usage in the crossfile above.
|
||||
export AR="gcc-ar"
|
||||
|
||||
# unbuffered output for continuous logging
|
||||
PYTHONUNBUFFERED=1 ${meson_cmd} setup \
|
||||
--prefix=/usr \
|
||||
--libdir=/usr/lib${XBPS_TARGET_WORDSIZE} \
|
||||
--libexecdir=/usr/libexec \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/bin \
|
||||
--includedir=/usr/include \
|
||||
--datadir=/usr/share \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--localedir=/usr/share/locale \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--sharedstatedir=/var/lib \
|
||||
--buildtype=plain \
|
||||
--auto-features=auto \
|
||||
--wrap-mode=nodownload \
|
||||
-Db_lto=true -Db_ndebug=true \
|
||||
-Db_staticpic=true \
|
||||
${configure_args} . ${meson_builddir}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=ninja}
|
||||
: ${make_build_target:=all}
|
||||
: ${meson_builddir:=build}
|
||||
|
||||
${make_cmd} -C ${meson_builddir} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
: ${make_cmd:=ninja}
|
||||
: ${make_check_target:=test}
|
||||
: ${meson_builddir:=build}
|
||||
|
||||
${make_check_pre} ${make_cmd} -C ${meson_builddir} ${makejobs} ${make_check_args} ${make_check_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=ninja}
|
||||
: ${make_install_target:=install}
|
||||
: ${meson_builddir:=build}
|
||||
|
||||
DESTDIR=${DESTDIR} ${make_cmd} -C ${meson_builddir} ${make_install_args} ${make_install_target}
|
||||
}
|
9
common/build-style/meta.sh
Normal file
9
common/build-style/meta.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
# meta pkg build style; do nothing.
|
||||
|
||||
do_fetch() {
|
||||
:
|
||||
}
|
||||
|
||||
do_install() {
|
||||
:
|
||||
}
|
52
common/build-style/perl-ModuleBuild.sh
Normal file
52
common/build-style/perl-ModuleBuild.sh
Normal file
|
@ -0,0 +1,52 @@
|
|||
#
|
||||
# This helper does the required steps to be able to build and install
|
||||
# perl modules with the Module::Build method into the correct location.
|
||||
#
|
||||
# Required vars to be set by a template:
|
||||
#
|
||||
# build_style=perl-ModuleBuild
|
||||
#
|
||||
do_configure() {
|
||||
if [ -f Build.PL ]; then
|
||||
# When cross compiling Module::Build reads in the build flags from the host perl, not the target:
|
||||
# extract the target specific flags (the ones also set in perl’s template) from
|
||||
# the target perl configuration and use them to override Module::Build’s default
|
||||
_conf="${XBPS_CROSS_BASE}/usr/lib/perl5/core_perl/Config_heavy.pl"
|
||||
_optimize=$(sed -n "s;^optimize='\(.*\)';\1;p" $_conf)
|
||||
_ccflags=$(sed -n "s;^ccflags='\(.*\)';\1;p" $_conf)
|
||||
_lddlflags=$(sed -n "s;^lddlflags='\(.*\)';\1;p" $_conf)
|
||||
_ldflags=$(sed -n "s;^ldflags='\(.*\)';\1;p" $_conf)
|
||||
_archlibexp=$(sed -n "s;^archlibexp='\(.*\)';\1;p" $_conf)
|
||||
|
||||
PERL_MM_USE_DEFAULT=1 PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$DESTDIR'" \
|
||||
PERL_MB_OPT="--installdirs vendor --destdir '$DESTDIR'" \
|
||||
LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
|
||||
perl Build.PL --config optimize="$_optimize" --config ccflags="$_ccflags" \
|
||||
--config lddlflags="$_lddlflags" --config ldflags="$_ldflags" \
|
||||
--config archlibexp="${XBPS_CROSS_BASE}${_archlibexp}" \
|
||||
${configure_args} INSTALLDIRS=vendor
|
||||
else
|
||||
msg_error "$pkgver: cannot find Build.PL for perl module!\n"
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
if [ ! -x ./Build ]; then
|
||||
msg_error "$pkgver: cannot find ./Build script!\n"
|
||||
fi
|
||||
LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./Build ${make_build_args}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
if [ ! -x ./Build ]; then
|
||||
msg_error "$pkgver: cannot find ./Build script!\n"
|
||||
fi
|
||||
${make_check_pre} ./Build test
|
||||
}
|
||||
|
||||
do_install() {
|
||||
if [ ! -x ./Build ]; then
|
||||
msg_error "$pkgver: cannot find ./Build script!\n"
|
||||
fi
|
||||
./Build ${make_install_args} install
|
||||
}
|
90
common/build-style/perl-module.sh
Normal file
90
common/build-style/perl-module.sh
Normal file
|
@ -0,0 +1,90 @@
|
|||
#
|
||||
# This helper does the required steps to be able to build and install
|
||||
# perl modules that use MakeMaker into the correct location.
|
||||
#
|
||||
# Required vars to be set by a template:
|
||||
#
|
||||
# build_style=perl-module
|
||||
#
|
||||
# Optionally if the module needs more directories to be configured other
|
||||
# than $XBPS_BUILDDIR/$wrksrc/$build_wrksrc, one can use (relative to
|
||||
# $wrksrc/$build_wrksrc):
|
||||
#
|
||||
# perl_configure_dirs="blob/bob foo/blah"
|
||||
#
|
||||
do_configure() {
|
||||
local perlmkf
|
||||
|
||||
local perlprefix=${XBPS_STATEDIR}/perlprefix-${XBPS_TARGET_MACHINE}
|
||||
mkdir -p $perlprefix
|
||||
if [ -d "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl" ]; then
|
||||
cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $perlprefix
|
||||
cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $perlprefix
|
||||
sed -i -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \
|
||||
${perlprefix}/Config.pm
|
||||
sed -i -e "s;^archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \
|
||||
${perlprefix}/Config_heavy.pl
|
||||
else
|
||||
cp "/usr/lib/perl5/core_perl/Config"*.p? $perlprefix
|
||||
cp "/usr/lib/perl5/core_perl/Errno.pm" $perlprefix
|
||||
fi
|
||||
export PERL5LIB=$perlprefix
|
||||
|
||||
if [ -f "${wrksrc}/${build_wrksrc:+$build_wrksrc/}Makefile.PL" ]; then
|
||||
sed -i "s,/usr/include,${XBPS_CROSS_BASE}/usr/include,g" \
|
||||
"${wrksrc}/${build_wrksrc:+$build_wrksrc/}Makefile.PL"
|
||||
fi
|
||||
|
||||
if [ -z "$perl_configure_dirs" ]; then
|
||||
perlmkf="$wrksrc/${build_wrksrc:+$build_wrksrc/}Makefile.PL"
|
||||
if [ ! -f "$perlmkf" ]; then
|
||||
msg_error "*** ERROR couldn't find $perlmkf, aborting ***\n"
|
||||
fi
|
||||
|
||||
cd "$wrksrc/${build_wrksrc:+$build_wrksrc}"
|
||||
PERL_MM_USE_DEFAULT=1 GCC="$CC" CC="$CC" LD="$CC" \
|
||||
OPTIMIZE="$CFLAGS" \
|
||||
CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include" \
|
||||
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
||||
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \
|
||||
perl -I. Makefile.PL ${configure_args} INSTALLDIRS=vendor
|
||||
fi
|
||||
|
||||
for i in ${perl_configure_dirs}; do
|
||||
perlmkf="$wrksrc/${build_wrksrc:+$build_wrksrc/}$i/Makefile.PL"
|
||||
if [ -f "$perlmkf" ]; then
|
||||
cd "$wrksrc/${build_wrksrc:+$build_wrksrc/}$i"
|
||||
PERL_MM_USE_DEFAULT=1 GCC="$CC" CC="$CC" LD="$CC" \
|
||||
OPTIMIZE="$CFLAGS" \
|
||||
CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include" \
|
||||
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
||||
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
||||
perl -I. Makefile.PL ${make_build_args} INSTALLDIRS=vendor
|
||||
else
|
||||
msg_error "*** ERROR: couldn't find $perlmkf, aborting **\n"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
${make_cmd} CC="$CC" LD="$CC" CFLAGS="$CFLAGS" OPTIMIZE="$CFLAGS" \
|
||||
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
||||
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
||||
${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_check_target:=test}
|
||||
|
||||
${make_check_pre} ${make_cmd} ${makejobs} ${make_check_args} ${make_check_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
|
||||
}
|
96
common/build-style/python-module.sh
Normal file
96
common/build-style/python-module.sh
Normal file
|
@ -0,0 +1,96 @@
|
|||
#
|
||||
# This helper is for templates installing python modules.
|
||||
#
|
||||
|
||||
do_build() {
|
||||
: ${python_versions:="2.7 $py3_ver"}
|
||||
local pyver= tmp_cflags="$CFLAGS" tmp_ldflags="$LDFLAGS"
|
||||
|
||||
for pyver in $python_versions; do
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
CFLAGS="$tmp_cflags"
|
||||
LDFLAGS="$tmp_ldflags"
|
||||
ADDENV=
|
||||
|
||||
PYPREFIX="$XBPS_CROSS_BASE"
|
||||
CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||
LDSHARED="${CC} -shared $LDFLAGS"
|
||||
case $pyver in
|
||||
3.*)
|
||||
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
||||
f=${f##*/}
|
||||
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
||||
done
|
||||
ADDENV+=" PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}"
|
||||
ADDENV+=" _PYTHON_SYSCONFIGDATA_NAME="$_PYTHON_SYSCONFIGDATA_NAME""
|
||||
esac
|
||||
env CC="$CC" LDSHARED="$LDSHARED" $ADDENV \
|
||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||
LDFLAGS="$LDFLAGS" python${pyver} setup.py \
|
||||
build --build-base=build-${pyver} ${make_build_args}
|
||||
else
|
||||
python${pyver} setup.py build --build-base=build-${pyver} ${make_build_args}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
do_check() {
|
||||
: ${python_versions:="2.7 $py3_ver"}
|
||||
|
||||
for pyver in $python_versions; do
|
||||
ln -s build-${pyver} build
|
||||
if [ -z "$make_check_target" ]; then
|
||||
if ! python${pyver} setup.py --help test >/dev/null 2>&1; then
|
||||
msg_warn "No command 'test' defined by setup.py for python${pyver}.\n"
|
||||
rm build
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
${make_check_pre} python${pyver} setup.py ${make_check_target:-test} ${make_check_args}
|
||||
rm build
|
||||
done
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${python_versions:="2.7 $py3_ver"}
|
||||
local pyver=
|
||||
|
||||
for pyver in $python_versions; do
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
ADDENV=
|
||||
PYPREFIX="$XBPS_CROSS_BASE"
|
||||
CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||
LDSHARED="${CC} -shared $LDFLAGS"
|
||||
case $pyver in
|
||||
3.*)
|
||||
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
||||
f=${f##*/}
|
||||
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
||||
done
|
||||
ADDENV+=" PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}"
|
||||
ADDENV+=" _PYTHON_SYSCONFIGDATA_NAME="$_PYTHON_SYSCONFIGDATA_NAME""
|
||||
esac
|
||||
env CC="$CC" LDSHARED="$LDSHARED" $ADDENV \
|
||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||
LDFLAGS="$LDFLAGS" python${pyver} setup.py \
|
||||
build --build-base=build-${pyver} \
|
||||
install --prefix=/usr --root=${DESTDIR} ${make_install_args}
|
||||
else
|
||||
python${pyver} setup.py build --build-base=build-${pyver} \
|
||||
install --prefix=/usr --root=${DESTDIR} ${make_install_args}
|
||||
fi
|
||||
|
||||
# Rename unversioned scripts to avoid name conflicts.
|
||||
if [ -d ${DESTDIR}/usr/bin ]; then
|
||||
find ${DESTDIR}/usr/bin -type f ! -name "*[[:digit:]]" | while IFS= read -r f _; do
|
||||
mv "${f}" "${f}${pyver%.*}"
|
||||
echo "[python-module] Unversioned script renamed to '${f#$DESTDIR}${pyver%.*}'"
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
34
common/build-style/python2-module.sh
Normal file
34
common/build-style/python2-module.sh
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# This helper is for templates installing python2-only modules.
|
||||
#
|
||||
|
||||
do_build() {
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
PYPREFIX="$XBPS_CROSS_BASE"
|
||||
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py2_inc} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py2_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||
LDSHARED="${CC} -shared $LDFLAGS"
|
||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||
LDFLAGS="$LDFLAGS" python2 setup.py build ${make_build_args}
|
||||
else
|
||||
python2 setup.py build ${make_build_args}
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
PYPREFIX="$XBPS_CROSS_BASE"
|
||||
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py2_inc} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py2_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||
LDSHARED="${CC} -shared $LDFLAGS"
|
||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||
LDFLAGS="$LDFLAGS" python2 setup.py \
|
||||
install --prefix=/usr --root=${DESTDIR} ${make_install_args}
|
||||
else
|
||||
python2 setup.py install --prefix=/usr --root=${DESTDIR} ${make_install_args}
|
||||
fi
|
||||
}
|
34
common/build-style/python3-module.sh
Normal file
34
common/build-style/python3-module.sh
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# This helper is for templates installing python3-only modules.
|
||||
#
|
||||
|
||||
do_build() {
|
||||
python3 setup.py build ${make_build_args}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
local testjobs
|
||||
if python3 -c 'import pytest' >/dev/null 2>&1; then
|
||||
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
||||
testjobs="-n $XBPS_MAKEJOBS"
|
||||
fi
|
||||
PYTHONPATH="$(cd build/lib* && pwd)" \
|
||||
${make_check_pre} \
|
||||
python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
|
||||
else
|
||||
# Fall back to deprecated setup.py test orchestration without pytest
|
||||
if [ -z "$make_check_target" ]; then
|
||||
if ! python3 setup.py --help test >/dev/null 2>&1; then
|
||||
msg_warn "No command 'test' defined by setup.py.\n"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
: ${make_check_target:=test}
|
||||
${make_check_pre} python3 setup.py ${make_check_target} ${make_check_args}
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
python3 setup.py install --prefix=/usr --root=${DESTDIR} ${make_install_args}
|
||||
}
|
33
common/build-style/python3-pep517.sh
Normal file
33
common/build-style/python3-pep517.sh
Normal file
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
# This style is for templates installing python3 modules adhering to PEP517
|
||||
#
|
||||
|
||||
do_build() {
|
||||
: ${make_build_target:=.}
|
||||
: ${make_build_args:=--no-isolation --wheel}
|
||||
python3 -m build ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_check() {
|
||||
local testjobs
|
||||
if python3 -c 'import pytest' >/dev/null 2>&1; then
|
||||
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
||||
testjobs="-n $XBPS_MAKEJOBS"
|
||||
fi
|
||||
${make_check_pre} python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
|
||||
else
|
||||
msg_warn "Unable to determine tests for PEP517 Python templates\n"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
if [ -z "${make_install_target}" ]; then
|
||||
# Default wheel name normalizes hyphens to underscores
|
||||
local wheelbase="${pkgname#python3-}"
|
||||
make_install_target="dist/${wheelbase//-/_}-${version}-*-*-*.whl"
|
||||
fi
|
||||
|
||||
python3 -m installer --destdir ${DESTDIR} \
|
||||
${make_install_args} ${make_install_target}
|
||||
}
|
143
common/build-style/qmake.sh
Normal file
143
common/build-style/qmake.sh
Normal file
|
@ -0,0 +1,143 @@
|
|||
#
|
||||
# This helper is for templates using Qt5/Qt6 qmake.
|
||||
#
|
||||
do_configure() {
|
||||
local qmake
|
||||
local qmake_args
|
||||
if [ -x "/usr/lib/qt5/bin/qmake" ]; then
|
||||
qmake="/usr/lib/qt5/bin/qmake"
|
||||
fi
|
||||
if [ -z "${qmake}" ]; then
|
||||
msg_error "${pkgver}: Could not find qmake - missing in hostmakedepends?\n"
|
||||
fi
|
||||
if [ "$CROSS_BUILD" ] && [ "$qmake" == "/usr/lib/qt5/bin/qmake" ]; then
|
||||
case $XBPS_TARGET_MACHINE in
|
||||
i686*) _qt_arch=i386;;
|
||||
x86_64*) _qt_arch=x86_64;;
|
||||
aarch64*) _qt_arch=arm64;;
|
||||
arm*) _qt_arch=arm;;
|
||||
mips*) _qt_arch=mips;;
|
||||
ppc64*) _qt_arch=power64;;
|
||||
ppc*) _qt_arch=power;;
|
||||
esac
|
||||
mkdir -p "${wrksrc}/.target-spec/linux-g++"
|
||||
cat > "${wrksrc}/.target-spec/linux-g++/qmake.conf" <<_EOF
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
CONFIG += incremental no_qt_rpath
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
|
||||
include(/usr/lib/qt5/mkspecs/common/linux.conf)
|
||||
include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
|
||||
include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
|
||||
|
||||
QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
|
||||
QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
|
||||
QMAKEMODULES = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/modules
|
||||
QMAKE_CC = ${CC}
|
||||
QMAKE_CXX = ${CXX}
|
||||
QMAKE_LINK = ${CXX}
|
||||
QMAKE_LINK_C = ${CC}
|
||||
QMAKE_LINK_SHLIB = ${CXX}
|
||||
|
||||
QMAKE_AR = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
|
||||
QMAKE_OBJCOPY = ${OBJCOPY}
|
||||
QMAKE_NM = ${NM} -P
|
||||
QMAKE_STRIP = ${STRIP}
|
||||
|
||||
QMAKE_CFLAGS = ${CFLAGS}
|
||||
QMAKE_CXXFLAGS = ${CXXFLAGS}
|
||||
QMAKE_LFLAGS = ${LDFLAGS}
|
||||
load(qt_config)
|
||||
_EOF
|
||||
echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
|
||||
|
||||
mkdir -p "${wrksrc}/.host-spec/linux-g++"
|
||||
cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
CONFIG += incremental no_qt_rpath
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
|
||||
include(/usr/lib/qt5/mkspecs/common/linux.conf)
|
||||
include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
|
||||
include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
|
||||
|
||||
QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
|
||||
QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
|
||||
QMAKE_CC = ${CC_host}
|
||||
QMAKE_CXX = ${CXX_host}
|
||||
QMAKE_LINK = ${CXX_host}
|
||||
QMAKE_LINK_C = ${CC_host}
|
||||
QMAKE_LINK_SHLIB = ${CXX_host}
|
||||
|
||||
QMAKE_AR = gcc-ar cqs
|
||||
QMAKE_OBJCOPY = ${OBJCOPY_host}
|
||||
QMAKE_NM = ${NM_host} -P
|
||||
QMAKE_STRIP = ${STRIP_host}
|
||||
|
||||
QMAKE_CFLAGS = ${CFLAGS_host}
|
||||
QMAKE_CXXFLAGS = ${CXXFLAGS_host}
|
||||
QMAKE_LFLAGS = ${LDFLAGS_host}
|
||||
load(qt_config)
|
||||
_EOF
|
||||
echo '#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
|
||||
cat > "${wrksrc}/qt.conf" <<_EOF
|
||||
[Paths]
|
||||
Sysroot=${XBPS_CROSS_BASE}
|
||||
Prefix=/usr
|
||||
ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
|
||||
Data=${XBPS_CROSS_BASE}/usr/share/qt5
|
||||
Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
|
||||
Headers=${XBPS_CROSS_BASE}/usr/include/qt5
|
||||
Libraries=${XBPS_CROSS_BASE}/usr/lib
|
||||
LibraryExecutables=/usr/lib/qt5/libexec
|
||||
Binaries=/usr/lib/qt5/bin
|
||||
Tests=${XBPS_CROSS_BASE}/usr/tests
|
||||
Plugins=/usr/lib/qt5/plugins
|
||||
Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/imports
|
||||
Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/qml
|
||||
Translations=${XBPS_CROSS_BASE}/usr/share/qt5/translations
|
||||
Settings=${XBPS_CROSS_BASE}/etc/xdg
|
||||
Examples=${XBPS_CROSS_BASE}/usr/share/qt5/examples
|
||||
HostPrefix=/usr
|
||||
HostData=/usr/lib/qt5
|
||||
HostBinaries=/usr/lib/qt5/bin
|
||||
HostLibraries=/usr/lib
|
||||
Spec=${wrksrc}/.host-spec/linux-g++
|
||||
TargetSpec=${wrksrc}/.target-spec/linux-g++
|
||||
_EOF
|
||||
qmake_args="-qtconf ${wrksrc}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/${PKG_CONFIG}"
|
||||
${qmake} ${qmake_args} \
|
||||
PREFIX=/usr \
|
||||
QT_INSTALL_PREFIX=/usr \
|
||||
LIB=/usr/lib \
|
||||
QT_TARGET_ARCH=$_qt_arch \
|
||||
${configure_args}
|
||||
else
|
||||
${qmake} ${qmake_args} \
|
||||
PREFIX=/usr \
|
||||
QT_INSTALL_PREFIX=/usr \
|
||||
LIB=/usr/lib \
|
||||
QMAKE_CC=$CC QMAKE_CXX=$CXX \
|
||||
QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
|
||||
QMAKE_CFLAGS="${CFLAGS}" \
|
||||
QMAKE_CXXFLAGS="${CXXFLAGS}" \
|
||||
QMAKE_LFLAGS="${LDFLAGS}" \
|
||||
CONFIG+=no_qt_rpath \
|
||||
${configure_args}
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} \
|
||||
CC="$CC" CXX="$CXX" LINK="$CXX"
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
${make_cmd} STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} \
|
||||
INSTALL_ROOT=${DESTDIR} ${make_install_args} ${make_install_target}
|
||||
}
|
16
common/build-style/raku-dist.sh
Normal file
16
common/build-style/raku-dist.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# This helper is for Raku package templates.
|
||||
#
|
||||
|
||||
do_check() {
|
||||
RAKULIB=lib ${make_check_pre} prove -r -e raku t/
|
||||
}
|
||||
|
||||
do_install() {
|
||||
export RAKUDO_LOG_PRECOMP=1
|
||||
export RAKUDO_RERESOLVE_DEPENDENCIES=0
|
||||
raku-install-dist \
|
||||
--to=${DESTDIR}/usr/lib/raku/vendor \
|
||||
--for=vendor \
|
||||
--from=.
|
||||
}
|
13
common/build-style/ruby-module.sh
Normal file
13
common/build-style/ruby-module.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# This helper is for templates installing ruby modules.
|
||||
#
|
||||
|
||||
do_install() {
|
||||
local _vendorlibdir=$(ruby -e 'puts RbConfig::CONFIG["vendorlibdir"]')
|
||||
|
||||
if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
|
||||
_vendorlibdir="${_vendorlibdir//lib$XBPS_WORDSIZE/lib$XBPS_TARGET_WORDSIZE}"
|
||||
fi
|
||||
|
||||
LANG=C ruby install.rb --destdir=${DESTDIR} --sitelibdir=${_vendorlibdir} ${make_install_args}
|
||||
}
|
35
common/build-style/scons.sh
Normal file
35
common/build-style/scons.sh
Normal file
|
@ -0,0 +1,35 @@
|
|||
#
|
||||
# This helper is for templates using scons.
|
||||
#
|
||||
do_build() {
|
||||
: ${make_cmd:=scons}
|
||||
|
||||
${make_cmd} ${makejobs} CC=$CC CXX=$CXX CCFLAGS="$CFLAGS" \
|
||||
cc=$CC cxx=$CXX ccflags="$CFLAGS" \
|
||||
CXXFLAGS="$CXXFLAGS" LINKFLAGS="$LDFLAGS" \
|
||||
cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" \
|
||||
RANLIB="$RANLIB" ranlib="$RANLIB" \
|
||||
prefix=/usr \
|
||||
${scons_use_destdir:+DESTDIR="${DESTDIR}"} \
|
||||
${scons_use_destdir:+destdir="${DESTDIR}"} \
|
||||
${make_build_args} ${make_build_target}
|
||||
}
|
||||
do_install() {
|
||||
: ${make_cmd:=scons}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
local _sandbox=
|
||||
|
||||
if [ -z "$scons_use_destdir" ]; then _sandbox=yes ; fi
|
||||
|
||||
${make_cmd} ${makejobs} CC=$CC CXX=$CXX CCFLAGS="$CFLAGS" \
|
||||
cc=$CC cxx=$CXX ccflags="$CFLAGS" \
|
||||
CXXFLAGS="$CXXFLAGS" LINKFLAGS="$LDFLAGS" \
|
||||
cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" \
|
||||
RANLIB="$RANLIB" ranlib="$RANLIB" \
|
||||
prefix=/usr \
|
||||
${scons_use_destdir:+DESTDIR="${DESTDIR}"} \
|
||||
${scons_use_destdir:+destdir="${DESTDIR}"} \
|
||||
${_sandbox:+--install-sandbox="${DESTDIR}"} \
|
||||
${make_install_args} ${make_install_target}
|
||||
}
|
147
common/build-style/sip-build.sh
Normal file
147
common/build-style/sip-build.sh
Normal file
|
@ -0,0 +1,147 @@
|
|||
#
|
||||
# This helper is for templates using sip-build.
|
||||
#
|
||||
|
||||
do_configure() {
|
||||
local _qt=
|
||||
local _spec=
|
||||
local _mkspec=
|
||||
|
||||
: "${sip_builddir:=build}"
|
||||
mkdir -p "$sip_builddir"
|
||||
|
||||
if [ ! -d /$py3_sitelib/pyqtbuild ]; then
|
||||
: "who uses sip-build without qmake anyway?"
|
||||
elif [ -x /usr/lib/qt6/bin/qmake ]; then
|
||||
_qt=qt6
|
||||
elif [ -x /usr/lib/qt5/bin/qmake ]; then
|
||||
_qt=qt5
|
||||
else
|
||||
msg_error 'qmake not found\n'
|
||||
fi
|
||||
|
||||
if [ ! "$_qt" ]; then
|
||||
: "who use sip-build without qmake anyway?"
|
||||
elif [ "$CROSS_BUILD" ]; then
|
||||
_mkspec="usr/lib/$_qt/mkspecs"
|
||||
_spec="$XBPS_WRAPPERDIR/sip-build/target-spec/linux-g++"
|
||||
mkdir -p "$_spec"
|
||||
cat >"$_spec/qmake.conf" <<-_EOF
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
CONFIG += incremental no_qt_rpath
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
|
||||
include(/$_mkspec/common/linux.conf)
|
||||
include(/$_mkspec/common/gcc-base-unix.conf)
|
||||
include(/$_mkspec/common/g++-unix.conf)
|
||||
|
||||
QMAKE_TARGET_CONFIG = $XBPS_CROSS_BASE/$_mkspec/qconfig.pri
|
||||
QMAKE_TARGET_MODULE = $XBPS_CROSS_BASE/$_mkspec/qmodule.pri
|
||||
QMAKEMODULES = $XBPS_CROSS_BASE/$_mkspec/modules
|
||||
QMAKE_CC = $CC
|
||||
QMAKE_CXX = $CXX
|
||||
QMAKE_LINK = $CXX
|
||||
QMAKE_LINK_C = $CC
|
||||
QMAKE_LINK_SHLIB = $CXX
|
||||
|
||||
QMAKE_AR = $XBPS_CROSS_TRIPLET-gcc-ar cqs
|
||||
QMAKE_OBJCOPY = $OBJCOPY
|
||||
QMAKE_NM = $NM -P
|
||||
QMAKE_STRIP = $STRIP
|
||||
|
||||
QMAKE_CFLAGS = $CFLAGS -I$XBPS_CROSS_BASE/usr/include/python$py3_ver
|
||||
QMAKE_CXXFLAGS = $CXXFLAGS -I$XBPS_CROSS_BASE/usr/include/python$py3_ver
|
||||
QMAKE_LFLAGS = -L$XBPS_CROSS_BASE/usr/lib $LDFLAGS
|
||||
load(qt_config)
|
||||
_EOF
|
||||
|
||||
printf '#include "%s/%s/linux-g++/qplatformdefs.h"\n' \
|
||||
"$XBPS_CROSS_BASE" "$_mkspec" >"$_spec/qplatformdefs.h"
|
||||
cat >"$XBPS_WRAPPERDIR/sip-build/qt.conf" <<-_EOF
|
||||
[Paths]
|
||||
Sysroot=$XBPS_CROSS_BASE
|
||||
Prefix=$XBPS_CROSS_BASE/usr
|
||||
ArchData=$XBPS_CROSS_BASE/usr/lib/$_qt
|
||||
Data=$XBPS_CROSS_BASE/usr/share/$_qt
|
||||
Documentation=$XBPS_CROSS_BASE/usr/share/doc/$_qt
|
||||
Headers=$XBPS_CROSS_BASE/usr/include/$_qt
|
||||
Libraries=$XBPS_CROSS_BASE/usr/lib
|
||||
LibraryExecutables=/usr/lib/$_qt/libexec
|
||||
Binaries=/usr/lib/$_qt/bin
|
||||
Tests=$XBPS_CROSS_BASE/usr/tests
|
||||
Plugins=/usr/lib/$_qt/plugins
|
||||
Imports=$XBPS_CROSS_BASE/usr/lib/$_qt/imports
|
||||
Qml2Imports=$XBPS_CROSS_BASE/usr/lib/$_qt/qml
|
||||
Translations=$XBPS_CROSS_BASE/usr/share/$_qt/translations
|
||||
Settings=$XBPS_CROSS_BASE/etc/xdg
|
||||
Examples=$XBPS_CROSS_BASE/usr/share/$_qt/examples
|
||||
HostPrefix=/usr
|
||||
HostData=/usr/lib/$_qt
|
||||
HostBinaries=/usr/lib/$_qt/bin
|
||||
HostLibraries=/usr/lib
|
||||
HostLibraryExecutables=/usr/lib/$_qt/libexec
|
||||
Spec=linux-g++
|
||||
TargetSpec=$_spec
|
||||
_EOF
|
||||
# Call it sip-qmake to not override qmake build-helper
|
||||
#
|
||||
# XXX: Intentionally quote {C,CXX,LD}FLAGS here but not native.
|
||||
# - Cross Build:
|
||||
# + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS
|
||||
# + hardening flags will be picked up from environment variables
|
||||
# - Native Build:
|
||||
# + hardening flags will be picked up first (Makefile, qt.conf?)
|
||||
# + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS
|
||||
# Maybe there're better workaround, I don't know.
|
||||
cat >"$XBPS_WRAPPERDIR/sip-qmake" <<-_EOF
|
||||
#!/bin/sh
|
||||
exec /usr/lib/$_qt/bin/qmake "\$@" \\
|
||||
-qtconf "$XBPS_WRAPPERDIR/sip-build/qt.conf" \\
|
||||
PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/${PKG_CONFIG} \\
|
||||
QMAKE_CFLAGS+="\$CFLAGS" \\
|
||||
QMAKE_CXXFLAGS+="\$CXXFLAGS" \\
|
||||
QMAKE_LFLAGS+="\$LDFLAGS"
|
||||
_EOF
|
||||
chmod 755 ${XBPS_WRAPPERDIR}/sip-qmake
|
||||
else
|
||||
cat >"${XBPS_WRAPPERDIR}/sip-qmake" <<-_EOF
|
||||
#!/bin/sh
|
||||
exec /usr/lib/$_qt/bin/qmake \\
|
||||
"\$@" \\
|
||||
PREFIX=/usr \\
|
||||
QT_INSTALL_PREFIX=/usr \\
|
||||
LIB=/usr/lib \\
|
||||
QMAKE_CC="$CC" QMAKE_CXX="$CXX" \\
|
||||
QMAKE_LINK="$CXX" QMAKE_LINK_C="$CC" \\
|
||||
QMAKE_CFLAGS+="$CFLAGS" \\
|
||||
QMAKE_CXXFLAGS+="$CXXFLAGS" \\
|
||||
QMAKE_LFLAGS+="$LDFLAGS" \\
|
||||
CONFIG+=no_qt_rpath
|
||||
_EOF
|
||||
chmod 755 ${XBPS_WRAPPERDIR}/sip-qmake
|
||||
fi
|
||||
|
||||
sip-build --no-make \
|
||||
${_qt:+--qmake "$XBPS_WRAPPERDIR/sip-qmake"} \
|
||||
--api-dir /usr/share/$_qt/qsci/api/python \
|
||||
$configure_args \
|
||||
--build-dir "$sip_builddir"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
# -I/usr/include/python$py3_ver is set by sip-build :(
|
||||
find "$sip_builddir" -name Makefile |
|
||||
xargs sed -i "s,-I\\(/usr/include\\),-I$XBPS_CROSS_BASE\\1,g"
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: "${sip_builddir:=build}"
|
||||
make -C "${sip_builddir}" ${makejobs}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: "${sip_builddir:=build}"
|
||||
make -C "${sip_builddir}" \
|
||||
DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} \
|
||||
install
|
||||
}
|
33
common/build-style/slashpackage.sh
Normal file
33
common/build-style/slashpackage.sh
Normal file
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
# This helper is for templates building slashpackage software.
|
||||
# http://cr.yp.to/slashpackage.html
|
||||
#
|
||||
# required variables
|
||||
#
|
||||
# build_style=slashpackage
|
||||
# build_wrksrc=${pkgname}-${version}
|
||||
# distfiles=<download link>
|
||||
#
|
||||
# example (daemontools)
|
||||
#
|
||||
# Template file for 'daemontools'
|
||||
# pkgname=daemontools
|
||||
# version=0.76
|
||||
# revision=1
|
||||
# build_wrksrc=${pkgname}-${version}
|
||||
# build_style=slashpackage
|
||||
# short_desc="A collection of tools for managing UNIX services"
|
||||
# maintainer="bougyman <tj@geoforce.com>"
|
||||
# license="Public Domain"
|
||||
# homepage="http://cr.yp.to/daemontools.html"
|
||||
# distfiles="http://cr.yp.to/daemontools/${pkgname}-${version}.tar.gz"
|
||||
|
||||
do_build() {
|
||||
package/compile
|
||||
}
|
||||
|
||||
do_install() {
|
||||
for command in command/*; do
|
||||
vbin $command
|
||||
done
|
||||
}
|
70
common/build-style/texmf.sh
Normal file
70
common/build-style/texmf.sh
Normal file
|
@ -0,0 +1,70 @@
|
|||
do_build() {
|
||||
local f p
|
||||
# Extract the source files
|
||||
mkdir -p "build/usr/share/texmf-dist"
|
||||
find . -maxdepth 1 -print -name "*.tar.xz" \
|
||||
-exec bsdtar -C "build/usr/share/texmf-dist" -xf {} \;
|
||||
cd "build/usr/share/texmf-dist/"
|
||||
# Everything in usr/share/texmf-dist/texmf-dist should really be in
|
||||
# usr/share/texmf-dist, so we move it
|
||||
if [ -d "texmf-dist" ] ; then
|
||||
rsync -ar texmf-dist/ ./
|
||||
rm -rf texmf-dist/
|
||||
fi
|
||||
# LICENSEs are unneeded
|
||||
rm -f LICENSE*
|
||||
|
||||
# We have some conflicting files between different packages. To work
|
||||
# around this, we use an ownership file that maps which conflicting
|
||||
# files should be in which packages. Here, each file in the map list is
|
||||
# checked whether it is in the package, and if it shouldn't be it is
|
||||
# removed.
|
||||
while IFS=' ' read -r f p ; do
|
||||
if [ "$p" = "$pkgname" ] && ! [ -e "$f" ]; then
|
||||
# Error out if the ownership map expects this package to have a
|
||||
# file but it dosen't
|
||||
msg_error "$pkgver: missing file $f\n"
|
||||
elif [ "$p" != "$pkgname" ] && [ -e "$f" ]; then
|
||||
# Remove a file that according to the ownership map belongs to
|
||||
# another file
|
||||
echo "removed $f"
|
||||
# Install a file that lists the removed packages
|
||||
mkdir -p ../texlive/removed
|
||||
echo "$f" >> ../texlive/removed/$pkgname.txt
|
||||
rm -f "$f"
|
||||
fi
|
||||
done < "${XBPS_COMMONDIR}/environment/build-style/texmf/ownership.txt"
|
||||
}
|
||||
|
||||
do_check() {
|
||||
# This is essentially a helper for generating the ownership map. It checks
|
||||
# to see if there are any conflicts between all of the different packages.
|
||||
local f p current_ver current_rev exitcode=0
|
||||
cd build
|
||||
|
||||
while read p; do
|
||||
# Don't check against the texlive-bin* packages, ourselves, -dbg or -32bit pkgs
|
||||
if [[ ${p%-*} =~ .*-bin$ ]] || [ "${p%-*}" = "$pkgname" ] || [[ ${p%-*} =~ .*-dbg$ ]] || [[ ${p%-*} =~ .*-32bit$ ]]; then
|
||||
continue
|
||||
fi
|
||||
# Don't check against any version other than the version in the source tree
|
||||
current_ver="$(grep -m 1 version= ${XBPS_SRCPKGDIR}/${p%-*}/template | cut -d= -f2)"
|
||||
current_rev="$(grep -m 1 revision= ${XBPS_SRCPKGDIR}/${p%-*}/template | cut -d= -f2)"
|
||||
if [ "${p%-*}-${current_ver}_${current_rev}" != "${p}" ]; then
|
||||
# They are not the same version
|
||||
continue
|
||||
fi
|
||||
echo checking conflicts with ${p}...
|
||||
while IFS= read -r f; do
|
||||
if [ -e ".$f" ]; then
|
||||
msg_red "both contain file $f\n"
|
||||
exitcode=1
|
||||
fi
|
||||
done < <(xbps-query -Rf $p | sed 's/ -> .*//')
|
||||
done < <(xbps-query -Rs texlive -p pkgver | cut -d : -f 1)
|
||||
return $exitcode
|
||||
}
|
||||
|
||||
do_install() {
|
||||
vcopy build/usr .
|
||||
}
|
640
common/build-style/void-cross.sh
Normal file
640
common/build-style/void-cross.sh
Normal file
|
@ -0,0 +1,640 @@
|
|||
#
|
||||
# This helper is for void system crosstoolchain templates.
|
||||
#
|
||||
# Optional variables:
|
||||
#
|
||||
# - cross_gcc_skip_go - do not build gccgo support
|
||||
# - cross_binutils_configure_args
|
||||
# - cross_gcc_bootstrap_configure_args
|
||||
# - cross_gcc_configure_args
|
||||
# - cross_glibc_cflags
|
||||
# - cross_glibc_ldflags
|
||||
# - cross_glibc_configure_args
|
||||
# - cross_musl_cflags
|
||||
# - cross_musl_ldflags
|
||||
# - cross_musl_configure_args
|
||||
#
|
||||
# configure_args is passed to both bootstrap gcc and final gcc
|
||||
# if you need to pass some to one and not the other, use the
|
||||
# respective cross_ variables for final gcc and bootstrap gcc
|
||||
#
|
||||
|
||||
_void_cross_apply_patch() {
|
||||
local pname="$(basename $1)"
|
||||
if [ ! -f ".${pname}_done" ]; then
|
||||
patch -Np1 $args -i $1
|
||||
touch .${pname}_done
|
||||
fi
|
||||
}
|
||||
|
||||
_void_cross_build_binutils() {
|
||||
[ -f ${wrksrc}/.binutils_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
|
||||
msg_normal "Patching binutils for ${tgt}\n"
|
||||
|
||||
cd ${wrksrc}/binutils-${ver}
|
||||
if [ -d "${XBPS_SRCPKGDIR}/binutils/patches" ]; then
|
||||
for f in ${XBPS_SRCPKGDIR}/binutils/patches/*.patch; do
|
||||
_void_cross_apply_patch "$f"
|
||||
done
|
||||
fi
|
||||
cd ..
|
||||
|
||||
msg_normal "Building binutils for ${tgt}\n"
|
||||
|
||||
mkdir -p ${wrksrc}/binutils_build
|
||||
cd ${wrksrc}/binutils_build
|
||||
|
||||
../binutils-${ver}/configure \
|
||||
--prefix=/usr \
|
||||
--sbindir=/usr/bin \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/lib \
|
||||
--target=${tgt} \
|
||||
--with-sysroot=/usr/${tgt} \
|
||||
--disable-nls \
|
||||
--disable-shared \
|
||||
--disable-multilib \
|
||||
--disable-werror \
|
||||
--disable-gold \
|
||||
--enable-relro \
|
||||
--enable-plugins \
|
||||
--enable-64-bit-bfd \
|
||||
--enable-deterministic-archives \
|
||||
--enable-default-hash-style=gnu \
|
||||
--with-system-zlib \
|
||||
--with-mmap \
|
||||
--with-pic \
|
||||
${cross_binutils_configure_args}
|
||||
|
||||
make configure-host
|
||||
make ${makejobs}
|
||||
|
||||
make install DESTDIR=${wrksrc}/build_root
|
||||
|
||||
touch ${wrksrc}/.binutils_done
|
||||
}
|
||||
|
||||
_void_cross_build_bootstrap_gcc() {
|
||||
[ -f ${wrksrc}/.gcc_bootstrap_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
|
||||
msg_normal "Patching GCC for ${tgt}\n"
|
||||
|
||||
cd ${wrksrc}/gcc-${ver}
|
||||
|
||||
# Do not run fixincludes
|
||||
sed -i 's@./fixinc.sh@-c true@' Makefile.in
|
||||
|
||||
for f in ${XBPS_SRCPKGDIR}/gcc/patches/*.patch; do
|
||||
_void_cross_apply_patch "$f"
|
||||
done
|
||||
if [ -f ${wrksrc}/.musl_version ]; then
|
||||
for f in ${XBPS_SRCPKGDIR}/gcc/files/*-musl.patch; do
|
||||
_void_cross_apply_patch "$f"
|
||||
done
|
||||
fi
|
||||
cd ..
|
||||
|
||||
msg_normal "Building bootstrap GCC for ${tgt}\n"
|
||||
|
||||
mkdir -p gcc_bootstrap
|
||||
cd gcc_bootstrap
|
||||
|
||||
local extra_args
|
||||
if [ -f ${wrksrc}/.musl_version ]; then
|
||||
extra_args+=" --with-newlib"
|
||||
extra_args+=" --disable-symvers"
|
||||
extra_args+=" libat_cv_have_ifunc=no"
|
||||
else
|
||||
extra_args+=" --without-headers"
|
||||
fi
|
||||
|
||||
../gcc-${ver}/configure \
|
||||
--prefix=/usr \
|
||||
--sbindir=/usr/bin \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/lib \
|
||||
--target=${tgt} \
|
||||
--disable-nls \
|
||||
--disable-multilib \
|
||||
--disable-shared \
|
||||
--disable-libquadmath \
|
||||
--disable-decimal-float \
|
||||
--disable-libgomp \
|
||||
--disable-libmpx \
|
||||
--disable-libmudflap \
|
||||
--disable-libssp \
|
||||
--disable-libitm \
|
||||
--disable-libatomic \
|
||||
--disable-threads \
|
||||
--disable-sjlj-exceptions \
|
||||
--enable-languages=c \
|
||||
--with-gnu-ld \
|
||||
--with-gnu-as \
|
||||
${extra_args} \
|
||||
${configure_args} \
|
||||
${cross_gcc_bootstrap_configure_args}
|
||||
|
||||
make ${makejobs}
|
||||
make install DESTDIR=${wrksrc}/build_root
|
||||
|
||||
local ptrs=$(${tgt}-gcc -dM -E - < /dev/null | \
|
||||
grep __SIZEOF_POINTER__)
|
||||
local ws=${ptrs##* }
|
||||
|
||||
case ${ws} in
|
||||
8) echo 64 > ${wrksrc}/.gcc_wordsize ;;
|
||||
4) echo 32 > ${wrksrc}/.gcc_wordsize ;;
|
||||
*) msg_error "Unknown word size: ${ws}\n" ;;
|
||||
esac
|
||||
|
||||
touch ${wrksrc}/.gcc_bootstrap_done
|
||||
}
|
||||
|
||||
_void_cross_build_kernel_headers() {
|
||||
[ -f ${wrksrc}/.linux_headers_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
local arch
|
||||
|
||||
msg_normal "Patching Linux headers for ${tgt}\n"
|
||||
|
||||
cd ${wrksrc}/linux-${ver}
|
||||
if [ -d "${XBPS_SRCPKGDIR}/kernel-libc-headers/patches" ]; then
|
||||
for f in ${XBPS_SRCPKGDIR}/kernel-libc-headers/patches/*.patch; do
|
||||
_void_cross_apply_patch "$f"
|
||||
done
|
||||
fi
|
||||
cd ..
|
||||
|
||||
msg_normal "Building Linux headers for ${tgt}\n"
|
||||
|
||||
cd linux-${ver}
|
||||
|
||||
case "$tgt" in
|
||||
x86_64*|i686*) arch=x86 ;;
|
||||
powerpc*) arch=powerpc ;;
|
||||
mips*) arch=mips ;;
|
||||
aarch64*) arch=arm64 ;;
|
||||
arm*) arch=arm ;;
|
||||
riscv*) arch=riscv ;;
|
||||
s390*) arch=s390 ;;
|
||||
*) msg_error "Unknown Linux arch for ${tgt}\n" ;;
|
||||
esac
|
||||
|
||||
make ARCH=${arch} headers
|
||||
find usr/include -name '.*' -delete
|
||||
rm usr/include/Makefile
|
||||
rm -r usr/include/drm
|
||||
cp -a usr/include ${wrksrc}/build_root/usr/${tgt}/usr
|
||||
|
||||
touch ${wrksrc}/.linux_headers_done
|
||||
}
|
||||
|
||||
_void_cross_build_glibc_headers() {
|
||||
[ -f ${wrksrc}/.glibc_headers_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
|
||||
msg_normal "Patching glibc for ${tgt}\n"
|
||||
|
||||
cd ${wrksrc}/glibc-${ver}
|
||||
if [ -d "${XBPS_SRCPKGDIR}/glibc/patches" ]; then
|
||||
for f in ${XBPS_SRCPKGDIR}/glibc/patches/*.patch; do
|
||||
_void_cross_apply_patch "$f"
|
||||
done
|
||||
fi
|
||||
cd ..
|
||||
|
||||
msg_normal "Building glibc headers for ${tgt}\n"
|
||||
|
||||
mkdir -p glibc_headers
|
||||
cd glibc_headers
|
||||
|
||||
echo "libc_cv_forced_unwind=yes" > config.cache
|
||||
echo "libc_cv_c_cleanup=yes" >> config.cache
|
||||
|
||||
# we don't need any custom args here, it's just headers
|
||||
CC="${tgt}-gcc" CXX="${tgt}-g++" CPP="${tgt}-cpp" LD="${tgt}-ld" \
|
||||
AS="${tgt}-as" NM="${tgt}-nm" CFLAGS="-pipe" CXXFLAGS="" CPPFLAGS="" \
|
||||
LDFLAGS="" \
|
||||
../glibc-${ver}/configure \
|
||||
--prefix=/usr \
|
||||
--host=${tgt} \
|
||||
--with-headers=${wrksrc}/build_root/usr/${tgt}/usr/include \
|
||||
--config-cache \
|
||||
--enable-kernel=2.6.27 \
|
||||
${cross_glibc_configure_args}
|
||||
|
||||
make -k install-headers cross_compiling=yes \
|
||||
install_root=${wrksrc}/build_root/usr/${tgt}
|
||||
|
||||
touch ${wrksrc}/.glibc_headers_done
|
||||
}
|
||||
|
||||
_void_cross_build_glibc() {
|
||||
[ -f ${wrksrc}/.glibc_build_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
|
||||
msg_normal "Building glibc for ${tgt}\n"
|
||||
|
||||
mkdir -p ${wrksrc}/glibc_build
|
||||
cd ${wrksrc}/glibc_build
|
||||
|
||||
local ws=$(cat ${wrksrc}/.gcc_wordsize)
|
||||
|
||||
echo "slibdir=/usr/lib${ws}" > configparms
|
||||
|
||||
echo "libc_cv_forced_unwind=yes" > config.cache
|
||||
echo "libc_cv_c_cleanup=yes" >> config.cache
|
||||
|
||||
CC="${tgt}-gcc" CXX="${tgt}-g++" CPP="${tgt}-cpp" LD="${tgt}-ld" \
|
||||
AR="${tgt}-ar" AS="${tgt}-as" NM="${tgt}-nm" \
|
||||
CFLAGS="-pipe ${cross_glibc_cflags}" \
|
||||
CXXFLAGS="-pipe ${cross_glibc_cflags}" \
|
||||
CPPFLAGS="${cross_glibc_cflags}" \
|
||||
LDFLAGS="${cross_glibc_ldflags}" \
|
||||
../glibc-${ver}/configure \
|
||||
--prefix=/usr \
|
||||
--libdir=/usr/lib${ws} \
|
||||
--libexecdir=/usr/libexec \
|
||||
--host=${tgt} \
|
||||
--with-headers=${wrksrc}/build_root/usr/${tgt}/usr/include \
|
||||
--config-cache \
|
||||
--disable-profile \
|
||||
--disable-werror \
|
||||
--enable-kernel=2.6.27 \
|
||||
${cross_glibc_configure_args}
|
||||
|
||||
make ${makejobs}
|
||||
make install_root=${wrksrc}/build_root/usr/${tgt} install
|
||||
|
||||
touch ${wrksrc}/.glibc_build_done
|
||||
}
|
||||
|
||||
_void_cross_build_musl() {
|
||||
[ -f ${wrksrc}/.musl_build_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
|
||||
msg_normal "Patching musl for ${tgt}\n"
|
||||
|
||||
cd ${wrksrc}/musl-${ver}
|
||||
if [ -d "${XBPS_SRCPKGDIR}/musl/patches" ]; then
|
||||
for f in ${XBPS_SRCPKGDIR}/musl/patches/*.patch; do
|
||||
_void_cross_apply_patch "$f"
|
||||
done
|
||||
fi
|
||||
cd ..
|
||||
|
||||
msg_normal "Building musl for ${tgt}\n"
|
||||
|
||||
mkdir -p musl_build
|
||||
cd musl_build
|
||||
|
||||
CC="${tgt}-gcc" CXX="${tgt}-g++" CPP="${tgt}-cpp" LD="${tgt}-ld" \
|
||||
AR="${tgt}-ar" AS="${tgt}-as" NM="${tgt}-nm" \
|
||||
CFLAGS="-pipe -fPIC ${cross_musl_cflags}" \
|
||||
CPPFLAGS="${cross_musl_cflags}" LDFLAGS="${cross_musl_ldflags}" \
|
||||
../musl-${ver}/configure \
|
||||
--prefix=/usr \
|
||||
--host=${tgt} \
|
||||
${cross_musl_configure_args}
|
||||
|
||||
make ${makejobs}
|
||||
make DESTDIR=${wrksrc}/build_root/usr/${tgt} install
|
||||
|
||||
touch ${wrksrc}/.musl_build_done
|
||||
}
|
||||
|
||||
_void_cross_build_libucontext() {
|
||||
[ -n "$cross_gcc_skip_go" ] && return 0
|
||||
[ -f ${wrksrc}/.libucontext_build_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
local arch incpath
|
||||
|
||||
msg_normal "Building libucontext for ${tgt}\n"
|
||||
|
||||
case "$tgt" in
|
||||
x86_64*) arch=x86_64 ;;
|
||||
i686*) arch=x86 ;;
|
||||
powerpc64*) arch=ppc64 ;;
|
||||
powerpc*) arch=ppc ;;
|
||||
mips*64*) arch=mips64 ;;
|
||||
mips*) arch=mips ;;
|
||||
aarch64*) arch=aarch64 ;;
|
||||
arm*) arch=arm ;;
|
||||
riscv64*) arch=riscv64 ;;
|
||||
s390x*) arch=s390x ;;
|
||||
*) msg_error "Unknown libucontext arch for ${tgt}\n" ;;
|
||||
esac
|
||||
|
||||
cd ${wrksrc}/libucontext-${ver}
|
||||
# a terrible hack but seems to work for now
|
||||
# we build a static-only library to prevent linking to a runtime
|
||||
# since it's tiny it can be linked into libgo and we don't have
|
||||
# to keep it around (which would possibly conflict with crossdeps)
|
||||
incpath="${wrksrc}/build_root/usr/${tgt}/usr/include"
|
||||
CC="${tgt}-gcc" AS="${tgt}-as" AR="${tgt}-ar" \
|
||||
make ARCH=$arch libucontext.a \
|
||||
CFLAGS="${cross_musl_cflags} -g0 -nostdinc -isystem ${incpath}"
|
||||
|
||||
cp libucontext.a ${wrksrc}/build_root/usr/${tgt}/usr/lib
|
||||
|
||||
touch ${wrksrc}/.libucontext_build_done
|
||||
}
|
||||
|
||||
_void_cross_build_gcc() {
|
||||
[ -f ${wrksrc}/.gcc_build_done ] && return 0
|
||||
|
||||
local tgt=$1
|
||||
local ver=$2
|
||||
|
||||
msg_normal "Building gcc for ${tgt}\n"
|
||||
|
||||
mkdir -p ${wrksrc}/gcc_build
|
||||
cd ${wrksrc}/gcc_build
|
||||
|
||||
local langs="c,c++,fortran,objc,obj-c++,ada,lto"
|
||||
if [ -z "$cross_gcc_skip_go" ]; then
|
||||
langs+=",go"
|
||||
fi
|
||||
|
||||
local extra_args
|
||||
if [ -f ${wrksrc}/.musl_version ]; then
|
||||
# otherwise glibc hosts get confused and use the gnu impl
|
||||
extra_args+=" --enable-clocale=generic"
|
||||
extra_args+=" --disable-symvers"
|
||||
extra_args+=" --disable-gnu-unique-object"
|
||||
extra_args+=" libat_cv_have_ifunc=no"
|
||||
else
|
||||
extra_args+=" --enable-gnu-unique-object"
|
||||
fi
|
||||
|
||||
# note on --disable-libquadmath:
|
||||
# on some platforms the library is actually necessary for the
|
||||
# fortran frontend to build, but still disable it because it
|
||||
# should not be in the resulting packages; it conflicts with
|
||||
# the libquadmath you can install into the cross root
|
||||
#
|
||||
# platforms where this is a problem should explicitly force
|
||||
# libquadmath to be on via cross_gcc_configure_args, the
|
||||
# do_install in this build-style automatically removes it
|
||||
#
|
||||
../gcc-${ver}/configure \
|
||||
--prefix=/usr \
|
||||
--sbindir=/usr/bin \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/lib \
|
||||
--target=${tgt} \
|
||||
--with-sysroot=/usr/${tgt} \
|
||||
--with-build-sysroot=${wrksrc}/build_root/usr/${tgt} \
|
||||
--enable-languages=${langs} \
|
||||
--disable-nls \
|
||||
--disable-multilib \
|
||||
--disable-sjlj-exceptions \
|
||||
--disable-libquadmath \
|
||||
--disable-libmudflap \
|
||||
--disable-libitm \
|
||||
--disable-libvtv \
|
||||
--disable-libsanitizer \
|
||||
--disable-libstdcxx-pch \
|
||||
--enable-shared \
|
||||
--enable-threads=posix \
|
||||
--enable-__cxa_atexit \
|
||||
--enable-linker-build-id \
|
||||
--enable-libada \
|
||||
--enable-lto \
|
||||
--enable-default-pie \
|
||||
--enable-default-ssp \
|
||||
--enable-libssp \
|
||||
--with-gnu-ld \
|
||||
--with-gnu-as \
|
||||
--with-linker-hash-style=gnu \
|
||||
${extra_args} \
|
||||
${configure_args} \
|
||||
${cross_gcc_configure_args}
|
||||
|
||||
make ${makejobs}
|
||||
|
||||
touch ${wrksrc}/.gcc_build_done
|
||||
}
|
||||
|
||||
_void_cross_test_ver() {
|
||||
local proj=$1
|
||||
local noerr=$2
|
||||
local ver cver
|
||||
for p in ${proj}-*; do
|
||||
cver=${p#${proj}-}
|
||||
if [ -z "$noerr" -a -n "$ver" ]; then
|
||||
msg_error "multiple versions of ${proj} found: ${ver}, ${cver}"
|
||||
fi
|
||||
ver=${cver}
|
||||
done
|
||||
if [ -d "${proj}-${ver}" ]; then
|
||||
echo ${ver} > ${wrksrc}/.${proj}_version
|
||||
return
|
||||
fi
|
||||
if [ -z "$noerr" ]; then
|
||||
msg_error "project ${proj} not available for build\n"
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
# Verify toolchain versions
|
||||
cd ${wrksrc}
|
||||
|
||||
local binutils_ver linux_ver gcc_ver libc_ver libucontext_ver
|
||||
local tgt=${sourcepkg/cross-}
|
||||
|
||||
_void_cross_test_ver binutils
|
||||
_void_cross_test_ver linux
|
||||
_void_cross_test_ver gcc
|
||||
|
||||
binutils_ver=$(cat .binutils_version)
|
||||
linux_ver=$(cat .linux_version)
|
||||
gcc_ver=$(cat .gcc_version)
|
||||
|
||||
_void_cross_test_ver musl noerr
|
||||
if [ ! -f .musl_version ]; then
|
||||
_void_cross_test_ver glibc
|
||||
libc_ver=$(cat .glibc_version)
|
||||
else
|
||||
libc_ver=$(cat .musl_version)
|
||||
if [ -z "$cross_gcc_skip_go" ]; then
|
||||
_void_cross_test_ver libucontext
|
||||
libucontext_ver=$(cat .libucontext_version)
|
||||
fi
|
||||
fi
|
||||
|
||||
local sysroot="/usr/${tgt}"
|
||||
|
||||
# Prepare environment
|
||||
cd ${wrksrc}
|
||||
|
||||
# Core directories for the build root
|
||||
mkdir -p build_root/usr/{bin,lib,include,share}
|
||||
mkdir -p build_root/usr/${tgt}/usr/{bin,lib,include,share}
|
||||
|
||||
# Host root uses host wordsize
|
||||
ln -sf usr/lib build_root/lib
|
||||
ln -sf usr/lib build_root/lib${XBPS_TARGET_WORDSIZE}
|
||||
ln -sf lib build_root/usr/lib${XBPS_TARGET_WORDSIZE}
|
||||
|
||||
# Prepare target sysroot
|
||||
ln -sf usr/lib build_root/${sysroot}/lib
|
||||
ln -sf lib build_root/${sysroot}/usr/libexec
|
||||
|
||||
_void_cross_build_binutils ${tgt} ${binutils_ver}
|
||||
|
||||
# Prepare environment so we can use temporary prefix
|
||||
local oldpath="$PATH"
|
||||
local oldldlib="$LD_LIBRARY_PATH"
|
||||
|
||||
export PATH="${wrksrc}/build_root/usr/bin:$PATH"
|
||||
export LD_LIBRARY_PATH="${wrksrc}/build_root/usr/lib:$PATH"
|
||||
|
||||
_void_cross_build_bootstrap_gcc ${tgt} ${gcc_ver}
|
||||
_void_cross_build_kernel_headers ${tgt} ${linux_ver}
|
||||
|
||||
local ws=$(cat ${wrksrc}/.gcc_wordsize)
|
||||
|
||||
# Now that we know the target wordsize, prepare symlinks
|
||||
ln -sf usr/lib ${wrksrc}/build_root/${sysroot}/lib${ws}
|
||||
ln -sf lib ${wrksrc}/build_root/${sysroot}/usr/lib${ws}
|
||||
|
||||
if [ -f ${wrksrc}/.musl_version ]; then
|
||||
_void_cross_build_musl ${tgt} ${libc_ver}
|
||||
_void_cross_build_libucontext ${tgt} ${libucontext_ver}
|
||||
else
|
||||
_void_cross_build_glibc_headers ${tgt} ${libc_ver}
|
||||
_void_cross_build_glibc ${tgt} ${libc_ver}
|
||||
fi
|
||||
|
||||
_void_cross_build_gcc ${tgt} ${gcc_ver}
|
||||
|
||||
# restore this stuff in case later hooks depend on it
|
||||
export PATH="$oldpath"
|
||||
export LD_LIBRARY_PATH="$oldldlib"
|
||||
}
|
||||
|
||||
do_install() {
|
||||
# We need to be able to access binutils in the root
|
||||
local oldpath="$PATH"
|
||||
local oldldlib="$LD_LIBRARY_PATH"
|
||||
export PATH="${wrksrc}/build_root/usr/bin:$PATH"
|
||||
export LD_LIBRARY_PATH="${wrksrc}/build_root/usr/lib:$PATH"
|
||||
|
||||
local tgt=${sourcepkg/cross-}
|
||||
local sysroot="/usr/${tgt}"
|
||||
local ws=$(cat ${wrksrc}/.gcc_wordsize)
|
||||
|
||||
# Core directories for the sysroot
|
||||
#
|
||||
# libexec is created for sysroot but not for dest, since in sysroot
|
||||
# we configure glibc with separate libexec, elsewhere it's just lib
|
||||
# and we want to delete the libexec from glibc afterwards to save space
|
||||
mkdir -p ${DESTDIR}/${sysroot}/usr/{bin,lib,libexec,include,share}
|
||||
# Sysroot base symlinks
|
||||
ln -sf usr/bin ${DESTDIR}/${sysroot}/bin
|
||||
ln -sf usr/lib ${DESTDIR}/${sysroot}/lib
|
||||
ln -sf usr/lib ${DESTDIR}/${sysroot}/lib${ws}
|
||||
ln -sf lib ${DESTDIR}/${sysroot}/usr/lib${ws}
|
||||
ln -sf usr/include ${DESTDIR}/${sysroot}/include
|
||||
|
||||
# Install Linux headers
|
||||
cd ${wrksrc}/linux-$(cat ${wrksrc}/.linux_version)
|
||||
cp -a usr/include ${DESTDIR}/${sysroot}/usr
|
||||
|
||||
# Install binutils
|
||||
cd ${wrksrc}/binutils_build
|
||||
make install DESTDIR=${DESTDIR}
|
||||
|
||||
# Install final gcc
|
||||
cd ${wrksrc}/gcc_build
|
||||
make install DESTDIR=${DESTDIR}
|
||||
|
||||
# Move libcc1.so* to the sysroot
|
||||
mv ${DESTDIR}/usr/lib/libcc1.so* ${DESTDIR}/${sysroot}/usr/lib
|
||||
|
||||
local gcc_ver=$(cat ${wrksrc}/.gcc_version)
|
||||
local gcc_patch=${gcc_ver/_*}
|
||||
local gcc_minor=${gcc_patch%.*}
|
||||
local gcc_major=${gcc_minor%.*}
|
||||
|
||||
if [ -f ${wrksrc}/.musl_version ]; then
|
||||
# Install musl
|
||||
cd ${wrksrc}/musl_build
|
||||
make DESTDIR=${DESTDIR}/${sysroot} install
|
||||
|
||||
# Remove useless headers
|
||||
rm -rf ${DESTDIR}/usr/lib/gcc/${tgt}/*/include-fixed
|
||||
|
||||
# Make ld-musl.so symlinks relative
|
||||
for f in ${DESTDIR}/${sysroot}/usr/lib/ld-musl-*.so.*; do
|
||||
ln -sf libc.so ${f}
|
||||
done
|
||||
else
|
||||
# Install glibc
|
||||
cd ${wrksrc}/glibc_build
|
||||
make install_root=${DESTDIR}/${sysroot} install install-headers
|
||||
|
||||
# Remove bad header
|
||||
rm -f ${DESTDIR}/usr/lib/gcc/${tgt}/${gcc_patch}/include-fixed/bits/statx.h
|
||||
fi
|
||||
|
||||
# minor-versioned symlinks
|
||||
mv ${DESTDIR}/usr/lib/gcc/${tgt}/${gcc_patch} \
|
||||
${DESTDIR}/usr/lib/gcc/${tgt}/${gcc_minor}
|
||||
ln -sfr ${DESTDIR}/usr/lib/gcc/${tgt}/${gcc_minor} \
|
||||
${DESTDIR}/usr/lib/gcc/${tgt}/${gcc_patch}
|
||||
|
||||
# ditto for c++ headers
|
||||
mv ${DESTDIR}/${sysroot}/usr/include/c++/${gcc_patch} \
|
||||
${DESTDIR}/${sysroot}/usr/include/c++/${gcc_minor}
|
||||
ln -sfr ${DESTDIR}/${sysroot}/usr/include/c++/${gcc_minor} \
|
||||
${DESTDIR}/${sysroot}/usr/include/c++/${gcc_patch}
|
||||
|
||||
# Symlinks for gnarl and gnat shared libraries
|
||||
local adalib=usr/lib/gcc/${tgt}/${gcc_patch}/adalib
|
||||
mv ${DESTDIR}/${adalib}/libgnarl-${gcc_major}.so \
|
||||
${DESTDIR}/${sysroot}/usr/lib
|
||||
mv ${DESTDIR}/${adalib}/libgnat-${gcc_major}.so \
|
||||
${DESTDIR}/${sysroot}/usr/lib
|
||||
ln -sf libgnarl-${gcc_major}.so ${DESTDIR}/${sysroot}/usr/lib/libgnarl.so
|
||||
ln -sf libgnat-${gcc_major}.so ${DESTDIR}/${sysroot}/usr/lib/libgnat.so
|
||||
rm -vf ${DESTDIR}/${adalib}/libgna{rl,t}.so
|
||||
|
||||
# Remove unnecessary libatomic which is only built for gccgo
|
||||
rm -rf ${DESTDIR}/${sysroot}/usr/lib/libatomic.*
|
||||
|
||||
# If libquadmath was forced (needed for gfortran on some platforms)
|
||||
# then remove it because it conflicts with libquadmath package
|
||||
rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
|
||||
|
||||
# Remove leftover symlinks
|
||||
rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
|
||||
rm -f ${DESTDIR}/lib*
|
||||
rm -f ${DESTDIR}/*bin
|
||||
# Remove unnecessary stuff
|
||||
rm -rf ${DESTDIR}/${sysroot}/{sbin,etc,var,libexec}
|
||||
rm -rf ${DESTDIR}/${sysroot}/usr/{sbin,share,libexec}
|
||||
rm -rf ${DESTDIR}/usr/share
|
||||
rm -f ${DESTDIR}/usr/lib*/libiberty.a
|
||||
|
||||
export PATH="$oldpath"
|
||||
export LD_LIBRARY_PATH="$oldldlib"
|
||||
}
|
21
common/build-style/waf.sh
Normal file
21
common/build-style/waf.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
# This helper is for templates using WAF to build/install.
|
||||
#
|
||||
do_configure() {
|
||||
: ${configure_script:=waf}
|
||||
|
||||
PYTHON=/usr/bin/python2 python2 ${configure_script} configure \
|
||||
--prefix=/usr --libdir=/usr/lib${XBPS_TARGET_WORDSIZE} ${configure_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${configure_script:=waf}
|
||||
|
||||
PYTHON=/usr/bin/python2 python2 ${configure_script} build ${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${configure_script:=waf}
|
||||
|
||||
PYTHON=/usr/bin/python2 python2 ${configure_script} install --destdir=${DESTDIR} ${make_install_args}
|
||||
}
|
29
common/build-style/waf3.sh
Normal file
29
common/build-style/waf3.sh
Normal file
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# This helper is for templates using WAF with python3 to build/install.
|
||||
#
|
||||
do_configure() {
|
||||
: ${configure_script:=waf}
|
||||
local cross_args
|
||||
|
||||
if [[ $build_helper = *"qemu"* ]] && [ "$CROSS_BUILD" ]; then
|
||||
# If the qemu build helper is specified, use it for cross builds
|
||||
cross_args="--cross-compile --hostcc=${CC_FOR_BUILD}
|
||||
--cross-execute=qemu-${XBPS_TARGET_QEMU_MACHINE}-static"
|
||||
fi
|
||||
|
||||
PYTHON=/usr/bin/python3 python3 ${configure_script} configure \
|
||||
--prefix=/usr --libdir=/usr/lib${XBPS_TARGET_WORDSIZE} \
|
||||
${configure_args} ${cross_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${configure_script:=waf}
|
||||
|
||||
PYTHON=/usr/bin/python3 python3 ${configure_script} build ${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${configure_script:=waf}
|
||||
|
||||
PYTHON=/usr/bin/python3 python3 ${configure_script} install --destdir=${DESTDIR} ${make_install_args}
|
||||
}
|
41
common/build-style/zig-build.sh
Normal file
41
common/build-style/zig-build.sh
Normal file
|
@ -0,0 +1,41 @@
|
|||
do_build() {
|
||||
local zig_target zig_cpu
|
||||
|
||||
# TODO: This duplication between build-profiles and cross-profiles
|
||||
# is totally unnecessary. It would be nice if there was some way to
|
||||
# avoid it.
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
zig_target="${XBPS_CROSS_ZIG_TARGET}"
|
||||
zig_cpu="${XBPS_CROSS_ZIG_CPU}"
|
||||
else
|
||||
zig_target="${XBPS_ZIG_TARGET}"
|
||||
zig_cpu="${XBPS_ZIG_CPU}"
|
||||
fi
|
||||
|
||||
# Inform zig of the required libc include paths.
|
||||
cat > xbps_zig_libc.txt <<-EOF
|
||||
include_dir=${XBPS_CROSS_BASE}/usr/include
|
||||
sys_include_dir=${XBPS_CROSS_BASE}/usr/include
|
||||
crt_dir=${XBPS_CROSS_BASE}/usr/lib
|
||||
msvc_lib_dir=
|
||||
kernel32_lib_dir=
|
||||
gcc_dir=
|
||||
EOF
|
||||
|
||||
# The Zig build system only has a single install step, there is no
|
||||
# way to build artifacts for a given prefix and then install those artifacts
|
||||
# to that prefix at some later time. Therefore, we build and install to the zig-out
|
||||
# directory and later copy the artifacts to the destdir in do_install().
|
||||
# We use zig-out to avoid path conflicts as it is the default install
|
||||
# prefix used by the zig build system.
|
||||
DESTDIR="zig-out" zig build \
|
||||
--sysroot "${XBPS_CROSS_BASE}" \
|
||||
--libc xbps_zig_libc.txt \
|
||||
-Dtarget="${zig_target}" -Dcpu="${zig_cpu}" \
|
||||
-Drelease-safe --prefix /usr install \
|
||||
${configure_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
cp -r zig-out/* "${DESTDIR}"
|
||||
}
|
13
common/chroot-style/README
Normal file
13
common/chroot-style/README
Normal file
|
@ -0,0 +1,13 @@
|
|||
CHROOT STYLES
|
||||
=============
|
||||
|
||||
This directory contains scripts to perform the chroot operation with xbps-src.
|
||||
The scripts should accept at least 5 arguments:
|
||||
|
||||
- $1 (MASTERDIR) masterdir to chroot
|
||||
- $2 (DISTDIR) path to the void-packages directory
|
||||
- $3 (HOSTDIR) path to hostdir
|
||||
- $4 (EXTRA_ARGS) additional arguments to be passed
|
||||
- $5 (CMD) command to execute
|
||||
- $@ remaining arguments to pass
|
||||
|
23
common/chroot-style/bwrap.sh
Executable file
23
common/chroot-style/bwrap.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This chroot script uses bubblewrap (see https://github.com/containers/bubblewrap)
|
||||
#
|
||||
set -e
|
||||
readonly MASTERDIR="$1"
|
||||
readonly DISTDIR="$2"
|
||||
readonly HOSTDIR="$3"
|
||||
readonly EXTRA_ARGS="$4"
|
||||
shift 4
|
||||
|
||||
if ! command -v bwrap >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
||||
echo "$0 MASTERDIR/DISTDIR not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec bwrap --bind "$MASTERDIR" / --ro-bind "$DISTDIR" /void-packages \
|
||||
--dev /dev --tmpfs /tmp --proc /proc \
|
||||
${HOSTDIR:+--bind "$HOSTDIR" /host} $EXTRA_ARGS "$@"
|
135
common/chroot-style/ethereal.sh
Executable file
135
common/chroot-style/ethereal.sh
Executable file
|
@ -0,0 +1,135 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This chroot script uses symlinks to emulate being in a chroot using
|
||||
# the host system as the masterdir
|
||||
#
|
||||
# It will damage your host system, only use it in disposable
|
||||
# containers.
|
||||
#
|
||||
# 2 extra steps required when using this chroot-style:
|
||||
# 1. Symlink / to masterdir inside the void-packages repo
|
||||
# 2. write the arch of the host system, as dictated by xbps-uhelper arch
|
||||
# into /.xbps_chroot_init
|
||||
#
|
||||
# The supported way to make use of thie chroot-style is to create
|
||||
# a root filesystem that has base-chroot and git installed and
|
||||
# have it inside a container engine like Docker.
|
||||
#
|
||||
# Docker example:
|
||||
# $ mkdir -p /tmp/image
|
||||
# $ xbps-install -y -r /tmp/image \
|
||||
# -R http://mirrors.servercentral.com/voidlinux/current \
|
||||
# -S base-chroot
|
||||
# $ tar -pC /tmp/image -c . | sudo docker import - voidlinux/masterdir
|
||||
# $ rm -rf /tmp/image
|
||||
# # docker run --rm -it \
|
||||
# -e XBPS_CHROOT_CMD=ethereal \
|
||||
# -e XBPS_ALLOW_CHROOT_BREAKOUT=yes \
|
||||
# -v $(pwd):/hostrepo voidlinux/masterdir \
|
||||
# /bin/bash -c 'ln -s / /hostrepo/masterdir && /hostrepo/xbps-src pkg <pkgname>'
|
||||
#
|
||||
|
||||
readonly MASTERDIR="$1"
|
||||
readonly DISTDIR="$2"
|
||||
readonly HOSTDIR="$3"
|
||||
readonly EXTRA_ARGS="$4"
|
||||
readonly CMD="$5"
|
||||
shift 5
|
||||
|
||||
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
||||
echo "$0 MASTERDIR/DISTDIR not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg_red() {
|
||||
# error messages in bold/red
|
||||
[ -n "$NOCOLORS" ] || printf >&2 "\033[1m\033[31m"
|
||||
printf "=> ERROR: %s\\n" "$@" >&2
|
||||
[ -n "$NOCOLORS" ] || printf >&2 "\033[m"
|
||||
}
|
||||
|
||||
fake_mount() {
|
||||
# If we already have a symlink from the desired place
|
||||
# to the base location then just return 0
|
||||
if [ -L "$2" -a "$(readlink "$2")" = "$1" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -d "$2" ] && ! rmdir "$2" >/dev/null 2>&1; then
|
||||
msg_red "Failed to remove $2, not empty ?\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -f "$2" -o -L "$2" ] && rm -f "$2"
|
||||
|
||||
ln -s "$1" "$2"
|
||||
echo "linked $2 -> $1"
|
||||
}
|
||||
|
||||
if [ "${XBPS_ALLOW_CHROOT_BREAKOUT}" != "yes" ]; then
|
||||
msg_red "chroot-style 'ethereal' requires XBPS_ALLOW_CHROOT_BREAKOUT=yes\n"
|
||||
msg_red "This chroot-style is meant for disposable containers and will destroy your system\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -L "$MASTERDIR" -o "$(readlink "$MASTERDIR")" != "/" ]; then
|
||||
msg_red "$MASTERDIR isn't symlinked to /!\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fake_mount "$DISTDIR" "$MASTERDIR"/void-packages
|
||||
|
||||
# Do the same for hostdir
|
||||
if [ -n "$HOSTDIR" ]; then
|
||||
fake_mount "$HOSTDIR" "$MASTERDIR"/host
|
||||
fi
|
||||
|
||||
# xbps-src may send some other binds, parse them here
|
||||
while getopts 'b:' c -- "$EXTRA_ARGS"; do
|
||||
# Skip everything that's not a bind
|
||||
[ "$c" = "b" ] || continue
|
||||
|
||||
from="${OPTARG%:*}"
|
||||
to="${OPTARG#*:}"
|
||||
|
||||
fake_mount "$from" "$to"
|
||||
|
||||
mounts="${mounts} $to"
|
||||
done
|
||||
|
||||
# Store current directory for returning later
|
||||
OLDPWD="$(pwd)"
|
||||
|
||||
# To give the illusion we entered the chroot, cd to /
|
||||
cd / || {
|
||||
msg_red "Failed to change directory to root!\n"
|
||||
exit 1 ; }
|
||||
|
||||
# Tell xbps-src that we are "in the chroot"
|
||||
# Start with `env` so our environment var's stay the same
|
||||
env IN_CHROOT=1 $CMD $@
|
||||
|
||||
# Store return of the command we care about
|
||||
ret="$?"
|
||||
|
||||
# Return to OLDPWD
|
||||
cd "${OLDPWD}"
|
||||
|
||||
# Remove the symlink and restore an empty dir to simulate
|
||||
# an umount operation.
|
||||
if [ -n "$HOSTDIR" ]; then
|
||||
rm -f "$MASTERDIR"/host
|
||||
mkdir -p "$MASTERDIR"/host
|
||||
fi
|
||||
|
||||
# Same as the operation above, do it all for all mountpoints
|
||||
# that were passed to us.
|
||||
for m in $mounts; do
|
||||
rm -f "$m"
|
||||
mkdir -p "$m"
|
||||
done
|
||||
|
||||
rm -f "$MASTERDIR"/void-packages
|
||||
mkdir -p "$MASTERDIR"/void-packages
|
||||
|
||||
exit $ret
|
21
common/chroot-style/uchroot.sh
Executable file
21
common/chroot-style/uchroot.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This chroot script uses xbps-uchroot(1).
|
||||
#
|
||||
readonly MASTERDIR="$1"
|
||||
readonly DISTDIR="$2"
|
||||
readonly HOSTDIR="$3"
|
||||
readonly EXTRA_ARGS="$4"
|
||||
readonly CMD="$5"
|
||||
shift 5
|
||||
|
||||
if ! command -v xbps-uchroot >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
||||
echo "$0 MASTERDIR/DISTDIR not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec xbps-uchroot $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $MASTERDIR $CMD $@
|
21
common/chroot-style/uunshare.sh
Executable file
21
common/chroot-style/uunshare.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This chroot script uses xbps-uunshare(1) with user_namespaces(7).
|
||||
#
|
||||
readonly MASTERDIR="$1"
|
||||
readonly DISTDIR="$2"
|
||||
readonly HOSTDIR="$3"
|
||||
readonly EXTRA_ARGS="$4"
|
||||
readonly CMD="$5"
|
||||
shift 5
|
||||
|
||||
if ! command -v xbps-uunshare >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
||||
echo "$0 MASTERDIR/DISTDIR not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec xbps-uunshare $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} -- $MASTERDIR $CMD $@
|
19
common/cross-profiles/README
Normal file
19
common/cross-profiles/README
Normal file
|
@ -0,0 +1,19 @@
|
|||
CROSS PROFILES
|
||||
==============
|
||||
|
||||
This directory contains cross profiles to allow cross compilation for the specified target.
|
||||
A cross profile file must provide the following variables:
|
||||
|
||||
- XBPS_TARGET_MACHINE (as returned by uname -m + optional -musl suffix)
|
||||
- XBPS_CROSS_TRIPLET (the cross compiler triplet)
|
||||
- XBPS_CROSS_CFLAGS (C compiler flags for the cross compiler)
|
||||
- XBPS_CROSS_CXXFLAGS (C++ compiler flags for the cross compiler)
|
||||
- XBPS_CROSS_FFLAGS (Fortran compiler flags for the cross compiler)
|
||||
- XBPS_CROSS_CPPFLAGS (Preprocessor flags for the cross compiler)
|
||||
- XBPS_CROSS_LDFLAGS (Linker flags for the cross compiler)
|
||||
- XBPS_CROSS_RUST_TARGET (the rust triplet for the rust cross compiler)
|
||||
- XBPS_CROSS_RUSTFLAGS (rust compiler flags for the cross compiler)
|
||||
- XBPS_CROSS_ZIG_TARGET (the arch-os-abi target triplet for zig)
|
||||
- XBPS_CROSS_ZIG_CPU (the cpu/feature set for zig)
|
||||
|
||||
A source package matching `cross-${XBPS_CROSS_TRIPLET}' must also exist.
|
12
common/cross-profiles/aarch64-musl.sh
Normal file
12
common/cross-profiles/aarch64-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARMv8.
|
||||
|
||||
XBPS_TARGET_MACHINE="aarch64-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="aarch64"
|
||||
XBPS_CROSS_TRIPLET="aarch64-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-march=armv8-a"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="aarch64-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="aarch64-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="baseline"
|
12
common/cross-profiles/aarch64.sh
Normal file
12
common/cross-profiles/aarch64.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARMv8.
|
||||
|
||||
XBPS_TARGET_MACHINE="aarch64"
|
||||
XBPS_TARGET_QEMU_MACHINE="aarch64"
|
||||
XBPS_CROSS_TRIPLET="aarch64-linux-gnu"
|
||||
XBPS_CROSS_CFLAGS="-march=armv8-a"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="aarch64-unknown-linux-gnu"
|
||||
XBPS_CROSS_ZIG_TARGET="aarch64-linux-gnu"
|
||||
XBPS_CROSS_ZIG_CPU="baseline"
|
1
common/cross-profiles/armv5te-musl.sh
Symbolic link
1
common/cross-profiles/armv5te-musl.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
armv5tel-musl.sh
|
1
common/cross-profiles/armv5te.sh
Symbolic link
1
common/cross-profiles/armv5te.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
armv5tel.sh
|
12
common/cross-profiles/armv5tel-musl.sh
Normal file
12
common/cross-profiles/armv5tel-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARM GNU EABI5 Soft Float and Musl libc.
|
||||
|
||||
XBPS_TARGET_MACHINE="armv5tel-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="arm"
|
||||
XBPS_CROSS_TRIPLET="arm-linux-musleabi"
|
||||
XBPS_CROSS_CFLAGS="-march=armv5te -msoft-float -mfloat-abi=soft"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="arm-unknown-linux-musleabi"
|
||||
XBPS_CROSS_ZIG_TARGET="arm-linux-musleabi"
|
||||
XBPS_CROSS_ZIG_CPU="generic+v5te+soft_float"
|
12
common/cross-profiles/armv5tel.sh
Normal file
12
common/cross-profiles/armv5tel.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARM GNU EABI5 Soft Float.
|
||||
|
||||
XBPS_TARGET_MACHINE="armv5tel"
|
||||
XBPS_TARGET_QEMU_MACHINE="arm"
|
||||
XBPS_CROSS_TRIPLET="arm-linux-gnueabi"
|
||||
XBPS_CROSS_CFLAGS="-march=armv5te -msoft-float -mfloat-abi=soft"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="arm-unknown-linux-gnueabi"
|
||||
XBPS_CROSS_ZIG_TARGET="arm-linux-gnueabi"
|
||||
XBPS_CROSS_ZIG_CPU="generic+v5te+soft_float"
|
1
common/cross-profiles/armv6hf-musl.sh
Symbolic link
1
common/cross-profiles/armv6hf-musl.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
armv6l-musl.sh
|
1
common/cross-profiles/armv6hf.sh
Symbolic link
1
common/cross-profiles/armv6hf.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
armv6l.sh
|
12
common/cross-profiles/armv6l-musl.sh
Normal file
12
common/cross-profiles/armv6l-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARM EABI5 Hard Float and Musl libc.
|
||||
|
||||
XBPS_TARGET_MACHINE="armv6l-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="arm"
|
||||
XBPS_CROSS_TRIPLET="arm-linux-musleabihf"
|
||||
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="arm-unknown-linux-musleabihf"
|
||||
XBPS_CROSS_ZIG_TARGET="arm-linux-musleabihf"
|
||||
XBPS_CROSS_ZIG_CPU="generic+v6"
|
12
common/cross-profiles/armv6l.sh
Normal file
12
common/cross-profiles/armv6l.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARM GNU EABI5 Hard Float.
|
||||
|
||||
XBPS_TARGET_MACHINE="armv6l"
|
||||
XBPS_TARGET_QEMU_MACHINE="arm"
|
||||
XBPS_CROSS_TRIPLET="arm-linux-gnueabihf"
|
||||
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="arm-unknown-linux-gnueabihf"
|
||||
XBPS_CROSS_ZIG_TARGET="arm-linux-gnueabihf"
|
||||
XBPS_CROSS_ZIG_CPU="generic+v6"
|
1
common/cross-profiles/armv7hf-musl.sh
Symbolic link
1
common/cross-profiles/armv7hf-musl.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
armv7l-musl.sh
|
1
common/cross-profiles/armv7hf.sh
Symbolic link
1
common/cross-profiles/armv7hf.sh
Symbolic link
|
@ -0,0 +1 @@
|
|||
armv7l.sh
|
12
common/cross-profiles/armv7l-musl.sh
Normal file
12
common/cross-profiles/armv7l-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARMv7 EABI Hard Float and Musl libc.
|
||||
|
||||
XBPS_TARGET_MACHINE="armv7l-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="arm"
|
||||
XBPS_CROSS_TRIPLET="armv7l-linux-musleabihf"
|
||||
XBPS_CROSS_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="armv7-unknown-linux-musleabihf"
|
||||
XBPS_CROSS_ZIG_TARGET="arm-linux-musleabihf"
|
||||
XBPS_CROSS_ZIG_CPU="generic+v7a+vfp3"
|
12
common/cross-profiles/armv7l.sh
Normal file
12
common/cross-profiles/armv7l.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ARMv7 GNU EABI Hard Float.
|
||||
|
||||
XBPS_TARGET_MACHINE="armv7l"
|
||||
XBPS_TARGET_QEMU_MACHINE="arm"
|
||||
XBPS_CROSS_TRIPLET="armv7l-linux-gnueabihf"
|
||||
XBPS_CROSS_CFLAGS="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="armv7-unknown-linux-gnueabihf"
|
||||
XBPS_CROSS_ZIG_TARGET="arm-linux-gnueabihf"
|
||||
XBPS_CROSS_ZIG_CPU="generic+v7a+vfp3"
|
12
common/cross-profiles/i686-musl.sh
Normal file
12
common/cross-profiles/i686-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for i686 and Musl libc.
|
||||
|
||||
XBPS_TARGET_MACHINE="i686-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="i386"
|
||||
XBPS_CROSS_TRIPLET="i686-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-march=i686"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="i686-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="i686-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="baseline"
|
12
common/cross-profiles/i686.sh
Normal file
12
common/cross-profiles/i686.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for i686 GNU.
|
||||
|
||||
XBPS_TARGET_MACHINE="i686"
|
||||
XBPS_TARGET_QEMU_MACHINE="i386"
|
||||
XBPS_CROSS_TRIPLET="i686-pc-linux-gnu"
|
||||
XBPS_CROSS_CFLAGS="-march=i686"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="i686-unknown-linux-gnu"
|
||||
XBPS_CROSS_ZIG_TARGET="i386-linux-gnu"
|
||||
XBPS_CROSS_ZIG_CPU="_i686+sse2"
|
12
common/cross-profiles/mips-musl.sh
Normal file
12
common/cross-profiles/mips-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for MIPS32 BE soft float.
|
||||
|
||||
XBPS_TARGET_MACHINE="mips-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="mips"
|
||||
XBPS_CROSS_TRIPLET="mips-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="mips-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="mips-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="generic+soft_float"
|
12
common/cross-profiles/mipsel-musl.sh
Normal file
12
common/cross-profiles/mipsel-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for MIPS32 LE soft float.
|
||||
|
||||
XBPS_TARGET_MACHINE="mipsel-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="mipsel"
|
||||
XBPS_CROSS_TRIPLET="mipsel-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="mipsel-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="mipsel-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="generic+soft_float"
|
12
common/cross-profiles/mipselhf-musl.sh
Normal file
12
common/cross-profiles/mipselhf-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for MIPS32 LE hardfloat.
|
||||
|
||||
XBPS_TARGET_MACHINE="mipselhf-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="mipsel"
|
||||
XBPS_CROSS_TRIPLET="mipsel-linux-muslhf"
|
||||
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -mhard-float"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="mipsel-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="mipsel-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="generic"
|
12
common/cross-profiles/mipshf-musl.sh
Normal file
12
common/cross-profiles/mipshf-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for MIPS32 BE hard float.
|
||||
|
||||
XBPS_TARGET_MACHINE="mipshf-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="mips"
|
||||
XBPS_CROSS_TRIPLET="mips-linux-muslhf"
|
||||
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -mhard-float"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="mips-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="mips-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="generic"
|
12
common/cross-profiles/ppc-musl.sh
Normal file
12
common/cross-profiles/ppc-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for PowerPC.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppc-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppc"
|
||||
XBPS_CROSS_TRIPLET="powerpc-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-mtune=G4"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpc-unknown-linux-musl"
|
||||
XBPS_ZIG_TARGET="powerpc-linux-musl"
|
||||
XBPS_ZIG_CPU="baseline"
|
12
common/cross-profiles/ppc.sh
Normal file
12
common/cross-profiles/ppc.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for PowerPC.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppc"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppc"
|
||||
XBPS_CROSS_TRIPLET="powerpc-linux-gnu"
|
||||
XBPS_CROSS_CFLAGS="-mtune=G4"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpc-unknown-linux-gnu"
|
||||
XBPS_ZIG_TARGET="powerpc-linux-gnu"
|
||||
XBPS_ZIG_CPU="baseline"
|
12
common/cross-profiles/ppc64-musl.sh
Normal file
12
common/cross-profiles/ppc64-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ppc64 big-endian musl.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppc64-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppc64"
|
||||
XBPS_CROSS_TRIPLET="powerpc64-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-mcpu=970 -mtune=power9"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpc64-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="powerpc64-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="970"
|
12
common/cross-profiles/ppc64.sh
Normal file
12
common/cross-profiles/ppc64.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ppc64 big-endian GNU.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppc64"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppc64"
|
||||
XBPS_CROSS_TRIPLET="powerpc64-linux-gnu"
|
||||
XBPS_CROSS_CFLAGS="-mcpu=970 -mtune=power9"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpc64-unknown-linux-gnu"
|
||||
XBPS_CROSS_ZIG_TARGET="powerpc64-linux-gnu"
|
||||
XBPS_CROSS_ZIG_CPU="970"
|
12
common/cross-profiles/ppc64le-musl.sh
Normal file
12
common/cross-profiles/ppc64le-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ppc64 little-endian musl.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppc64le-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppc64le"
|
||||
XBPS_CROSS_TRIPLET="powerpc64le-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-mtune=power9"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpc64le-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="powerpc64le-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="baseline"
|
12
common/cross-profiles/ppc64le.sh
Normal file
12
common/cross-profiles/ppc64le.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for ppc64 little-endian GNU.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppc64le"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppc64le"
|
||||
XBPS_CROSS_TRIPLET="powerpc64le-linux-gnu"
|
||||
XBPS_CROSS_CFLAGS="-mtune=power9"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpc64le-unknown-linux-gnu"
|
||||
XBPS_CROSS_ZIG_TARGET="powerpc64le-linux-gnu"
|
||||
XBPS_CROSS_ZIG_CPU="baseline"
|
12
common/cross-profiles/ppcle-musl.sh
Normal file
12
common/cross-profiles/ppcle-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for little endian PowerPC.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppcle-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppcle"
|
||||
XBPS_CROSS_TRIPLET="powerpcle-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-mcpu=power8 -mtune=power9"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpcle-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="powerpcle-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="pwr8"
|
12
common/cross-profiles/ppcle.sh
Normal file
12
common/cross-profiles/ppcle.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for little endian PowerPC.
|
||||
|
||||
XBPS_TARGET_MACHINE="ppcle"
|
||||
XBPS_TARGET_QEMU_MACHINE="ppcle"
|
||||
XBPS_CROSS_TRIPLET="powerpcle-linux-gnu"
|
||||
XBPS_CROSS_CFLAGS="-mcpu=power8 -mtune=power9"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="powerpcle-unknown-linux-gnu"
|
||||
XBPS_CROSS_ZIG_TARGET="powerpcle-linux-gnu"
|
||||
XBPS_CROSS_ZIG_CPU="pwr8"
|
12
common/cross-profiles/x86_64-musl.sh
Normal file
12
common/cross-profiles/x86_64-musl.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for x86_64 and Musl libc.
|
||||
|
||||
XBPS_TARGET_MACHINE="x86_64-musl"
|
||||
XBPS_TARGET_QEMU_MACHINE="x86_64"
|
||||
XBPS_CROSS_TRIPLET="x86_64-linux-musl"
|
||||
XBPS_CROSS_CFLAGS="-mtune=generic"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="x86_64-unknown-linux-musl"
|
||||
XBPS_CROSS_ZIG_TARGET="x86_64-linux-musl"
|
||||
XBPS_CROSS_ZIG_CPU="baseline"
|
12
common/cross-profiles/x86_64.sh
Normal file
12
common/cross-profiles/x86_64.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Cross build profile for x86_64 GNU.
|
||||
|
||||
XBPS_TARGET_MACHINE="x86_64"
|
||||
XBPS_TARGET_QEMU_MACHINE="x86_64"
|
||||
XBPS_CROSS_TRIPLET="x86_64-linux-gnu"
|
||||
XBPS_CROSS_CFLAGS="-mtune=generic"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_FFLAGS="$XBPS_CROSS_CFLAGS"
|
||||
XBPS_CROSS_RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
XBPS_CROSS_RUST_TARGET="x86_64-unknown-linux-gnu"
|
||||
XBPS_CROSS_ZIG_TARGET="x86_64-linux-gnu"
|
||||
XBPS_CROSS_ZIG_CPU="baseline"
|
28
common/environment/README
Normal file
28
common/environment/README
Normal file
|
@ -0,0 +1,28 @@
|
|||
ENVIRONMENT SHELL SNIPPETS
|
||||
==========================
|
||||
|
||||
This directory contains shell files (must not be executable nor contain a shebang)
|
||||
that are read by xbps-src when building source packages. The shell files
|
||||
are read in lexical order (as ordered by shell rules).
|
||||
|
||||
These files shall set or unset environment variables while building packages.
|
||||
Only files with the `.sh' extension are read, so this file will be simply ignored.
|
||||
|
||||
The following directories are used to set the order in which the shell snippets
|
||||
should be read by xbps-src:
|
||||
|
||||
* build-style (to set vars for a specific build_style helper)
|
||||
* setup (before reading template)
|
||||
* setup-subpkg (before running the subpkg <pkgname>_package() function)
|
||||
* fetch (before running fetch phase)
|
||||
* extract (before running extract phase)
|
||||
* configure (before running configure phase)
|
||||
* build (before running build phase)
|
||||
* check (before running check phase)
|
||||
* install (before running install phase)
|
||||
* pkg (before running pkg phase)
|
||||
|
||||
NOTES
|
||||
~~~~~
|
||||
* Symlinks can be created (relative) to make a shell snippet available in
|
||||
multiple phases.
|
0
common/environment/build-style/.empty
Normal file
0
common/environment/build-style/.empty
Normal file
10
common/environment/build-style/R-cran.sh
Normal file
10
common/environment/build-style/R-cran.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
makedepends+=" R"
|
||||
depends+=" R"
|
||||
create_wrksrc=required
|
||||
build_wrksrc="${pkgname#R-cran-}"
|
||||
|
||||
# default to cran
|
||||
if [ -z "$distfiles" ]; then
|
||||
distfiles="https://cran.r-project.org/src/contrib/${pkgname#R-cran-}_${version//r/-}.tar.gz
|
||||
https://cran.r-project.org/src/contrib/Archive/${pkgname#R-cran-}/${pkgname#R-cran-}_${version//r/-}.tar.gz"
|
||||
fi
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue