Commit Graph

545 Commits

Author SHA1 Message Date
Leo 74b32d03db fix(abuild): use -print0 **after** the print commands 2021-06-10 14:28:44 +00:00
Leo ac3ee42458 feat(abuild): add support for pyX.Y providers
Now all python packages that install python modules under
/usr/lib/pythonX.Y/site-packages will have a provider that indicates
their MAJOR (X) and MINOR (Y) versions.

pyX maps to the MAJOR version of the package, its objective is to allow
users to quickly install a python module without having to search around
for the correct package, doing `apk add py3.9:foo` will install whatever
packages provides the foo module.

The directories checked only go one level deep, so
'/usr/lib/python3.9/site-packages/date' will generate
py3:date=$pkgver-r$pkgrel.

files ending with .py also count and are added with their .py prefix
stripped away. so '/usr/lib/python3.9/site-packages/six.py' will
generate py3:six=$pkgver-r$pkgrel.

The reason for doing this is the same as creating pc:, so: and cmd:, it
is more reliable and robust to depened on what we known of what the package
provides than to try to guess via the pkgname.

Co-authored-by: Chloe Kudryavtsev <toast@toast.cafe>
2021-05-06 10:50:42 -03:00
Wolf 29557a4a54 Set non-zero size if there are any files in the package
If there are only empty files in the pkgdir, on some filesystems
(discovered on btrfs), du might return 0 for the sum size of the files.
But apk-tools considers packages with size = 0 to be virtual and skips
extraction of any files contained.

To work around that (until it is resolved in apk-tools 3), settings the
size to 1 when it is zero AND some files are present should work fine.
2021-05-06 13:32:08 +00:00
Natanael Copa fd91001089 abuild: allow set extra options for apk index
Use ABUILD_APK_INDEX_OPTS as extra options for apk index. This is so we
can set the apk keys dir to the directory with our temporary test keys
2021-04-29 12:37:38 +02:00
Natanael Copa d7150a3fb1 abuild: warn if -dbg is not first in subpackages
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10002
2021-04-29 11:45:59 +02:00
Natanael Copa db1950c5ce abuild: test for duplicates when doing checksum
fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10013
2021-04-28 13:02:28 +02:00
Natanael Copa 32b7789e9a abuild: allow override setfattr
In osme situations it might be needed to disable setfattr. Allow this
via: `SETFATTR=true abuild ...`

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10027
2021-04-28 10:33:23 +02:00
Wolf f523aabce3 Add new lines around the checksums in APKBUILD
In order to make diffs more tidy and the APKBUILD overall more visually
pleasing, new lines are added after opening and before closing quote,
turning

sha512sums="HASH  foo
HASH  bar"

into

sha512sums="
HASH  foo
HASH  bar
"

therefore keeping alignment of file names.
2021-04-12 15:03:02 +00:00
Natanael Copa f35f2aa859 abuild: add test for invalid filenames
reject filenames with newlines

fixes #10024
2021-02-04 14:44:16 +01:00
Drew DeVault b0af30c5be abuild.in: update autoconf test for riscv64 2021-01-04 20:28:09 +01:00
Sören Tempel 3665a7a994 abuild rootbld: disable real chown calls in fakeroot
By default, fakeroot forwards chown system calls to the libc and ignores
EPERM errors. Unfortunately, when fakeroot is used inside a restricted
bubblewrap environment, bubblewrap intercepts these system calls and
returns EINVAL. The EINVAL return value is not masked by fakeroot and
returned to the caller, thereby causing failures of mv(1), install(1),
chown(1), … which use the chown system calls internally.

Setting the FAKEROOTDONTTRYCHOWN environment variable prevents the chown
systemcalls to be performed in the first place. This variable is only
set in the environment created through bubblewrap by abuild rootbld.

Fixes #10021
2020-12-21 22:00:19 +01:00
Leo c59629326b abuild.in: check for a valid pkgrel with apk version --check
fixes #10011
2020-12-13 11:23:42 -03:00
Natanael Copa 10aa67a0ca Revert "set CARGO_HOME to $SRCDEST/cargo"
the SRCDEST may be shared by multiple builders and apparently cargo does
not seem to handle that well. There are also no good way to do clean-up
of the cache for purging things that is no longer in use.

This reverts commit af0c88e6ab.
2020-11-27 15:17:11 +00:00
Natanael Copa 32785f6360 abuild: restore working dir after updating index
This fixes issue with `abuild cleanpkg all`, which would fail to set
SOURCE_DATE_EPOC for reproducible builds.
2020-10-29 14:46:46 +00:00
Leo 4c38544a96 abuild: don't warn about static libraries in -dev 2020-10-29 11:38:38 +00:00
Leo 8eeca0adad *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
Leo ba3e575d37 abuild: accept lib64 as an option to ignore /lib64 checks
this is required when we package stuff with compatibility to glibc like
libc6-compat
2020-07-20 14:03:52 -03:00
Natanael Copa dd4cd9d606 abuild: return error if there are more than one maintainer
fixes #5421
2020-07-08 13:15:13 +02:00
Natanael Copa ff11a9a0a8 abuild: provide a list of patches that failed
Try all patches and return of list of patches that failed rather than
exit on first failed patch.
2020-07-06 10:59:56 +00:00
Leo 29a3433b43 abuild: don't error out immediately in postcheck()
Store exit code in the variable 'e', then return it, if there are no
errors then it will return 0 as that is the default value, otherwise it
will return 1 and error out as previously
2020-07-06 10:46:26 +00:00
Leo cd004c0232 error out if /lib64 or /usr/lib64 is found 2020-07-06 10:46:26 +00:00
Leo 0202244ce5 abuild: fix a couple of whitespace
use whitespace instead of tab where appropriate
2020-07-06 10:20:57 +00:00
Rasmus Thomsen 79cc553d3b abuild: set -g in DFLAGS too for -dbg subpackages
This is required for proper debug info for D packages
2020-05-03 13:57:34 +02:00
Sören Tempel 19678c5434 Revert "abuild: include $pkgname in temporary rootbld directory"
This commit broke abuild-rmtemp which has a prefix check to ensure it
doesn't remove non-abuild directories. Revert the commit instead of
adjusting the prefix check for now.

This reverts commit d0828c0655.
2020-04-17 13:16:42 +02:00
Natanael Copa 3c45858fc0 abuild: fix check_libc
fixes commit 012a179339
2020-03-31 10:13:24 +00:00
Minecrell f9e2f96476 abuild: default_prepare: Apply GZIP/XZ-compressed *.patch files
This allows using default_prepare to apply compressed patches,
e.g. the linux-lts kernel patches (compressed using XZ).
2020-03-30 11:03:21 +00:00
Leo 012a179339 use option_has instead of list_has 2020-03-23 14:00:27 +00:00
A. Wilcox 93cc98930d abuild: Use $APK instead of apk
This is the only appearance of `apk` in the source.  Appears accidental.

Fixes: 41343329 ("abuild: fix dependency tracing for cross builds")
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
2020-03-23 13:55:41 +00:00
Leo ea166888bb Don't pollute stderr with rmdir messages that are ignored 2020-03-23 13:53:54 +00:00
Leo 2151c7af80 warn when directories found that hold shell completions.
This will warn then paths for certain shells that have completions are
found and tell the user to add a subpackage for it.

In a future date we also want to warn the user to move certain
directories where packages have completions to those directories so our
default_ functions can move them without problems
2020-03-23 13:20:05 +00:00
Leo 1bf7e588df move usr/lib/glade/modules and usr/share/glade/catalogs to -dev by default. 2020-03-23 13:14:16 +00:00
Wictor Lund 6d741ffba8 abuild.in: in snapshot(), fix recursive calls
- Call "$abuild_path" instead of plain "abuild"
- Pass $forceroot as done elsewhere
2020-02-16 23:46:58 +01:00
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
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
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
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 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 d8cfcd5dc9 abuild: detect /bin/sh dependency even if shebang has spaces
fixes !7
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 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