Commit Graph

1082 Commits

Author SHA1 Message Date
Timothy Flynn
0d75949827 LibUnicode: Parse and generate locale display names for date fields 2022-01-13 13:43:57 +01:00
Timothy Flynn
7f162c471d LibUnicode: Parse and generate locale display names for calendars
Note there's a bit of an unfortunate duplication in the calendar enum
generated by UnicodeLocale and the existing enum generated by
UnicodeDateTimeFormat. The former contains every calendar known to the
CLDR, whereas the latter contains the calendars we've actually parsed
for DateTimeFormat (currently only Gregorian). The new enum generated
here can be removed once DateTimeFormat knows about all calendars.
2022-01-13 13:43:57 +01:00
DavidLindbom
c6f3856d4f man.serenityos.org: Include Games section on index page 2022-01-13 13:43:51 +01:00
Chris Frey
8f3759c04f Meta: Use fuse2fs if available to avoid root when building image
The fuse2fs tool that is part of e2fsprogs-1.46 has a 'fakeroot'
mount option.  This allows a non-root users to modify file ownership
and permissions without actually being root.  This package is
available in Debian bullseye and buster-backports.

If available, the script assumes the user wants to use it.
Otherwise, it falls back to the usual root requirements.

Now that root is not required, the root check in
build-root-filesystem.sh is not necessary.  Since
build-root-filesystem.sh has 'set -e' enabled, removing this check
will not cause a change in functionality.
2022-01-13 03:35:21 -08:00
Chris Frey
951f7becec Meta: Use consistent indents in build-image-qemu.sh
This is a whitespace only commit to avoid confusion with the
next feature commit.
2022-01-13 03:35:21 -08:00
Chris Frey
319cdf4ff3 Meta: Do not ignore error message with exec
When calling sub-programs from shell with exec, the useful || die
idiom does not actually do anything, since the first script is gone.
2022-01-13 03:35:21 -08:00
Timothy Flynn
bdf02c21e1 LibUnicode: Swap the preferred order of standard time zone display names
Our generator is currently preferring the DST variant of the time zone
display names over the non-DST variant. LibTimeZone currently does not
have DST support, and operates in a mode that basically assumes DST does
not exist. Swap the display names for now just to be consistent until we
have DST support.

Note we will need to generate both of these variants and select the
appropriate one at runtime once we have DST support.
2022-01-12 15:43:12 +01:00
Itamar
f464ae84ce CMake: Add HACKSTUDIO_BUILD option for building from Hack Studio
If this option is set, we will not build all components.
Instead, we include an external CMake file passed in via a variable
named HACKSTUDIO_BUILD_CMAKE_FILE.

This will be used to build serenity components from Hack Studio.
2022-01-12 14:55:19 +01:00
Timothy Flynn
0d8120eeb2 LibUnicode: Perform number system lookups by enumeration value
Now that number systems are generated as an enum, we can generated the
number system data in the order of that enum. This lets us perform
lookups of that data by index instead of a loop of string comparisons.
2022-01-12 10:49:07 +01:00
Timothy Flynn
c5138f0f2b LibUnicode: Parse number system digits from the CLDR
We had a hard-coded table of number system digits copied from ECMA-402.
Turns out these digits are in the CLDR, so let's parse the digits from
there instead of hard-coding them.
2022-01-12 10:49:07 +01:00
Timothy Flynn
e2dfbe8f67 LibUnicode: Parse and generate long and short generic time zone names
This implements the CalendarPatternStyle::{Long,Short}Generic styles of
time zone name formatting.
2022-01-11 23:56:35 +01:00
Timothy Flynn
8d35563f28 LibUnicode: Implement TR-35's localized GMT offset formatting
This adds an API to use LibTimeZone to convert a time zone such as
"America/New_York" to a GMT offset string like "GMT-5" (short form) or
"GMT-05:00" (long form).
2022-01-11 23:56:35 +01:00
Timothy Flynn
5aa144193c LibTimeZone: Use new AK::Time factory method in generated code 2022-01-11 23:56:35 +01:00
Idan Horowitz
a8537ad096 CI: Require a blank line between commit titles and bodies 2022-01-11 23:45:14 +02:00
Timothy Flynn
09c0324880 LibTimeZone: Begin generating GMT offset rules for each time zone
This is a rather naive implementation, but serves as a first pass at
determining the GMT offset for a time zone at a particular point in
time. This implementation ignores DST (because we are not parsing any
RULE entries yet), and ignores any offset patterns of the form "Mon>4"
or "lastSun".
2022-01-11 00:36:45 +01:00
Timothy Flynn
1c2c98ac5d LibTimeZone: Add method to convert a time zone to a string 2022-01-11 00:36:45 +01:00
Timothy Flynn
14535fb67a LibTimeZone: Perform time-zone-from-string lookups case insensitively
Time zone names in the TZDB are defined to be case insensitive.
2022-01-11 00:36:45 +01:00
Timothy Flynn
b493c2ca90 LibTimeZone: Add a unit test for generated time zone data 2022-01-11 00:36:45 +01:00
Timothy Flynn
ccce9e5c7f LibTimeZone: Tweak the enumeration generated for parsed time zones
For example, generate "Etc/GMT+12" as "Etc_GMT_Ahead_12" (instead of as
"Etc_GMT_P12"). A little clearer what the name means without having to
know off-hand what "P" was representing.
2022-01-11 00:36:45 +01:00
Timothy Flynn
b543c3e490 Meta: Don't assume how each generator wants to generate keyed map names
The generate_mapping helper generates a series of structs like:

    Array<SomeType, 1> s_mapping_key_0 {};
    Array<SomeType, 2> s_mapping_key_1 {};
    Array<SomeType, 3> s_mapping_key_2 {};
    Array<Span<SomeType const>> s_mapping { {
        s_mapping_key_0.span(),
        s_mapping_key_1.span(),
        s_mapping_key_2.span(),
    } };

