Commit Graph

484 Commits

Author SHA1 Message Date
Piotr Wójcik 4f03807529 xbps-src: overwrite packages in local repo 2021-09-13 23:04:48 +02:00
Piotr Wójcik 7b7d385f8b common/hooks: simplify setting arch for binpkg
setup_pkg always export XBPS_TARGET_MACHINE
2021-09-13 23:04:48 +02:00
Quentin Rameau fbc36bd439 hooks/fix-permissions: reword error message
The proper way of describing the culprit bit is “other”
and not “all” users.
2021-09-08 23:16:27 +02:00
Michal Vasilek b30ea3cffe hooks/post-install: add fix permissions hook 2021-08-26 21:46:44 +02:00
Érico Nogueira 6303c2e6ce common/hooks: speed up generate-runtime-deps.
Instead of using file(1) to check for ELF files, just read bytes
directly from the file and check if they are the ELF magic bytes.

Should probably be factored out into a common function that can be used
in other places, if necessary.

Also use awk instead of "grep|awk" for some minor speedup.
2021-07-22 11:56:26 -03:00
Piotr Wójcik 3680c424db hooks/prepare-32bit: create packages from all *-devel
All *-devel dependencies of 32bit packages are replaced
with *-devel-32bit. Missing dependencies made some
uninstallable.
2021-07-10 20:45:50 +02:00
Piotr Wójcik 7845fa8c53 hooks/prepare-32bit: correct devel packages matching
fixes cases like 'ruby-devel-doc'
2021-07-10 20:45:50 +02:00
Érico Nogueira 3d62ba684f common/hooks/post-install: show error in $STRIPCMD in 06-strip-and-debug.
Currently fails with a hard to understand error message:

    2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1
2021-07-04 22:29:17 +02:00
Đoàn Trần Công Danh 8b25a1449b do-patch: switch default patch_args to -Np1
All templates that require -Np0 have patch_args appended.
Let's flip the switch.
2021-06-20 13:17:29 +07:00
q66 1ea593eeda base-files: fix conf files replacing each other wrong 2021-02-28 02:05:33 +01:00
q66 5949392125 base-files: make some sysctls like kexec setting user-alterable
While at it, relax the pkglint for base-files only.
2021-02-28 01:44:30 +01:00
Đoàn Trần Công Danh 8f8c5789b9 common/00-libdir: only create lib{32,64} symlink if not exists 2021-02-10 14:38:59 +01:00
Leah Neukirchen 210b461028 hooks/post-install/06-strip-and-debug-pkgs.sh: speed up.
Only run file once for each file in the destdir, only double-check
when we are about to strip the ELF files.
2021-01-30 15:20:53 +01:00
Leah Neukirchen 6ecbbf767a hooks/pre-pkg/03-rewrite-python-shebang.sh: use grep -r instead of find.
This saves us one sed execution per file in the destdir, resulting
in a major speedup.

Grep will only consider text files and only look at the first line.
2021-01-30 15:20:43 +01:00
Érico Rolim 4a41da0426 hooks/{pre,post}-install: fix 98-fixup-gir-path.
The libdir changes to use /usr/lib{32,64} instead of /usr/lib broke
cross builds for some packages that use gir, due to issues with copying
over symlinks. Since we haven't managed to track down the root cause for
the installation path, a symlink is a clean enough temporary fix. This
follows the style of the 00-libdir hooks.

Since pre-install runs for the main package and then each subpackage, it
should use PKGDESTDIR (not DESTDIR), which also enables a subpackage
that installs files during pkg_install to work cleanly.

As far as I can see, the previous hook was quite flawed. Since it was a
pre-install hook, the check for a directory would happen *before*
package installation (so nothing would happen). The only reason it did
anything was because it also ran as a step before a subpackage's
pkg_install (most GIR packages have a -devel subpackage), but used
DESTDIR instead of PKGDESTDIR, so it checked and affected the contents
of the main package. Then when the subpackage's pkg_install ran, the
files would have already been copied to the correct folders.

Closes #27437
2021-01-24 18:08:27 -03:00
Đoàn Trần Công Danh 32e2827145 wrapper: valac: pass --vapidir after real arguments
Due to constant change in vala, some projects includes some old and
pre-generated vapi in their source tree and uses that version
instead of system one.

Pass system vapidir after real arguments in order to prefer its bundled
vapi.
2021-01-24 12:45:14 +07:00
q66 cb804fbf85 xbps-src: remove noarch 2021-01-20 13:09:59 +01:00
Đoàn Trần Công Danh 04825ced01 hooks: abort if l10n files found in /usr/lib 2021-01-09 13:11:27 +07:00
Đoàn Trần Công Danh 6547bbb473 freetype: clean XBPS_CROSS_TRIPLET reference in freetype-config
* $XBPS_CROSS_TRIPLET-pkg-config is our wrapper not a real executable
* In a build that have both freetype-config and pkg-config,
  $XBPS_CROSS_BASE will be prepended twice with current system,
  let's fix it.
2021-01-05 06:41:36 +07:00
Đoàn Trần Công Danh bd62ff8580 99-pkglint-subpkgs: replace grep with case..esac
On experience with 100 subpkgs, this change reduces execution time from
284ms to 4ms

Closes: #27137 [via git-merge-pr]
2020-12-29 22:46:59 -08:00
q66 6283b0d209 common/hooks/{pre,post}-install: generalized libdir hook
this makes sure we don't have to worry about packages installing
stuff in lib32/lib64, it will be automagically symlinked

if something is still left over for whatever reason, or if the
opposite wordsize directory exists, that will be caught by pkglint
2020-12-21 21:03:06 -03:00
Đoàn Trần Công Danh 3996821f07 99-pkglint-subpkgs: correct for multiline subpackages
As discussing in [1], on template with "subpackages" as multilines will
report false positive on some packages will never be built.

There're multiple problems here:

- expanded "subpackages" will have an empty line if it has a newline
  inside template
- "sed" expression couldn't work with multilines "subpackages"

Let's not quote "$subpkgs" and "$subpackages" in "printf" to let the
shell do expansion and trim the empty lines for us. And rewrite the
"sed" expression to work with multilines "subpackages"

[1]: https://github.com/void-linux/void-packages/pull/26939#issuecomment-739098547
2020-12-14 09:35:02 +07:00
Érico Rolim a6c6bcc651 common/hooks: remove remove-localized-manpages hook.
Allow packages to include localized man pages. Needed for manpages-l10n.
2020-12-12 03:58:57 -03:00
Đoàn Trần Công Danh ca8b0789b9 wrapper: bring valac and vapigen to current version
Current wrappers hard-coded them at 0.42 which is very long ago.
Hence, those wrappers insert a versioned vapidir that no longer exists.
The build still work because valac will look into host's versioned vapidir
instead.

Let's check the version we're having and wrap that instead of changing
the hard-coded number from time to time.
2020-11-26 20:57:52 +07:00
Érico Rolim c804437d04 common/hooks/post-install/04-create-xbps-metadata-scripts.sh:
use correct section for chroot(2) in comment.
2020-11-13 23:06:14 -03:00
Andrew J. Hesford e590822d93 python3: update to 3.9.0. 2020-10-10 10:21:09 -04:00
Piotr Wójcik 6efc7dd98d xbps-src: quote wrksrc to allow whitespace 2020-09-03 21:03:32 +02:00
Piotr Wójcik dcdbcbf30a 11-pkglint-elf-in-usrshare: disallow x-executable
Can be allowed per-package now
2020-08-25 21:18:59 +02:00
Helmut Pozimski e0979275b4 11-pkglint-elf-in-usrshare: allow explicit setting of exceptions
Co-authored-by: Piotr Wójcik <chocimier@tlen.pl>
2020-08-25 21:18:59 +02:00
Noah Huppert 984fa5d9cb xbps-src: fixed dangling binpkg lock on error
Co-authored-by: Noah Huppert <contact@noahh.io>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>

