parent
b8af538578
commit
256c245a65
|
@ -1,80 +1,76 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, version
|
||||
, suffix ? ""
|
||||
, hash ? null
|
||||
, src ? fetchFromGitHub {
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
version,
|
||||
suffix ? "",
|
||||
hash ? null,
|
||||
src ? fetchFromGitHub {
|
||||
owner = "lix-project";
|
||||
repo = "lix";
|
||||
rev = version;
|
||||
inherit hash;
|
||||
}
|
||||
, docCargoHash ? null
|
||||
, patches ? [ ]
|
||||
, maintainers ? lib.teams.lix.members
|
||||
,
|
||||
},
|
||||
docCargoHash ? null,
|
||||
docCargoLock ? null,
|
||||
patches ? [ ],
|
||||
maintainers ? lib.teams.lix.members,
|
||||
}@args:
|
||||
assert (hash == null) -> (src != null);
|
||||
{ stdenv
|
||||
, meson
|
||||
, bash
|
||||
, bison
|
||||
, boehmgc
|
||||
, boost
|
||||
, brotli
|
||||
, busybox-sandbox-shell
|
||||
, bzip2
|
||||
, callPackage
|
||||
, coreutils
|
||||
, curl
|
||||
, cmake
|
||||
, docbook_xsl_ns
|
||||
, docbook5
|
||||
, doxygen
|
||||
, editline
|
||||
, flex
|
||||
, git
|
||||
, gnutar
|
||||
, gtest
|
||||
, gzip
|
||||
, jq
|
||||
, lib
|
||||
, libarchive
|
||||
, libcpuid
|
||||
, libgit2
|
||||
, libsodium
|
||||
, libxml2
|
||||
, libxslt
|
||||
, lowdown
|
||||
, lsof
|
||||
, man
|
||||
, mercurial
|
||||
, mdbook
|
||||
, mdbook-linkcheck
|
||||
, nlohmann_json
|
||||
, ninja
|
||||
, openssl
|
||||
, toml11
|
||||
, python3
|
||||
, perl
|
||||
, pkg-config
|
||||
, rapidcheck
|
||||
, Security
|
||||
, sqlite
|
||||
, util-linuxMinimal
|
||||
, xz
|
||||
# , nixosTests
|
||||
, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||
, withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin)
|
||||
, aws-sdk-cpp
|
||||
, # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
|
||||
withLibseccomp ? lib.meta.availableOn stdenv.hostPlatform libseccomp
|
||||
, libseccomp
|
||||
, confDir
|
||||
, stateDir
|
||||
, storeDir
|
||||
,
|
||||
assert lib.assertMsg (docCargoHash != null || docCargoLock != null)
|
||||
"Either `lix-doc`'s cargoHash using `docCargoHash` or `lix-doc`'s `cargoLock.lockFile` using `docCargoLock` must be set!";
|
||||
let
|
||||
isLegacyParser = lib.versionOlder version "2.91";
|
||||
in
|
||||
{
|
||||
stdenv,
|
||||
meson,
|
||||
bison,
|
||||
boehmgc,
|
||||
boost,
|
||||
brotli,
|
||||
busybox-sandbox-shell,
|
||||
bzip2,
|
||||
callPackage,
|
||||
curl,
|
||||
cmake,
|
||||
doxygen,
|
||||
editline,
|
||||
flex,
|
||||
git,
|
||||
gtest,
|
||||
jq,
|
||||
lib,
|
||||
libarchive,
|
||||
libcpuid,
|
||||
libsodium,
|
||||
lowdown,
|
||||
lsof,
|
||||
mercurial,
|
||||
mdbook,
|
||||
mdbook-linkcheck,
|
||||
nlohmann_json,
|
||||
ninja,
|
||||
openssl,
|
||||
toml11,
|
||||
pegtl,
|
||||
python3,
|
||||
pkg-config,
|
||||
rapidcheck,
|
||||
Security,
|
||||
sqlite,
|
||||
util-linuxMinimal,
|
||||
xz,
|
||||
# , nixosTests
|
||||
enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform,
|
||||
enableStatic ? stdenv.hostPlatform.isStatic,
|
||||
withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin),
|
||||
aws-sdk-cpp,
|
||||
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
|
||||
withLibseccomp ? lib.meta.availableOn stdenv.hostPlatform libseccomp,
|
||||
libseccomp,
|
||||
confDir,
|
||||
stateDir,
|
||||
storeDir,
|
||||
}:
|
||||
let
|
||||
lix-doc = callPackage ./doc {
|
||||
|
@ -105,14 +101,12 @@ let
|
|||
nativeBuildInputs =
|
||||
[
|
||||
pkg-config
|
||||
bison
|
||||
flex
|
||||
jq
|
||||
meson
|
||||
ninja
|
||||
cmake
|
||||
python3
|
||||
doxygen
|
||||
|
||||
# Tests
|
||||
git
|
||||
|
@ -120,10 +114,12 @@ let
|
|||
jq
|
||||
lsof
|
||||
]
|
||||
++ lib.optionals (enableDocumentation) [
|
||||
++ lib.optionals isLegacyParser [ bison ]
|
||||
++ lib.optionals enableDocumentation [
|
||||
(lib.getBin lowdown)
|
||||
mdbook
|
||||
mdbook-linkcheck
|
||||
doxygen
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [ util-linuxMinimal ];
|
||||
|
||||
|
@ -145,8 +141,9 @@ let
|
|||
toml11
|
||||
lix-doc
|
||||
]
|
||||
++ lib.optionals (!isLegacyParser) [ pegtl ]
|
||||
++ lib.optionals stdenv.isDarwin [ Security ]
|
||||
++ lib.optionals (stdenv.isx86_64) [ libcpuid ]
|
||||
++ lib.optionals stdenv.isx86_64 [ libcpuid ]
|
||||
++ lib.optionals withLibseccomp [ libseccomp ]
|
||||
++ lib.optionals withAWS [ aws-sdk-cpp ];
|
||||
|
||||
|
@ -156,7 +153,7 @@ let
|
|||
];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs --build tests
|
||||
patchShebangs --build tests doc/manual
|
||||
'';
|
||||
|
||||
preConfigure =
|
||||
|
@ -182,6 +179,7 @@ let
|
|||
|
||||
mesonFlags =
|
||||
[
|
||||
(lib.mesonBool "b_lto" true)
|
||||
(lib.mesonEnable "gc" true)
|
||||
(lib.mesonBool "enable-tests" true)
|
||||
(lib.mesonBool "enable-docs" enableDocumentation)
|
||||
|
@ -203,10 +201,15 @@ let
|
|||
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
|
||||
};
|
||||
|
||||
ninjaFlags = [ "-v" ];
|
||||
|
||||
postInstall =
|
||||
''
|
||||
lib.optionalString enableDocumentation ''
|
||||
mkdir -p $doc/nix-support
|
||||
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 ''
|
||||
mkdir -p $out/nix-support
|
||||
|
@ -222,14 +225,26 @@ let
|
|||
'';
|
||||
|
||||
doCheck = true;
|
||||
mesonCheckFlags = [ "--suite=check" ];
|
||||
mesonCheckFlags = [
|
||||
"--suite=check"
|
||||
"--print-errorlogs"
|
||||
];
|
||||
checkInputs = [
|
||||
gtest
|
||||
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;
|
||||
mesonInstallCheckFlags = [ "--suite=installcheck" ];
|
||||
mesonInstallCheckFlags = [
|
||||
"--suite=installcheck"
|
||||
"--print-errorlogs"
|
||||
];
|
||||
|
||||
preInstallCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
# socket path becomes too long otherwise
|
||||
|
@ -262,7 +277,7 @@ let
|
|||
# point 'nix edit' and ofborg at the file that defines the attribute,
|
||||
# not this common file.
|
||||
pos = builtins.unsafeGetAttrPos "version" args;
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Powerful package manager that makes package management reliable and reproducible";
|
||||
longDescription = ''
|
||||
Lix (a fork of Nix) is a powerful package manager for Linux and other Unix systems that
|
||||
|
@ -272,10 +287,10 @@ let
|
|||
environments.
|
||||
'';
|
||||
homepage = "https://lix.systems";
|
||||
license = licenses.lgpl21Plus;
|
||||
license = lib.licenses.lgpl21Plus;
|
||||
inherit maintainers;
|
||||
platforms = platforms.unix;
|
||||
outputsToInstall = [ "out" ] ++ optional enableDocumentation "man";
|
||||
platforms = lib.platforms.unix;
|
||||
outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man";
|
||||
mainProgram = "nix";
|
||||
broken = enableStatic;
|
||||
};
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{ lib
|
||||
, aws-sdk-cpp
|
||||
, boehmgc
|
||||
, callPackage
|
||||
, fetchFromGitHub
|
||||
, Security
|
||||
, storeDir ? "/nix/store"
|
||||
, stateDir ? "/nix/var"
|
||||
, confDir ? "/etc"
|
||||
, path
|
||||
,
|
||||
{
|
||||
lib,
|
||||
aws-sdk-cpp,
|
||||
boehmgc,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
Security,
|
||||
storeDir ? "/nix/store",
|
||||
stateDir ? "/nix/var",
|
||||
confDir ? "/etc",
|
||||
path,
|
||||
}:
|
||||
let
|
||||
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.override {
|
||||
apis = [
|
||||
|
@ -42,19 +45,23 @@ let
|
|||
stateDir
|
||||
confDir
|
||||
;
|
||||
boehmgc = boehmgc-nix;
|
||||
boehmgc = if needsBoehmgcPatches args.version then boehmgc-nix else boehmgc-nix_2_3;
|
||||
aws-sdk-cpp = aws-sdk-cpp-nix;
|
||||
};
|
||||
in
|
||||
lib.makeExtensible (self: ({
|
||||
lix_2_90 = (
|
||||
common {
|
||||
version = "2.90-beta.1";
|
||||
hash = "sha256-REWlo2RYHfJkxnmZTEJu3Cd/2VM+wjjpPy7Xi4BdDTQ=";
|
||||
docCargoHash = "sha256-oH248kR4Of0MhcY2DYxNX0A+/XJ3L+UuIpBKn3sJt54=";
|
||||
}
|
||||
);
|
||||
lib.makeExtensible (self: {
|
||||
lix_2_90 = common {
|
||||
version = "2.90.0";
|
||||
hash = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc=";
|
||||
docCargoHash = "sha256-vSf9MyD2XzofZlbzsmh6NP69G+LiX72GX4Um9UJp3dc=";
|
||||
};
|
||||
|
||||
latest = self.lix_2_90;
|
||||
stable = self.lix_2_90;
|
||||
}))
|
||||
lix_2_91 = common {
|
||||
version = "2.91.0";
|
||||
hash = "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=";
|
||||
docCargoHash = "sha256-KOn1fXF7k7c/0e5ZCNZwt3YZmjL1oi5A2mhwxQWKaUo=";
|
||||
};
|
||||
|
||||
latest = self.lix_2_91;
|
||||
stable = self.lix_2_91;
|
||||
})
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{ ... }:
|
||||
res: pkgs: super:
|
||||
_: _: pkgs: _:
|
||||
|
||||
with pkgs;
|
||||
{
|
||||
lixVersions = recurseIntoAttrs (callPackage ./. {
|
||||
storeDir = config.nix.storeDir or "/nix/store";
|
||||
stateDir = config.nix.stateDir or "/nix/var";
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
});
|
||||
with pkgs; {
|
||||
lixVersions = recurseIntoAttrs (
|
||||
callPackage ./. {
|
||||
storeDir = config.nix.storeDir or "/nix/store";
|
||||
stateDir = config.nix.stateDir or "/nix/var";
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
}
|
||||
);
|
||||
|
||||
lix = lixVersions.stable;
|
||||
|
||||
|
|
Loading…
Reference in a new issue