lix: 2.90 -> 2.91

This commit is contained in:
isabel roses 2024-08-17 17:39:28 +01:00
parent b8af538578
commit 256c245a65
Signed by untrusted user: isabelroses
GPG key ID: 08A97B9A107A1798
3 changed files with 137 additions and 115 deletions

View file

@ -1,80 +1,76 @@
{ lib {
, fetchFromGitHub lib,
, version fetchFromGitHub,
, suffix ? "" version,
, hash ? null suffix ? "",
, src ? fetchFromGitHub { hash ? null,
src ? fetchFromGitHub {
owner = "lix-project"; owner = "lix-project";
repo = "lix"; repo = "lix";
rev = version; rev = version;
inherit hash; inherit hash;
} },
, docCargoHash ? null docCargoHash ? null,
, patches ? [ ] docCargoLock ? null,
, maintainers ? lib.teams.lix.members patches ? [ ],
, maintainers ? lib.teams.lix.members,
}@args: }@args:
assert (hash == null) -> (src != null); assert (hash == null) -> (src != null);
{ stdenv assert lib.assertMsg (docCargoHash != null || docCargoLock != null)
, meson "Either `lix-doc`'s cargoHash using `docCargoHash` or `lix-doc`'s `cargoLock.lockFile` using `docCargoLock` must be set!";
, bash let
, bison isLegacyParser = lib.versionOlder version "2.91";
, boehmgc in
, boost {
, brotli stdenv,
, busybox-sandbox-shell meson,
, bzip2 bison,
, callPackage boehmgc,
, coreutils boost,
, curl brotli,
, cmake busybox-sandbox-shell,
, docbook_xsl_ns bzip2,
, docbook5 callPackage,
, doxygen curl,
, editline cmake,
, flex doxygen,
, git editline,
, gnutar flex,
, gtest git,
, gzip gtest,
, jq jq,
, lib lib,
, libarchive libarchive,
, libcpuid libcpuid,
, libgit2 libsodium,
, libsodium lowdown,
, libxml2 lsof,
, libxslt mercurial,
, lowdown mdbook,
, lsof mdbook-linkcheck,
, man nlohmann_json,
, mercurial ninja,
, mdbook openssl,
, mdbook-linkcheck toml11,
, nlohmann_json pegtl,
, ninja python3,
, openssl pkg-config,
, toml11 rapidcheck,
, python3 Security,
, perl sqlite,
, pkg-config util-linuxMinimal,
, rapidcheck xz,
, Security # , nixosTests
, sqlite enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
, util-linuxMinimal enableStatic ? stdenv.hostPlatform.isStatic,
, xz withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin),
# , nixosTests aws-sdk-cpp,
, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
, enableStatic ? stdenv.hostPlatform.isStatic withLibseccomp ? lib.meta.availableOn stdenv.hostPlatform libseccomp,
, withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin) libseccomp,
, aws-sdk-cpp confDir,
, # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 stateDir,
withLibseccomp ? lib.meta.availableOn stdenv.hostPlatform libseccomp storeDir,
, libseccomp
, confDir
, stateDir
, storeDir
,
}: }:
let let
lix-doc = callPackage ./doc { lix-doc = callPackage ./doc {
@ -105,14 +101,12 @@ let
nativeBuildInputs = nativeBuildInputs =
[ [
pkg-config pkg-config
bison
flex flex
jq jq
meson meson
ninja ninja
cmake cmake
python3 python3
doxygen
# Tests # Tests
git git
@ -120,10 +114,12 @@ let
jq jq
lsof lsof
] ]
++ lib.optionals (enableDocumentation) [ ++ lib.optionals isLegacyParser [ bison ]
++ lib.optionals enableDocumentation [
(lib.getBin lowdown) (lib.getBin lowdown)
mdbook mdbook
mdbook-linkcheck mdbook-linkcheck
doxygen
] ]
++ lib.optionals stdenv.isLinux [ util-linuxMinimal ]; ++ lib.optionals stdenv.isLinux [ util-linuxMinimal ];
@ -145,8 +141,9 @@ let
toml11 toml11
lix-doc lix-doc
] ]
++ lib.optionals (!isLegacyParser) [ pegtl ]
++ lib.optionals stdenv.isDarwin [ Security ] ++ lib.optionals stdenv.isDarwin [ Security ]
++ lib.optionals (stdenv.isx86_64) [ libcpuid ] ++ lib.optionals stdenv.isx86_64 [ libcpuid ]
++ lib.optionals withLibseccomp [ libseccomp ] ++ lib.optionals withLibseccomp [ libseccomp ]
++ lib.optionals withAWS [ aws-sdk-cpp ]; ++ lib.optionals withAWS [ aws-sdk-cpp ];
@ -156,7 +153,7 @@ let
]; ];
postPatch = '' postPatch = ''
patchShebangs --build tests patchShebangs --build tests doc/manual
''; '';
preConfigure = preConfigure =
@ -182,6 +179,7 @@ let
mesonFlags = mesonFlags =
[ [
(lib.mesonBool "b_lto" true)
(lib.mesonEnable "gc" true) (lib.mesonEnable "gc" true)
(lib.mesonBool "enable-tests" true) (lib.mesonBool "enable-tests" true)
(lib.mesonBool "enable-docs" enableDocumentation) (lib.mesonBool "enable-docs" enableDocumentation)
@ -203,10 +201,15 @@ let
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib"; BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
}; };
ninjaFlags = [ "-v" ];
postInstall = postInstall =
'' lib.optionalString enableDocumentation ''
mkdir -p $doc/nix-support mkdir -p $doc/nix-support
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
mkdir -p $devdoc/nix-support
echo "devdoc internal-api $devdoc/share/doc/nix/internal-api" >> $devdoc/nix-support/hydra-build-products
'' ''
+ lib.optionalString stdenv.hostPlatform.isStatic '' + lib.optionalString stdenv.hostPlatform.isStatic ''
mkdir -p $out/nix-support mkdir -p $out/nix-support
@ -222,14 +225,26 @@ let
''; '';
doCheck = true; doCheck = true;
mesonCheckFlags = [ "--suite=check" ]; mesonCheckFlags = [
"--suite=check"
"--print-errorlogs"
];
checkInputs = [ checkInputs = [
gtest gtest
rapidcheck rapidcheck
]; ];
# This needs to run after _multioutDocs moves the docs to $doc
postFixup = ''
mkdir -p $devdoc/share/doc/nix
mv $doc/share/doc/nix/internal-api $devdoc/share/doc/nix
'';
doInstallCheck = true; doInstallCheck = true;
mesonInstallCheckFlags = [ "--suite=installcheck" ]; mesonInstallCheckFlags = [
"--suite=installcheck"
"--print-errorlogs"
];
preInstallCheck = lib.optionalString stdenv.hostPlatform.isDarwin '' preInstallCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
# socket path becomes too long otherwise # socket path becomes too long otherwise
@ -262,7 +277,7 @@ let
# point 'nix edit' and ofborg at the file that defines the attribute, # point 'nix edit' and ofborg at the file that defines the attribute,
# not this common file. # not this common file.
pos = builtins.unsafeGetAttrPos "version" args; pos = builtins.unsafeGetAttrPos "version" args;
meta = with lib; { meta = {
description = "Powerful package manager that makes package management reliable and reproducible"; description = "Powerful package manager that makes package management reliable and reproducible";
longDescription = '' longDescription = ''
Lix (a fork of Nix) is a powerful package manager for Linux and other Unix systems that Lix (a fork of Nix) is a powerful package manager for Linux and other Unix systems that
@ -272,10 +287,10 @@ let
environments. environments.
''; '';
homepage = "https://lix.systems"; homepage = "https://lix.systems";
license = licenses.lgpl21Plus; license = lib.licenses.lgpl21Plus;
inherit maintainers; inherit maintainers;
platforms = platforms.unix; platforms = lib.platforms.unix;
outputsToInstall = [ "out" ] ++ optional enableDocumentation "man"; outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man";
mainProgram = "nix"; mainProgram = "nix";
broken = enableStatic; broken = enableStatic;
}; };

