mirror of
https://github.com/uutils/coreutils.git
synced 2025-07-07 13:35:00 +00:00
flake: drop flake-utils, refactor
This commit is contained in:
parent
854000e394
commit
3b99bc12cc
2 changed files with 44 additions and 59 deletions
22
flake.lock
generated
22
flake.lock
generated
|
@ -1,23 +1,5 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1720633750,
|
||||
|
@ -35,8 +17,8 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
|
|
81
flake.nix
81
flake.nix
|
@ -2,26 +2,29 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
# <https://github.com/nix-systems/nix-systems>
|
||||
systems.url = "github:nix-systems/default";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
libselinuxPath = with pkgs;
|
||||
lib.makeLibraryPath [
|
||||
libselinux
|
||||
];
|
||||
libaclPath = with pkgs;
|
||||
lib.makeLibraryPath [
|
||||
acl
|
||||
];
|
||||
outputs = inputs: let
|
||||
inherit (inputs.nixpkgs) lib legacyPackages;
|
||||
eachSystem = lib.genAttrs (import inputs.systems);
|
||||
pkgsFor = legacyPackages;
|
||||
in {
|
||||
devShells = eachSystem (
|
||||
system: let
|
||||
libselinuxPath = with pkgsFor.${system};
|
||||
lib.makeLibraryPath [
|
||||
libselinux
|
||||
];
|
||||
|
||||
build_deps = with pkgs; [
|
||||
libaclPath = with pkgsFor.${system};
|
||||
lib.makeLibraryPath [
|
||||
acl
|
||||
];
|
||||
|
||||
build_deps = with pkgsFor.${system}; [
|
||||
clang
|
||||
llvmPackages.bintools
|
||||
rustup
|
||||
|
@ -31,7 +34,8 @@
|
|||
# debugging
|
||||
gdb
|
||||
];
|
||||
gnu_testing_deps = with pkgs; [
|
||||
|
||||
gnu_testing_deps = with pkgsFor.${system}; [
|
||||
autoconf
|
||||
automake
|
||||
bison
|
||||
|
@ -40,32 +44,31 @@
|
|||
gettext
|
||||
texinfo
|
||||
];
|
||||
in {
|
||||
devShell = pkgs.mkShell {
|
||||
buildInputs = build_deps ++ gnu_testing_deps;
|
||||
in {
|
||||
default = pkgsFor.${system}.pkgs.mkShell {
|
||||
packages = build_deps ++ gnu_testing_deps;
|
||||
|
||||
RUSTC_VERSION = "1.75";
|
||||
LIBCLANG_PATH = pkgs.lib.makeLibraryPath [pkgs.llvmPackages_latest.libclang.lib];
|
||||
shellHook = ''
|
||||
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
|
||||
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
|
||||
'';
|
||||
RUSTC_VERSION = "1.75";
|
||||
LIBCLANG_PATH = pkgsFor.${system}.lib.makeLibraryPath [pkgsFor.${system}.llvmPackages_latest.libclang.lib];
|
||||
shellHook = ''
|
||||
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
|
||||
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
|
||||
'';
|
||||
|
||||
SELINUX_INCLUDE_DIR = ''${pkgs.libselinux.dev}/include'';
|
||||
SELINUX_LIB_DIR = libselinuxPath;
|
||||
SELINUX_STATIC = "0";
|
||||
SELINUX_INCLUDE_DIR = ''${pkgsFor.${system}.libselinux.dev}/include'';
|
||||
SELINUX_LIB_DIR = libselinuxPath;
|
||||
SELINUX_STATIC = "0";
|
||||
|
||||
# Necessary to build GNU.
|
||||
LDFLAGS = ''-L ${libselinuxPath} -L ${libaclPath}'';
|
||||
# Necessary to build GNU.
|
||||
LDFLAGS = ''-L ${libselinuxPath} -L ${libaclPath}'';
|
||||
|
||||
# Add precompiled library to rustc search path
|
||||
RUSTFLAGS =
|
||||
(builtins.map (a: ''-L ${a}/lib'') [
|
||||
])
|
||||
++ [
|
||||
# Add precompiled library to rustc search path
|
||||
RUSTFLAGS = [
|
||||
''-L ${libselinuxPath}''
|
||||
''-L ${libaclPath}''
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue