1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-09 09:36:20 +09:00

lixPackageSets: support splicing

This commit is contained in:
Alois Wohlschlager 2025-04-10 14:41:30 +02:00 committed by Yureka
parent 7b7a9a6a14
commit 32be3c655c

View file

@ -1,13 +1,14 @@
{
lib,
stdenv,
makeScopeWithSplicing',
generateSplicesForMkScope,
aws-sdk-cpp,
boehmgc,
callPackage,
fetchgit,
fetchFromGitHub,
rustPlatform,
newScope,
editline,
ncurses,
clangStdenv,
@ -22,6 +23,7 @@
let
makeLixScope =
{
attrName,
lix-args,
nix-eval-jobs-args,
}:
@ -29,83 +31,90 @@ let
# GCC 13.2 is known to miscompile Lix coroutines (introduced in 2.92).
lixStdenv = if lib.versionAtLeast lix-args.version "2.92" then clangStdenv else stdenv;
in
lib.makeScope newScope (
self:
lib.recurseIntoAttrs {
inherit
storeDir
stateDir
confDir
;
makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope [
"lixPackageSets"
attrName
];
f =
self:
lib.recurseIntoAttrs {
inherit
storeDir
stateDir
confDir
;
boehmgc =
# TODO: Why is this called `boehmgc-nix_2_3`?
let
boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; };
in
# Since Lix 2.91 does not use boost coroutines, it does not need boehmgc patches either.
if lib.versionOlder lix-args.version "2.91" then
boehmgc-nix_2_3.overrideAttrs (drv: {
patches = (drv.patches or [ ]) ++ [
# Part of the GC solution in https://github.com/NixOS/nix/pull/4944
../nix/patches/boehmgc-coroutine-sp-fallback.patch
boehmgc =
# TODO: Why is this called `boehmgc-nix_2_3`?
let
boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; };
in
# Since Lix 2.91 does not use boost coroutines, it does not need boehmgc patches either.
if lib.versionOlder lix-args.version "2.91" then
boehmgc-nix_2_3.overrideAttrs (drv: {
patches = (drv.patches or [ ]) ++ [
# Part of the GC solution in https://github.com/NixOS/nix/pull/4944
../nix/patches/boehmgc-coroutine-sp-fallback.patch
];
})
else
boehmgc-nix_2_3;
aws-sdk-cpp =
(aws-sdk-cpp.override {
apis = [
"s3"
"transfer"
];
})
else
boehmgc-nix_2_3;
customMemoryManagement = false;
}).overrideAttrs
{
# only a stripped down version is build which takes a lot less resources to build
requiredSystemFeatures = [ ];
};
aws-sdk-cpp =
(aws-sdk-cpp.override {
apis = [
"s3"
"transfer"
];
customMemoryManagement = false;
}).overrideAttrs
{
# only a stripped down version is build which takes a lot less resources to build
requiredSystemFeatures = [ ];
};
editline = editline.override {
inherit ncurses;
enableTermcap = true;
};
editline = editline.override {
inherit ncurses;
enableTermcap = true;
# NOTE: The `common-*.nix` helpers contain a top-level function which
# takes the Lix source to build and version information. We use the
# outer `callPackage` for that.
#
# That *returns* another function which takes the actual build
# dependencies, and that uses the new scope's `self.callPackage` so
# that `nix-eval-jobs` can be built against the correct `lix` version.
lix = self.callPackage (callPackage ./common-lix.nix lix-args) {
stdenv = lixStdenv;
};
nix-direnv = nix-direnv.override {
nix = self.lix;
};
nix-eval-jobs = self.callPackage (callPackage ./common-nix-eval-jobs.nix nix-eval-jobs-args) {
stdenv = lixStdenv;
};
nix-fast-build = nix-fast-build.override {
inherit (self) nix-eval-jobs;
};
colmena = colmena.override {
nix = self.lix;
inherit (self) nix-eval-jobs;
};
};
# NOTE: The `common-*.nix` helpers contain a top-level function which
# takes the Lix source to build and version information. We use the
# outer `callPackage` for that.
#
# That *returns* another function which takes the actual build
# dependencies, and that uses the new scope's `self.callPackage` so
# that `nix-eval-jobs` can be built against the correct `lix` version.
lix = self.callPackage (callPackage ./common-lix.nix lix-args) {
stdenv = lixStdenv;
};
nix-direnv = nix-direnv.override {
nix = self.lix;
};
nix-eval-jobs = self.callPackage (callPackage ./common-nix-eval-jobs.nix nix-eval-jobs-args) {
stdenv = lixStdenv;
};
nix-fast-build = nix-fast-build.override {
inherit (self) nix-eval-jobs;
};
colmena = colmena.override {
nix = self.lix;
inherit (self) nix-eval-jobs;
};
}
);
};
in
lib.makeExtensible (self: {
inherit makeLixScope;
lix_2_90 = self.makeLixScope {
attrName = "lix_2_90";
lix-args = rec {
version = "2.90.0";
@ -136,6 +145,8 @@ lib.makeExtensible (self: {
};
lix_2_91 = self.makeLixScope {
attrName = "lix_2_91";
lix-args = rec {
version = "2.91.1";
@ -166,6 +177,8 @@ lib.makeExtensible (self: {
};
lix_2_92 = self.makeLixScope {
attrName = "lix_2_92";
lix-args = rec {
version = "2.92.0";