2024-03-01 21:11:58 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPackages,
|
|
|
|
autoconf-archive,
|
|
|
|
autoreconfHook,
|
2024-03-03 07:38:22 +00:00
|
|
|
boehmgc,
|
|
|
|
nlohmann_json,
|
2024-03-01 21:11:58 +00:00
|
|
|
bison,
|
|
|
|
changelog-d,
|
2024-03-03 01:09:56 +00:00
|
|
|
boost,
|
|
|
|
brotli,
|
|
|
|
bzip2,
|
|
|
|
curl,
|
|
|
|
editline,
|
2024-03-01 21:11:58 +00:00
|
|
|
fileset,
|
|
|
|
flex,
|
2024-03-03 01:09:56 +00:00
|
|
|
git,
|
2024-03-03 06:10:35 +00:00
|
|
|
gtest,
|
2024-03-03 01:09:56 +00:00
|
|
|
jq,
|
|
|
|
libarchive,
|
|
|
|
libcpuid,
|
|
|
|
libseccomp,
|
|
|
|
libsodium,
|
2024-03-01 21:11:58 +00:00
|
|
|
lowdown,
|
|
|
|
mdbook,
|
|
|
|
mdbook-linkcheck,
|
|
|
|
mercurial,
|
2024-03-03 01:09:56 +00:00
|
|
|
openssl,
|
|
|
|
pkg-config,
|
2024-03-03 06:10:35 +00:00
|
|
|
rapidcheck,
|
2024-03-03 01:09:56 +00:00
|
|
|
sqlite,
|
|
|
|
util-linuxMinimal,
|
|
|
|
xz,
|
2024-03-01 21:11:58 +00:00
|
|
|
|
|
|
|
pname ? "nix",
|
|
|
|
versionSuffix ? "",
|
|
|
|
officialRelease ? true,
|
|
|
|
# Set to true to build the release notes for the next release.
|
|
|
|
buildUnreleasedNotes ? false,
|
|
|
|
}: let
|
|
|
|
version = lib.fileContents ./.version + versionSuffix;
|
|
|
|
|
|
|
|
# .gitignore has already been processed, so any changes in it are irrelevant
|
|
|
|
# at this point. It is not represented verbatim for test purposes because
|
|
|
|
# that would interfere with repo semantics.
|
|
|
|
baseFiles = fileset.fileFilter (f: f.name != ".gitignore") ./.;
|
|
|
|
src = fileset.toSource {
|
|
|
|
root = ./.;
|
|
|
|
fileset = fileset.intersect baseFiles (fileset.unions [
|
|
|
|
./.version
|
|
|
|
./boehmgc-coroutine-sp-fallback.diff
|
|
|
|
./bootstrap.sh
|
|
|
|
./configure.ac
|
|
|
|
./doc
|
|
|
|
./local.mk
|
|
|
|
./m4
|
|
|
|
./Makefile
|
|
|
|
./Makefile.config.in
|
|
|
|
./misc
|
|
|
|
./mk
|
|
|
|
./precompiled-headers.h
|
|
|
|
./src
|
|
|
|
./tests/functional
|
|
|
|
./tests/unit
|
|
|
|
./unit-test-data
|
|
|
|
./COPYING
|
|
|
|
./scripts/local.mk
|
|
|
|
(fileset.fileFilter (f: lib.strings.hasPrefix "nix-profile" f.name) ./scripts)
|
|
|
|
# TODO: do we really need README.md? It doesn't seem used in the build.
|
|
|
|
./README.md
|
|
|
|
]);
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation (finalAttrs: {
|
|
|
|
name = "nix-${version}";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
|
|
|
VERSION_SUFFIX = versionSuffix;
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
flex
|
|
|
|
(lib.getBin lowdown)
|
|
|
|
mdbook
|
|
|
|
mdbook-linkcheck
|
|
|
|
autoconf-archive
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
|
|
|
|
|
|
|
# Tests
|
|
|
|
git
|
|
|
|
mercurial
|
|
|
|
jq
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
# FIXME(Qyriad): should this be util-linux as it is in current upstream?
|
|
|
|
(buildPackages.util-linuxMinimal or buildPackages.utillinuxMinimal)
|
|
|
|
] ++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d;
|
2024-03-03 01:09:56 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
bzip2
|
|
|
|
xz
|
|
|
|
brotli
|
|
|
|
editline
|
|
|
|
openssl
|
|
|
|
sqlite
|
|
|
|
libarchive
|
|
|
|
boost
|
|
|
|
lowdown
|
|
|
|
libsodium
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isLinux [ libseccomp ]
|
|
|
|
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
|
2024-03-03 06:10:35 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
gtest
|
|
|
|
rapidcheck
|
|
|
|
];
|
|
|
|
|
2024-03-03 07:38:22 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
boehmgc
|
|
|
|
nlohmann_json
|
|
|
|
];
|
|
|
|
|
2024-03-03 06:10:35 +00:00
|
|
|
# FIXME: Used to make checkInputs accessible from outside the derivation args
|
|
|
|
# during the refactor.
|
|
|
|
passthru.finalAttrs = finalAttrs;
|
2024-03-01 21:11:58 +00:00
|
|
|
})
|