Closes: #24191 [via git-merge-pr]
2020-08-17 09:42:08 -04:00
fosslinux 102841754a xbps-triggers: add texmf-dist regeneration trigger 2020-07-14 02:38:24 +02:00
John 9ff9323c0f hooks/pkglint-devel-paths: do move static find calls out of the loop
Right now they got executed every iteration, but weren't dependent
on the loop. Which resulted in getting the output x times more often
than neccessary
2020-07-12 04:20:48 -07:00
Đoàn Trần Công Danh 74f0186fd9 common/wrapper: python*-config: answer --includes
We haven't run into trouble with this because most configure script
check if $PYTHON-config exist,
thus force packager uses /usr/bin/python{,3}
2020-07-04 22:22:10 +07:00
John c677edf2b3 hooks/pkglint-elf-in-usrshare: speed up by only starting file once 2020-06-29 16:24:08 -07:00
Andrew J. Hesford 4ef9cff1d3 xbps-src: consume all shebang arguments during rewrite 2020-06-18 09:38:18 +02:00
Andrew J. Hesford b56a3b0650 xbps-src: improve python shebang rewrites 2020-06-10 19:11:58 +02:00
Đoàn Trần Công Danh d9c22b4d0a pre-pkg: use existing info to check empty package 2020-05-31 02:11:11 +00:00
Đoàn Trần Công Danh 91c0eaa5a7 xbps-src: pre-pkg: allow only white-listed directories. 2020-05-31 02:11:11 +00:00
Đoàn Trần Công Danh d7f942b709 post-install: warn if cross wrapper not cleared 2020-05-31 02:10:51 +00:00
Đoàn Trần Công Danh eef02a2b84 post-install: clean reference to $XBPS_CROSS_BASE in pkgconfig 2020-05-31 02:10:51 +00:00
John 953f4b47a9
xbps-src/common: add option to disable generic pkg-config link
closes #21728
2020-05-26 21:21:23 +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
Đoàn Trần Công Danh 20f9bedefb xbps-src: use $XBPS_GIT_CMD for git 2020-05-23 06:59:24 +00:00
Andrew Benson de825d8a24 00-distfiles.sh: fix status phrasing 2020-05-10 10:57:40 +02:00
Piotr Wójcik 5028523d43 common/hooks: fix pycompile_module with explicit python_version=2 2020-04-25 02:10:01 +02:00
a 3c135fddb7 06-strip-and-debug-pkgs.sh: ignore binaries for unknown machines
Because most likely these files are not executables, but some kind of
bytecode. And strip doesn't know how to strip them anyway.
2020-04-23 23:01:01 -04:00
Piotr Wójcik 8a09d89eac common/hooks: remove pycompile_version, use python_version instead 2020-04-22 20:11:26 +02:00
Andrew J. Hesford 596250e4ea xbps-src: remove default python_version
Closes: #21209 [via git-merge-pr]
2020-04-21 18:45:25 -04:00
Đoàn Trần Công Danh 7c8ab37d36 pkglint: forbid files generated by mimedb trigger 2020-04-11 21:19:42 -04:00
Juan RP 7fe90df2b1
xbps-src: don't set a default for XBPS_PKG_COMPTYPE.
Use xbps-create(1) defaults:

 - xbps<0.59 defaults to xz
 - xbps>=0.59 defaults to zstd
2020-03-03 10:26:12 +01:00
q66 1fdd919d3b 02-script-wrapper: preserve original timestamps of wrapper scripts
At least since 0.53, the meson buildsystem checks whether the
"date" command's file is outdated and if it is, it'll trigger
regeneration of the build files.

Since the wrappers are reinstalled from scratch on every build step,
this would result in meson being re-run on each of those steps.
Which resulted in broken builds in some projects (e.g. efl) since
our meson build-style by default uses LTO and that requires the AR
environment variable being exported in a specific way, which was
only being done for the do_configure step but not build/install,
which resulted in meson being run with one env for configure and
another env for build, which broke everything.
2020-03-02 00:58:35 +01:00
Piotr Wójcik e06efd6bbb hooks/do-extract: refrain from extracting text files outside wrksrc 2020-02-19 19:02:01 +01:00
Piotr Wójcik 9e585603d6 hooks/do-extract: treat *.sh files as text files 2020-02-19 19:02:01 +01:00
innerspacepilot 0c523c2240 add support for .xz compressed files 2020-02-12 08:36:14 +01:00
Piotr Wójcik 588e8cdb7b common: retry ftp download during CI 2020-02-11 23:05:31 +01:00
Jürgen Buchmüller a32b6efd23 02-script-wrapper: add wrappers for ap{r,u}-1-config 2020-01-31 20:28:15 +01:00
mobinmob d224b06d8e 00-distfiles.sh: allow bsdtar for zip and 7z archives 2020-01-24 14:53:41 +01:00
q66 2b7fb8124c 00-distfiles.sh: allow bsdtar for ruby gems 2020-01-11 18:52:20 +01:00
Jürgen Buchmüller 834a0a397f 00-distfiles.sh: fix bsdtar contents checksum (@)
Closes: #18070
2020-01-06 15:15:50 +01:00
Juan RP d547e90018 hooks/do-extract: 00-distfiles.sh: disable trap on ERR. 2020-01-05 10:44:56 +01:00
Juan RP d15b1f6746 hooks: 00-distfiles.sh: detect bsdtar and then tar (GNU).
This way xbps-src is able to work with any of them.
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
Đoàn Trần Công Danh f130fb058a hook: python-shebang: check for shebang in the first line only
- Grepping whole files is inefficient
- git-instaweb (in git package) has the code to generate python file in
  a here doc in the middle of its code, old hook generates false
  positive with this package
