Commit Graph

1244 Commits

Author SHA1 Message Date
Leo
af0c88e6ab set CARGO_HOME to $SRCDEST/cargo
CARGO_HOME tells cargo where to store installed dependencies, save it to
a directory in $SRCDEST so we don't need to download all dependencies
again when compiling a rust package.
2020-02-16 23:30:17 +01:00
Leo
e125a76489 newapkbuild: do out-of-source CMake builds by default
It is recommended by upstream CMake (it will warn when you do in-source
builds) to keep generated files away from the source.
2020-02-16 19:05:42 +01:00
Sören Tempel
d0828c0655 abuild: include $pkgname in temporary rootbld directory
This makes it easier to figure out to which build the directory belongs
to. Occasionally, I have many failed abuild rootblds in my /var/tmp and
including the $pkgname in the directory would help me associating the
directories with failed builds I recently executed.
2020-02-16 12:34:58 +01:00
Timo Teräs
bad781082d abuild: use stat instead of df to figure filesystem type
Fixes the error:
  df: .: can't find mount point

When running abuild inside a chroot when the root file system
mountpoint information is not necessarily directly available.
2020-02-08 12:51:10 +02:00
Timo Teräs
c9d3df08b3 functions.sh: exclusively use apk --print-arch to detect build arch
Originally "gcc -dumpmachine" was used to detect build gcc triplet.
However, abuild does not depend on gcc or build-base (but installs
it if needed to build) so gcc might not be there. Additionally
abuild-sign can be used standalone, and does not have gcc dependency.

Using ${CC:-gcc} is problematic in cross-compile, as CC might be
already set for the cross-compiler and would result giving the target
host triplet.

It was deemed simplest to use "apk --print-arch" exclusively to detect
the builder host type, or specify CBUILD manually. If there is need
to use abuild/abuild-sign on non-Alpine hosts withou apk, we can
later add fallback that uses "uname -m" to detect the architecture
and guess Alpine CBUILD from it.

Fixes #9974
Fixes: 5adf47c1 "functions.sh: use apk --print-arch for CARCH if gcc is missing"
Fixes: 95cd15c0 "functions.sh: dont die if gcc is missing"
2020-02-07 23:14:23 +02:00
Leo
57185172c5 fix typo in sample for pre and post install 2020-02-05 17:27:26 +01:00
Natanael Copa
5adf47c168 functions.sh: use apk --print-arch for CARCH if gcc is missing 2020-01-31 09:47:44 +00:00
kpcyrd
4f5b0a14bd abuild: explicitly sort apk content 2020-01-30 10:41:06 +00:00
kpcyrd
660f793d6d abuild: set fixed atime and ctime in tar 2020-01-30 10:41:06 +00:00
Leo
d5826968b7 abuild.in: add default bashcomp, zshcomp and fishcomp functions 2020-01-28 08:57:40 +00:00
Sören Tempel
d5f4982a9a abuild-keygen: make size of private key configurable
Previously, a key size of 2048 bits was hardcoded. While this is still
the default, it can now be changed. Additionally, the default key size
might be changed to 4096 in the future.
2019-12-23 15:12:14 +01:00
Natanael Copa
0d3dc71833 ==== release 3.5.0 ==== 2019-12-19 15:17:57 +00:00
Natanael Copa
478d4e9452 ==== release 3.5.0_rc3 ==== 2019-12-18 12:36:19 +00:00
Natanael Copa
ec96c604e9 abuild: fix building without git
fixes #9981
2019-12-05 08:32:30 +00:00
Natanael Copa
bb0324e398 abuild: fix applying patches from https
fix patches such as https://dev.alpinelinux.org/archive/domoticz/openzwave-1.6.patch

