Commit graph

304 commits

Author SHA1 Message Date
Cameron Youell 1d24f394c6 Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
Tim Schumacher fb0fd85e97 Meta: Don't install CA certificates during a on-Serenity build
`SERENITYOS` is also set when compiling Lagom on SerenityOS, so we can't
just check it and expect `CMAKE_STAGING_PREFIX` to be set.

Instead, check `CMAKE_STAGING_PREFIX` directly and use that as an
indicator for whether we can install a file there.
2023-03-20 09:33:30 +01:00
kleines Filmröllchen 904a4dd314 Meta: Use extract_tar_path for WASM spec test generation 2023-03-19 14:15:35 +00:00
kleines Filmröllchen d3d93ef1df Meta: Refactor FLAC spec test extraction with extract_tar_path 2023-03-19 14:15:35 +00:00
kleines Filmröllchen a6dd992ad3 Meta: Add a tar extraction CMake wrapper
This is a copy of the zip wrapper adopted for tar archives.
2023-03-19 14:15:35 +00:00
Andreas Kling d38a3ca9eb LibGfx/OpenType: Add some initial support for GPOS glyph positioning
This patch parses enough of GPOS tables to be able to support the
kerning information embedded in Inter.

Since that specific font only applies positioning offsets to the first
glyph in each pair, I was able to get away with not changing our API.
Once we start adding support for more sophisticated positioning, we'll
need to be able to communicate more than a simple "kerning offset" to
the clients of this code.
2023-03-17 09:36:20 +01:00
Fabian Dellwing b07654c3c1 Meta: Download cacert.pem at build time 2023-03-16 18:54:20 +03:30
Timothy Flynn 020c2b59c4 LibWeb: Support generating IDL namespaces
These are similar to prototypes and constructors in that they will now
be lazily instantiated when they are first requested.
2023-03-15 12:48:25 -04:00
Linus Groh 3316d247bf LibWeb: Support interfaces with the [Global] extended attribute
These are treated differently as the interface members are placed on the
object itself, not its prototype.
As the object itself still needs to be hand-written code, and we can no
longer fully hide the gnarly generated code in the prototype object,
these now generate a 'mixin' class that is added to the actual object
through inheritance.

https://webidl.spec.whatwg.org/#Global
2023-03-07 23:33:34 +00:00
Sam Atkins 3d8cc2257f LibCMake: Introduce a CMake lexer 2023-03-04 05:43:43 -07:00
Timothy Flynn fd1fbad1d2 LibGfx+LibUnicode: Support specifying the path to search for emoji
Similar to the FontDatabase, this will be needed for Ladybird to find
emoji images. We now generate just the file name of emoji image in
LibUnicode, and look for that file in the specified path (defaulting to
/res/emoji) at runtime.
2023-03-01 14:54:16 +00:00
Timothy Flynn 8c38d46c1a LibUnicode: Generate the path to emoji images alongside emoji data
This will provide for quicker emoji lookups, rather than having to
discover and allocate these paths at runtime before we find out if they
even exist.
2023-02-24 19:48:47 +01:00
Nico Weber f7e152d049 LibGfx: Add scaffolding for a webp decoder
At the moment, this processes the RIFF chunk structure and extracts
the ICCP chunk, so that `icc` can now print ICC profiles embedded
in webp files. (And are image files really more than containers
of icc profiles?)

It doesn't even decode image dimensions yet.

The lossy format is a VP8 video frame. Once we get to that, we
might want to move all the image decoders into a new LibImageDecoders
that depends on both LibGfx and LibVideo. (Other newer image formats
like heic and av1f also use video frames for image data.)
2023-02-24 19:44:20 +01:00
Lucas CHOLLET 856d0202f2 LibGfx: Rename JPGLoader to JPEGLoader
The patch also contains modifications on several classes, functions or
files that are related to the `JPGLoader`.

Renaming include:
 - JPGLoader{.h, .cpp}
 - JPGImageDecoderPlugin
 - JPGLoadingContext
 - JPG_DEBUG
 - decode_jpg
 - FuzzJPGLoader.cpp
 - Few string literals or texts
2023-02-18 23:56:24 +01:00
Timon Kruiper dfc6555fec CMake: Add -mstrict-align flag to compile options for aarch64 build
The aarch64 processor is set up to trap on unaligned memory accesses, so
to enforce that the compiler correctly generates aligned accesses, the
-mstrict-align flag is needed. We also need the -Wno-cast-align as there
are some files in AK that don't build without the flag.
2023-02-15 22:53:19 +01:00
Ali Mohammad Pur 2a276c86d4 Shell: Start implementing a POSIX-compliant parser
The parser is still very much a work-in-progress, but it can currently
parse most of the basic bits, the only *completely* unimplemented things
in the parser are:
- heredocs (io_here)
- alias expansion
- arithmetic expansion

There are a whole suite of bugs, and syntax highlighting is unreliable
at best.
For now, this is not attached anywhere, a future commit will enable it
for /bin/sh or a `Shell --posix` invocation.
2023-02-13 23:00:15 +03:30
Karol Kosek bc587b89d8 CMake: Don't require to install glapi.h to system
This failed when a current build configuration hadn't got any program
depending on LibGL.
2023-02-04 15:53:07 -07:00
Tim Schumacher ef7f343e95 CMake: Set DWARF version before the debug information level
Setting the DWARF version after having selected which level of debug
information to generate apparently undoes some settings again.

Doing the reverse apparently keeps both the version and the debug level
setting, resulting in a significantly smaller disk image size.
2023-02-02 16:31:09 +01:00
Sam Atkins 5ac57f9d41 Meta: Use existing test-sources lists for Lagom instead of globbing
...mostly.

This creates and uses an override for the `serenity_test()` function, so
that Lagom can make use of the existing `Tests/LibFoo/CMakeLists.txt`
files instead of having to GLOB for test source files and manually copy
any data files.

Some GLOBs remain but this is most of them.

Co-authored-by: Andrew Kaster <akaster@serenityos.org>
2023-01-19 11:50:10 +00:00
Timothy Flynn 8f2589b3b0 LibUnicode: Parse and generate case folding code point data
Case folding rules have a similar mapping style as special casing rules,
where one code point may map to zero or more case folding rules. These
will be used for case-insensitive string comparisons. To see how case
folding can differ from other casing rules, consider "ß" (U+00DF):

    >>> "ß".lower()
    'ß'

    >>> "ß".upper()
    'SS'

    >>> "ß".title()
    'Ss'

    >>> "ß".casefold()
    'ss'
2023-01-18 14:43:40 +00:00
Timothy Flynn 7bd8fd000f LibWeb: Generate dedicated methods to create Web constructors/prototypes
Currently, for each exposed interface, we generate one massive function
to create every Web constructor and prototype. In an effort to lazily
create these instead, this first step is to extract the creation of each
of these into its own method.

First, this generates a forwarding header for all IDL types. This is to
allow callers to remain unchanged without forcing them to include the
(very heavy) generated IDL headers. This header is included by LibWeb's
forwarding header.

Next, this defines a base template method on Web::Bindings::Intrinsics
to create a prototype/constructor pair. Specializations of this template
are now generated in a new .cpp file, IntrinsicDefinitions.cpp. The base
Intrinsics class is updated to use this new method, and will continue to
cache the result.

Last, some WebAssembly classes are updated to use this new mechanism.
They were using some ad hoc cache keys that are now in line with the
generated specializations.

That one massive function is still used to invoke these specializations,
so they are not lazy as of this commit.
2023-01-10 16:08:14 +01:00
Liav A c876412b1b Kernel: Remove the NE2000 PCI network adapter driver
Nobody tests this network card as the person who added it, Jean-Baptiste
Boric (known as boricj) is not an active contributor in the project now.
After a discussion with him on the Discord server, we agreed it's for
the best to remove the driver, as for two reasons:
- The original author (boricj) agreed to do this, stating that he will
  not be able to test the driver anymore after his Athlon XP machine is
  no longer supported after the removal of the i686 port.
- It was agreed that the NE2000 network card family is far from the
  ideal hardware we would want to support, similarly to the RTL8139 that
  got removed recently for almost the same reason.
2023-01-08 21:51:59 +01:00
Liav A 5c97c6d874 Kernel: Remove the RTL8139 PCI network adapter driver
Nobody tests this network card, and the driver has bugs (see the issue
https://github.com/SerenityOS/serenity/issues/10198 for more details),
so it's almost certain that this happened due to code being rotting when
there's simply no testing of it.

Essentially this has been determined to be dead-code so this is the most
important reason to drop this code. Another good reason to do so is
because the RTL8139 only supports Fast Ethernet connections (10/100
Megabits per second), and is considered obsolete even for bare metal
setups.
2023-01-07 11:37:57 -07:00
Liav A fb0dee5a54 Meta: Force compilation with DWARF revision 4
We currently don't support DWARF revision 5 and LLVM/Clang might create
such debug info into our binaries in x86_64, which will lead to a crash
in CrashReporter that is unable to parse that information correctly.
2022-12-28 11:53:41 +01:00
Andrew Kaster 0384513779 Lagom: Add option to build Ladybird as part of a Lagom build
This means that Ladybird can be built with either Meta/Lagom or Ladybird
as the top-level source directory. This setup is a bit awkward, but will
preserve the packaging story for Ladybird until we come up with a more
permanent solution.
2022-12-25 07:58:58 -07:00
Timothy Flynn 2334b4cebd Meta: Move UCD/CLDR/TZDB downloaded artifacts to Build/caches
They currently reside under Build/<arch>, meaning that they would be
redownloaded for each architecture/toolchain build combo. Move them to a
location that can be re-used for all builds.
2022-12-24 09:46:28 -05:00
Tim Schumacher 1c630316ec CMake: Fall back to the Web Archive when downloading files 2022-12-21 09:13:50 +00:00
Timothy Flynn ed84a6f6ee LibUnicode: Use www.unicode.org domain to download emoji-test.txt
The non-www domain does not appear to be available now. We use the www
domain for UCD.zip already.

Co-authored-by: Stephan Unverwerth <s.unverwerth@serenityos.org>
2022-12-20 12:09:16 -05:00
Jelle Raaijmakers 2da1c1c10e LibGL: Generate the API wrappers
We now generate all LibGL API wrappers from a single API method
definition list stored in `GLAPI.json`. Since a significant portion of
the OpenGL API methods are relatively consistent variants, we take
advantage of this to generate a lot of these variants at once.

The autogenerated methods check for the non-nullness of the current
`GLContext`, and only perform an action if a `GLContext` is present.
This prevents a crash in ports like GLTron, who assume you can still
call the OpenGL API without an active context.

This increases our API wrapper method count from 211 to 356.

Fixes #15814.
2022-12-20 10:42:31 +01:00
Andrew Kaster 733a318709 Meta+CMake: Extract Wasm spec tests into the binary directory
Clean up the Wasm spec tests CMake rules to extract and compile the wat
files into wasm files in the LibWasm binary directory instead of its
source directory. Also make the rules more robust to missing host tools,
and use more CMake install rules for the test files rather than relying
on build-root-filesystem.sh. Add some FIXMEs for later, we really
shouldn't be doing installation of test files into /home/anon at the
build-root-filesystem stage in $CURRENT_YEAR. Tests go in /usr/Tests
2022-12-14 20:29:43 +03:30
Andrew Kaster 16d4791212 CMake: Pass NO_POLICY_SCOPE to options cmake helpers
Tell CMake to not create a new policy scope for the
(lagom|serenity|common)_options.cmake helpers, and lets us set common
policies for both projects in common_options.cmake that actually apply
to the rest of the project, instead of just common_options.cmake itself.
2022-12-14 12:43:12 +01:00
Filiph Siitam Sandström f050534991 Lagom: Don't compile with -fPIC on WIN32 2022-12-13 21:53:29 +00:00
Timothy Flynn bb6a84cc85 LibTimeZone: Update to TZDB version 2022g
https://mm.icann.org/pipermail/tz-announce/2022-November/000076.html
2022-12-13 16:04:32 -05:00
Andrew Kaster e4a59f664b Toolchain+Meta: Add script to build CMake from source
Since we upstreamed CMake support for Serenity, we can use the Platform
files from upstream instead of keeping our local copy. While not added
in this commit, we can add patching capabilities for the platform files
similar to what we do for gdb, llvm, gcc, and binutils later.
2022-12-13 11:36:14 +01:00
Daniel Bertalan 24d2c90a28 BindingsGenerator+CMake: Keep track of IDL dependencies
This commit teaches BindingsGenerator to generate depfiles, which can be
used by CMake to ensure that bindings are properly regenerated when
imported IDL files change.

Two new options, `--depfile` and `--depfile-target` are added.
- `--depfile` sets the path for the dependency file.
- `--depfile-target` lets us set a target name different than the output
  file in the depfile. This option is needed because generated files are
  first written to a temporary file, but depfiles have to refer to the
  final location.
These are analogous to GCC's `-MF` and `-MT` options respectively. The
depfile's syntax matches the ones generated by GCC.

Note: This changes the minimal required CMake version to 3.20 if the
Make generator is used, and to 3.21 for the Xcode generator. Ninja is
not affected.
2022-12-13 11:31:24 +01:00
Daniel Bertalan 8d1ad592a1 BindingsGenerator: Write generated code to disk instead of stdout
This commit adds the `-o` option for specifying an output path to
BindingsGenerator.
2022-12-13 11:31:24 +01:00
Jan200101 483c18437b Meta: Detect ccache being passed as the compiler
This prevents ccache from being invoking itself.
Icecc fails to ran this way because of recursion detection.
2022-12-12 21:34:09 -07:00
Jan200101 10d40af167 Meta: Separate ccache setup into its own component 2022-12-12 21:34:09 -07:00
Andrew Kaster 8356677868 CMake: Force-link clang_rt.profile.a to LibC when building with coverage
This used to be in place until 671712cae6.

I had commented on that PR that "yeah should be good to remove". Turns
out that's not the case. A future patch to the clang driver might make
this obsolete :^).
2022-12-10 11:51:16 +00:00
Timothy Flynn 558901acb4 LibTimeZone: Update to TZDB version 2022f
https://mm.icann.org/pipermail/tz-announce/2022-October/000075.html
2022-11-04 08:56:11 +00:00
Tim Schumacher ce2f1b845f Everywhere: Mark dependencies of most targets as PRIVATE
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.

