Commit Graph

577 Commits

Author SHA1 Message Date
Piotr Wójcik 14d0b54a06 xbps-src: add flag to build broken packages
helps to check if build can be fixed
2022-04-26 21:29:11 +02:00
Piotr Wójcik 3ad374dbe4 xbps-src: sort and deduplicate packages at update-sys 2022-04-21 18:21:07 +02:00
Michal Vasilek 1ccc884f1c xbps-src: make -E ignore remote repositories with -N 2022-04-17 19:39:03 +02:00
classabbyamp 7548d06eca shutils: introduce XBPS_ORIG_MAKEJOBS variable
Some packages couldn't work well with XBPS_MAKEJOBS,
thus we disable parallel build for those packages.

On the other hand, some packages including but not limited to openjdk
use an internal mechanism to build themselves in parallel.

Let's invent another variable for those packages.

(message by sgn)

Co-authored-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2022-02-11 20:03:30 +01:00
Piotr Wójcik 054569c364 xbps-src: correctly change working directory for post_fetch 2022-01-05 20:32:41 +01:00
Gonzalo Tornaría 7231f47b26 etc/conf: implement XBPS_MIRROR for remote repos
Setting this variable will make xbps-src use an alternative mirror for
remote repositories.

Using this variable one can change the remote repository for all
architectures in a single setting and without the need to modify
`etc/xbps.d/repos-remote*.conf`. This is much more convenient as it
allows changing remote repos without a dirty worktree.

To use just add a line like the following to `etc/conf`:

    XBPS_MIRROR=https://repo-us.voidlinux.org/current

We also disable 00-repository-main.conf for cross so we don't use the
remote repo from the xbps package.
2021-12-22 23:12:06 +01:00
Piotr Wójcik 9cdfea60ca xbps-src: improve error message on dependencies installation
Message contained one of many packages to install,
incorrectly suggesting that this is problematic one.
Remove that. List of packages is printed on previous line.
2021-10-15 19:01:15 +02:00
Piotr Wójcik 4f03807529 xbps-src: overwrite packages in local repo 2021-09-13 23:04:48 +02:00
Đoàn Trần Công Danh d8e2056a8f xbps-src: retire XBPS_PKGDESTDIR
Historically, PKGDESTDIR was only set during pkg_install, and
XBPS_PKGDESTDIR was set to indicate that we're in subpkg's
pkg_install.

However, from 0b95cb8f5d, (Merge xbps-src code to make it usable in
a standalone mode., 2014-03-22), PKGDESTDIR is always set,
regardless of states.

Let's drop all usages of XBPS_PKGDESTDIR.

While we're at it, error out of vmove is used outside of subpkg.
2021-07-11 16:21:29 +07:00
Đoàn Trần Công Danh e5626f81c7 update_check: support pkgs.fedoraproject.org 2021-06-23 19:04:03 +07:00
Đoàn Trần Công Danh fb4838a591 base-chroot: add tzdata
Some packages require tzdata to testing, however, adding `tzdata` to
those checkdepends will break masterdir, since `tzdata` provides
`/usr/share/zoneinfo/UTC`, hence, it will be removed upon cleanup.

Let's add `tzdata` into `base-chroot` and remove the shenanigan in
`chroot.sh`.
2021-06-17 07:33:49 +07:00
Đoàn Trần Công Danh cf11f9987e update-check: fix update pattern for literal dot
The dot (.) inside [] matches literal dot. I don't know how it's
working, however the update-check for some packages is broken (i.e.
anthy-unicode).

