Unverified Commit a7a8f825 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

Merge #263535: staging-next 2023-10-26

parents f31242fc 391aafc3
Loading
Loading
Loading
Loading
+70 −12
Original line number Diff line number Diff line
# Meson {#meson}

Overrides the configure phase to run meson to generate Ninja files. To run these files, you should accompany Meson with ninja. By default, `enableParallelBuilding` is enabled as Meson supports parallel building almost everywhere.
[Meson](https://mesonbuild.com/) is an open source meta build system meant to be
fast and user-friendly.

## Variables controlling Meson {#variables-controlling-meson}
In Nixpkgs, meson comes with a setup hook that overrides the configure, check,
and install phases.

### `mesonFlags` {#mesonflags}
Being a meta build system, meson needs an accompanying backend. In the context
of Nixpkgs, the typical companion backend is [Ninja](#ninja), that provides a
setup hook registering ninja-based build and install phases.

Controls the flags passed to meson.
## Variables controlling Meson {#meson-variables-controlling}

### `mesonBuildType` {#mesonbuildtype}
### Meson Exclusive Variables {#meson-exclusive-variables}

Which [`--buildtype`](https://mesonbuild.com/Builtin-options.html#core-options) to pass to Meson. We default to `plain`.
#### `mesonFlags` {#meson-flags}

### `mesonAutoFeatures` {#mesonautofeatures}
Controls the flags passed to `meson setup` during configure phase.

What value to set [`-Dauto_features=`](https://mesonbuild.com/Builtin-options.html#core-options) to. We default to `enabled`.
#### `mesonWrapMode` {#meson-wrap-mode}

### `mesonWrapMode` {#mesonwrapmode}
Which value is passed as
[`-Dwrap_mode=`](https://mesonbuild.com/Builtin-options.html#core-options)
to. In Nixpkgs the default value is `nodownload`, so that no subproject will be
downloaded (since network access is already disabled during deployment in
Nixpkgs).

What value to set [`-Dwrap_mode=`](https://mesonbuild.com/Builtin-options.html#core-options) to. We default to `nodownload` as we disallow network access.
Note: Meson allows pre-population of subprojects that would otherwise be
downloaded.

### `dontUseMesonConfigure` {#dontusemesonconfigure}
#### `mesonBuildType` {#meson-build-type}

Disables using Meson’s `configurePhase`.
Which value is passed as
[`--buildtype`](https://mesonbuild.com/Builtin-options.html#core-options) to
`meson setup` during configure phase. In Nixpkgs the default value is `plain`.

#### `mesonAutoFeatures` {#meson-auto-features}

Which value is passed as
[`-Dauto_features=`](https://mesonbuild.com/Builtin-options.html#core-options)
to `meson setup` during configure phase. In Nixpkgs the default value is
`enabled`, meaning that every feature declared as "auto" by the meson scripts
will be enabled.

#### `mesonCheckFlags` {#meson-check-flags}

Controls the flags passed to `meson test` during check phase.

#### `mesonInstallFlags` {#meson-install-flags}

Controls the flags passed to `meson install` during install phase.

#### `mesonInstallTags` {#meson-install-tags}

A list of installation tags passed to Meson's commandline option
[`--tags`](https://mesonbuild.com/Installing.html#installation-tags) during
install phase.

Note: `mesonInstallTags` should be a list of strings, that will be converted to
a comma-separated string that is recognized to `--tags`.
Example: `mesonInstallTags = [ "emulator" "assembler" ];` will be converted to
`--tags emulator,assembler`.

#### `dontUseMesonConfigure` {#dont-use-meson-configure}

When set to true, don't use the predefined `mesonConfigurePhase`.

#### `dontUseMesonCheck` {#dont-use-meson-check}

When set to true, don't use the predefined `mesonCheckPhase`.

#### `dontUseMesonInstall` {#dont-use-meson-install}

When set to true, don't use the predefined `mesonInstallPhase`.

### Honored variables {#meson-honored-variables}

The following variables commonly used by `stdenv.mkDerivation` are honored by
Meson setup hook.

- `prefixKey`
- `enableParallelBuilding`
+2 −0
Original line number Diff line number Diff line
# ninja {#ninja}

Overrides the build, install, and check phase to run ninja instead of make. You can disable this behavior with the `dontUseNinjaBuild`, `dontUseNinjaInstall`, and `dontUseNinjaCheck`, respectively. Parallel building is enabled by default in Ninja.

Note that if the [Meson setup hook](#meson) is also active, Ninja's install and check phases will be disabled in favor of Meson's.
+98 −2
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ rec {
  elaborate = args': let
    args = if lib.isString args' then { system = args'; }
           else args';

    # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
    rust = assert !(args ? rust && args ? rustc); args.rust or args.rustc or {};

    final = {
      # Prefer to parse `config` as it is strictly more informative.
      parsed = parse.mkSystemFromString (if args ? config then args.config else args.system);
@@ -159,9 +163,101 @@ rec {
        ({
          linux-kernel = args.linux-kernel or {};
          gcc = args.gcc or {};
          rustc = args.rustc or {};
        } // platforms.select final)
        linux-kernel gcc rustc;
        linux-kernel gcc;

      # TODO: remove after 23.05 is EOL, with an error pointing to the rust.* attrs.
      rustc = args.rustc or {};

      rust = rust // {
        # Once args.rustc.platform.target-family is deprecated and
        # removed, there will no longer be any need to modify any
        # values from args.rust.platform, so we can drop all the
        # "args ? rust" etc. checks, and merge args.rust.platform in
        # /after/.
        platform = rust.platform or {} // {
          # https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch
          arch =
            /**/ if rust ? platform then rust.platform.arch
            else if final.isAarch32 then "arm"
            else if final.isMips64  then "mips64"     # never add "el" suffix
            else if final.isPower64 then "powerpc64"  # never add "le" suffix
            else final.parsed.cpu.name;

          # https://doc.rust-lang.org/reference/conditional-compilation.html#target_os
          os =
            /**/ if rust ? platform then rust.platform.os or "none"
            else if final.isDarwin then "macos"
            else final.parsed.kernel.name;

          # https://doc.rust-lang.org/reference/conditional-compilation.html#target_family
          target-family =
            /**/ if args ? rust.platform.target-family then args.rust.platform.target-family
            else if args ? rustc.platform.target-family
            then
              (
                # Since https://github.com/rust-lang/rust/pull/84072
                # `target-family` is a list instead of single value.
                let
                  f = args.rustc.platform.target-family;
                in
                  if builtins.isList f then f else [ f ]
              )
            else lib.optional final.isUnix "unix"
                 ++ lib.optional final.isWindows "windows";

          # https://doc.rust-lang.org/reference/conditional-compilation.html#target_vendor
          vendor = let
            inherit (final.parsed) vendor;
          in rust.platform.vendor or {
            "w64" = "pc";
          }.${vendor.name} or vendor.name;
        };

        # The name of the rust target, even if it is custom. Adjustments are
        # because rust has slightly different naming conventions than we do.
        rustcTarget = let
          inherit (final.parsed) cpu kernel abi;
          cpu_ = rust.platform.arch or {
            "armv7a" = "armv7";
            "armv7l" = "armv7";
            "armv6l" = "arm";
            "armv5tel" = "armv5te";
            "riscv64" = "riscv64gc";
          }.${cpu.name} or cpu.name;
          vendor_ = final.rust.platform.vendor;
        in rust.config
          or "${cpu_}-${vendor_}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";

        # The name of the rust target if it is standard, or the json file
        # containing the custom target spec.
        rustcTargetSpec =
          /**/ if rust ? platform
          then builtins.toFile (final.rust.rustcTarget + ".json") (builtins.toJSON rust.platform)
          else final.rust.rustcTarget;

        # The name of the rust target if it is standard, or the
        # basename of the file containing the custom target spec,
        # without the .json extension.
        #
        # This is the name used by Cargo for target subdirectories.
        cargoShortTarget =
          lib.removeSuffix ".json" (baseNameOf "${final.rust.rustcTargetSpec}");

        # When used as part of an environment variable name, triples are
        # uppercased and have all hyphens replaced by underscores:
        #
        # https://github.com/rust-lang/cargo/pull/9169
        # https://github.com/rust-lang/cargo/issues/8285#issuecomment-634202431
        cargoEnvVarTarget =
          lib.strings.replaceStrings ["-"] ["_"]
            (lib.strings.toUpper final.rust.cargoShortTarget);

        # True if the target is no_std
        # https://github.com/rust-lang/rust/blob/2e44c17c12cec45b6a682b1e53a04ac5b5fcc9d2/src/bootstrap/config.rs#L415-L421
        isNoStdTarget =
          builtins.any (t: lib.hasInfix t final.rust.rustcTarget) ["-none" "nvptx" "switch" "-uefi"];
      };

      linuxArch =
        if final.isAarch32 then "arm"
+7 −0
Original line number Diff line number Diff line
@@ -19616,6 +19616,13 @@
      fingerprint = "FD0A C425 9EF5 4084 F99F 9B47 2ACC 9749 7C68 FAD4";
    }];
  };
  YellowOnion = {
    name = "Daniel Hill";
    email = "daniel@gluo.nz";
    github   = "YellowOnion";
    githubId = 364160;
    matrix = "@woobilicious:matrix.org";
  };
  yesbox = {
    email = "jesper.geertsen.jonsson@gmail.com";
    github = "yesbox";
+10 −11
Original line number Diff line number Diff line
name,src,ref,server,version,luaversion,maintainers
alt-getopt,,,,,,arobyn
bit32,,,,5.3.0-1,5.1,lblasc
argparse,https://github.com/luarocks/argparse.git,,,,,
basexx,https://github.com/teto/basexx.git,,,,,
binaryheap,https://github.com/Tieske/binaryheap.lua,,,,,vcunat
argparse,,,,,,
basexx,,,,,,
binaryheap,,,,,,vcunat
busted,,,,,,
cassowary,,,,,,marsam alerque
cldr,,,,,,alerque
@@ -12,8 +12,7 @@ cosmo,,,,,,marsam
coxpcall,,,,1.17.0-1,,
cqueues,,,,,,vcunat
cyan,,,,,,
cyrussasl,https://github.com/JorjBauer/lua-cyrussasl.git,,,,,
digestif,https://github.com/astoff/digestif.git,,,0.2-1,5.3,
digestif,https://github.com/astoff/digestif.git,,,,5.3,
dkjson,,,,,,
fennel,,,,,,misterio77
fifo,,,,,,
@@ -24,7 +23,7 @@ http,,,,0.3-0,,vcunat
inspect,,,,,,
jsregexp,,,,,,
ldbus,,,http://luarocks.org/dev,,,
ldoc,https://github.com/stevedonovan/LDoc.git,,,,,
ldoc,,,,,,
lgi,,,,,,
linenoise,https://github.com/hoelzro/lua-linenoise.git,,,,,
ljsyscall,,,,,5.1,lblasc
@@ -40,7 +39,7 @@ lrexlib-posix,,,,,,
lua-cjson,,,,,,
lua-cmsgpack,,,,,,
lua-curl,,,,,,
lua-iconv,,,,,,
lua-ffi-zlib,,,,,,
lua-lsp,,,,,,
lua-messagepack,,,,,,
lua-protobuf,,,,,,lockejan
@@ -83,30 +82,30 @@ luaunit,,,,,,lockejan
luautf8,,,,,,pstn
luazip,,,,,,
lua-yajl,,,,,,pstn
lua-iconv,,,,7.0.0,,
luuid,,,,,,
luv,,,,1.44.2-1,,
lush.nvim,https://github.com/rktjmp/lush.nvim,,,,,teto
lyaml,,,,,,lblasc
magick,,,,,,donovanglover
magick,,,,,5.1,donovanglover
markdown,,,,,,
mediator_lua,,,,,,
middleclass,,,,,,
mpack,,,,,,
moonscript,https://github.com/leafo/moonscript.git,dev-1,,,,arobyn
nui-nvim,,,,,,mrcjkb
nui.nvim,,,,,,mrcjkb
nvim-client,https://github.com/neovim/lua-client.git,,,,,
nvim-cmp,https://github.com/hrsh7th/nvim-cmp,,,,,
penlight,https://github.com/lunarmodules/Penlight.git,,,,,alerque
plenary.nvim,https://github.com/nvim-lua/plenary.nvim.git,,,,5.1,
rapidjson,https://github.com/xpol/lua-rapidjson.git,,,,,
rest.nvim,,,,,5.1,teto
readline,,,,,,
rustaceanvim,,,,,,mrcjkb
say,https://github.com/Olivine-Labs/say.git,,,,,
serpent,,,,,,lockejan
sqlite,,,,,,
std._debug,https://github.com/lua-stdlib/_debug.git,,,,,
std.normalize,https://github.com/lua-stdlib/normalize.git,,,,,
std.normalize,,,,,,
stdlib,,,,41.2.2,,vyp
teal-language-server,,,http://luarocks.org/dev,,,
telescope.nvim,,,,,5.1,
Loading