Merge pull request #298667 from anthonyroussel/upgrade/facter

facter: 3.14.17 -> 4.6.1
This commit is contained in:
Mario Rodas 2024-04-15 07:57:08 -05:00 committed by GitHub
commit 48e4597e52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 121 additions and 41 deletions

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem "facter"

View File

@ -0,0 +1,17 @@
GEM
remote: https://rubygems.org/
specs:
facter (4.6.1)
hocon (~> 1.3)
thor (>= 1.0.1, < 2.0)
hocon (1.4.0)
thor (1.3.1)
PLATFORMS
ruby
DEPENDENCIES
facter
BUNDLED WITH
2.5.6

View File

@ -0,0 +1,33 @@
{
facter = {
dependencies = ["hocon" "thor"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0pxpldfcf40dr9khra3sa131ij7gzd97bba2vpw89c785pl736a7";
type = "gem";
};
version = "4.6.1";
};
hocon = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "106dmzsl1bxkqw5xaif012nwwfr3k9wff32cqc77ibjngknj6477";
type = "gem";
};
version = "1.4.0";
};
thor = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1vq1fjp45az9hfp6fxljhdrkv75cvbab1jfrwcw738pnsiqk8zps";
type = "gem";
};
version = "1.3.1";
};
}

View File

@ -0,0 +1,66 @@
{
bundlerApp,
bundlerUpdateScript,
coreutils,
facter,
gnugrep,
iproute2,
lib,
makeWrapper,
nettools,
pciutils,
procps,
stdenv,
testers,
util-linux,
virt-what,
zfs,
}:
bundlerApp {
pname = "facter";
gemdir = ./.;
exes = [ "facter" ];
nativeBuildInputs = [ makeWrapper ];
postBuild =
let
runtimeDependencies =
[
coreutils
gnugrep
nettools
pciutils
procps
util-linux
]
++ lib.optionals stdenv.isLinux [
iproute2
virt-what
zfs
];
in
''
wrapProgram $out/bin/facter --prefix PATH : ${lib.makeBinPath runtimeDependencies}
'';
passthru = {
tests.version = testers.testVersion {
command = "${lib.getExe facter} --version";
package = facter;
version = (import ./gemset.nix).facter.version;
};
updateScript = bundlerUpdateScript "facter";
};
meta = {
changelog = "https://www.puppet.com/docs/puppet/latest/release_notes_facter.html";
description = "A system inventory tool";
homepage = "https://github.com/puppetlabs/facter";
license = lib.licenses.asl20;
mainProgram = "facter";
maintainers = with lib.maintainers; [ womfoo anthonyroussel ];
platforms = lib.platforms.unix;
};
}

View File

@ -1,39 +0,0 @@
{ lib, stdenv, fetchFromGitHub, boost, cmake, cpp-hocon, curl, leatherman, libwhereami, yaml-cpp, openssl, ruby, util-linux }:
stdenv.mkDerivation rec {
pname = "facter";
version = "3.14.17";
src = fetchFromGitHub {
sha256 = "sha256-RvsUt1DyN8Xr+Xtz84mbKlDwxLewgK6qklYVdQHu6q0=";
rev = version;
repo = pname;
owner = "puppetlabs";
};
postPatch = ''
sed '1i#include <array>' -i lib/src/facts/glib/load_average_resolver.cc # gcc12
'';
CXXFLAGS = lib.optionalString stdenv.cc.isGNU "-fpermissive -Wno-error=catch-value";
NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lblkid";
cmakeFlags = [
"-DFACTER_RUBY=${ruby}/lib/libruby${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DRUBY_LIB_INSTALL=${placeholder "out"}/lib/ruby"
];
env.NIX_CFLAGS_COMPILE = "-Wno-error";
nativeBuildInputs = [ cmake ];
buildInputs = [ boost cpp-hocon curl leatherman libwhereami yaml-cpp openssl ruby util-linux ];
meta = with lib; {
homepage = "https://github.com/puppetlabs/facter";
description = "A system inventory tool";
license = licenses.asl20;
maintainers = [ maintainers.womfoo ];
platforms = platforms.unix;
mainProgram = "facter";
};
}

View File

@ -5249,8 +5249,6 @@ with pkgs;
facedetect = callPackage ../tools/graphics/facedetect { };
facter = callPackage ../tools/system/facter { };
faketty = callPackage ../tools/misc/faketty { };
fasd = callPackage ../tools/misc/fasd { };