Let's remove the backslash.
2021-05-23 12:11:03 +07:00
Érico Nogueira 47dae4b67d shutils/pkgtarget: don't spam stderr with expected rm errors
Since the first `rm -rf` command is allowed/expected to fail, hide its
output. This was missed with the initial optimization in
d7bf8e06a0.
2021-05-14 16:13:51 -03:00
Érico Nogueira d7bf8e06a0 shutils/pkgtarget: speed up build dir cleanup.
We need `chmod -R` to be able to cleanup after Go packages, but it's
unnecessary in most other cases. By only running it when the first `rm
-rf` fails, we optimize for the most common case and get a tiny speedup
for this build step.
2021-05-11 20:09:09 -03:00
Piotr Wójcik aa83569fcb xbps-src: add make_check=ci-skip 2021-04-26 18:49:15 +02:00
Piotr Wójcik 490ef8c8b2 xbps-src: update-check: print out match pattern in verbose mode 2021-04-17 21:34:10 +02:00
Michael Aldridge 4f896929b9 xbps-src: remove remove-obsoletes 2021-04-16 00:02:06 -07:00
Michael Aldridge 0c9e6e56e7 common/xbps-src: Fix remove-obsoletes 2021-04-15 01:35:17 -07:00
Michael Aldridge f5e766c248 xbps-src: Add remove-obsoletes command 2021-04-14 22:45:13 -07:00
Enno Boland 6d243d7619
common/xbps-src: update-check checks new gnome upstream sites 2021-04-09 18:52:35 +02:00
Đoàn Trần Công Danh 59c67f7d6d xbps-src/update_check: update pattern for GitHub 2021-03-19 22:48:10 +07:00
Duncaen 1f6ab168de xbps-src: simplify dbulk-dump output
* List dependencies of subpackages as part of the source packages
  dependencies, knowing the subpackage they are coming from does
  not matter to a build scheduler as long as xbps-src requires
  those to exist in the same way to main depends= have to exist.
* Resolve virtual? packages through existing means in xbps-src to
  avoid duplicating and possibly diverting from xbps-src's
  behaviour in tools that use dbulk-dump.
* Filter out dependencies on the template itself from sub packages,
  this matches the xbps-src behaviour and there is no need to
  have to duplicate logic for this into the scheduling tool.
* Error out on archs= restrictions as we do already on broken=
  and nocross=, there shouldn't be the need to discover archs=
  restrictions when attempting to build the package.
2021-03-12 18:33:11 -05:00
Piotr Wójcik 81e0103b38 xbps-src: make update-sys operate on host
partially reverts 75eca1b03e
2021-03-10 17:19:02 +01:00
Érico Rolim 21f5e306a5 xbps-src/shutils/show: remove outdated long_desc printing. 2021-03-02 19:58:28 -03:00
Đoàn Trần Công Danh 36a3b046fb update_check/gnome: also check for 0.* version 2021-02-21 09:28:34 +07:00
Érico Rolim 2a748e7e6d xbps-src/libexec: add make_check option.
Allows a template to define in which circumstances its do_check phase
should run, without requiring custom do_check definitions in each
template (also makes it easier to change how build styles do things
without checking as many templates).