Also included are changes to readd now missing dependencies to tools
that actually need them.
2022-11-01 14:49:09 +00:00
Tim Schumacher 678db534ff LibC: Properly implement stack protectors
The shared parts are now firmly compiled into LibC instead of being
defined as a static library and then being copied over manually.
The non-shared ("local") parts are kept as a static library that is
linked into each binary on demand.

This finally allows us to support linking with the -fstack-protector
flag, which now replaces the `ssp` target being linked into each binary
accidentally via CMake.
2022-11-01 14:49:09 +00:00
Tim Schumacher 7834e26ddb Everywhere: Explicitly link all binaries against the LibC target
Even though the toolchain implicitly links against -lc, it does not know
where it should get LibC from except for the sysroot. In the case of
Clang this causes it to pick up the LibC stub instead, which might be
slightly outdated and feature missing symbols.

This is currently not an issue that manifests because we pass through
the dependency on LibC and other libraries by accident, which causes
CMake to link against the LibC target (instead of just the library),
and thus points the linker at the build output directory.

Since we are looking to fix that in the upcoming commits, let's make
sure that everything will still be able to find the proper LibC first.
2022-11-01 14:49:09 +00:00
Zaggy1024 353e1c2b4d LibVideo: Add PlaybackManager to load and decode videos
This file will be the basis for abstracting away the out-of-thread or
later out-of-process decoding from applications displaying videos. For
now, the demuxer is hardcoded to be MatroskaParser, since that is all
we support so far. The demuxer should later be selected based on the
file header.

The playback and decoding are currently all done on one thread using
timers. The design of the code is such that adding threading should
be trivial, at least based on an earlier version of the code. For now,
though, it's better that this runs in one thread, as the multithreaded
approach causes the Video Player to lock up permanently after a few
frames are decoded.
2022-10-31 14:47:13 +01:00
Linus Groh 4db85493e8 AK+Meta: Add WEB_FETCH_DEBUG macro 2022-10-30 20:10:29 +00:00
Jan200101 4b305e8fe4 Meta: Convert build directory path to be completely absolute 2022-10-27 20:43:55 +01:00
Timothy Flynn bd592480e4 Meta: Replace Bash script for generating emoji.txt with C++ generator
We currently have two build-time parsers for the UCD's emoji-test.txt
file. To prepare for future changes, this removes the Bash parser and
moves its functionality to the newer C++ parser.
2022-10-27 12:59:56 +02:00
Timothy Flynn b5a876e606 Meta: Allow specifying additional dependencies with invoke_generator 2022-10-27 12:59:56 +02:00
Timothy Flynn b077fccd3d LibLocale+LibJS: Update to CLDR version 42.0.0
There were some notable changes to the CLDR JSON format and data in this
release.

The patterns for a date at a specific time, i.e. "{date} at {time}", now
appear under the "atTime" attribute of the "dateTimeFormats" object.

Locale specific changes that affected test-js:

All locales:

* In many patterns, the code points U+00A0 (NO-BREAK SPACE) and U+202F
  (NARROW NO-BREAK SPACE) are now used in place of an ASCII space. For
  example, before the "dayPeriod" fields AM and PM.

* Separators such as U+2013 (EN DASH) are now surrounded by U+2009 (THIN
  SPACE) in place of an ASCII space character.

Locale "en":

* Narrow localizations of time formats are even more narrow. For
  example, the abbreviation "wk." for "week" is now just "wk".

Locale "ar":

* The code point U+060C (ARABIC COMMA) is now used in place of an ASCII
  comma.

* The code point U+200F (RIGHT-TO-LEFT MARK) now appears at the
  beginning of many localizations.

* When the "latn" numbering system is used for currency formatting, the
  currency symbol more consistently is placed at the end of the pattern.

Locale "he":

* The "many" plural rules category has been removed.

Locales "zh" and "es-419":

* Several display-name localizations were changed.
2022-10-25 10:10:39 +01:00
Timothy Flynn 27737f613c LibTimeZone+LibJS: Update to TZDB version 2022e
https://mm.icann.org/pipermail/tz-announce/2022-October/000074.html

This version changes America/Chicago's transtion from LMT to CST from
1883 Nov 18 12:09:24 to 1883 Nov 18 18:00.
2022-10-18 16:01:44 +02:00