1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 02:50:44 +00:00
Commit Graph

141 Commits

Author SHA1 Message Date
Andrew Kaster
b5a728ae5f Ports: Port gn
This requires allowing ports to override fetch() since tar.gz sha256sums
from googlesource.com are not deterministic.
2023-07-29 09:42:20 -06:00
Tim Schumacher
401544f68f Ports: Remove the separate branch for extracting .tar.gz files
This can just use the default `tar` invocation, which successfully
recognizes the type automatically. In fact, `.tar.gz` and `.tgz` are
already listed by that particular case anyways.
2023-07-13 05:09:46 +02:00
Tim Schumacher
58cf3b365e Ports: Don't import GPG keys on download
This was part of our setup for verifying GPG-signed files, but that is
no longer needed.
2023-07-13 05:09:46 +02:00
Tim Schumacher
b8cf8c6081 Ports: Remove the "no HTTPS" workaround
curl on SerenityOS now has HTTPS support, since we use the upstream
ca-certificates package.
2023-07-13 05:09:46 +02:00
Tim Schumacher
89b0a61067 Ports: Remove support for auth_types other than sha256 2023-07-10 13:08:27 +02:00
Lucas CHOLLET
b8bc1ac5d0 Ports: Fix a typo in .port_include.sh 2023-07-06 15:01:17 +01:00
Jelle Raaijmakers
7551666a80 Ports: Do not perform slow curl check if download already exists
Even if the file was already downloaded, we were trying to perform a
relatively slow HTTPS-call.
2023-07-05 16:17:35 +01:00
Mike Swanson
5a1c0c6836 Ports: Support extracting *.tar.zst source archives 2023-05-12 05:36:47 +02:00
Jelle Raaijmakers
3af92a76be Ports: De-special case ./package.sh dev
There is nothing special about the `dev` command; move its logic to
`do_dev` and invoke it generalized.
2023-05-09 06:36:30 +02:00
Jelle Raaijmakers
a81e83f3b5 Ports: Only remove dir contents on clean, not the dir itself
The entirety of `.port_include.sh` depends on having a current working
directory for the respective port. If we were to remove the directory,
some actions such as `fetch` could fail since our current working
directory would now be an invalid inode.

This issue was exposed by running `./package.sh` followed by
`./package.sh dev` and answering 'y' to the question on cleaning the
build directory.
2023-05-09 06:36:30 +02:00
Jelle Raaijmakers
71671e0921 Ports: Alphabetize commands in .port_include.sh
Also remove a stray newline.
2023-05-09 06:36:30 +02:00
Tim Schumacher
6f47c53ff9 Ports: Force patch regeneration after resolving conflicts
Otherwise, the post-conflict state will be used as a reference point,
and no changes will be detected.
2023-04-19 07:53:18 +02:00
Tim Schumacher
fb049d6913 Ports: Don't mangle patches when requiring manual edits
While at it, pass the `--3way` option to give the user something to work
with. Otherwise, Git will just prepare the commit metadata and nothing
else. Note that this has a relatively low chance of working, since the
recorded blob hashes aren't known to a freshly imported repository.
2023-04-19 07:53:18 +02:00
Jelle Raaijmakers
5230fb0359 Ports: Fix erroneous spelling of erroneous 2023-03-24 00:31:03 +01:00
Jelle Raaijmakers
403c0e6dab Ports: Install all dependencies instead of just one
Commit 9b7e217dda broke installation of port dependencies by
`return`ing as soon as the first dependency was found.
2023-02-02 14:38:48 +01:00
Jan200101
141e5d6f20 Ports: Use absolute path of port_include
This ensures that .port_include will always import other scripts from
the correct location.
2023-01-29 13:11:22 +01:00
Jan200101
9b7e217dda Ports: Support multiple port directories
This allows Ports unfit for the main repository to be put elsewhere.
2023-01-29 13:11:22 +01:00
Peter Elliott
d844829de4 Ports: Fix compatiblity issues with running package.sh on Serenity 2023-01-19 12:22:24 +01:00
Jelle Raaijmakers
7c2976e006 Ports: Make sed work on macOS
The ports `libvorbis`, `readline` and `timidity` would not install on
macOS as a result of using `sed -i` without an extension provided. GNU
sed is available through Homebrew, but it does not replace `sed` by
default.

Instead, provide a new `sed_in_place` function that calls `sed` with the
right arguments.
2023-01-09 22:36:50 +00:00
EWouters
5f87c3022c Ports: Set $LD for Clang, GCC and host in .hosted_defs.sh
Sets `$LD` to `$HOST_LD` in `.port_include.sh` if it is defined as well,
else it will be set to `ld`.

Makes libiconv build with the Clang toolchain.

This also impacts other ports when building them with the Clang
toolchain, and might result in more ports building correctly.
2023-01-06 14:00:31 -07:00
Jan200101
058a39c6fc Ports: Use absolute path of script
The relative paths are not valid inside a port build directory.
This makes target_env source .hosted_defs.sh correctly.
2022-12-31 00:02:41 +01:00
sin-ack
27da878bb7 Ports: Export CMAKE_BUILD_PARALLEL_LEVEL for ports scripts
When using cmake --build, CMake will look for this environment variable
to enable parallelism. The Zig port, for example, uses cmake --build,
and will otherwise use a single core if cmake selects Make as the build
system. This should help with all ports which use cmake --build.
2022-12-11 19:55:37 -07:00
Jelle Raaijmakers
45108438ce Ports: Fix warning when building with useconfigure="false"
When building a port with `useconfigure="false"`, the `do_configure`
function invokes a `buildstep` with multiple positional arguments as the
command to execute.

It then tests whether the positional arguments evaluate to an emtpy
string, but could fail when multiple positional arguments were provided.
This resulted in the following warning when building the Composer port,
for example:

  ../.port_include.sh: line 16: [: echo: binary operator expected

Prevent this warning by testing against the number of positional
arguments, instead.
2022-11-24 12:06:25 +00:00
Peter Elliott
0994e6964b Ports: Fix return statuses with new buildsteps
previously every buildstep would return a success error code. As a
result, all the steps would run even if previous steps failed.

I've also added a red status message when this happens.
2022-10-25 09:34:53 +02:00
Gunnar Beutner
2968cbca11 Ports: Prefix output with the build step and port name
We already have something similar for the toolchain builds. This makes
it easier to identify which build step is currently running.
2022-10-23 20:37:27 +02:00
cflip
66c039c66f Ports: Allow ports to specify working directory when run from launcher 2022-10-17 01:37:58 +02:00
Tim Schumacher
46b8a4cda3 Ports: Only regenerate patches if there are actual changed commits
We were previously comparing the hash against the hash after the initial
import, which caused us to regenerate patches every time as long as we
did have patches (even if they haven't changed at all) and the script
entirely missing that it should remove patches if the current commit is
the "import" commit.
2022-09-18 13:00:46 +04:30
Tim Schumacher
c1dc8c9ccb Ports: Handle generating a ReadMe for an empty patch directory 2022-09-18 13:00:46 +04:30
Tim Schumacher
f6005764d7 Ports: Place tags at important points in the commit history
This helps with easier rebasing and for easier comparing or returning to
the state at which the last actual on-disk patches were.
2022-09-18 13:00:46 +04:30
Tim Schumacher
1b9fb7041d Ports: Unify the git "origin" and the working copy
I've lost more changes to "you forgot to push the changed commits to the
remote" than I'd like to admit, so let's just unify both and only ever
use the actual working repository for detemining whether any patches
have changed.
2022-09-18 13:00:46 +04:30
Tim Schumacher
453323f3c1 Ports: Force full-length file indices when formatting patches
This keeps file index lengths from being dependent on internals of the
repository.
2022-09-18 13:00:46 +04:30
Tim Schumacher
72c059535e Ports: Follow symlinks while discovering whether a port has patches
This enables us to use `./package.sh dev` with LLVM and GCC.
2022-09-18 13:00:46 +04:30
Tim Schumacher
4d29489705 Ports: Keep [...] prefixes while importing patches
This stops us from mangling our LLVM patch names and titles when using
`./package.sh dev`, as they like to put their category names in square
brackets.
2022-09-18 13:00:46 +04:30
Jelle Raaijmakers
7e85ec3431 Ports: Do not allow clean* to be overridden
There were only two packages making use of this functionality, but it
seems more sensible to have a fixed implementation for the cleaning of
ports - especially now they delete the entire build directory and/or
dist files.
2022-09-13 13:44:01 -04:00
Jelle Raaijmakers
5bfc61bc69 Ports: Actually clean port build directory
The functionality for `./package.sh clean` was a bit weird: based on
whether you were working in dev mode, it would try to delete either
`$workdir` or `$nongit_workdir` and `*.out` from your `pwd`.

The new functionality is pretty clear: `./package.sh clean` deletes the
entire build directory for the port regardless of what mode you're in,
`./package.sh clean_dist` removes all `$files`, and
`./package.sh clean_all` does both.
2022-09-13 13:44:01 -04:00
Tim Schumacher
75a1442aac Ports: Move build directories into Build/ 2022-07-13 21:22:52 +01:00
Tim Schumacher
5bbd5e7322 Ports: Don't create ccache symlinks for tools we don't have 2022-07-07 19:32:33 +02:00
Andrew Kaster
ad0a001f0a Ports: Use $arch-serenity-pc-clang{++} for CC and CXX
This lets us eliminate the extra arguments on CC and CXX for ports that
care about CC and CXX pointing to actual filenames they can invoke
realpath or basename on.
2022-06-19 09:05:35 +02:00
Andrew Kaster
8c877664f7 Ports: Add variables for Toolchain binary directory and cxxfilt 2022-06-19 09:05:35 +02:00
Tim Schumacher
e29e4e6c1f Ports: Ensure that core.autocrlf is disabled before handling patches
While `core.autocrlf=false` should be the default, there will certainly
be users that have changed the default setting in their global
configuration.

Ensure that the setting is disabled to avoid accidentally mangling or
not applying our patches.
2022-06-17 09:47:57 +01:00
Timur Sultanov
35d31dec7e Ports: Add option to disable ccache 2022-06-12 00:28:26 +01:00
Tim Schumacher
d426c5a4b2 Ports: Format patches without numbering, commit hash or version number 2022-06-08 17:58:36 +01:00
Tim Schumacher
d69a79b03b Ports: Automatically enter the work directory when running dev 2022-06-08 17:58:36 +01:00
Tim Schumacher
8a5941e294 Ports: Force-add all files when entering dev
This keeps us from accidentally excluding files that are listed in the
`.gitignore` but that are included in the tarball anyways.
2022-06-01 11:02:34 +01:00
Tim Schumacher
f81e47eea8 Ports: Allow selecting multiple config_{sub,guess}_paths
Some ports may have more than one `config.sub` that is in use (vendored
dependencies, etc.). Instead of fiddling about with space-delimited
strings, let's just make that setting into an array right away.
2022-05-25 22:54:04 +01:00
Tim Schumacher
ff90647958 Ports: Fix a typo in get_new_config_guess
While we're at it, we might as well replace the download arguments in
`get_new_config_{sub,guess}` with the variable we defined earlier.
2022-05-25 22:54:04 +01:00
Tim Schumacher
ee66ed6248 Ports: Fully delete Co-Authored-By lines from the ReadMe
Otherwise, this results in a number of empty lines where
Co-Authored-By would have been.
2022-05-22 00:11:16 +01:00
Tim Schumacher
7550017f97 Ports: Sanitize environment before handling Ports
This keeps users from leaking their host environment variables (CFLAGS,
etc.) into Ports, and it keeps us from leaking Port-specific settings
into their dependencies.
2022-05-21 18:12:07 +02:00
Ali Mohammad Pur
3a879faba6 Ports: Skip Co-Authored-By lines when generating patch ReadMes 2022-05-19 20:17:10 +04:30
Ali Mohammad Pur
dcf8385e5b Ports: Make package.sh dev work with ports that have slashes in $workdir 2022-05-19 20:17:10 +04:30