previously it would only work with the filenamename.patch::$url syntax
2019-11-28 12:46:12 +00:00
Natanael Copa
0745179c4f ==== release 3.5.0_rc2 ==== 2019-11-26 18:42:46 +00:00
Natanael Copa
80a2e6f8cf abuild: set SOURCE_DATE_EPOCH from rootpkg 2019-11-26 18:41:32 +00:00
Sören Tempel
918b7b1920 abuild: Fix abuild rootbld
Without this change abuild rootbld would fail with:

	touch: invalid date '@'

Because SOURCE_DATE_EPOCH wasn't set when abuild rootbld was used. This
is a bug introduced in 71d9d5233b. Instead
of reverting the aforementioned commit move the SOURCE_DATE_EPOCH
initialization to a custom function and also call it from the abuild
rootbld function.

Fixes #9978
2019-11-14 10:36:33 +01:00
Natanael Copa
51d9e3bcb9 Revert "abuild: make built package reproducible"
The introduction of the --pax-options seems to confuse apk and resulted
in `BAD archive' errors.

This reverts commit f04a2ee34b.
2019-11-07 20:46:36 +00:00
Natanael Copa
95cd15c025 functions.sh: dont die if gcc is missing
abuild-sign does not use gcc.

fixes #9974
2019-11-07 16:02:47 +00:00
Natanael Copa
21dcfb1f21 ==== release 3.5.0_rc1 ==== 2019-11-07 15:39:35 +00:00
Natanael Copa
d8cfcd5dc9 abuild: detect /bin/sh dependency even if shebang has spaces
fixes !7
2019-11-07 15:39:35 +00:00
Fredrik Gustafsson
6d321050e5 Change permissions for sudo to 4555
Currently the permissions for abuild-sudo is set to 4111, this make it
impossible to move the sudo file after it has being created. Moving
the sudo file is needed by yocto when creating an apk-package of abuild.
The sudo binary in debian stretch since if debian does it, it can't be bad.

Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
2019-11-07 15:39:35 +00:00
Bart Ribbers
2162348a9a Allow round brackets in the license variable 2019-11-07 15:39:35 +00:00
Natanael Copa
71d9d5233b abuild: get the git commit date only when needed
getting the commit date can be timeconsuming so only do it once we need
it. We also re-use the ABUILD_LAST_COMMIT to speed up the operation.
2019-11-07 14:40:55 +00:00
Natanael Copa
114c0cf287 abuild: rename global last_commit to ABUILD_LAST_COMMIT
rename the global variable to upppercase.
2019-11-07 14:40:55 +00:00
Natanael Copa
1cfbdf688c abuild: fix git_* functions
Add -- to explicitly separate out the file path.

Let git_last_commit_epoch take an option with the hash.
2019-11-07 14:40:55 +00:00
Natanael Copa
f04a2ee34b abuild: make built package reproducible
Flags to make the tarball reproducible is taken from here:
http://h2.jaguarpaw.co.uk/posts/reproducible-tar/
2019-11-07 13:24:43 +00:00
Natanael Copa
672032a4be abuild-sign: dont set timestamp in gzip
This improves reproducibility of builds
2019-11-07 13:23:36 +00:00
Natanael Copa
b80a27b86a abuild-sign: use pigz if available
This is similar to what we do in abuild. It improves performance on
multicore machines.
2019-11-07 13:21:45 +00:00
Natanael Copa
5b34b696d4 abuild: set SOURCE_DATE_EPOCH to last commit date by default
set datestamps to be used in the built packages to date of commit. This
makes it much easier to have reproducible builds.
2019-11-07 12:06:24 +00:00
Natanael Copa
918cba2a77 make: install depends as virtual 2019-11-07 12:02:24 +00:00
Richard Mortier
b3dcf19ef7 make: add depends target
Signed-off-by: Richard Mortier <mort@cantab.net>
2019-11-07 12:01:13 +00:00
Natanael Copa
c486b3b4f3 allow override sharedir for testing
Aloow overrid sharedir with global ABUILD_SHAREDIR so we test the local
functions.sh instead of a system installed functions.sh
2019-11-07 11:42:23 +00:00
Natanael Copa
f3dc428ea0 rename datadir -> sharedir
abuild uses datadir as local variable in various functions. Rename the
global datadir to sharedir to avoid confusion.
2019-11-07 11:42:23 +00:00
Natanael Copa
43fb2c012e add basic tests using bats 2019-11-07 11:32:37 +00:00
Jakub Jirutka
a8f564287e newapkbuild: simplify source URL derived from GitHub URL
GitHub allows to reference https://github.com/<user>/<proj>/archive/<ver>.tar.gz
also as https://github.com/<user>/<proj>/archive/<ver>/<anything>.tar.gz.
2019-10-27 20:35:10 +01:00
Jakub Jirutka
6c3b2e6b58 newapkbuild: run cargo install with --locked
This forces cargo to install the exact versions of the dependencies
specified in Cargo.lock. This is essential for reproducible builds!
2019-10-27 13:50:53 +01:00
Natanael Copa
b09bdddff3 abuild: remove unused print_version function
the function is not used since commit  3379e67551 (abuild: print
version of built package early)
2019-10-01 16:56:47 +00:00
Natanael Copa
511b934182 abuild: add -V for print abuild version 2019-10-01 16:51:21 +00:00
Natanael Copa
66177eb5ec abuild: only set sysconfdir in functions.sh
we set sysconfdir in functions.sh so there is no need to set it in
abuild.
2019-10-01 16:20:53 +00:00
Leo
1c075c2855 Fix package version check on checkapk
The assignment of the oldpkg variable is missing the name of the package
2019-10-01 17:14:36 +01:00
Rasmus Thomsen
05eee44039 newapkbuild: add rust support 2019-10-01 17:12:19 +01:00
Joseph Burt
f9da71cc68 apkbuild-cpan.in: add 'configure' prereqs
Prereqs from the 'configure' phase also belong in makedepends
2019-10-01 17:08:51 +01:00
Joseph Burt
baf17c8dd7 apkbuild-cpan.in: always start pkgver with a digit
The 'version' string from CPAN can start with 'v...' or similar.
2019-10-01 17:08:51 +01:00
Leo
dbf0e80e62 Make default_dev move to /usr/share/pkgconfig 2019-10-01 17:01:11 +01:00
Leo
6e5bd59d6f Add support for parsing pkg-config files in /usr/share/pkgconfig 2019-10-01 16:37:42 +01:00
Natanael Copa
aa86438443 abuild: add amove func to move from $pkgdir to $subpkgdir
moving files and directories from $pkgdir to $subpkgdir is a common
pattern, so make a helper function for this.

usage: amove FILESPEC...

FILESPEC is a list of files or patterns/globs that will be exanded by
the shell.

amove will clean up empty directories after moving the files/dirs.

Example usage:

  amove 'usr/lib/lib*.a'
  amove 'etc/*.d' # moves both etc/conf.d and etc/init.d
  amove 'lib/*.so' 'usr/lib/*.so'

  cd "$pkgdir"
  find usr -name '*.h' | xargs amove

This is based on the work of Chloe Kudryavtsev:
https://github.com/alpinelinux/abuild/pull/92
2019-10-01 16:25:45 +01:00
Natanael Copa
610f1982ef Makefile: clean *.o files 2019-10-01 15:00:31 +01:00
Natanael Copa
f9707808ef abuild: various USE_CCACHE fixes
- set PATH in the rootbld environment so ccache is actually used.

- drop the check for command -v ccache. ccache will be pulled in as
  build dependency so we don't need to die if its missing.

- create ~/.ccache if missing rather than die. This directory will
  normally be created by ccache itself, but we need to create it so we
  can bind mount it incase of rootbld.

- don't die if ccache.conf is missing. ccache will create it.
2019-10-01 13:13:43 +00:00