Commit Graph

27 Commits

Author SHA1 Message Date
morganamilo
9af4033cad Rename LIBRARY to MAKEPKG_LIBRARY
Implements #59.
2023-11-04 00:02:17 +00:00
Daan De Meyer
79bd512181 Add --keyringdir meson option to configure the keyring directory
On Debian, keyrings are stored in /usr/share/keyrings. To support
this, let's add a new --keyringdir option that allows configuring
the directory under datarootdir where the keyrings should be
imported from. We default to 'pacman/keyrings' for backwards
compatibility.
2022-07-29 10:17:52 +10:00
Jonas Witschel
f5f9e0f4ea makepkg: use bsdtar --no-read-sparse for archive creation if available
bsdtar uses the "pax" TAR archive format by default, which has support for
storing sparse file information in the archive. Unfortunately this is a source
of unreproducibility because the sparse encoding is taken from the file system
and different file systems handle sparse files differently: some file systems
have no support for sparsely encoded files at all, and even file systems with
sparse file support can report different file information for identical files
due to differing implementations.

As a real world example where this happens, consider the Arch Linux package
"brotli-testdata 1.0.9-7", which contains a sparsely encoded all-zeros file
"usr/share/brotli/testdata/zeros". Building this package on a btrfs file system
yields a different package than building it on tmpfs or ext4 solely due to
different sparse file information that gets recorded in the package tarball.

To improve the reproducibility of archives containing sparsely encoded files,
libarchive version 3.6.0 introduces a new --no-read-sparse option. This skips
reading sparse file information from disk entirely and therefore stores files
"expanded" in the archive, which is the only way to make them reliably
reproducible across file systems.

makepkg will use this option if libarchive is recent enough to support it,
which is detected at build time.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-03-11 09:43:59 +10:00
Eli Schwartz
8fe5520709 meson: make our symlinking script more portable
We do not need the --relative case as it is dead code (we only ever link
a filename without directory components).

For the rest, GNU-specific ln -T does two things:

- if the link name is an existing directory, ln fails instead of
  creating a surprising link inside the directory
- if the link name is a symlink to a directory, ln treats it as a file,
  and due to -f, unlinks it

The second case can be portably solved by ln -n, and both cases can be
solved by doing what the original autotools Makefile did: rm -f && ln -s

If the file exists, it will be removed. If it cannot be removed, it must
be an ordinary directory, and the script aborts with an error.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-04-23 09:48:08 +10:00
Eli Schwartz
9bf3d6a760 remove sed command lookup and hardcoding in edit-script.sh
We should not need to hardcode the path to sed as we simply don't care.
We don't check what kind of sed we found, and we're using the same one
we initially found on the PATH, which is surely still on the PATH.

At one point we did care to find the system copy of sed and hardcode it
in makepkg, because we also passed non-portable -i options to it and
makepkg needed to continue working on macOS even if some incompatible
GNU sed got installed afterward, elsewhere on the PATH. But this was
never relevant to the in-tree buildsystem script running sed.

In commit 3a814ee6bc we removed even that,
so we don't need to look it up at all.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-03-25 11:38:58 +10:00
Andrew Gregory
1fdf8c0076 gitlab-ci: print output and logs for failed tests
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21 17:18:24 +10:00
Allan McRae
2e32d51a26 Remove unneeded ltmain patch
Many moons ago, libtool was bad - I mean worse than today!  It gobbled all
--as-needed and we ended up with an overlinked libalpm.  This was annoying,
particularly when dealing with soname bumps in libraries pacman/libalpm had
no business linking to. Luckily we had a fix, stolen from GNOME I believe.
And with that fix, we lived in harmony with libtool for many years.  Until one
day, unbeknownst to us, libtool was "fixed".  We kept applying our patch,
because it still applied, but it did worse than nothing.  It gobbled up our
other LDFLAGS, and our libalpm started missing out on RELRO and BIND_NOW.
This made the Arch Security Team unhappy. We will make them happy again by
stopping the patch.

Signed-off-by: Allan McRae <allan@archlinux.org>
2020-01-27 17:53:50 +10:00
Eli Schwartz
49a8e90bc7 meson: make non-symlink scripts install for real, and use a better wrapper
We now generate the scripts using their real name, install them using
meson's builtin facility instead of an install_script, and generate the
wrapper scripts in the root of the build directory, instead of a
subdirectory.

This gets us closer to resolving FS#64394.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-11-26 10:49:57 +10:00
Allan McRae
2dd7725f2a Remove "Generated from ...; do not edit by hand" from scripts
This is a useless piece of information.

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-11-06 15:46:59 +10:00
Ethan Sommer
3a814ee6bc makepkg: replaces sed in-place with built in substitution
Reads PKGBUILD into an array and replaces the pkgver and pkgrel with
bash parameter substitution, then uses shell redirection to write to to
the file. Because shell redirection follows symlinks, this accomplishes
the same thing as the previous default of using the GNU-specific
--follow-symlinks sed flag.

Removes SEDPATH and SEDINPLACEFLAGS from the build systems as they are
not used elsewhere.

Signed-off-by: Ethan Sommer <e5ten.arch@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-11-06 12:03:38 +10:00
Allan McRae
27955a0fee Move update-copyright into build-aux
This is a useful function to update all our copyright years. Move
it into build-aux so that it is not lost in the switch to meson.

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-11-05 15:25:52 +10:00
Eli Schwartz
de6249ce22 Support file with seccomp enabled
Not all compression types can be detected in the seccomp sandbox, so we
need to disable it. This requires either configuring makepkg to know the
sandbox is available, or checking for file >= 5.38 in which the sandbox
option is a no-op even when seccomp is disabled.

- Requires autoconf-archive for autotools version compare macro.
- meson version comparison could be made a lot simpler using meson-git.

Fixes FS#58626

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-10-07 13:43:37 +10:00
Dave Reisner
18a6440061 meson: remove tap-driver.py, use meson's TAP protocol
This includes a patch from Andrew to fix pactest's TAP output for
subtests. Original TAP support in meson was added in 0.50, but 0.51
contains a bugfix that ensures the test still work with the --verbose
flag passed to meson test, so let's depend on that.
2019-08-12 10:03:17 +10:00
Dave Reisner
0318e84546 build-aux: detect build dir based on build.ninja
.ninja.log is only present after building (successful or otherwise) the
project, but build.ninja is output as soon as the build dir is setup.

Signed-off-by: Allan McRae <allan@archlinux.org>
2019-08-05 18:26:21 +10:00
Santiago Torres
226d2c1248 drop DU* config variables
Since DUFLAGS and DUPATH are not needed anymore remove them from the
source

Signed-off-by: Santiago Torres <santiago@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-03-19 12:07:15 +10:00
Eli Schwartz
bbfb75fd29 build: remove references to variable replacements from pacman-optimize
MODECMD and OWNERCMD are not used by pacman itself, so we don't need to
check for and replace them now that pacman-optimize is removed.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-03-19 12:04:51 +10:00
Eli Schwartz
363664e47d meson: be more accurate in comments when generating processed scripts
Instead of assuming all scripts are .sh.in and leaving a comment to that
effect, just take the input file directly.

Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28 10:48:57 +10:00
Eli Schwartz
fbc6d8b428 build-aux: rm annoying and useless file
tap-driver.sh is added to the build tree by autoreconf, and contains
upstream modifications as such. This results in dirty working trees.

It was originally added in commit 403c175dbc
which made the testsuite use automake, but as far as I can tell, never
served any purpose.

Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-28 10:48:41 +10:00
Dave Reisner
d230ec6f17 meson: add a wrapper to bootstrap scripts from within build dir
This doesn't do quite as good of a job of "hiding away" the real script
as we did with autotools, but it satisfies the need for being able to
run scripts which depend on libmakepkg with the local copy within the
repo. We do, however, improve upon the autotools script by ensuring that
the bash path used in configuring pacman is the interpreter used to run
the underlying script.
2018-11-02 03:16:34 -04:00
Dave Reisner
51db84750e Add meson.build files to build with meson
Provide both build systems in parallel for now, to ensure that we work
out all the differences between the two. Some time from now, we'll give
up on autotools.

Meson tends to be faster and probably easier to read/maintain. On my
machine, the full meson configure+build+install takes a little under
half as long as a similar autotools-based invocation.

Building with meson is a two step process. First, configure the build:

  meson build

Then, compile the project:

  ninja -C build

There's some mild differences in functionality between meson and
autotools.  specifically:

1) No singular update-po target. meson only generates individual
update-po targets for each textdomain (of which we have 3).  To make
this easier, there's a build-aux/update-po script which finds all
update-po targets and runs them.

2) No 'make dist' equivalent. Just run 'git archive' to generate a
suitable tarball for distribution.
2018-11-02 03:16:34 -04:00
Andrew Gregory
403c175dbc integrate tests with automake
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21 11:00:18 +10:00
Allan McRae
28cb22e3c2 Patch ltmain on autoreconf
We used to carry a patched version of ltmain in our repos to fix libtools
issues with -Wl,-as-needed. Now that ltmain is "generated" by autoreconf,
we manually patch it afterwards.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-22 13:27:47 +10:00
Allan McRae
96a4d1ca04 Update gitignore files for use with autoreconf
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-22 13:27:23 +10:00
Allan McRae
df9d19ba73 Remove autotools files
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-22 13:27:07 +10:00
Allan McRae
dcb3b9f85f update to automake 1.14
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-26 15:32:16 +10:00
Allan McRae
8308c7b320 Update "missing" file
The latest automake release causes complaints about an out of date
'missing' file during configure.  Sync with upstream.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28 23:38:46 +10:00
Dave Reisner
30ca48df4c buildsys: move autotools bloat to build-aux
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 22:28:45 -04:00