Compare commits
1 commit
43d8518d8b
...
bf1c266e30
Author | SHA1 | Date | |
---|---|---|---|
bf1c266e30 |
2 changed files with 59 additions and 39 deletions
41
flake.nix
41
flake.nix
|
@ -15,49 +15,11 @@
|
|||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
default = self.packages.${system}.image;
|
||||
|
||||
glibc = pkgs.stdenv.mkDerivation {
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://gnu/glibc/glibc-2.40.tar.xz";
|
||||
sha256 = "sha256-GaiQF16SY9dI9ieZPeb0sa+c0h4D8IDkv7Oh+sECBaI=";
|
||||
};
|
||||
name = "glibcStandalone";
|
||||
enableParallelBuilding = true;
|
||||
configureFlags = [
|
||||
"--prefix=/"
|
||||
"--libdir=/lib"
|
||||
"--bindir=/bin"
|
||||
"--sysconfdir=/etc"
|
||||
];
|
||||
preConfigure =
|
||||
''
|
||||
export PWD_P=$(type -tP pwd)
|
||||
for i in configure io/ftwtest-sh; do
|
||||
sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
|
||||
done
|
||||
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
|
||||
configureScript="`pwd`/../$sourceRoot/configure"
|
||||
'';
|
||||
nativeBuildInputs = [ pkgs.bison pkgs.python3Minimal];
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
];
|
||||
preInstall = ''
|
||||
export DESTDIR=${placeholder "out"}
|
||||
'';
|
||||
};
|
||||
|
||||
image = pkgs.writeShellScriptBin "image" ''
|
||||
echo "make UKI..."
|
||||
echo ${self.packages.${system}.kernel.kernel}/bzImage
|
||||
|
@ -69,6 +31,7 @@
|
|||
'';
|
||||
|
||||
kernel = pkgs.callPackage ./kernel { };
|
||||
glibc = pkgs.callPackage ./glibc { };
|
||||
mkinitrd = pkgs.writeShellScriptBin "mkinitrd" ''
|
||||
echo "make initrd..."
|
||||
mkdir -p out
|
||||
|
|
57
glibc/default.nix
Normal file
57
glibc/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
fetchurl,
|
||||
pkgs,
|
||||
stdenv,
|
||||
|
||||
...
|
||||
}:
|
||||
let
|
||||
version = "2.40";
|
||||
pname = "glibcStandalone";
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
inherit version;
|
||||
|
||||
pname = pname;
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/glibc/glibc-${version}.tar.xz";
|
||||
sha256 = "sha256-GaiQF16SY9dI9ieZPeb0sa+c0h4D8IDkv7Oh+sECBaI=";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
configureFlags = [
|
||||
"--prefix=/"
|
||||
"--libdir=/lib"
|
||||
"--bindir=/bin"
|
||||
"--sysconfdir=/etc"
|
||||
];
|
||||
|
||||
preConfigure =
|
||||
''
|
||||
export PWD_P=$(type -tP pwd)
|
||||
for i in configure io/ftwtest-sh; do
|
||||
sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
|
||||
done
|
||||
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
|
||||
configureScript="`pwd`/../$sourceRoot/configure"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
bison
|
||||
python3Minimal
|
||||
];
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
];
|
||||
|
||||
preInstall = ''
|
||||
export DESTDIR=${placeholder "out"}
|
||||
'';
|
||||
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue