Commit graph

157 commits

Author SHA1 Message Date
Tim Schumacher
40808fe1cd Ports: Properly update submodules when checking out Git repositories 2023-09-24 23:54:56 +02:00
Tim Schumacher
e12e833eaa Ports: Clone Git repositories to the actual workdir 2023-09-24 23:54:56 +02:00
Tim Schumacher
ce556c9566 Ports: Remove the ability to override fetch and patch_internal 2023-09-09 01:06:31 +02:00
Tim Schumacher
e28ff48304 Ports: Introduce support for Git repositories 2023-09-09 01:06:31 +02:00
Tim Schumacher
ce50dbb411 Ports: Pass --no-sign to tagging operations
If the user chose to sign tags by default, not passing this flag will
force a signed and therefore annotated tag, which requires a message.
2023-09-09 01:06:31 +02:00
Tim Schumacher
b80760003e Ports: Use clearer tag names for ./package.sh dev
The old names only made sense in the context of `./package.sh dev` but
that will not be the only context anymore very soon.
2023-09-09 01:06:31 +02:00
Tim Schumacher
9a828a76d2 Ports: Remove ./package.sh dev support for non-Git patches
All of our existing patches have been converted into Git patch format,
and new patches are created through `./package.sh dev` itself.
2023-09-09 01:06:31 +02:00
Tim Schumacher
456fd9f574 Ports: Switch to the new files syntax 2023-09-09 01:06:31 +02:00
Tim Ledbetter
5af7d5da2f Ports: Simplify the output from identify when installing icons
This ensures that the correct index is always used when selecting an
image of a particular size.
2023-08-23 12:55:00 +02:00
Gurkirat Singh
afb19a2cff Ports: Fix clean_dist function in .port_include.sh
A bug was introduced in commit #20413, where the `clean_dist` function
was missed from refactoring to the new "files" format.
2023-08-11 09:43:46 +02:00
Tim Schumacher
fb4db096cb Ports: Remove the filename entry from files 2023-08-08 19:57:43 +02:00
Tim Schumacher
2732545b4c Ports: Ensure that the download filename matches the URL basename
This is a preparation step for removing support for explicitly setting a
download filename entirely.
2023-08-08 19:57:43 +02:00
Tim Schumacher
c71815bc91 Ports: Move handling for simple downloads into a separate function 2023-08-08 19:57:43 +02:00
Tim Schumacher
a37b95f465 Ports: Do file downloading in a single big loop 2023-08-08 19:57:43 +02:00
Tim Schumacher
284fee9e77 Ports: Make files a proper array 2023-08-08 19:57:43 +02:00
Liav A
fcc3497803 Ports: Rename packages.db => installed.db
The /usr/Ports/packages.db will be used later for tracking available
ports by the upcoming package manager, which will use it to do search
queries, providing metadata on available ports, etc.

Ports that are installed will be registered from now on in the file of
/usr/Ports/installed.db, so that file will be used later on to allow
further management of what is actually installed on the system.
2023-08-07 13:24:25 -06:00
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