Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pkgs/os-specific/redox-os/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
makeScopeWithSplicing',
generateSplicesForMkScope,
}:

let
otherSplices = generateSplicesForMkScope "redox-os";
in
makeScopeWithSplicing' {
inherit otherSplices;
f =
self:
let
callPackage = self.callPackage;
in
{
libc = callPackage ./relibc { };
};
}
69 changes: 69 additions & 0 deletions pkgs/os-specific/redox-os/relibc/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
lib,
rustPlatform,
rust-cbindgen,
expect,
stdenv,
fetchFromGitLab,
}:
rustPlatform.buildRustPackage {
pname = "relibc";
version = "0.2.5";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version = "0.2.5";
version = "0.2.5-unstable-2025-12-29";


src = fetchFromGitLab {
owner = "redox-os";
repo = "relibc";
rev = "0e506e97af6a834386cc424f0cb500866a3d658d";
hash = "sha256-1+1c0RrjtQqaY1Fy/5MgM5tYvd4Sbj+vxJvdhDzi95Q=";
fetchSubmodules = true;
domain = "gitlab.redox-os.org";
};

cargoHash = "sha256-2NdfPp4ndfE3y+CQ6eTG/gy7HrSDC6QW2C1BiP8uDFI=";

RUSTC_BOOTSTRAP = 1;
TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;

# error: Usage of `RUSTC_WORKSPACE_WRAPPER` requires `-Z unstable-options`
auditable = false;

doCheck = false;
patchPhase = ''
runHook prePatch

patchShebangs --build renamesyms.sh stripcore.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in postPatch instead, as setting patchPhase means the patches attribute won't be applied (although none are set here in the pcakage right now, they could be set through overrideAttrs)


runHook postPatch
'';

buildPhase = ''
runHook preBuild

make CC=gcc AR=ar LD=ld NM=nm CARGO_COMMON_FLAGS="" all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as for the install phase


runHook postBuild
'';

installPhase = ''
runHook preInstall

mkdir -p $out
DESTDIR=$out make CC=gcc AR=ar LD=ld NM=nm install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these all set by the stdenv already? (except DESTDIR)


runHook postInstall
'';

nativeBuildInputs = [
rust-cbindgen
expect
];

meta = {
homepage = "https://gitlab.redox-os.org/redox-os/relibc";
description = "C Library in Rust for Redox and Linux";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.eveeifyeve ];
platforms = lib.platforms.redox ++ lib.platforms.linux;
teams = [ lib.teams.redox ];
};
}
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7025,7 +7025,7 @@ with pkgs;
else if libc == "wasilibc" then
wasilibc
else if libc == "relibc" then
relibc
redox.libc
else if libc == "llvm" then
llvmPackages_20.libc
else
Expand Down Expand Up @@ -9845,6 +9845,8 @@ with pkgs;
raspberrypifw = callPackage ../os-specific/linux/firmware/raspberrypi { };
raspberrypi-armstubs = callPackage ../os-specific/linux/firmware/raspberrypi/armstubs.nix { };

redox = recurseIntoAttrs (callPackages ../os-specific/redox-os { });

rfkill_udev = callPackage ../os-specific/linux/rfkill/udev.nix { };

sgx-sdk = callPackage ../os-specific/linux/sgx/sdk { };
Expand Down
Loading