View file

@ -1,14 +1,14 @@
{ lib {
, aws-sdk-cpp lib,
, boehmgc aws-sdk-cpp,
, callPackage boehmgc,
, fetchFromGitHub callPackage,
, Security fetchFromGitHub,
, storeDir ? "/nix/store" Security,
, stateDir ? "/nix/var" storeDir ? "/nix/store",
, confDir ? "/etc" stateDir ? "/nix/var",
, path confDir ? "/etc",
, path,
}: }:
let let
boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; }; boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; };
@ -20,6 +20,9 @@ let
]; ];
}); });
# Since Lix 2.91 does not use boost coroutines, it does not need boehmgc patches either.
needsBoehmgcPatches = version: lib.versionOlder version "2.91";
aws-sdk-cpp-nix = aws-sdk-cpp-nix =
(aws-sdk-cpp.override { (aws-sdk-cpp.override {
apis = [ apis = [
@ -42,19 +45,23 @@ let
stateDir stateDir
confDir confDir
; ;
boehmgc = boehmgc-nix; boehmgc = if needsBoehmgcPatches args.version then boehmgc-nix else boehmgc-nix_2_3;
aws-sdk-cpp = aws-sdk-cpp-nix; aws-sdk-cpp = aws-sdk-cpp-nix;
}; };
in in
lib.makeExtensible (self: ({ lib.makeExtensible (self: {
lix_2_90 = ( lix_2_90 = common {
common { version = "2.90.0";
version = "2.90-beta.1"; hash = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc=";
hash = "sha256-REWlo2RYHfJkxnmZTEJu3Cd/2VM+wjjpPy7Xi4BdDTQ="; docCargoHash = "sha256-vSf9MyD2XzofZlbzsmh6NP69G+LiX72GX4Um9UJp3dc=";
docCargoHash = "sha256-oH248kR4Of0MhcY2DYxNX0A+/XJ3L+UuIpBKn3sJt54="; };
}
);
latest = self.lix_2_90; lix_2_91 = common {
stable = self.lix_2_90; version = "2.91.0";
})) hash = "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=";
docCargoHash = "sha256-KOn1fXF7k7c/0e5ZCNZwt3YZmjL1oi5A2mhwxQWKaUo=";
};
latest = self.lix_2_91;
stable = self.lix_2_91;
})

View file

@ -1,13 +1,13 @@
{ ... }: _: _: pkgs: _:
res: pkgs: super:
with pkgs; with pkgs; {
{ lixVersions = recurseIntoAttrs (
lixVersions = recurseIntoAttrs (callPackage ./. { callPackage ./. {
storeDir = config.nix.storeDir or "/nix/store"; storeDir = config.nix.storeDir or "/nix/store";
stateDir = config.nix.stateDir or "/nix/var"; stateDir = config.nix.stateDir or "/nix/var";
inherit (darwin.apple_sdk.frameworks) Security; inherit (darwin.apple_sdk.frameworks) Security;
}); }
);
lix = lixVersions.stable; lix = lixVersions.stable;