mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
packaging: Factor out mkPackageBuilder
This commit is contained in:
parent
0aef34b790
commit
e10ff893e5
1 changed files with 6 additions and 7 deletions
|
@ -38,6 +38,10 @@ let
|
||||||
# Indirection for Nixpkgs to override when package.nix files are vendored
|
# Indirection for Nixpkgs to override when package.nix files are vendored
|
||||||
filesetToSource = lib.fileset.toSource;
|
filesetToSource = lib.fileset.toSource;
|
||||||
|
|
||||||
|
/** Given a set of layers, create a mkDerivation-like function */
|
||||||
|
mkPackageBuilder = exts: userFn:
|
||||||
|
stdenv.mkDerivation (lib.extends (lib.composeManyExtensions exts) userFn);
|
||||||
|
|
||||||
localSourceLayer = finalAttrs: prevAttrs:
|
localSourceLayer = finalAttrs: prevAttrs:
|
||||||
let
|
let
|
||||||
workDirPath =
|
workDirPath =
|
||||||
|
@ -62,7 +66,6 @@ let
|
||||||
|
|
||||||
mesonLayer = finalAttrs: prevAttrs:
|
mesonLayer = finalAttrs: prevAttrs:
|
||||||
{
|
{
|
||||||
mesonFlags = prevAttrs.mesonFlags or [];
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgs.buildPackages.meson
|
pkgs.buildPackages.meson
|
||||||
pkgs.buildPackages.ninja
|
pkgs.buildPackages.ninja
|
||||||
|
@ -182,15 +185,11 @@ scope: {
|
||||||
|
|
||||||
inherit resolvePath filesetToSource;
|
inherit resolvePath filesetToSource;
|
||||||
|
|
||||||
mkMesonDerivation = f: let
|
mkMesonDerivation =
|
||||||
exts = [
|
mkPackageBuilder [
|
||||||
miscGoodPractice
|
miscGoodPractice
|
||||||
bsdNoLinkAsNeeded
|
bsdNoLinkAsNeeded
|
||||||
localSourceLayer
|
localSourceLayer
|
||||||
mesonLayer
|
mesonLayer
|
||||||
];
|
];
|
||||||
in stdenv.mkDerivation
|
|
||||||
(lib.extends
|
|
||||||
(lib.composeManyExtensions exts)
|
|
||||||
f);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue