Commit graph

67 commits

Author SHA1 Message Date
Tim Schumacher c07f91474d Ports: Make array-like settings actual arrays
We may need entries with spaces in makeopts, installopts, and
configopts, and at that point we should also convert depends and
auth_opts to avoid confusion.
2021-10-05 02:13:08 +02:00
Tim Schumacher e507cfcdb0 Ports: Set defaults before loading package.sh
This is too much bash magic for a simple "Use this value if the script
doesn't set anything", especially since only one default setting depends
on values from the script.
2021-10-05 02:13:08 +02:00
sin-ack 06a6b68690 Ports: Make the build step messages use ellipsis rather than excl. point
This stops the port build system from yelling at the user. This commit
also adds a "success" message after the "Adding to database" message.
2021-08-15 14:50:39 +01:00
Gunnar Beutner 6eee60de41 Ports: Make sure HOST_* variables are set correctly for nested builds
When building a port as a dependency for another port the HOST_*
variables were previously initialized with values referring to the
SerenityOS toolchain.

Fixes #9168.
2021-08-13 21:29:48 +02:00
Jelle Raaijmakers a76c208bae Ports: Support icons for launchers with arguments 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers 8493477cc7 Ports: Convert only first index of ico files
When installing an icon, we fall back to a resizing strategy when an
exact match on the image dimensions is missing. However, if we are
dealing with an `.ico` file with multiple indices, `convert` will
resize every separate index and will create multiple files.

This changes makes sure we only resize the first index. A future
improvement could be to select an index most closely matching the
requested dimensions.
2021-08-04 13:54:08 +01:00
Jelle Raaijmakers 546af2d9ef Ports: Notify user of missing ImageMagick binaries 2021-08-04 13:54:08 +01:00
Kenneth Myhra f7161b03ca Ports: Add overridable pre_fetch method in .port_include.sh
This adds an overridable pre_fetch method which is called from the fetch
method at the very beginning.

The pre_fetch method can be overridden in your package.sh script so that
you can do any necessary preparations before the fetch method is called.
2021-07-22 22:30:55 +02:00
Linus Groh 6b9e0d98d9 Ports: Add launcher_run_in_terminal package.sh variable
This is being used to generate the RunInTerminal entry in launcher app
files.
2021-07-20 00:58:26 +01:00
pancake f1266335e7 Ports: Add './package.sh shell' to get a shell with the build env set 2021-07-08 15:42:51 +02:00
Gunnar Beutner 8ba0533138 Ports: Add port for DungeonRush 2021-06-16 20:08:13 +02:00
Egor Ananyin 142f9db5bd Ports: Add pre_fetch to .port_include.sh 2021-06-10 20:21:08 +01:00
Max Trussell b889bfe0f6 Ports: .port_include.sh add install_icon function 2021-06-09 17:37:56 +04:30
Gunnar Beutner 46de51f467 Ports: Create launchers for the stpuzzles port
This changes the .port_include.sh script so that ports can more easily
create more than one launcher by making the install_launcher function
available to the port's package.sh script.

This creates launchers for the stpuzzles port in the Games/Puzzles
category.
2021-06-04 09:38:25 +02:00
Gunnar Beutner 101e4233b8 Ports: Don't set the current working directory in the launcher script
This removes the hack for launching Super Mario.
2021-06-04 09:38:25 +02:00
Linus Groh c1b2813ddf Ports: Only do build check for configure, build, and install steps
This was breaking ports linting, which runs the script with the
'showproperty' option. This check is not needed for some other options
as well, so let's do it conditionally.
2021-05-20 20:04:58 +01:00
Linus Groh 068ddf4513 Ports: Add build completion sanity check to .port_include.sh
Simply by checking whether a built libc.so exists, we should be able to
avoid strange build errors where that's not the case and just tell the
user upfront.

Fixes #7309.
2021-05-20 19:41:45 +01:00
Gunnar Beutner 0b47ea408c Ports: Change how we invoke ccache because some ports didn't use it
This prepends ccache to the PATH instead of setting CC/CXX. Doing it
this way ensures all ports use ccache because some of them didn't
before.
2021-04-27 18:01:43 +02:00
Gunnar Beutner 64d05152f7 Ports: Try to download files again when verification fails 2021-04-25 13:30:18 +02:00
Gunnar Beutner 5a3f63ea00 Ports: Remove support for algos other than sha256 and sig 2021-04-25 13:30:18 +02:00
Jelle Raaijmakers 4c26e318a3 Ports: Pass along any command arguments in package.sh
Commit b3db01e20 broke simple commands without arguments like:

  ./package.sh clean

Now, all available arguments are passed along, even if there are none.
2021-04-25 00:38:27 +02:00
Gunnar Beutner b3db01e20e Ports: Detect more types of errors in the AvailablePorts.md file
This adds support for detecting incorrect version numbers and links
in the ports list.