2019-12-28 18:02:39 +01:00
Juan RP 3a08e3d1b6
xbps-src: new pre-pkg hook that prints collected rdeps. 2019-12-15 18:55:58 +01:00
Cameron Nemo 23ff926700 base-files: install /usr/lib32 symlink on i686 2019-12-15 09:17:51 +01:00
Cameron Nemo 091ab0b612 base-files: ship bin and lib symlinks 2019-12-14 14:01:42 +01:00
Piotr Wójcik 0139bdb524 04-create-xbps-medatada-scripts.sh: autogenerate pycompile_modules 2019-12-06 20:23:37 +01:00
Piotr Wójcik eb3405a5ed hooks/generate-gitrevs: update summary 2019-11-23 09:33:32 +01:00
q66 80b96a0ea0 common: better location for config.{sub,guess} + update 2019-11-18 20:36:27 +01:00
John e351f6b462 hooks/post-install/03-remove-empty-dirs.sh: use find -delete instead of rmdir -p
rmdir -p could end up deleting even /destdir when a empty package would
not have any subpackages with a i686 masterdir.
2019-10-22 16:58:09 +02:00
John a93c02d3cc hooks/post-install: do remove lib32 symlink before checking for empty dirs
this resulted in empty i686 packages never getting flagged as empty
since the /usr/lib32 -> lib symlink was only removed after the check
2019-10-22 16:58:09 +02:00
Juan RP e4984d01ea xbps-src: multiple performance improvements
- use xbps-checkvers(1) to resolve dependencies.
- all dependencies are installed at once for the host and target.
- the show-build-deps target is now much faster.
- the update-bulk/show-repo-updates targets are now much faster.
- the update-sys/show-sys-updates targets are now much faster.
- the bootstrap target now works on musl hosts.
- simplified some loops.
- use cut(1) rather than awk(1) where applicable.
- multiple random changes to improve performance.

Based on work started by @Duncaen on #12433

Close #12433
Close #11282
2019-07-10 20:28:46 +02:00
Jürgen Buchmüller 17ba00b095 Revert "xbps-src: multiple performance improvements."
This reverts commit 2a4e178e35.
2019-07-05 12:08:45 +02:00
Juan RP 2a4e178e35 xbps-src: multiple performance improvements.
- use xbps-checkvers(1) to resolve dependencies.
- all dependencies are installed at once for the host and target.
- the `show-build-deps` target is now much faster.
- the `update-bulk/show-repo-updates` targets are now much faster.
- the `update-sys/show-sys-updates` targets are now much faster.
- the `bootstrap` target now works on musl hosts.
- simplified some loops.
- use cut(1) rather than awk(1) where applicable.
- multiple random changes to improve performance.

Based on work started by @Duncaen on https://github.com/void-linux/void-packages/pull/12433

Close https://github.com/void-linux/void-packages/pull/12433
Close https://github.com/void-linux/void-packages/pull/11282
2019-07-05 08:53:51 +02:00
Cameron Nemo 206a4a73f5 99-pkglint.sh: prevent installing files in /destdir
Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
2019-06-23 17:17:22 +02:00
Juan RP 248e301ff7 hooks/00-gen-pkg: use xbps-create(1) --changelog if set on template.
Signed-off-by: Juan RP <xtraeme@gmail.com>
2019-06-20 19:52:52 +02:00
Juan RP 7b7d7c13a1
xbps-src: exit properly if mktemp(1) fails, not from its subshell.
Thanks @huglovefan
2019-06-17 17:38:07 +02:00
Juan RP f59b295903 xbps-src: cleaned up usage of mktemp(1).
This one was on my TODO for a long while... fixes unportable
arguments (checked with the NetBSD's manual page).
2019-06-17 15:23:20 +02:00
Jürgen Buchmüller 998aac300a
hooks/pre-pkg/05-prepare-32bit.sh: fix symlinks
If lib32symlinks contains plain library names without a path as in
the case of glibc (lib32symlinks="ld-linux.so.2") the expression
${f%/*} is not empty, but returns the basename.
Handle that case by verifying that ${f%/*} is different from ${f}.

Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
2019-05-28 15:14:23 +02:00
John 0108c2a60e common/02-script-wrapper.sh: add generic_wrapper2 gdal-config 2019-05-12 20:21:26 +02:00
Jürgen Buchmüller f7107d38eb cross gir: hook to fix wrong cross install path
When cross building the gir files (*.gir, *.typelib) are installed
at ${DESTDIR}/usr/${XBPS_CROROSS_TRIPLET}/usr/* while they need to
be at ${DESTDIR}/usr/*
This hook is a temporary workaround until we can fix the cross gir
install to not insert the (as it seems) host's ${DESTDIR} into the
target's destination path.

Remove the temporary hack in polkit which is now handled by the hook.
2019-04-28 14:37:40 +02:00
maxice8 3d372ddc32 02-script-wrapper.sh: avoid useless use of echo
Co-authored-by: duncaen <duncaen@voidlinux.org>
2019-04-15 12:18:00 -03:00
maxice8 23216853d6 00-patches.sh: avoid useless use of cat 2019-04-15 12:18:00 -03:00
maxice8 53c60b31ae 05-preapre-32bit.sh: avoid useless use of cat 2019-04-15 12:18:00 -03:00
maxice8 68733fc673 99-pkglint.sh: avoid useless use of cat 2019-04-15 12:18:00 -03:00
maxice8 509f522dac 06-shlib-provides.sh: avoid useless use of cat 2019-04-15 12:18:00 -03:00
maxice8 f5c0feedf6 00-distfiles: avoid useless use of cat 2019-04-15 12:18:00 -03:00
maxice8 81da3e618c 06-strip-and-debug-pkgs.sh: replace grep -q with [[ ]] 2019-04-14 12:46:51 -03:00
maxice8 cdb6bf6e94 00-compress-info-files.sh: replace echo | grep with [[ ]] 2019-04-14 09:02:28 -03:00
maxice8 49193d73d9 00-patches.sh: replace echo | grep with [[ ]] 2019-04-14 07:45:09 -03:00
maxice8 13b5d09803 04-create-xbps-metadata-scripts.sh: replace echo | grep with [[ ]] 2019-04-14 07:45:09 -03:00
maxice8 a00d546dce 06-strip-and-debug-pkgs.sh: replace echo | grep with [[ ]] 2019-04-14 07:45:09 -03:00
maxice8 26d73d5ede 05-prepare-32bit.sh: remove dirname usage 2019-04-14 06:22:09 -03:00
maxice8 5b26fde9c0 06-strip-and-debug-pkgs.sh: remove dirname usage 2019-04-14 06:22:09 -03:00
maxice8 974f2805f2 00-compress-info-files.sh: remove dirname usage 2019-04-14 06:22:09 -03:00
Juan RP 1ee6a3174f xbps-src: reduce basename(1) usage.
This saves a few exec()s.
2019-04-14 01:47:16 -03:00
maxice8 a105e6b887 hooks/pre-pkg/05-prepare-32bit: handle files with spaces 2019-04-06 11:19:52 -03:00
maxice8 8956ff14f7
meta: forcefully gunzip and bunzip2 .gz and .bz2 files.
Otherwise it gets stuck with a confirmation prompt.
2019-03-03 19:34:54 -03:00
maxice8 34fe9c410f meta: move 00-patches.sh hook to do-patch phase 2019-02-27 22:56:19 -03:00
maxice8 4dddab21e9 meta: add hook directories for patch phase 2019-02-27 22:56:19 -03:00