Where the names of the struct were generated by the format_mapping_name
lambda inside the helper. Rather than this lambda making assumptions on
how each generator wants to name its structs, add a parameter for the
caller to provide a naming formatter.

This is because the TimeZoneData generator will want pretty specific
identifier formatting rules.
2022-01-11 00:36:45 +01:00
Timothy Flynn
6da1bfeeea Meta: Support generating case-insensitive value-from-string methods
This also extracts the default parameters for generate_value_from_string
to a structure. This is just to make it cleaner to add new options.
2022-01-11 00:36:45 +01:00
Timothy Flynn
7d9b6b41c3 LibTimeZone: Remove accidental pluralization of generator variable names 2022-01-11 00:36:45 +01:00
kleines Filmröllchen
9e471353dd Meta: Convert new help page link styles for the man page website
The special URL links (help://man) and the application opening links now
work on the man page website. While the page links are translated
correctly, the application launch can't be implemented. For this reason,
an explanatory error page is shown instead.
2022-01-11 00:24:57 +01:00
Michel Hermier
e1685b6b69 Lagom: Avoid declaring Time in the global namespace
When compiled using clang, an ambiguity error is detected between
`class AK::Time` aliased to `::Time` and the `struct ::Time` provided
in `GenerateTimeZoneData.cpp`. Solve this by moving most of the code in
an anonymous namespace.
2022-01-10 15:57:59 +01:00
Marcus Nilsson
4459cb33ed LibGUI+AK: Add DRAG_DEBUG opt and put drag operations behind dbgln_if
No need to have this enabled all the time.
2022-01-10 14:23:04 +01:00
Daniel Bertalan
162606f358 Toolchain+CI: Link LLVM with LLD if available
According to most benchmarks, LLD is faster than GNU ld and the macOS
linker, so let's use it if possible in order to speed up the toolchain
build.
2022-01-10 09:55:45 +03:30
Daniel Bertalan
d21c38a72d CI: Hash only relevant files for the key of the compiler cache
In the last few commits, a second patch was added to the LLVM toolchain,
and it no longer uses our binutils patch. This commit changes the CI
cache keys accordingly, in order to prevent unnecessary rebuilds of both
toolchains when only one is changed.

The Clang toolchain's cache now only takes into account patches that
begin with `llvm`, and the GNU toolchain excludes those from the hash
calculation. We now also hash the two CMake cache files that we use for
building LLVM and its runtime libraries.
2022-01-10 09:55:45 +03:30
Federico Guerinoni
9aa556fdf0 Userland: Port wasm to LibMain 2022-01-09 04:26:16 -08:00
serenityosrocks
689fe7ddff Meta: Make "Meta/serenity.sh run aarch64" work on macOS 2022-01-09 12:25:23 +01:00
Lucas CHOLLET
ed0f4bdfaf Shell: Port to LibMain 2022-01-09 03:22:10 +03:30
Linus Groh
eb60d16549 LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value>
Instead of making it a void function, checking for an exception, and
then receiving the relevant result via VM::last_value(), we can
consolidate all of this by using completions.

This allows us to remove more uses of VM::exception(), and all uses of
VM::last_value().
2022-01-08 23:43:03 +01:00
Simon Woertz
47f4e54cdc Lagom: Execute LibPDF unit tests on the host
Add lagom unit tests for `LibPDF`.
2022-01-08 18:57:55 +01:00
Timothy Flynn
498b741434 LibUnicode: Use LibTimeZone's list of time zone names
LibUnicode no longer needs to generate a list of time zone names that it
parsed from metaZones.json. We can defer to the TZDB for a golden list
of time zones.
2022-01-08 12:45:34 +01:00
Timothy Flynn
ca9123f66f LibUnicode: Rename DateTimeFormat's generator's TimeZone struct
Before using LibTimeZone within LibUnicode, rename this structure to
avoid naming conflicts with the TimeZone namespace.
2022-01-08 12:45:34 +01:00
Timothy Flynn
87abf00f7c LibTimeZone: Extract and parse the backwards compatibility LINK entries
This set of LINK entries contains the link from "UTC" to "Etc/UTC",
which LibJS will heavily depend upon.
2022-01-08 12:45:34 +01:00
Timothy Flynn
b5758a0623 LibTimeZone: Parse and generate LINK entries from the TZDB as aliases
For example, "GMT" should be linked to the golden time zone "Etc/GMT".
2022-01-08 12:45:34 +01:00
Timothy Flynn
9253e695d1 LibTimeZone: Parse ZONE entries from the TZDB and generate their names 2022-01-08 12:45:34 +01:00
Timothy Flynn
41f4a5050c CI: Add a cache for the IANA time zone database files 2022-01-08 12:45:34 +01:00
Timothy Flynn
8669b25cea LibTimeZone+Meta: Add plumbing for an IANA Time Zone Database generator
The IANA Time Zone Database contains data needed, at least, for various
JavaScript objects. This adds plumbing for a parser and code generator
for this data. The generated data will be made available by LibTimeZone,
much like how UCD and CLDR data is available through LibUnicode.
2022-01-08 12:45:34 +01:00
Timothy Flynn
9ba386a7bb Meta: Move invoke_generator to utils.cmake 2022-01-08 12:45:34 +01:00
Timothy Flynn
d5f14b5ff9 Meta: Move remove_unicode_data_if_version_changed to utils.cmake
This function will be used by the time zone database parser. Move it to
the common utilities file, and rename it remove_path_if_version_changed
to be more generic.
2022-01-08 12:45:34 +01:00
Timothy Flynn
a70e029236 Meta: Redefine link_with_unicode_data to not include unicode_data.cmake
This is to prevent an import cycle in a subsequent commit.
2022-01-08 12:45:34 +01:00
Timothy Flynn
363eafbc44 Meta: Remove -ldl linkage from LagomUnicode
This was needed for dlopen() on some systems, but is no longer needed as
of commit 1116a29c19.
2022-01-08 12:45:34 +01:00
Timothy Flynn
3938a2cca7 CI: Extract toolchain ccache in the Serenity build stage
The toolchain is built in a previous stage, but once the Serenity stage
has begun, we have to re-pull the toolchain from the Azure cache. There
is a timing window where a cache-busting change can be commited between
these steps; to alleviate the affect this has, pull the toolchain ccache
so that the build only takes a few minutes instead of a couple hours.
2022-01-07 18:16:30 -08:00
mjz19910
10ec98dd38 Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Liav A
168063819d Meta: Remove explicit IDE attached drive from q35 setup
Use $SERENITY_BOOT_DRIVE to determine it for us.
2022-01-07 12:35:25 +01:00
Andrew Kaster
c62c10caf0 Meta+CI+Documentation: Bump host gcc requirement up to gcc 11
Bump macOS CI version to macOS 11 while we're here.
2022-01-07 11:02:30 +01:00
mjz19910
3102d8e160 Everywhere: Fix many spelling errors 2022-01-07 10:56:59 +01:00
Guilherme Gonçalves
f91d471843 LibSQL: Implement LIKE SQL expressions 2022-01-07 10:50:39 +03:30
Timothy Flynn
6d7d9dd324 LibUnicode: Do not assume time zones & meta zones have a 1-to-1 mapping
The generator parses metaZones.json to form a mapping of meta zones to
time zones (AKA "golden zone" in TR-35). This parser errantly assumed
this was a 1-to-1 mapping.
2022-01-06 22:28:01 +01:00