Simplify definitions of libcs
- Used `stdenvNoLibc` directly in the package files instead of overriding `stdenv` to it in `all-packages.nix` - Moved applicable libcs to `pkgs/by-name` (note: not newlib because it's also accessible via `newlib-nano`)
This commit is contained in:
parent
866ad45761
commit
1870d82500
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenvNoLibc,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
automake,
|
automake,
|
||||||
autoconf,
|
autoconf,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenvNoLibc.mkDerivation (finalAttrs: {
|
||||||
pname = "avr-libc";
|
pname = "avr-libc";
|
||||||
version = "2.2.1";
|
version = "2.2.1";
|
||||||
|
|
||||||
@ -1,11 +1,17 @@
|
|||||||
{
|
{
|
||||||
stdenv,
|
stdenv,
|
||||||
|
stdenvNoLibc,
|
||||||
lib,
|
lib,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
linuxHeaders ? null,
|
linuxHeaders ? null,
|
||||||
useBSDCompatHeaders ? true,
|
useBSDCompatHeaders ? true,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
stdenv' = if stdenv.hostPlatform != stdenv.buildPlatform then stdenvNoLibc else stdenv;
|
||||||
|
in
|
||||||
|
let
|
||||||
|
stdenv = stdenv';
|
||||||
|
|
||||||
cdefs_h = fetchurl {
|
cdefs_h = fetchurl {
|
||||||
name = "sys-cdefs.h";
|
name = "sys-cdefs.h";
|
||||||
url = "https://git.alpinelinux.org/aports/plain/main/libc-dev/sys-cdefs.h?id=7ca0ed62d4c0d713d9c7dd5b9a077fba78bce578";
|
url = "https://git.alpinelinux.org/aports/plain/main/libc-dev/sys-cdefs.h?id=7ca0ed62d4c0d713d9c7dd5b9a077fba78bce578";
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
stdenv,
|
stdenvNoLibc,
|
||||||
buildPackages,
|
buildPackages,
|
||||||
fetchFromGitHub,
|
|
||||||
lib,
|
lib,
|
||||||
firefox-unwrapped,
|
firefox-unwrapped,
|
||||||
firefox-esr-unwrapped,
|
firefox-esr-unwrapped,
|
||||||
@ -11,7 +10,7 @@ let
|
|||||||
pname = "wasilibc";
|
pname = "wasilibc";
|
||||||
version = "22-unstable-2024-10-16";
|
version = "22-unstable-2024-10-16";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenvNoLibc.mkDerivation {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
|
|
||||||
src = buildPackages.fetchFromGitHub {
|
src = buildPackages.fetchFromGitHub {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
stdenv,
|
stdenvNoLibc,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
buildPackages,
|
buildPackages,
|
||||||
lib,
|
lib,
|
||||||
@ -11,7 +11,7 @@
|
|||||||
nanoizeNewlib ? false,
|
nanoizeNewlib ? false,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenvNoLibc.mkDerivation (finalAttrs: {
|
||||||
pname = "newlib";
|
pname = "newlib";
|
||||||
version = "4.5.0.20241231";
|
version = "4.5.0.20241231";
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
# "normal" view to the outside world: the binaries in $out will
|
# "normal" view to the outside world: the binaries in $out will
|
||||||
# execute on `stdenv.hostPlatform`. We then fool newlib's build
|
# execute on `stdenv.hostPlatform`. We then fool newlib's build
|
||||||
# process into doing the right thing.
|
# process into doing the right thing.
|
||||||
"--host=${stdenv.targetPlatform.config}"
|
"--host=${stdenvNoLibc.targetPlatform.config}"
|
||||||
|
|
||||||
]
|
]
|
||||||
++ (
|
++ (
|
||||||
@ -134,8 +134,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
+ ''[ "$(find $out -type f | wc -l)" -gt 0 ] || (echo '$out is empty' 1>&2 && exit 1)'';
|
+ ''[ "$(find $out -type f | wc -l)" -gt 0 ] || (echo '$out is empty' 1>&2 && exit 1)'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
incdir = "/${stdenv.targetPlatform.config}/include";
|
incdir = "/${stdenvNoLibc.targetPlatform.config}/include";
|
||||||
libdir = "/${stdenv.targetPlatform.config}/lib";
|
libdir = "/${stdenvNoLibc.targetPlatform.config}/lib";
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|||||||
@ -6646,10 +6646,6 @@ with pkgs;
|
|||||||
|
|
||||||
h3 = h3_3;
|
h3 = h3_3;
|
||||||
|
|
||||||
avrlibc = callPackage ../development/misc/avr/libc {
|
|
||||||
stdenv = stdenvNoLibc;
|
|
||||||
};
|
|
||||||
|
|
||||||
sourceFromHead = callPackage ../build-support/source-from-head-fun.nix { };
|
sourceFromHead = callPackage ../build-support/source-from-head-fun.nix { };
|
||||||
|
|
||||||
jruby = callPackage ../development/interpreters/jruby { };
|
jruby = callPackage ../development/interpreters/jruby { };
|
||||||
@ -8005,12 +8001,6 @@ with pkgs;
|
|||||||
withGd = true;
|
withGd = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
musl = callPackage ../by-name/mu/musl/package.nix (
|
|
||||||
lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
|
|
||||||
stdenv = stdenvNoLibc;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
# These are used when building compiler-rt / libgcc, prior to building libc.
|
# These are used when building compiler-rt / libgcc, prior to building libc.
|
||||||
preLibcHeaders =
|
preLibcHeaders =
|
||||||
let
|
let
|
||||||
@ -8082,10 +8072,6 @@ with pkgs;
|
|||||||
package = windows.mcfgthreads;
|
package = windows.mcfgthreads;
|
||||||
};
|
};
|
||||||
|
|
||||||
wasilibc = callPackage ../development/libraries/wasilibc {
|
|
||||||
stdenv = stdenvNoLibc;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Only supported on Linux and only on glibc
|
# Only supported on Linux and only on glibc
|
||||||
glibcLocales =
|
glibcLocales =
|
||||||
if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu then
|
if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu then
|
||||||
@ -16287,12 +16273,9 @@ with pkgs;
|
|||||||
|
|
||||||
xp-pen-deco-01-v2-driver = libsForQt5.xp-pen-deco-01-v2-driver;
|
xp-pen-deco-01-v2-driver = libsForQt5.xp-pen-deco-01-v2-driver;
|
||||||
|
|
||||||
newlib = callPackage ../development/misc/newlib {
|
newlib = callPackage ../development/misc/newlib { };
|
||||||
stdenv = stdenvNoLibc;
|
|
||||||
};
|
|
||||||
|
|
||||||
newlib-nano = callPackage ../development/misc/newlib {
|
newlib-nano = callPackage ../development/misc/newlib {
|
||||||
stdenv = stdenvNoLibc;
|
|
||||||
nanoizeNewlib = true;
|
nanoizeNewlib = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user