1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 01:30:46 +00:00
Commit Graph

128 Commits

Author SHA1 Message Date
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
Ali Mohammad Pur
527502494c Ports: Make the patch auto-import script care about the patch's authors
Previously it would commit with the current user's git identity, this
commit makes it ask the user if they want to retain the original
author(s) of the patch as commit authors and co-authors, as well as the
original commit date.
2022-05-19 20:17:10 +04:30
Daniel Bertalan
cccc001ded Ports: Add $STRIP and $HOST_STRIP variables
This fixes stripping the debug information from the gcc port when
building on macOS hosts.
2022-05-12 13:12:37 +02:00
Daniel Bertalan
f123fd7af6 Ports: Enable ccache for SERENITY_TOOLCHAIN=Clang 2022-05-12 13:12:37 +02:00
Jelle Raaijmakers
37bbfc1b38 Ports: Improve newline support for ./package.sh dev
Previously `git am` could fail on patches with Windows line endings
(CRLF). By supplying `--keep-cr`, we prevent git from stripping the CR
from our patches.
2022-05-09 21:18:21 +02:00
Tim Schumacher
d8ce2802e0 Ports: Make the number of compile jobs configurable 2022-05-03 22:18:20 +02:00
circl
2130a83640 Ports: Make .hosted_defs.sh usable outside of .port_include.sh
This commit moves some stuff around in order to isolate .hosted_defs.sh
from .port_include.sh
2022-04-26 22:45:48 +02:00
Daniel Bertalan
9a898df1cd Ports: Fix issue with the patches directory being a symlink
The path of the temporary directory should be an absolute path to
account for the patches directory being a symlink like in the upcoming
LLVM port update.
2022-04-23 10:43:32 -07:00
Tim Schumacher
4c9fbea987 Revert "Ports: Fix dependency install if port name is not folder name"
This breaks ports whose name may come up in more than one port name.

This reverts commit cc08f82ddb.
2022-04-03 12:32:00 +01:00
EWouters
cc08f82ddb Ports: Fix dependency install when port name is not port folder name
There was a bug in the way the `.port_include.sh` script handled
installing dependencies. According to the
[documentation](https://github.com/SerenityOS/serenity/tree/master/Ports#depends)
the depends array should have port names in it. The port system allows
for the name of the port to be different from the folder where port
lives. Previously the `installdepends` function would cd to the name
of the port, now it will find and run the `package.sh` that has the
line `port=$depend` in it.
2022-04-02 13:12:02 +01:00
Tim Schumacher
1cab2e54e1 Ports: Fail if config.{sub,guess} don't replace existing files
This should help with finding misconfigured config.sub and config.guess
settings.
2022-03-16 14:10:59 +00:00
Daniel Bertalan
4f89f47acb Ports: Download fresh config.guess if needed
The config.guess file needs to know about the SerenityOS `uname -m`
system name if we want to build ports inside Serenity. Support was only
added in January 2022, so most ports don't have a new enough version
yet.

This commit adds facilities for fetching a fresh config.guess file that
supports SerenityOS, similarly to what we do for config.sub. As its
first user, we make the bash port buildable inside the system.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
aed2e214b6 Ports: Use sed -i for run_replace_in_file on Serenity hosts
We don't have a perl port, so let's use GNU sed's in-place option for
doing substitutions when running inside Serenity.

Note that we can't do this unconditionally, as `sed -i` is not portable
and works differently on BSD systems.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
0be67ef12c Ports: Use the objcopy built as part of the toolchain
Relying on host tools working correctly is not a good idea, as they may
be outdated (and therefore not support features like RELR relocations)
or may not exist at all (like objcopy on macOS).
2022-02-20 23:07:31 +00:00