Also, unlike before it doesn't parse the package.sh script but executes
it instead which allows us to detect syntax errors.
2021-04-23 16:11:48 +02:00
Gunnar Beutner e72235b981 Ports: Add launchers for some of the ports 2021-04-23 11:33:57 +02:00
Gunnar Beutner 4115fcc933 Ports: Build ports only once when running build_all.sh
Previously we'd end up building some ports multiple times, e.g.
as a dependency for another port. This changes the build_all.sh
script so that it builds ports only once.
2021-04-21 23:41:48 +02:00
Gunnar Beutner 6eedb570a2 Ports: Enable building ports with ccache 2021-04-18 10:42:41 +02:00
Gunnar Beutner 28b3c8bc1d Port: Support running some configure/build commands with the host toolchain
This is useful for ports which depend on running tools on the host system.
In this case we can build the port twice - once for the host and once for
the target system.
2021-04-14 21:46:20 +02:00
Gunnar Beutner 8874b4b4fe Ports: Make sure pkg-config only picks up packages from the target 2021-04-14 21:46:20 +02:00
Peter Elliott fbbb4b3395 Ports: fallback to pro when curl is not installed 2021-04-12 14:06:24 +02:00
Peter Elliott f71102a474 Ports: Require less commands in .port_include.sh
- fallback to http with curl when https fails
- add --no-gpg-verification, which will skip gpg signature verification
2021-04-12 14:06:24 +02:00
Peter Elliott 938924f36d Meta: Add install-ports CMake target
install-ports copys the necessary files from Ports/ to /usr/Ports. Also
refactor the compiler and destiation variables from .port_include.sh
into .hosted_defs.sh. .hosted_defs.sh does not exists when ports are
built in serenity
2021-04-12 14:06:24 +02:00
Linus Groh 15a820e9ad Ports: Use SERENITY_ARCH in .port_include.sh if already defined
Instead of always hardcoding i686, only use it as fallback value as we
already do in other scripts.
2021-03-13 13:13:03 +01:00
Linus Groh 4c497228a9 Ports: Use SERENITY_ARCH in --target/--host
Recent ports already do this, let's update the others as well. One step
closer to multi-arch support for ports! :^)
2021-03-13 13:13:03 +01:00
Linus Groh 7cb9237be9 Ports: Remove/replace hardcoded i686-pc-serenity-{gcc,g++,ar,ranlib}
Except in the Lua port's Makefile patch, I couldn't figure this out...
2021-03-13 13:13:03 +01:00
Linus Groh f318ab6bed Ports: Replace hardcoded Build/ paths with SERENITY_BUILD_DIR
Fixes #5710.
2021-03-11 21:01:29 +01:00
Linus Groh 92ca22a5e1 Ports: Add post_configure function
There's pre_configure to do things required by the configure script,
let's also add post_configure for things not covered by the configure
script.
The specific use case is overwriting a file created by python3's
configure script.
2021-02-02 16:53:06 +01:00
Linus Groh 02520f16e3 Ports: Move packages.db from Ports/ to Build/
When removing and recreating the Build directory, it's quite annoying
having to edit/remove Ports/packages.db as the installer won't install
previously installed port dependencies again if they're still listed.
This problem is easily solved by just considering packages.db a
build-specific file.
2021-02-01 19:40:34 +01:00
TheMorc d4668507d4 Ports: Improve configure script
Just a small modification so that ports that are configured e.g.
using cmake don't need a dummy configure file anymore.
2021-01-25 22:34:43 +01:00
Linus Groh a4fbdb97c7 Ports: Install dependencies in separate "installdepends" step
Calling installdepends in do_fetch seems kinda silly and unexpected.
Let's add a separate step with the same name instead.
2021-01-23 08:28:25 +01:00
Jonathan Turner 0bf5669ba3
Meta: Get building on NixOS (#5005) 2021-01-22 17:44:05 +01:00
Linus Groh 2bc9726e3c Ports: Rename a few .diff files to .patch
Let's keep things consistent, .diff is the name we use pretty much
everywhere. Also tweak the glob in .port_includes.sh to be
'patches/*.patch' rather than just 'patches/*'.
2021-01-17 08:43:46 +01:00
Dan MacDonald b7fd5315e5
Ports: Hard-code SERENITY_ARCH=i686 until other architectures work (#4688) 2020-12-31 21:54:51 +01:00
meme 23b23cee5a Build: Support non-i686 toolchains
* Add SERENITY_ARCH option to CMake for selecting the target toolchain
* Port all build scripts but continue to use i686
* Update GitHub Actions cache to include BuildIt.sh
2020-12-29 17:42:04 +01:00
Nico Weber 33d6d640d3
Ports: Use keyserver.ubuntu.com as .sig keyserver (#2535)
Increases the number of successfully building ports from
27 to 36 (of 56) on my system.
2020-06-09 21:10:00 +02:00
Sergey Bugaev 450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
Linus Groh 7feb48b1da Ports: Support pre_configure script
This is useful if we want to do something after patching but before
running the configure script - e.g. creating the configure script using
another script :^)
2020-04-15 16:39:09 +02:00
Andreas Kling f5418f40cc Ports/bash: Make a /bin/bash symlink to /usr/local/bin/bash
I've added a post_install step to the system that allows you to run
arbitrary commands after the regular install step.

This allows scripts that start with "#!/bin/bash" to work in Serenity.
2020-03-25 15:55:28 +01:00
Emanuel Sprung 991953ab0a Ports: Improve port build sript
* Add authenticity methods: sig, asc, md5sum, sha1sum, sha256sum
* Split patch into own step
* Improve extraction and patching: only do it, if it hasn't already be done,
  to do that, hidden files are created when a file is extracted or a patch is
  applied
* Patch function is named patched_internal to not overwrite patch command in /usr/bin
2020-02-06 14:06:23 +01:00
Sergey Bugaev ccfc9d8923 Ports: Do not download sources if they're already present
When running ./package.sh to rebuild an already installed port, we would not
want to spend time re-downlodaing the same tarball again. Ideally, this should
use some sort of hash checking to ensure the file is not truncated or something,
but this is good enough for now.
2019-12-23 14:55:17 +01:00
joshua stein 73c953b674 Build: get rid of UseIt.sh
The build system uses relative paths to the toolchain binaries, so
modifying $PATH is no longer necessary, and nothing needs
$SERENITY_ROOT anymore.
2019-12-20 23:55:08 +01:00
Larkin e5e0924c0b Ports: Use unzip to extract zips if bsdtar unavailable (#855) 2019-12-06 19:45:57 +01:00