Skip to content

Instantly share code, notes, and snippets.

@fogti
Created January 10, 2022 20:21
Show Gist options
  • Save fogti/bb8ed4f47123960f4231d6fa928599ac to your computer and use it in GitHub Desktop.
Save fogti/bb8ed4f47123960f4231d6fa928599ac to your computer and use it in GitHub Desktop.
nixpkgs/lib/systems with-import cycle
let nixOp = nixBlti.nixOp;
let nixBltiRT = nixBlti.initRtDep(nixRt);
let nixInScope = nixBlti.mkScopeWith();
return async (nixBound) => {
nixBound = await nixBound;
let nix__lib = nixOp._lambdaA2chk(nixBound, "lib");
return (async (nixInScope) =>
(async (nixInScope) =>
(async (nixInScope) =>
nixBlti.PLazy.from(async () => {
let nix__abis_;
nix__abis_ = nixInScope.abis;
return nixBlti.PLazy.from(async () => {
let nix__abis;
nix__abis = nixBlti.PLazy.from(
async () =>
await (
await (
await (
await nix__lib
).mapAttrs
)(
async (nix___) => async (nix__abi) =>
await (
await nixBltiRT.removeAttrs(nix__abi)
)(["assertions"])
)
)(nix__abis_)
);
return await (async (nixInScope) => {
nixInScope.patterns = (async (nixInScope) => {
nixInScope.isi686 = Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () => await (await nixInScope.cpuTypes).i686
),
});
nixInScope["isx86_32"] = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), {
family: "x86",
bits: 32,
}),
});
nixInScope["isx86_64"] = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), {
family: "x86",
bits: 64,
}),
});
nixInScope.isPowerPC = Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () => await (await nixInScope.cpuTypes).powerpc
),
});
nixInScope.isPower = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "power" }),
});
nixInScope.isx86 = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "x86" }),
});
nixInScope.isAarch32 = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), {
family: "arm",
bits: 32,
}),
});
nixInScope.isAarch64 = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), {
family: "arm",
bits: 64,
}),
});
nixInScope.isMips = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "mips" }),
});
nixInScope.isMmix = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "mmix" }),
});
nixInScope.isRiscV = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "riscv" }),
});
nixInScope.isSparc = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "sparc" }),
});
nixInScope.isWasm = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "wasm" }),
});
nixInScope.isMsp430 = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "msp430" }),
});
nixInScope.isVc4 = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "vc4" }),
});
nixInScope.isAvr = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "avr" }),
});
nixInScope.isAlpha = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "alpha" }),
});
nixInScope.isOr1k = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "or1k" }),
});
nixInScope.isM68k = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "m68k" }),
});
nixInScope.isS390 = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { family: "s390" }),
});
nixInScope.isJavaScript = Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () => await (await nixInScope.cpuTypes).js
),
});
nixInScope.is32bit = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { bits: 32 }),
});
nixInScope.is64bit = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), { bits: 64 }),
});
nixInScope.isBigEndian = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), {
significantByte: nixBlti.PLazy.from(
async () =>
await (
await nixInScope.significantBytes
).bigEndian
),
}),
});
nixInScope.isLittleEndian = Object.assign(Object.create(null), {
cpu: Object.assign(Object.create(null), {
significantByte: nixBlti.PLazy.from(
async () =>
await (
await nixInScope.significantBytes
).littleEndian
),
}),
});
nixInScope.isBSD = Object.assign(Object.create(null), {
kernel: Object.assign(Object.create(null), {
families: Object.assign(Object.create(null), {
bsd: nixBlti.PLazy.from(
async () => (await nixInScope.kernelFamilies).bsd
),
}),
}),
});
nixInScope.isDarwin = Object.assign(Object.create(null), {
kernel: Object.assign(Object.create(null), {
families: Object.assign(Object.create(null), {
darwin: nixBlti.PLazy.from(
async () => (await nixInScope.kernelFamilies).darwin
),
}),
}),
});
nixInScope.isUnix = nixBlti.PLazy.from(async () => [
nixInScope.isBSD,
nixInScope.isDarwin,
nixInScope.isLinux,
nixInScope.isSunOS,
nixInScope.isCygwin,
nixInScope.isRedox,
]);
nixInScope.isMacOS = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).macos
),
});
nixInScope.isiOS = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).ios
),
});
nixInScope.isLinux = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).linux
),
});
nixInScope.isSunOS = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).solaris
),
});
nixInScope.isFreeBSD = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).freebsd
),
});
nixInScope.isNetBSD = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).netbsd
),
});
nixInScope.isOpenBSD = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).openbsd
),
});
nixInScope.isWindows = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).windows
),
});
nixInScope.isCygwin = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).windows
),
abi: nixBlti.PLazy.from(
async () => await (await nix__abis).cygnus
),
});
nixInScope.isMinGW = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).windows
),
abi: nixBlti.PLazy.from(
async () => await (await nix__abis).gnu
),
});
nixInScope.isWasi = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).wasi
),
});
nixInScope.isRedox = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).redox
),
});
nixInScope.isGhcjs = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).ghcjs
),
});
nixInScope.isGenode = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).genode
),
});
nixInScope.isNone = Object.assign(Object.create(null), {
kernel: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).none
),
});
nixInScope.isAndroid = nixBlti.PLazy.from(async () => [
Object.assign(Object.create(null), {
abi: nixBlti.PLazy.from(
async () => await (await nix__abis).android
),
}),
Object.assign(Object.create(null), {
abi: nixBlti.PLazy.from(
async () => await (await nix__abis).androideabi
),
}),
]);
nixInScope.isGnu = (async (nixInScope) =>
await (
await nixBltiRT.map(async (nix__a) =>
Object.assign(Object.create(null), { abi: nix__a })
)
)([
nixInScope.gnuabi64,
nixInScope.gnu,
nixInScope.gnueabi,
nixInScope.gnueabihf,
]))(nixBlti.mkScopeWith(nixInScope, await nix__abis));
nixInScope.isMusl = (async (nixInScope) =>
await (
await nixBltiRT.map(async (nix__a) =>
Object.assign(Object.create(null), { abi: nix__a })
)
)([
nixInScope.musl,
nixInScope.musleabi,
nixInScope.musleabihf,
]))(nixBlti.mkScopeWith(nixInScope, await nix__abis));
nixInScope.isUClibc = (async (nixInScope) =>
await (
await nixBltiRT.map(async (nix__a) =>
Object.assign(Object.create(null), { abi: nix__a })
)
)([
nixInScope.uclibc,
nixInScope.uclibceabi,
nixInScope.uclibceabihf,
]))(nixBlti.mkScopeWith(nixInScope, await nix__abis));
nixInScope.isEfi = nixBlti.PLazy.from(
async () =>
await (
await nixBltiRT.map(
async (nix__family) =>
await (async (nixAttrsScope) => {
if (
!Object.prototype.hasOwnProperty.call(
nixAttrsScope,
"cpu"
)
)
nixAttrsScope.cpu = Object.create(null);
await nixOp._deepMerge(
nixAttrsScope.cpu,
nix__family,
"family"
);
return nixAttrsScope[nixBlti.extractScope];
})(nixBlti.mkScope())
)
)(["x86", "arm", "aarch64"])
);
return nixInScope[nixBlti.extractScope];
})(nixBlti.mkScope(nixInScope));
nixInScope.matchAnyAttrs = async (nix__patterns) =>
await ((await nixBltiRT.isList(nix__patterns))
? async (nix__attrs) =>
await (
await (
await nixInScope.any
)(
async (nix__pattern) =>
await (
await (
await nixInScope.matchAttrs
)(nix__pattern)
)(nix__attrs)
)
)(nix__patterns)
: (
await nixInScope.matchAttrs
)(nix__patterns));
nixInScope.predicates = nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.mapAttrs
)(async (nix___) => await nixInScope.matchAnyAttrs)
)(nixInScope.patterns)
);
return nixInScope[nixBlti.extractScope];
})(nixBlti.mkScope(nixInScope));
});
}))(nixBlti.mkScopeWith(nixInScope, await (await nix__lib).lists)))(
nixBlti.mkScopeWith(nixInScope, await (await nix__lib).attrsets)
))(
nixBlti.mkScopeWith(
nixInScope,
await (
await nixBltiRT.import(nixRt.export("Relative", "./parse.nix"))
)(Object.assign(Object.create(null), { lib: nix__lib }))
)
);
};
let nixOp = nixBlti.nixOp;
let nixBltiRT = nixBlti.initRtDep(nixRt);
let nixInScope = nixBlti.mkScopeWith();
return async (nixBound) => {
nixBound = await nixBound;
let nix__lib = nixOp._lambdaA2chk(nixBound, "lib");
return (async (nixInScope) =>
(async (nixInScope) =>
(async (nixInScope) =>
(async (nixInScope) =>
(async (nixInScope) =>
nixBlti.PLazy.from(async () => {
let nix__mergeOneOption, nix__setTypes;
nix__setTypes = async (nix__type) =>
await (
await nixInScope.mapAttrs
)(
async (nix__name) => async (nix__value) =>
await nixBlti.PLazy.from(async () => {
await nixBltiRT.assert(
"line 28: type.check value",
(
await (
await nix__type
).check
)(nix__value)
);
return await (
await (
await nixInScope.setType
)((await nix__type).name)
)(
nixOp.Update(
Object.assign(Object.create(null), {
name: nix__name,
}),
nix__value
)
);
})
);
nix__mergeOneOption = nixBlti.PLazy.from(
async () => (await (await nix__lib).options).mergeOneOption
);
return await (async (nixInScope) => {
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "significant-byte",
description: "Endianness",
merge: nix__mergeOneOption,
})
)
),
"openSignificantByte"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)(
(
await nixInScope.attrValues
)(nixInScope.significantBytes)
)
),
"significantByte"
);
nixInScope.significantBytes = nixBlti.PLazy.from(
async () =>
await (
await (
await nix__setTypes
)((await nixInScope.types).openSignificantByte)
)(
Object.assign(Object.create(null), {
bigEndian: Object.create(null),
littleEndian: Object.create(null),
})
)
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)([8, 16, 32, 64, 128])
),
"bitWidth"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "cpu-type",
description:
"instruction set architecture name and information",
merge: nix__mergeOneOption,
check: async (nix__x) =>
await nixOp.And(
(
await (
await (
await nixInScope.types
).bitWidth
).check
)((await nix__x).bits),
(await nixOp.Less(8, (await nix__x).bits))
? (
await (
await (
await nixInScope.types
).significantByte
).check
)((await nix__x).significantByte)
: nixOp.u_Invert(
Object.prototype.hasOwnProperty.call(
await nix__x,
"significantByte"
)
)
),
})
)
),
"openCpuType"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)((await nixInScope.attrValues)(nixInScope.cpuTypes))
),
"cpuType"
);
nixInScope.cpuTypes = (async (nixInScope) =>
await (
await (
await nix__setTypes
)((await nixInScope.types).openCpuType)
)(
Object.assign(Object.create(null), {
arm: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
}),
armv5tel: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "5",
arch: "armv5t",
}),
armv6m: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "6",
arch: "armv6-m",
}),
armv6l: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "6",
arch: "armv6",
}),
armv7a: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "7",
arch: "armv7-a",
}),
armv7r: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "7",
arch: "armv7-r",
}),
armv7m: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "7",
arch: "armv7-m",
}),
armv7l: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "7",
arch: "armv7",
}),
armv8a: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "8",
arch: "armv8-a",
}),
armv8r: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "8",
arch: "armv8-a",
}),
armv8m: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "8",
arch: "armv8-m",
}),
aarch64: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.littleEndian,
family: "arm",
version: "8",
arch: "armv8-a",
}),
aarch64_be: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.bigEndian,
family: "arm",
version: "8",
arch: "armv8-a",
}),
i386: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "x86",
arch: "i386",
}),
i486: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "x86",
arch: "i486",
}),
i586: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "x86",
arch: "i586",
}),
i686: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "x86",
arch: "i686",
}),
x86_64: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.littleEndian,
family: "x86",
arch: "x86-64",
}),
mips: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.bigEndian,
family: "mips",
}),
mipsel: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "mips",
}),
mips64: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.bigEndian,
family: "mips",
}),
mips64el: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.littleEndian,
family: "mips",
}),
mmix: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.bigEndian,
family: "mmix",
}),
m68k: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.bigEndian,
family: "m68k",
}),
powerpc: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.bigEndian,
family: "power",
}),
powerpc64: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.bigEndian,
family: "power",
}),
powerpc64le: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.littleEndian,
family: "power",
}),
powerpcle: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "power",
}),
riscv32: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "riscv",
}),
riscv64: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.littleEndian,
family: "riscv",
}),
s390: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.bigEndian,
family: "s390",
}),
s390x: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.bigEndian,
family: "s390",
}),
sparc: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.bigEndian,
family: "sparc",
}),
sparc64: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.bigEndian,
family: "sparc",
}),
wasm32: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "wasm",
}),
wasm64: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.littleEndian,
family: "wasm",
}),
alpha: Object.assign(Object.create(null), {
bits: 64,
significantByte: nixInScope.littleEndian,
family: "alpha",
}),
msp430: Object.assign(Object.create(null), {
bits: 16,
significantByte: nixInScope.littleEndian,
family: "msp430",
}),
avr: Object.assign(Object.create(null), {
bits: 8,
family: "avr",
}),
vc4: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "vc4",
}),
or1k: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.bigEndian,
family: "or1k",
}),
js: Object.assign(Object.create(null), {
bits: 32,
significantByte: nixInScope.littleEndian,
family: "js",
}),
})
))(
nixBlti.mkScopeWith(
nixInScope,
await nixInScope.significantBytes
)
);
nixInScope.gnuNetBSDDefaultExecFormat = async (nix__cpu) =>
await ((await nixOp.Or(
nixOp.Or(
nixOp.Or(
nixOp.And(
nixOp.Equal((await nix__cpu).family, "arm"),
nixOp.Equal((await nix__cpu).bits, 32)
),
nixOp.And(
nixOp.Equal((await nix__cpu).family, "sparc"),
nixOp.Equal((await nix__cpu).bits, 32)
)
),
nixOp.And(
nixOp.Equal((await nix__cpu).family, "m68k"),
nixOp.Equal((await nix__cpu).bits, 32)
)
),
nixOp.And(
nixOp.Equal((await nix__cpu).family, "x86"),
nixOp.Equal((await nix__cpu).bits, 32)
)
))
? (
await nixInScope.execFormats
).aout
: (
await nixInScope.execFormats
).elf);
nixInScope.isCompatible = async (nix__a) => async (nix__b) =>
(async (nixInScope) =>
await (
await (
await (
await nix__lib
).any
)((await nix__lib).id)
)([
nixOp.And(
nixOp.Equal(nix__b, nixInScope.i386),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.i486)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.i486),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.i586)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.i586),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.i686)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.i686),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope["x86_64"])
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.arm),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv5tel)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv5tel),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv6l)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv6l),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv6m)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv6m),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv7l)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7l),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv7a)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7l),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv7r)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7l),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv7m)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7a),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8a)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7r),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8a)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7m),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8a)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7a),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8r)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7r),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8r)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7m),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8r)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7a),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8m)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7r),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8m)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv7m),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8m)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv8r),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8a)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv8m),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.armv8a)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.aarch64),
nixOp.Equal(nix__a, nixInScope.armv8a)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.armv8a),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.aarch64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.aarch64),
nixOp.Equal(nix__a, nixInScope["aarch64_be"])
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope["aarch64_be"]),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.aarch64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.powerpc),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.powerpc64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.powerpcle),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.powerpc)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.powerpc),
nixOp.Equal(nix__a, nixInScope.powerpcle)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.powerpc64le),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.powerpc64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.powerpc64),
nixOp.Equal(nix__a, nixInScope.powerpc64le)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.mips),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.mips64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.mips),
nixOp.Equal(nix__a, nixInScope.mipsel)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.mipsel),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.mips)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.mips64),
nixOp.Equal(nix__a, nixInScope.mips64el)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.mips64el),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.mips64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.riscv32),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.riscv64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.sparc),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.sparc64)
),
nixOp.And(
nixOp.Equal(nix__b, nixInScope.wasm32),
(
await (
await nixInScope.isCompatible
)(nix__a)
)(nixInScope.wasm64)
),
nixOp.Equal(nix__b, nix__a),
]))(
nixBlti.mkScopeWith(nixInScope, await nixInScope.cpuTypes)
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "vendor",
description: "vendor for the platform",
merge: nix__mergeOneOption,
})
)
),
"openVendor"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)((await nixInScope.attrValues)(nixInScope.vendors))
),
"vendor"
);
nixInScope.vendors = nixBlti.PLazy.from(
async () =>
await (
await (
await nix__setTypes
)((await nixInScope.types).openVendor)
)(
Object.assign(Object.create(null), {
apple: Object.create(null),
pc: Object.create(null),
w64: Object.create(null),
none: Object.create(null),
unknown: Object.create(null),
})
)
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "exec-format",
description:
"executable container used by the kernel",
merge: nix__mergeOneOption,
})
)
),
"openExecFormat"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)((await nixInScope.attrValues)(nixInScope.execFormats))
),
"execFormat"
);
nixInScope.execFormats = nixBlti.PLazy.from(
async () =>
await (
await (
await nix__setTypes
)((await nixInScope.types).openExecFormat)
)(
Object.assign(Object.create(null), {
aout: Object.create(null),
elf: Object.create(null),
macho: Object.create(null),
pe: Object.create(null),
wasm: Object.create(null),
unknown: Object.create(null),
})
)
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "exec-format",
description:
"executable container used by the kernel",
merge: nix__mergeOneOption,
})
)
),
"openKernelFamily"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)(
(
await nixInScope.attrValues
)(nixInScope.kernelFamilies)
)
),
"kernelFamily"
);
nixInScope.kernelFamilies = nixBlti.PLazy.from(
async () =>
await (
await (
await nix__setTypes
)((await nixInScope.types).openKernelFamily)
)(
Object.assign(Object.create(null), {
bsd: Object.create(null),
darwin: Object.create(null),
})
)
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "kernel",
description: "kernel name and information",
merge: nix__mergeOneOption,
check: async (nix__x) =>
await nixOp.And(
(
await (
await (
await nixInScope.types
).execFormat
).check
)((await nix__x).execFormat),
(
await (
await nixInScope.all
)(
(
await (
await nixInScope.types
).kernelFamily
).check
)
)(
(
await nixInScope.attrValues
)((await nix__x).families)
)
),
})
)
),
"openKernel"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)((await nixInScope.attrValues)(nixInScope.kernels))
),
"kernel"
);
nixInScope.kernels = (async (nixInScope) =>
(async (nixInScope) =>
await nixOp.Update(
(
await (
await nix__setTypes
)((await nixInScope.types).openKernel)
)(
Object.assign(Object.create(null), {
macos: Object.assign(Object.create(null), {
execFormat: nixInScope.macho,
families: Object.assign(Object.create(null), {
darwin: nixInScope.darwin,
}),
name: "darwin",
}),
ios: Object.assign(Object.create(null), {
execFormat: nixInScope.macho,
families: Object.assign(Object.create(null), {
darwin: nixInScope.darwin,
}),
}),
freebsd: Object.assign(Object.create(null), {
execFormat: nixInScope.elf,
families: Object.assign(Object.create(null), {
bsd: nixInScope.bsd,
}),
}),
linux: Object.assign(Object.create(null), {
execFormat: nixInScope.elf,
families: Object.create(null),
}),
netbsd: Object.assign(Object.create(null), {
execFormat: nixInScope.elf,
families: Object.assign(Object.create(null), {
bsd: nixInScope.bsd,
}),
}),
none: Object.assign(Object.create(null), {
execFormat: nixInScope.unknown,
families: Object.create(null),
}),
openbsd: Object.assign(Object.create(null), {
execFormat: nixInScope.elf,
families: Object.assign(Object.create(null), {
bsd: nixInScope.bsd,
}),
}),
solaris: Object.assign(Object.create(null), {
execFormat: nixInScope.elf,
families: Object.create(null),
}),
wasi: Object.assign(Object.create(null), {
execFormat: nixInScope.wasm,
families: Object.create(null),
}),
redox: Object.assign(Object.create(null), {
execFormat: nixInScope.elf,
families: Object.create(null),
}),
windows: Object.assign(Object.create(null), {
execFormat: nixInScope.pe,
families: Object.create(null),
}),
ghcjs: Object.assign(Object.create(null), {
execFormat: nixInScope.unknown,
families: Object.create(null),
}),
genode: Object.assign(Object.create(null), {
execFormat: nixInScope.elf,
families: Object.create(null),
}),
mmixware: Object.assign(Object.create(null), {
execFormat: nixInScope.unknown,
families: Object.create(null),
}),
})
),
Object.assign(Object.create(null), {
darwin: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).macos
),
watchos: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).ios
),
tvos: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).ios
),
win32: nixBlti.PLazy.from(
async () => await (await nixInScope.kernels).windows
),
})
))(
nixBlti.mkScopeWith(
nixInScope,
await nixInScope.kernelFamilies
)
))(
nixBlti.mkScopeWith(nixInScope, await nixInScope.execFormats)
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "abi",
description:
"binary interface for compiled code and syscalls",
merge: nix__mergeOneOption,
})
)
),
"openAbi"
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.enum
)((await nixInScope.attrValues)(nixInScope.abis))
),
"abi"
);
nixInScope.abis = nixBlti.PLazy.from(
async () =>
await (
await (
await nix__setTypes
)((await nixInScope.types).openAbi)
)(
Object.assign(Object.create(null), {
cygnus: Object.create(null),
msvc: Object.create(null),
eabi: Object.assign(Object.create(null), {
float: "soft",
}),
eabihf: Object.assign(Object.create(null), {
float: "hard",
}),
elf: Object.create(null),
androideabi: Object.create(null),
android: Object.assign(Object.create(null), {
assertions: nixBlti.PLazy.from(async () => [
Object.assign(Object.create(null), {
assertion: async (nix__platform) =>
nixOp.u_Invert((await nix__platform).isAarch32),
message: "The ",
}),
]),
}),
gnueabi: Object.assign(Object.create(null), {
float: "soft",
}),
gnueabihf: Object.assign(Object.create(null), {
float: "hard",
}),
gnu: Object.assign(Object.create(null), {
assertions: nixBlti.PLazy.from(async () => [
Object.assign(Object.create(null), {
assertion: async (nix__platform) =>
nixOp.u_Invert((await nix__platform).isAarch32),
message: "The ",
}),
]),
}),
gnuabi64: Object.assign(Object.create(null), {
abi: "64",
}),
musleabi: Object.assign(Object.create(null), {
float: "soft",
}),
musleabihf: Object.assign(Object.create(null), {
float: "hard",
}),
musl: Object.create(null),
uclibceabihf: Object.assign(Object.create(null), {
float: "soft",
}),
uclibceabi: Object.assign(Object.create(null), {
float: "hard",
}),
uclibc: Object.create(null),
unknown: Object.create(null),
})
)
);
if (!Object.prototype.hasOwnProperty.call(nixInScope, "types"))
nixInScope.types = Object.create(null);
await nixOp._deepMerge(
nixInScope.types,
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.mkOptionType
)(
Object.assign(Object.create(null), {
name: "system",
description:
"fully parsed representation of llvm- or nix-style platform tuple",
merge: nix__mergeOneOption,
check: async (nixBound) => {
nixBound = await nixBound;
let nix__cpu = nixOp._lambdaA2chk(nixBound, "cpu");
let nix__vendor = nixOp._lambdaA2chk(
nixBound,
"vendor"
);
let nix__kernel = nixOp._lambdaA2chk(
nixBound,
"kernel"
);
let nix__abi = nixOp._lambdaA2chk(nixBound, "abi");
return await nixOp.And(
nixOp.And(
nixOp.And(
(
await (
await (
await nixInScope.types
).cpuType
).check
)(nix__cpu),
(
await (
await (
await nixInScope.types
).vendor
).check
)(nix__vendor)
),
(
await (
await (
await nixInScope.types
).kernel
).check
)(nix__kernel)
),
(
await (
await (
await nixInScope.types
).abi
).check
)(nix__abi)
);
},
})
)
),
"parsedPlatform"
);
nixInScope.isSystem = nixBlti.PLazy.from(
async () => await (await nixInScope.isType)("system")
);
nixInScope.mkSystem = async (nix__components) =>
await nixBlti.PLazy.from(async () => {
await nixBltiRT.assert(
"line 389: types.parsedPlatform.check components",
(
await (
await (
await nixInScope.types
).parsedPlatform
).check
)(nix__components)
);
return await (
await (
await nixInScope.setType
)("system")
)(nix__components);
});
nixInScope.mkSkeletonFromList = async (nix__l) =>
await nixBlti.orDefault(
nixBlti.PLazy.from(
async () =>
await (
await (async (nixAttrsScope) => {
nixAttrsScope["1"] = nixBlti.PLazy.from(async () =>
(await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(0),
"avr"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
kernel: "none",
abi: "unknown",
})
: await nixBltiRT.throw(
"Target specification with 1 components is ambiguous"
)
);
nixAttrsScope["2"] = nixBlti.PLazy.from(async () =>
(await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(1),
"cygwin"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
kernel: "windows",
abi: "cygnus",
})
: await ((await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(1),
"windows"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
kernel: "windows",
abi: "msvc",
})
: (await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(1),
"elf"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: "unknown",
kernel: "none",
abi: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
})
: Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
}))
);
nixAttrsScope["3"] = nixBlti.PLazy.from(async () =>
(await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(1),
"apple"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: "apple",
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(2)
),
})
: await ((await nixOp.Or(
nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(1),
"linux"
),
nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2),
"gnu"
)
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
abi: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(2)
),
})
: (await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2),
"mingw32"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
kernel: "windows",
})
: (await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2),
"wasi"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
kernel: "wasi",
})
: (await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2),
"redox"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
kernel: "redox",
})
: (await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2),
"mmixware"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
kernel: "mmixware",
})
: (await (
await (
await nixInScope.hasPrefix
)("netbsd")
)(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2)
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(2)
),
})
: (await (
await (
await nixInScope.elem
)(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2)
)
)(["eabi", "eabihf", "elf"]))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: "unknown",
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
abi: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(2)
),
})
: (await nixOp.Equal(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2),
"ghcjs"
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: "unknown",
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(2)
),
})
: (await (
await (
await nixInScope.hasPrefix
)("genode")
)(
(
await (
await nixInScope.elemAt
)(nix__l)
)(2)
))
? Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(2)
),
})
: nixBltiRT.throw(
"Target specification with 3 components is ambiguous"
))
);
nixAttrsScope["4"] = Object.assign(
Object.create(null),
{
cpu: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(0)
),
vendor: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(1)
),
kernel: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(2)
),
abi: nixBlti.PLazy.from(
async () =>
await (
await (
await nixInScope.elemAt
)(nix__l)
)(3)
),
}
);
return nixAttrsScope[nixBlti.extractScope];
})(nixBlti.mkScope())
)[
await nixBltiRT.toString(
(
await nixInScope.length
)(nix__l)
)
]
),
nixBlti.PLazy.from(
async () =>
await nixBltiRT.throw(
"system string has invalid number of hyphen-separated components"
)
)
);
nixInScope.mkSystemFromSkeleton = async (nix__args) => {
nix__args = await nix__args;
let nix__cpu = nixOp._lambdaA2chk(nix__args, "cpu");
let nix__vendor = nixOp._lambdaA2chk(
nix__args,
"vendor",
nixBlti.PLazy.from(async () => {
await nixBltiRT.assert("line 438: false", false);
return null;
})
);
let nix__kernel = nixOp._lambdaA2chk(nix__args, "kernel");
let nix__abi = nixOp._lambdaA2chk(
nix__args,
"abi",
nixBlti.PLazy.from(async () => {
await nixBltiRT.assert("line 441: false", false);
return null;
})
);
return nixBlti.PLazy.from(async () => {
let nix__getAbi,
nix__getCpu,
nix__getKernel,
nix__getVendor,
nix__parsed;
nix__getCpu = async (nix__name) =>
await nixBlti.orDefault(
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.cpuTypes
)[await nix__name]
),
nixBlti.PLazy.from(
async () =>
await nixBltiRT.throw(
"Unknown CPU type: " + (await nix__name)
)
)
);
nix__getVendor = async (nix__name) =>
await nixBlti.orDefault(
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.vendors
)[await nix__name]
),
nixBlti.PLazy.from(
async () =>
await nixBltiRT.throw(
"Unknown vendor: " + (await nix__name)
)
)
);
nix__getKernel = async (nix__name) =>
await nixBlti.orDefault(
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.kernels
)[await nix__name]
),
nixBlti.PLazy.from(
async () =>
await nixBltiRT.throw(
"Unknown kernel: " + (await nix__name)
)
)
);
nix__getAbi = async (nix__name) =>
await nixBlti.orDefault(
nixBlti.PLazy.from(
async () =>
await (
await nixInScope.abis
)[await nix__name]
),
nixBlti.PLazy.from(
async () =>
await nixBltiRT.throw(
"Unknown ABI: " + (await nix__name)
)
)
);
nix__parsed = Object.assign(Object.create(null), {
cpu: nixBlti.PLazy.from(
async () =>
await (
await nix__getCpu
)((await nix__args).cpu)
),
vendor: nixBlti.PLazy.from(async () =>
Object.prototype.hasOwnProperty.call(
await nix__args,
"vendor"
)
? await (
await nix__getVendor
)((await nix__args).vendor)
: await ((await (
await nixInScope.isDarwin
)(nix__parsed))
? (
await nixInScope.vendors
).apple
: (await (
await nixInScope.isWindows
)(nix__parsed))
? (
await nixInScope.vendors
).pc
: (
await nixInScope.vendors
).unknown)
),
kernel: nixBlti.PLazy.from(async () =>
(await (
await (
await nixInScope.hasPrefix
)("darwin")
)((await nix__args).kernel))
? await (
await nix__getKernel
)("darwin")
: await ((await (
await (
await nixInScope.hasPrefix
)("netbsd")
)((await nix__args).kernel))
? (
await nix__getKernel
)("netbsd")
: (
await nix__getKernel
)((await nix__args).kernel))
),
abi: nixBlti.PLazy.from(async () =>
Object.prototype.hasOwnProperty.call(
await nix__args,
"abi"
)
? await (
await nix__getAbi
)((await nix__args).abi)
: await ((await nixOp.Or(
(
await nixInScope.isLinux
)(nix__parsed),
(
await nixInScope.isWindows
)(nix__parsed)
))
? (await (
await nixInScope.isAarch32
)(nix__parsed))
? (await (
await (
await (
await nix__lib
).versionAtLeast
)(
nixBlti.orDefault(
nixBlti.PLazy.from(
async () =>
await (
await (
await nix__parsed
).cpu
).version
),
"0"
)
)
)("6"))
? (
await nixInScope.abis
).gnueabihf
: (
await nixInScope.abis
).gnueabi
: (
await nixInScope.abis
).gnu
: (
await nixInScope.abis
).unknown)
),
});
return await (
await nixInScope.mkSystem
)(nix__parsed);
});
};
nixInScope.mkSystemFromString = async (nix__s) =>
await (
await nixInScope.mkSystemFromSkeleton
)(
(
await nixInScope.mkSkeletonFromList
)((await (await (await nix__lib).splitString)("-"))(nix__s))
);
nixInScope.doubleFromSystem = async (nixBound) => {
nixBound = await nixBound;
let nix__cpu = nixOp._lambdaA2chk(nixBound, "cpu");
let nix__kernel = nixOp._lambdaA2chk(nixBound, "kernel");
let nix__abi = nixOp._lambdaA2chk(nixBound, "abi");
return await ((await nixOp.Equal(
nix__abi,
(
await nixInScope.abis
).cygnus
))
? (await (await nix__cpu).name) + "-cygwin"
: Object.prototype.hasOwnProperty.call(
await (
await nix__kernel
).families,
"darwin"
)
? (await (await nix__cpu).name) + "-darwin"
: (await (await nix__cpu).name) +
"-" +
(await (
await nix__kernel
).name));
};
nixInScope.tripleFromSystem = async (nix__sys) => {
nix__sys = await nix__sys;
let nix__cpu = nixOp._lambdaA2chk(nix__sys, "cpu");
let nix__vendor = nixOp._lambdaA2chk(nix__sys, "vendor");
let nix__kernel = nixOp._lambdaA2chk(nix__sys, "kernel");
let nix__abi = nixOp._lambdaA2chk(nix__sys, "abi");
return await nixBlti.PLazy.from(async () => {
await nixBltiRT.assert(
"line 478: isSystem sys",
(
await nixInScope.isSystem
)(nix__sys)
);
return nixBlti.PLazy.from(async () => {
let nix__optAbi, nix__optExecFormat;
nix__optExecFormat = nixBlti.PLazy.from(
async () =>
await (
await (
await (
await nix__lib
).optionalString
)(
nixOp.And(
nixOp.Equal((await nix__kernel).name, "netbsd"),
nixOp.NotEqual(
(
await nixInScope.gnuNetBSDDefaultExecFormat
)(nix__cpu),
(
await nix__kernel
).execFormat
)
)
)
)((await (await nix__kernel).execFormat).name)
);
nix__optAbi = nixBlti.PLazy.from(
async () =>
await (
await (
await (
await nix__lib
).optionalString
)(
nixOp.NotEqual(
nix__abi,
(
await nixInScope.abis
).unknown
)
)
)("-" + (await (await nix__abi).name))
);
return (
(await (await nix__cpu).name) +
"-" +
(await (
await nix__vendor
).name) +
"-" +
(await (
await nix__kernel
).name) +
(await nix__optExecFormat) +
(await nix__optAbi)
);
});
});
};
return nixInScope[nixBlti.extractScope];
})(nixBlti.mkScope(nixInScope));
}))(
nixBlti.mkScopeWith(
nixInScope,
await (
await (
await nixBltiRT.import(
nixRt.export("Relative", "./inspect.nix")
)
)(Object.assign(Object.create(null), { lib: nix__lib }))
).predicates
)
))(nixBlti.mkScopeWith(nixInScope, await (await nix__lib).strings)))(
nixBlti.mkScopeWith(nixInScope, await (await nix__lib).attrsets)
))(nixBlti.mkScopeWith(nixInScope, await (await nix__lib).types)))(
nixBlti.mkScopeWith(nixInScope, await (await nix__lib).lists)
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment