Commit graph

44 commits

Author SHA1 Message Date
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
Dan MacDonald d76fb99403 Ports: Add support for zip files and ensure configure is executable (#773) 2019-11-13 17:22:24 +01:00
Andreas Kling 3d239be7b4 Ports: Undo POSIX sh compliance changes for now
Partial revert of 704f48d7f3.
These changes made the ports system unusable.
2019-11-03 10:05:02 +01:00
George Pickering 704f48d7f3 POSIX compliance: (most) shell scripts converted to generic shell
Ports/.port_include.sh, Toolchain/BuildIt.sh, Toolchain/UseIt.sh
have been left largely untouched due to use of Bash-exclusive
functions and variables such as $BASH_SOURCE, pushd and popd.
2019-11-03 09:26:22 +01:00
Larkin Nickle 8060749d04 Ports: Update uninstall function to use $SERENITY_ROOT
Now uninstalling should just work once we have plists in place.
2019-09-24 15:39:35 +02:00
Larkin 18249b5996 Ports: Switch to new ports system (#594)
Much redundancy is removed from package scripts with this system.
It also supports simple dependency management, uninstalling (through
BSD ports style plist files), cleaning up after itself (with clean,
clean_dist, clean_all commands), etc.
2019-09-24 08:56:39 +02:00
Andreas Kling bc2bd1e64a Ports: Always export Serenity's GCC and G++ in the build environment
Export the appropriate CC and CXX to all port commands.
2019-09-06 20:33:18 +02:00
Dan MacDonald 362ac8f1ba Ports: Force curl to follow redirects in run_fetch_web() (#266)
This fixes downloading files from github when building ports.
2019-07-01 20:57:46 +02:00
Andreas Kling 2daf89e2f7 Ports: Fix SDL2 port trying to build against PulseAudio for some reason.
I didn't look into why, but for some reason the SDL2 cmake build system
thinks it should build against PulseAudio which we definitely don't have.
So just tell it explicitly not to do that.

Fixes #265.
2019-07-01 14:08:15 +02:00
Larkin Nickle d080f6e8dd Ports: Remove bashisms and switch all scripts to /bin/sh. 2019-06-05 14:00:01 +02:00
Robin Burchell b7d315319d Ports: Add links
Doesn't actually run yet. in_term's read() fails with EFAULT for reasons that
are presently beyond me, points to a bug in Serenity.
2019-05-28 20:06:47 +02:00
Christopher Dumas 674be46afd Ports: Vim and ncurses 2019-05-28 20:05:22 +02:00
Andreas Kling cbd858544d LibC: Move struct timeval to sys/time.h. #POSIX 2019-05-28 13:48:06 +02:00
Robin Burchell 335d0e52a4 Ports: Replace run_command use in bash with a run_replace_in_file helper
This way, we don't (in the ports themselves) depend on perl as a public
interface, which means if we ever have to, we can port to something else easier.
2019-05-28 11:03:18 +02:00
Robin Burchell 2b1a52745e Ports: Remove MAKEOPTS hacks from bash
This doesn't seem to go wrong anymore.
2019-05-28 11:03:18 +02:00
Robin Burchell 9a284ad3f7 Move everything to a subdirectory
Also don't run cd for the initial git clone (DERP!), and other bash port fixes.
2019-05-28 03:07:18 +02:00
Robin Burchell 19afcfe03c port_include: Various updates
* Prints what is run, which is useful for trace purposes.
* Fix autotools configure to respect arguments
* Add run_patch for applying patches
2019-05-28 02:45:54 +02:00
Robin Burchell 5c82d14128 Add the start of a simple ports infrastructure 2019-05-28 00:21:14 +02:00