Skip to content

Commit 1a85e36

Browse files
committed
feat: better support for old glibc
Signed-off-by: Yaroslav Bolyukin <[email protected]>
1 parent ea95069 commit 1a85e36

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

flake.lock

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
description = "VIVE Pro 2 support for linux";
33
inputs = {
4-
nixpkgs.url = "github:nixos/nixpkgs/1316edc465ed7b2d650ba8be6a1a0b129926bd81";
4+
nixpkgs.url = "github:dguibert/nixpkgs/dg/fix-replacestdenv-coreutils";
55
flake-utils.url = "github:numtide/flake-utils";
66
rust-overlay = {
7-
url = "github:oxalica/rust-overlay/f7d4a3aabee883bfa4d8987a19446ca8f25df81f";
7+
url = "github:oxalica/rust-overlay";
88
inputs = {
99
nixpkgs.follows = "nixpkgs";
1010
flake-utils.follows = "flake-utils";
@@ -23,7 +23,8 @@
2323
pkgs = import nixpkgs {
2424
inherit system;
2525
overlays = [
26-
rust-overlay.overlay
26+
rust-overlay.overlays.default
27+
(import ./nix/oldGlibc.nix)
2728
(final: prev:
2829
let
2930
rust = (final.buildPackages.rustChannelOf {
@@ -46,8 +47,9 @@
4647
};
4748
pkgs-mingw = import nixpkgs {
4849
inherit system;
50+
config.replaceStdenv = import ./nix/oldGlibcStdenv.nix;
4951
overlays = [
50-
rust-overlay.overlay
52+
rust-overlay.overlays.default
5153
(final: prev: {
5254
# inherit rustPlatform;
5355
# https://github.com/NixOS/nixpkgs/issues/149593

nix/oldGlibc.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
let nixpkgs-old = builtins.fetchTarball {
2+
name = "release-18.09";
3+
url = "https://github.com/nixos/nixpkgs/archive/925ff360bc33876fdb6ff967470e34ff375ce65e.tar.gz";
4+
sha256 = "1qbmp6x01ika4kdc7bhqawasnpmhyl857ldz25nmq9fsmqm1vl2s";
5+
};
6+
in
7+
self: super:
8+
let
9+
oldPkgs = import nixpkgs-old { system = super.system; };
10+
in
11+
rec {
12+
glibc = oldPkgs.glibc // { pname = "glibc"; };
13+
glibcLocales = oldPkgs.glibcLocales;
14+
glibcIconv = oldPkgs.glibcIconv;
15+
stdenv = super.stdenv // {
16+
overrides = self2: super2: super.stdenv.overrides self2 super2 // {
17+
glibc = glibc;
18+
linuxHeaders = glibc.linuxHeaders;
19+
};
20+
};
21+
}

0 commit comments

Comments
 (0)