Commit Graph

298 Commits

Author SHA1 Message Date
Juan RP 68701cf6ca xbps-src: repair -f <phase> again; close #2617
Also simplified configure/build/install phases to only touch a single
file once the phase has been run, rather than multiple of them
(pre/post, etc).
2015-09-27 18:49:38 +02:00
Juan RP 1f2147f240 xbps-src/doinstall.sh: update args check. 2015-09-27 11:28:11 +02:00
Juan RP 21b2f6c3e8 xbps-src: fix regressions introduced with -f <phase>. 2015-09-27 10:30:10 +02:00
Juan RP 1f4a588861 xbps-src: fix -f pkg when destdir is empty. 2015-09-27 10:09:08 +02:00
Juan RP 4449fbd0be xbps-src: make -f <phase> respect previous successful phases. 2015-09-24 16:12:10 +02:00
Juan RP 08efa2cca1 xbps-src: -f <phase> now works for configure/build/install/pkg phases. 2015-09-24 15:45:47 +02:00
Jürgen Buchmüller 482acee672 purge_distfiles.sh: remove empty directories 2015-09-23 15:12:55 +02:00
Juan RP a9b66c178a xbps-src: set LC_COLLATE=C in environment as suggested by @chneukirchen.
This is enough to let ca-certificates build again.

Close #2513
2015-09-15 08:15:13 +02:00
Juan RP bcdacb66a0 xbps-src: replace basename(1) with ${var##*/}.
Reduce number of fork+exec due to using a subshell to execute basename(1).
2015-09-11 07:55:40 +02:00
Jürgen Buchmüller 7aa6261c63 chroot.sh: set LC_ALL=C in the chroot 2015-09-10 13:48:47 +02:00
Jürgen Buchmüller 1c4a971d74 purge-distfile: improve template scan speed 2015-09-05 07:41:58 +02:00
Jürgen Buchmüller f5c8a5581e Merge pull request #2438 from pullmoll/setup_pkg
setup_pkg(): fix check for pkgname-32bit + update gcc-multilib
2015-09-03 16:03:44 +02:00
Jürgen Buchmüller 0c7cfd6abe setup_pkg(): fix check for pkgname-32bit
+ Also update gcc-multilib to gcc-4.9.3

Trying to build `gcc-multilib` failed because `glibc-32bit`
has no separate `srcpkg/glibc-32bit/template`, but is a
result of building `glibc` for target arch `i686`.

For gcc-4.9.3 to build a patch is required that gets us rid
of strange errors when including /usr/include/bits/stdio2.h
2015-09-03 12:26:13 +02:00
Juan RP 22c9a81810 xbps-src: set $SHELL in the chroot target.
... otherwise it's set to /bin/xbps-shell and might give unexpected results
with packages that expect something else.

Suggested by @chris2.
2015-09-03 07:36:50 +02:00
Juan RP 4dfaf60651 xbps-src: do not remove masterdir/tmp before entering chroot.
There's no reason to remove this on each iteration.
This is to make @chris2 happy.
2015-09-02 10:08:22 +02:00
Juan RP cef388f07b xbps-src: introduce a new target: "sort-dependencies".
This expects a variable argument list with package names that will be
returned to stdout topologically sorted.

$ ./xbps-src sort-dependencies libarchive-devel liblzma-devel libxbps zlib-devel bzip2-devel
bzip2
xz
zlib
libarchive
xbps
2015-08-16 10:47:35 +02:00
beefcurtains 3c424a73f6 xbps-src: quote $wrksrc
Allows spaces in the directory name
2015-07-29 11:11:04 +00:00
Juan RP 5a40351feb xbps-src: only remove deps before building on travis builds.
This assumes -C is set without -t and XBPS_CHROOT_CMD set to proot.

A stupid workaround for now...
2015-07-29 10:52:10 +02:00
Juan RP 279ead0999 xbps-src: added XBPS_ALLOW_RESTRICTED conf option for restricted pkgs.
Such packages should set the `restricted' var to allow building a binary package.
Note that such packages do not allow redistribution of sources and binaries,
so that it's up to the user if (s)he wants to pkg it locally.
2015-07-26 10:22:35 +02:00
jbu ac844019f4 purge_distfile.sh: Print info if percent changes 2015-07-20 15:25:21 +02:00
Juan RP 2284708d43 xbps-src: remove autodeps for target pkg if -t is not set.
When building with -C and without -t (xbps-uchroot(1) with overlayfs),
make sure to remove autodeps prior to start resolving dependencies.

This is necessary for cases where a previous built pkg contains the
same build dependency required for another pkg with -C, resulting
in dependencies being detected as installed and later removed.

Thanks to @dominikh and @Gottox for info and comments.
2015-07-16 09:38:02 +02:00
Juan RP 0ce38c4c74 xbps-src: make sure XBPS_WRAPPERDIR is only created in required cases.
- When building a bootstrap pkg and the chroot is not ready (bootstrap).
- When building a pkg within the chroot.
2015-07-12 10:13:43 +02:00
Juan RP 55863abdd2 xbps-src: do not sync xbps repos in chroot mode.
If XBPS_CHROOT_CMD == uchroot with overlayfs (-O), the temporary masterdir
will be removed completely after synchronizing remote repositories, and
later on, when the build starts the repos are unsynchronized.

So do the sync on the real masterdir before entering the chroot.
2015-07-12 08:24:04 +02:00
Juan RP e6b34ca994 xbps-src: set XBPS_MAKEJOBS to 1 if unset or disable_parallel_build. 2015-07-10 10:07:02 +02:00
Juan RP e3542fac95 xbps-src: remove_pkg_autodeps: print errval and debug output on error. 2015-07-09 11:40:52 +02:00
jbu b28b004505 purge_distfiles.sh: ignore msg_error()
When sourcing templates to get $checksum there are templates
calling msg_error(). This is not relevant for this function,
thus define a local dummy msg_error() to ignore these cases.
2015-07-07 05:37:38 +02:00
jbu 919afe94fc xbps-src: Add purge-distfiles command
Closes #1970
2015-07-06 10:02:25 +02:00
jbu b30cbd9870 xbps-src: implement a by_sha256 hash cache 2015-07-04 11:18:46 +02:00
Juan RP d8030e5651 Revert "xbps-src: install dependencies with -U (--unpack-only)."
This reverts commit 8d2226deba.

This breaks all bins that need ca-certificates (curl, wget, git, etc).
2015-06-07 17:02:20 +02:00
Juan RP 8d2226deba xbps-src: install dependencies with -U (--unpack-only).
This should result in a considerable performance improvement, because the
expensive configuration phase of all dependencies is skipped.

Hopefully this does not introduce build issues :-)
2015-06-07 12:06:55 +02:00
Juan RP 1ffba0ae71 xbps-src: fix regression with the proot chroot-style. 2015-06-03 20:12:49 +02:00
Juan RP 3493f3c229 xbps-src: requires xbps>=0.45 now. 2015-06-03 11:32:47 +02:00
Juan RP 28b44acac9 xbps-src/cross: reconfigure base-directories too. 2015-06-03 10:55:37 +02:00
Juan RP 428c34d1f0 xbps-src: reconfigure base-files not base-directories. 2015-06-03 10:44:58 +02:00
Juan RP b1d2d425b4 xbps-src: remove stupid workaround to sleep for a second.
This was added to make sure pkg file metadata contains a different mtime
(in seconds precision), but building multiple pkgs in less than a second
will be really strange.
2015-05-23 09:52:19 +02:00
Juan RP 94f2e004b4 xbps-src: remove autodeps while building hostdeps too. 2015-05-23 09:52:19 +02:00
Juan RP 4f67c26652 xbps-src: force autodeps cleanup while building dependencies.
Before that change, "./xbps-src -C pkg foo" would not remove dependencies
installed by previous builds required by foo.
2015-05-02 03:40:52 +02:00
Juan RP 47f46229b8 xbps-src/cross: create sysroot/include symlink.
The cross compiler seems to need it to compile C++ code (wtf).
2015-05-01 12:34:17 +02:00
Juan RP 11836f56c1 xbps-src: a more meaningful msg when dep cannot be resolved. 2015-04-30 09:09:03 +02:00
Juan RP c6999a235d xbps-src: if build dependency cannot be resolved, exit with error. 2015-04-30 08:26:12 +02:00
Juan RP 90771d92f5 xbps-src: only print real source pkgs in show-build-deps. 2015-04-26 08:32:46 +02:00
Juan RP 3caa64b981 xbps-src: create XBPS_WRAPPERDIR in the upperdir with overlayfs. 2015-04-24 11:02:37 +02:00
Juan RP d07d3a72c9 xbps-src: new target: show-avail and returns 0 if pkg can be built. 2015-04-16 08:38:32 +02:00
Juan RP 313cdf6ee6 xbps-src: force reconfiguration of base-directories in sysroot.
... otherwise some required symlinks in sysroot aren't created, and this
seems to be required when cross compiling for i686.
2015-04-15 12:23:07 +02:00
Juan RP ba814ab5c7 xbps-src/build.sh: error out if installing cross pkgs fails for some reason. 2015-04-15 11:38:23 +02:00
Juan RP 0b2a7f39f3 xbps-src/cross: install cross-vpkg-dummy as manual, to not autoremove it. 2015-04-14 11:01:11 +02:00
Juan RP 14849336aa xbps-src/cross: force installation of cross pkgs just in case. 2015-04-14 10:47:25 +02:00
Juan RP 9a7350c3da xbps-src/cross: return early if cross pkgs are already installed. 2015-04-14 10:42:47 +02:00
Juan RP ad71cffe79 xbps-src/bulk: silence output if there are no pkgs to build. 2015-04-11 08:40:46 +02:00
Juan RP e2e7b10b0d xbps-src: repair bootstrap-update in the !chroot case. 2015-04-09 19:45:59 +02:00
Juan RP c7f21fd595 xbps-src: introduce support for multiple chroot implementations.
Available implementations at common/chroot-style/*.sh. Each .sh
script there implements a chroot style to be able to chroot and bind
mount with multiple utilities. The current supported list:

 - uunshare (uses xbps-uunshare(8))
 - uchroot (uses xbps-uchroot(8))
 - proot (uses proot, see http://proot.me)

The XBPS_CHROOT_CMD can be set in etc/conf to use a specific implementation,
and XBPS_CHROOT_CMD_ARGS to pass in additional arguments to the cmd.
2015-04-09 18:57:41 +02:00
Juan RP 8cd7f1a901 Revert "xbps-src: Set the MAKEFLAGS environment variable"
This reverts commit d803775b3d.

This breaks all pkgs that exec make directly without ${makejobs}
(which should be built as -j1) and makes installation also parallel,
which we do not want.

We'll probably resurrect this in a certain future.
2015-04-09 09:21:53 +02:00
Juan RP 3964b12de6 Merge pull request #1214 from nmeum/makeflags
xbps-src: Set the MAKEFLAGS environment variable
2015-04-09 07:51:46 +02:00
Sören Tempel d803775b3d xbps-src: Set the MAKEFLAGS environment variable
This ensures that packages with custom build functions also use our
provided MAKEFLAGS. Without this commit it was necessary to always
append the "${makejobs}" variable manually to make. For compatibility
reasons that is still possible but should probably be removed in the
future by making "makejobs" a local variable.
2015-04-08 19:44:06 +02:00
Juan RP 6d465e0a43 xbps-src/bulk: simplify and make the toposort work again. 2015-04-07 12:34:23 +02:00
Juan RP 66f6780b31 xbps-src: show-build-deps: only return pkgnames.
We do not care about its version really.
2015-04-07 12:33:42 +02:00
Juan RP efbb1f4a8a xbps-src: make -a target work with show-repo-updates/update-bulk. 2015-04-07 12:18:26 +02:00
Juan RP 48548f1983 xbps-src/build.sh: sleep 1 second while running do-pkg.sh.
This will ensure that binpkg files do not have recorded the same mtime,
which is required in xbps to detect obsolete files properly.
2015-04-02 09:09:12 +02:00
Juan RP 7a59746763 xbps-src/build.sh: pass $sourcepkg not subpkgname to the helpers.
Close #1243
2015-03-30 20:24:11 +02:00
Juan RP f7cd626a1c xbps-src/build_dependencies: create XBPS_STATEDIR.
This fixes cross compilation of pkgs that depend on itself.
2015-03-28 04:49:18 +01:00
Juan RP 7cffdb2d28 xbps-src/build_dependencies: handle deps provided by vpkgs correctly.
... otherwise deps specified by the cross-vpkg-dummy pkg aren't
taken into account. Assume that version provided by the vpkg is
good enough for building.
2015-03-28 03:22:07 +01:00
Juan RP 1c5f4690e6 xbps-src: always require current srcpkgs version in build dependencies.
That means that version comparators are not supported anymore in
hostmakedepends and makedepends.

This will ensure that a pkg is always built with the same build dependencies
everywhere, if the srcpkgs tree is uptodate.
2015-03-27 10:59:58 +01:00
Juan RP b43411d4d2 xbps-src: show-build-deps: sort -u the results. 2015-03-26 04:18:42 +01:00
Juan RP 439807df63 xbps-src: setup_pkg: re-read conf file to propagate vars to build.sh. 2015-03-23 18:02:45 +01:00
Juan RP 451411ad21 xbps-src: set_build_options: read conf file for XBPS_PKG_OPTIONS.
This makes XBPS_PKG_OPTIONS* settings work via build.sh. Thanks chris2.
2015-03-23 17:57:23 +01:00
Juan RP a86b30ba05 xbps-src: fix remaining issues with -N and -a. 2015-03-23 16:05:43 +01:00
Juan RP 03ef5b6804 xbps-src: make -N -a <target> work.
If required cross pkgs are not available in xbps repos, those are now built
automagically.
2015-03-23 12:44:37 +01:00
Christian Neukirchen ca81f8e7f1 xbps-src/shutils/common.sh: check $version, - and _ are now forbidden. 2015-03-20 19:06:18 +01:00
Juan RP 55ce6f836f xbps-src/bulk: do not use tac(1) in the tsort result, it's inverted otherwise. 2015-03-20 14:45:06 +01:00
Juan RP ce859b4188 xbps-src: run_func on error must return 1 not 2. 2015-03-20 09:17:40 +01:00
Juan RP 95ca05e6e6 xbps-src: check_pkg_arch now exits with errcode 2. 2015-03-19 10:26:19 +01:00
Juan RP 0337b86f43 xbps-src: return 0 on success, 1 on error and 2 on nocross/broken (ignore). 2015-03-19 10:08:02 +01:00
Christian Neukirchen be94bdd70a xbps-src/shutils/common.sh: actively unset disabled build options to override default values. 2015-03-18 16:14:51 +01:00
Juan RP aab0fe7ed3 xbps-src/bulk: declare some more local vars. 2015-03-17 11:04:09 +01:00
Juan RP 43258cc391 xbps-src: remove autodeps before running the phase unless -C is set.
This should avoid unexpected issues due to building pkgs with dependencies
installed by previous builds.
2015-03-15 10:34:13 +01:00
Juan RP 01afe81aac xbps-src: fix -E to check for the target pkg being registered in repos.
rather than just checking if its binary package is available.
2015-03-15 09:54:52 +01:00
Juan RP d8f69bde78 xbps-src: repair 'update-bulk' target (close #1121). 2015-03-14 09:47:56 +01:00
Juan RP a8962ace18 xbps-src/build.sh: only skip building/installing deps for target pkg with -N. 2015-03-14 09:24:35 +01:00
Juan RP f2883afc1b xbps-src/build.sh: fix xbps-src-doinstall() when pkg is a subpkg.
Close #1120
2015-03-14 09:06:44 +01:00
Juan RP 849d22e46d xbps-src: refactor build logic into its own script (build.sh).
The build.sh script is now responsible to handle all the logic to build
a source package and its subpackages, as well as all its required
build dependencies. Thanks to this and subshells, dependencies are now
built into its own child process, creating a process tree that can go
nested as long as your system allows forking and has enough memory :-)

This fixes some issues that have been while building pkgs that have lots
of nested dependencies.
2015-03-14 07:52:29 +01:00
Juan RP 891b7e661e xbps-src: move xbps repo conf files to etc/. 2015-03-13 09:53:30 +01:00
Juan RP 5c177c7b67 Require xbps>=0.44 for xbps-uunshare(8) to simplify code. 2015-03-12 18:56:14 +01:00
Juan RP d694d022d1 xbps-src: use xbps-uunshare(8) to sync remote cross repos too. 2015-03-12 18:49:21 +01:00
Juan RP 388c3143ac xbps-src: tweak the order of LDFLAGS set in templates.
Rather than appending to the final LDFLAGS, add it to the head,
this way packages that use LDFLAGS="-lfoo" will still work with --as-needed.

This fixes hsetroot build, at least.
2015-03-12 10:46:36 +01:00
Juan RP 31b544020f xbps-src/libexec: remove double slash from shebang. 2015-03-11 08:28:13 +01:00
Juan RP 87d91f0594 xbps-src: fix previous. 2015-03-09 09:52:35 +01:00
Juan RP c74c204a6e xbps-src: do not sync repodata with -N. 2015-03-09 09:50:09 +01:00
Juan RP b7063fa1bc xbps-src: fix previous. 2015-03-05 21:47:41 +01:00
Juan RP 3d21df48e7 xbps-src: use xbps-uunshare(8) if it's available. 2015-03-05 21:44:22 +01:00
Juan RP 50a116d27a xbps-src: set default compiler/preprocessor/linker flags via etc/conf.
Rather than setting them in the build profile, just set them in
etc/defaults.conf (overridable via etc/conf) to simplify the code.

- Also enable _FORTIFY_SOURCE=2 in CPPFLAGS.
- Also enable -z,relro in LDFLAGS.

As suggested by @chneukirchen.
2015-03-04 15:18:46 +01:00
Juan RP d2f127d7ab xbps-src: create log files in $XBPS_STATEDIR while installing bdeps. 2015-03-03 10:45:34 +01:00
Juan RP 083d139f68 xbps-src: setup_pkg: rename a var for clarity. 2015-03-01 19:29:16 +01:00
Juan RP bdb798fa64 xbps-src: more improvements for -E and -t options.
If both options are set, check first if the binpkg exists before
creating the temporary masterdir, and clean this up properly.
2015-03-01 19:29:16 +01:00
Juan RP 2f524cf66a xbps-src: cleanups for -E and -t.
-E also detect noarch binpkgs.
-t make sure to cleanup the temporary masterdirs.
2015-03-01 19:29:16 +01:00
Juan RP 8ee4a7c257 xbps-src: added -E opt to exit immediately if a binpkg already exists.
With -E if there's a binary package in a local repository for the
target pkg, exit immediately. This will be used by the upcoming xbps-fbulk(8).
2015-02-28 10:29:27 +01:00
Juan RP cda175e0d6 xbps-src: make show-build-deps return err when arch is not supported. 2015-02-28 02:38:00 +01:00
Juan RP 429df59e2a xbps-src: show-build-deps: fix an issue with subpkgs. 2015-02-28 01:52:23 +01:00
Juan RP 4130cd3e8f xbps-src: show-build-deps: ignore virtual rdeps completely. 2015-02-28 01:46:38 +01:00
Juan RP 3107408b9e xbps-src: show-build-deps: convert virtual rdeps. 2015-02-28 01:36:22 +01:00
Juan RP 98ae47f3eb xbps-src: show-build-deps: also print rdeps and drop subpkgs. 2015-02-28 00:13:42 +01:00