Add to Manual and CONTRIBUTING as well.
2021-02-11 02:40:09 -03:00
sternenseemann 1384e928f7 xbps-src: create $XBPS_MASTERDIR/tmp in chroot_prepare
Missing $XBPS_MASTERDIR/tmp caused ca-certificates and glibc-locales to
fail in the reconfigure step of binary-bootstrap, since a call to mktemp
(which I couldn't locate in source though) assumed /tmp in the chroot
would be present already.

This issue was reproducible reliably for me on NixOS by doing something
like:

    rm -rf masterdir
    ./xbps-src binary-bootstrap

The workaround I found was:

    mkdir -p masterdir/tmp      # or alternatively ./xbps-src clean
                                # which also (re-)creates masterdir/tmp
    ./xbps-src binary-bootstrap

This workaround is now mirrored in chroot_prepare by ensuring that tmp
always exists.
2021-02-11 02:07:32 -03:00
Đoàn Trần Công Danh 2ec0338af6 update_check: update GNOME pattern for GNOME 40 2021-01-28 07:18:59 +07:00
Érico Rolim ef9c6f9a29 shutils/chroot: add newline to warning about unset timezone.
The warning is being triggered in CI, though it shouldn't have been hit
at all.
2021-01-22 12:51:30 -03:00
q66 cb804fbf85 xbps-src: remove noarch 2021-01-20 13:09:59 +01:00
Olaf Mersmann 0d8589f193 shutils/chroot.sh: create symlink for /etc/localtime
Currently /etc/localtime is copied from the host to the chroot. Some
software expects /etc/localtime to be a symbolic link it can read to
determine the name of the time zone, so set up the expected link
structure.
2021-01-19 22:13:26 -03:00
John 5884118e3a shutils/show.sh: never show self deps for depends
xbps-src always ignore self deps in depends and in hostmakedepends
when not cross compiling. The old behaviour did only check for cross.
This now also ignores them in makedepends, but they are either way
disallowed in there, and returning an error would be correct, but
./xbps-src show-* is and never was suitable for linting, so ignore for now.
2021-01-06 21:19:46 +01:00
q66 5922df60c7 xbps-src: make sure to apply FFLAGS properly like CFLAGS 2021-01-03 14:11:02 +01:00
Duncaen 3eed75216c xbps-src: remove proot chroot-style
proot is broken and result in random hard to debug issues,
this is the best way to not have new users use it.
2020-12-29 23:02:16 -08:00
Érico Rolim a5ed5f551c shutils/chroot.sh: fix syslog configuration.
The file was created in chroot_prepare(), but the configuration
directory was being cleaned in chroot_sync_repodata(). This commit moves
the configuration to after the directories are created.

Fixes #25534
2020-12-11 15:25:39 -03:00
Đoàn Trần Công Danh 08a382be7e chroot.sh: export XBPS_ALT_REPOSITORY to chroot
Outside of chroot, we calcucate XBPS_ALT_REPOSITORY only to throw it
away and calculate it again inside chroot. Normally, this is not problem
except when we're working with a Git's worktree, in which case, we don't
have the access to original gitdir inside chroot.

Let's bring that value from outside of chroot into it.
2020-12-09 19:54:08 +07:00
Jony ecc31ed587 xbps-src/shutils/update_check.sh: add support for git.sr.ht
The code for `git.sr.ht` was almost identical to that of `hg.sr.ht`. The
main difference, aside from replacing `hg.sr.ht` in `url` with
`git.sr.ht`, was the endpoint of `url`. The `hg.sr.ht` url uses `tags`
whereas `git.sr.ht` uses `refs`.
2020-10-21 22:10:31 +02:00
Piotr Wójcik 46cb66d525 Prefer flags over config file, again 2020-09-14 23:55:22 +02:00
Piotr Wójcik 600d33006b xbps-src: separate options of target package and its dependencies 2020-09-07 22:18:29 +02:00
Piotr Wójcik 15e7a92951 xbps-src: make build options from config ang flags work together
Flag options was appended to XBPS_PKG_OPTIONS, but was later
overwritten by sourcing config. Instead, pass only flags
options in separate variable and join at very end.
2020-09-07 22:18:29 +02:00
Piotr Wójcik 52781a35fe Revert "xbps-src: fix build-options via cmdline."
Needed to load XBPS_PKG_OPTIONS_foo.

This reverts commit 47175dc8bb.
2020-09-07 22:18:29 +02:00
Piotr Wójcik 6efc7dd98d xbps-src: quote wrksrc to allow whitespace 2020-09-03 21:03:32 +02:00
Isaac Freund 5de1503434 xbps-src/update-check: add codeberg support 2020-08-18 14:46:25 +02:00
Isaac Freund 3d035237ac xbps-src/update-check: unify per-site locals 2020-08-18 14:46:25 +02:00
Đoàn Trần Công Danh 050861b37e xbps-src: enable C.UTF-8 locale on glibc masterdir
`util-linux` requires `C.UTF-8` for testing.

Since this is an important part of system,
enable `C.UTF-8' for checking `util-linux`.
2020-08-07 11:35:11 +00:00
Piotr Wójcik dabbbffabf xbps-src: -p argument for showing more variables 2020-07-13 19:52:53 +02:00
q66 248503d632 Revert "common/shlibs: fix hidrd"
This reverts commit f7948d6051.

??????
2020-07-06 22:25:02 +02:00
Piraty f7948d6051 common/shlibs: fix hidrd 2020-07-06 22:07:38 +02:00
Andrew Benson 61a501a104 shutils/bulk.sh: remove newlines from package list 2020-06-04 13:21:42 -05:00
John 6ce531b231 common: unser PKG_CONFIG before sourcing templates, set PKG_CONFIG also for native 2020-05-29 14:30:06 +02:00
John 82734d940c
common/xbps-src: set PKG_CONFIG{,FOR_BUILD} env vars 2020-05-26 21:18:27 +02:00
Đoàn Trần Công Danh 2af30cdd78 setup: compute gitrev from outside of chroot
Together with previous commit, `xbps-src` is able to support
git-worktree and shared repository by now.
2020-05-23 06:59:24 +00:00
Jürgen Buchmüller 8e2cacd746 common/.../purge_distfiles.sh: fix template scan
To avoid scanning templates multiple times, because
symbolic links were included, use find to scan only
directories below srcpkgs and collect their
srcpkgs/<dir>/template files.
2020-05-04 19:23:25 +02:00
q66 2357578d15 shutils/common.sh: plumbing for ppcle 2020-04-30 01:06:51 +02:00
Piotr Wójcik 04e9ee8010 xbps-src: changelog in 'show' target 2020-04-28 23:27:00 +02:00
Piotr Wójcik 6cd3bd1806 xbps-src: break out of following cyclic dependencies 2020-04-15 20:34:06 +02:00
Juan RP ad3d1f862d
xbps-src: show_pkg_build_depends: handle cross case. 2020-04-15 13:29:44 +02:00
Juan RP a73783d17d
xbps-src: fix show_pkg_build_depends after af6e1a7e79.
af6e1a7e79 introduces dependencies based in subpkgs,
but this makes "xbps-src show-build-deps" return cyclic
dependencies in some cases, i.e:

$ ./xbps-src show-build-deps kirigami2
cmake
extra-cmake-modules
kcoreaddons
kirigami2
qt5
$

This is because `kirigami2-devel` depends on `kirigami2`, thus
introducing a cycle.

Skip cycles completely, note that "show-build-deps" should not
be used to collect deps for cross compilation, because you can't
know what type of dependency it is: host or target.
2020-04-15 13:12:26 +02:00
Piotr Wójcik af6e1a7e79 xbps-src: build depends of subpackages
resolves #20508
2020-04-15 11:17:54 +02:00
Juan RP b166cdd484
Revert "xbps-src: create XBPS_WRAPPERDIR via libexec/build.sh."
This reverts commit 4df0bcff74.

Reverted until I find the real issue.
2020-04-14 14:14:13 +02:00
Juan RP 8ab6edc842
xbps-src/chroot.sh: copy xbps repo keys even with -N.
To make @pullmoll happy
2020-04-13 01:59:03 +02:00
Juan RP 8b3ce3fc02
xbps-src: (chroot_sync_repodata) skip unnecessary stuff with -N. 2020-04-13 01:14:31 +02:00
Juan RP 4df0bcff74
xbps-src: create XBPS_WRAPPERDIR via libexec/build.sh.
This way there's no stale files in other unrelated targets,
like `show-build-deps`.
2020-04-07 12:39:41 +02:00
Leah Neukirchen 64ef186678 common/xbps-src/shutils/cross: update cross-vpkg-dummy version. 2020-04-06 22:26:43 +02:00
Piotr Wójcik 174f6b522b common.sh: allow individual build options for packages with dot in name 2020-03-09 21:59:16 +01:00
Zach Dykstra e4b9e4a04a update_check.sh: remove v from the detected version match group 2020-03-09 21:05:58 +01:00
Juan RP 47175dc8bb
xbps-src: fix build-options via cmdline.
Fixes #19495
2020-03-06 18:18:36 +01:00
Piotr Wójcik 588e8cdb7b common: retry ftp download during CI 2020-02-11 23:05:31 +01:00
q66 9fb3ffe131 common: make XBPS{_TARGET}_NEED_ATOMIC less misleading 2020-02-07 21:41:39 +01:00
Jürgen Buchmüller 5bed028584 common.sh: introduce XBPS{,_TARGET}_NEED_ATOMIC 2020-02-07 21:29:22 +01:00
Zach Dykstra b7389f26af Add hg.sr.ht to update_check.sh
hg.sr.ht project pages are laid out quite closely to GitHubs format. We
can basically clone the check for GitHub to a new base URL of hg.sr.ht .
2020-02-05 09:05:08 +01:00
q66 cd2e132ea1 xbps-src: per-architecture handling of repo confs
The new behavior is basically this:

1) Local repos are installed same as before.
2) Multilib configs are now handled only if they exist. They follow
   a naming system repos-{local,remote}-ARCH-multilib.conf.
3) Remote repo files follow naming repos-remote-ARCH.conf. If that
   does not exist, repos-remote.conf or repos-remote-musl.conf is
   used instead (fallback).
4) Cross follows the same behavior, just without multilib.

[ci skip]
2020-01-30 15:49:01 +01:00
q66 f0e852c511 xbps-src: implement per-architecture repocache
That means instead of having a single hostdir/repocache, there
is now hostdir/repocache-$XBPS_TARGET_MACHINE.

This solves multiple problems:

1) When cross-compiling for different architectures and the repos
   for host and target differ, you will not get signature/checksum
   conflicts for noarch packages.
2) The clean-repocache command will not delete noarch packages that
   don't belong to that architecture.
3) Clean mixing of glibc and musl masterdirs with the same hostdir
   is now possible; even when building natively, the musl masterdir
   will use its repocache-foo-musl, while the glibc masterdir will
   use repocache-foo.

[ci skip]
2020-01-28 18:25:39 +01:00
q66 4098c62ebc xbps-src: prevent builddir/destdir from always being removed
The problem here is that newly introduced behavior in commit
b2b0409be4 resulted in builddir and
destdir *always* being removed when starting a build, as a part of
masterdir auto-update. We don't want this as we may want to resume
a previous build (e.g. by running stages individually or by resuming
a failed build from where it stopped).

Therefore, explicitly override the removal to restore previous behavior.
2020-01-28 01:09:04 +01:00
Juan RP d94a15be8f
xbps-src: use XBPS_INSTALL_ARGS; allow custom xbps.d settings.
If `etc/xbps.d/custom` exists (directory) and contains
xbps.d(5) .conf files, those will be copied verbatim
to `masterdir/etc/xbps.d`.

This allows you to set your custom xbps.d(5) settings
without having to modify any other file.

This is also useful for testing xbps.d(5) noextract feature.
2020-01-26 10:41:12 +01:00
Duncaen 0ad3adfb0b
Revert "xbps-src/build.sh: always start with a clean statedir."
This reverts commit 2a959e32ee.
2020-01-13 23:34:00 +01:00
Jürgen Buchmüller 1111601672 common.sh: if $XBPS_SKIP_REMOTEREPOS rm *remote*
There may be /etc/xbps.d/*remote* config files dangling from a previous
run w/o XBPS_SKIP_REMOTEREPOS being set. Make sure to remove them
in case $XBPS_SKIP_REMOTEREPOS is set for this run.
2020-01-08 16:54:32 +01:00
Juan RP 2a959e32ee
xbps-src/build.sh: always start with a clean statedir.
Let's see if this fixes buildbot...
2020-01-05 13:02:43 +01:00
Juan RP 0ad1351c30
xbps-src/chroot.sh: repair "binary-bootstrap" for 32bit on x86_64. 2020-01-05 12:07:30 +01:00
Juan RP 12f676e6f2
xbps-src: install_pkg_deps: restore previous behaviour.
Don't msg_error if a dependency failed to build, maybe
due to broken or nocross.
2020-01-05 10:48:13 +01:00
Juan RP b2b0409be4 xbps-src/chroot.sh: simplify update_base_chroot(). 2020-01-05 10:44:56 +01:00
Juan RP b164856abd xbps-src/chroot.sh: silence grep output 2020-01-05 10:44:56 +01:00
Juan RP 5285cb9212 xbps-src: fix for x86_64 local multilib repos.
Found and fixed by @pullmoll
2020-01-05 10:44:56 +01:00
Juan RP 80b76c221a xbps-src: update_base_chroot(): remove autodeps after sysup. 2020-01-05 10:44:56 +01:00
Juan RP 817d3a8b7d chroot_init: return 0 at the end to not inherit last cmd errval. 2020-01-05 10:44:56 +01:00
Juan RP 75eca1b03e xbps-src: base-chroot-v2 (reduce artifacts/deps)
This patchset contains multiple changes to xbps-src and
its required package "base-chroot" for building packages
via chroot.

- moved xbps.d(5) conf files to `etc/xbps.d`.
- renamed xbps.d(5) repository files to `etc/xbps.d/repos-{local,remote}*`.
- do not set `--repository` to any xbps command that supports it,
  xbps-src now simply populates `rootdir/etc/xbps.d` with correct
  settings (taking care of CHROOT_READY/IN_CHROOT).
- Unless `-C` is set (to preserve builddir/destdir/autodeps), when
  entering to the chroot (if CHROOT_READY is set), xbps-src will
  clean up the masterdir and then perform a system update to always
  use a constant set of packages for that exact date.
- Improved some normal/error msgs.
- Includes support for `xbps>=0.58`.
- common/hooks: switch to bsdtar.
- base-chroot:
  - base-chroot-musl is gone, now unified for glibc/musl.
  - deps removed: gettext, mpfr, readline, texinfo, which, xz.
  - deps changed: tar -> bsdtar.

Effectively this reduces dependencies in `base-chroot`, makes
it unified for musl and glibc, switches xbps-src to use `bsdtar`
rather than GNU `tar` and `xz`, gets rid of useless host dependencies
like GNU gettext, texinfo, etc.

I've been testing these changes for 1 month or so already,
I was able to build from scratch `base-system` for both native
and multiple targets, i.e `./xbps-src -a target -Nt pkg base-system`
2020-01-05 10:44:56 +01:00
Piotr Wójcik 85f5e06fda xbps-src: don't install checkdepends for cross build 2020-01-02 23:15:41 +01:00
Juan RP 8c9aca6426
xbps-src: "build-options" obj is a string, no newlines accepted. 2019-12-29 20:19:54 +01:00
q66 7febf540a9 shutils/purge_distfiles.sh: fix purging of multiple distfiles
Previously, xbps-src would try to find checksums in template files
and not purge those found but it actually ignored everything that
had the checksums specified on multiple lines.

The reason for this is that the bash 'read' builtin reads until it
finds a newline, and if you specify multiple checksums on multiple
lines rather than on one line it would ignore all but the first.

Fix this by replacing newlines with spaces, so that it can properly
read all checksums into an array.
2019-12-23 00:53:29 +01:00
Juan RP f7412cdf8d
xbps-src: don't set -i to xbps-install(1).
As reported by @pullmoll via https://github.com/void-linux/xbps/issues/190
the culprit is this assignment, rather than in the xbps code.

Tested with local and remote repos, no regressions found.
2019-12-15 18:53:04 +01:00
q66 3a363d2611 xbps-src: account for nonfree repo with -E
This makes sure nonfree packages don't get rebuilt when -E is
passed to xbps-src.

[ci skip]
2019-12-14 11:26:36 +01:00
Stefano Ragni 3c8ad720a3 shutils/bulk.sh: use XBPS_DISTDIR when running xbps-src 2019-12-01 12:14:39 +01:00
q66 021b7cc11e xbps-src: revert to previous bulk_sortdeps code
This should restore sort-dependencies behavior back to its former
behavior of not including all of the build dependencies not in
the input list in its listing.
2019-11-19 02:04:25 +01:00
Duncaen 2a59e976c1
xbps-src/chroot.sh: don't set empty PROXY environment variables 2019-11-08 18:48:25 +01:00
John c1acedacaa xbps-src/shutils/cross.sh: error out if cross toolchain can't be compiled
$rval was the return code of pkg_available and not of build.sh, since
pkg_available returns 0. because of this install_cross_pkg() would
always return 0 for success.
2019-11-03 18:42:17 +01:00
Johannes 175b65f006 common: change wording in error message
build helper and build styles are now different concepts
2019-11-01 00:45:49 +01:00
Juan RP 23f75a842d
xbps-src/chroot.sh: fix previous correctly 2019-10-27 12:15:49 +01:00
Juan RP b469f1d590
xbps-src/chroot.sh: initialize XBPS_CONFIG_FILE.
Fixes #15208
2019-10-27 12:14:24 +01:00
John 46ac0aeb23 common/build_dependencies.sh: Disallow subpackages in makedepends 2019-10-26 00:44:22 +02:00
q66 0a38409da6 xbps-src: work around autodeps removal needing multiple passes 2019-10-25 23:53:38 +02:00