package.nix: final cleanup

Change-Id: I7d5b7d26a63f7ac56ed054e7f264f39d30273b94
This commit is contained in:
Qyriad 2024-03-09 02:36:32 -07:00
parent 1070ddf84f
commit c1cb44d5e0

View file

@ -2,7 +2,6 @@
pkgs,
lib,
stdenv,
buildPackages,
autoconf-archive,
autoreconfHook,
aws-sdk-cpp,
@ -32,10 +31,11 @@
pkg-config,
rapidcheck,
sqlite,
util-linuxMinimal,
util-linuxMinimal ? utillinuxMinimal,
utillinuxMinimal ? null,
xz,
busybox-sandbox-shell ? null,
busybox-sandbox-shell,
pname ? "nix",
versionSuffix ? "",
@ -56,33 +56,6 @@
# .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.intersection baseFiles (fileset.unions [
./.version
./boehmgc-coroutine-sp-fallback.diff
./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
]);
};
aws-sdk-cpp-nix = aws-sdk-cpp.override {
apis = [ "s3" "transfer" ];
customMemoryManagement = false;
@ -92,6 +65,8 @@
"RAPIDCHECK_HEADERS=${lib.getDev rapidcheck}/extras/gtest/include"
];
baseFiles = fileset.fileFilter (f: f.name != ".gitignore") ./.;
configureFiles = fileset.unions [
./.version
./configure.ac
@ -139,6 +114,7 @@ in stdenv.mkDerivation (finalAttrs: {
outputs = [ "out" ]
++ lib.optionals finalAttrs.doBuild [ "dev" "doc" ];
# dontBuild isn't specified most of the time, where it is implicitly false.
doBuild = !(finalAttrs.dontBuild or false);
nativeBuildInputs = [
@ -156,10 +132,8 @@ in stdenv.mkDerivation (finalAttrs: {
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;
] ++ lib.optional stdenv.hostPlatform.isLinux util-linuxMinimal
++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d;
buildInputs = [
curl
@ -177,20 +151,14 @@ in stdenv.mkDerivation (finalAttrs: {
++ lib.optionals stdenv.isLinux [ libseccomp ]
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
# There have been issues building these dependencies
# TODO(Qyriad): Should this also have && (stdenv.isLinux || stdenv.isDarwin), as upstream does?
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) aws-sdk-cpp-nix
# FIXME(Qyriad): This is how the flake.nix version does it, but this is cursed.
++ lib.optionals (finalAttrs.doCheck) finalAttrs.passthru._checkInputs
;
passthru._checkInputs = [
checkInputs = [
gtest
rapidcheck
];
# FIXME(Qyriad): remove at the end of refactoring.
checkInputs = finalAttrs.passthru._checkInputs;
propagatedBuildInputs = [
boehmgc
nlohmann_json
@ -271,9 +239,6 @@ in stdenv.mkDerivation (finalAttrs: {
meta.platforms = lib.platforms.unix;
# FIXME: Used to make checkInputs accessible from outside the derivation args
# during the refactor.
passthru.finalAttrs = finalAttrs;
passthru.perl-bindings = pkgs.callPackage ./perl {
inherit fileset stdenv;
};