Skip to content

Commit

Permalink
feat: better support for old glibc
Browse files Browse the repository at this point in the history
Signed-off-by: Yaroslav Bolyukin <[email protected]>
  • Loading branch information
CertainLach committed Jul 2, 2022
1 parent ea95069 commit 1a85e36
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
25 changes: 12 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
description = "VIVE Pro 2 support for linux";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/1316edc465ed7b2d650ba8be6a1a0b129926bd81";
nixpkgs.url = "github:dguibert/nixpkgs/dg/fix-replacestdenv-coreutils";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay/f7d4a3aabee883bfa4d8987a19446ca8f25df81f";
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
Expand All @@ -23,7 +23,8 @@
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlay
rust-overlay.overlays.default
(import ./nix/oldGlibc.nix)
(final: prev:
let
rust = (final.buildPackages.rustChannelOf {
Expand All @@ -46,8 +47,9 @@
};
pkgs-mingw = import nixpkgs {
inherit system;
config.replaceStdenv = import ./nix/oldGlibcStdenv.nix;
overlays = [
rust-overlay.overlay
rust-overlay.overlays.default
(final: prev: {
# inherit rustPlatform;
# https://github.com/NixOS/nixpkgs/issues/149593
Expand Down
21 changes: 21 additions & 0 deletions nix/oldGlibc.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
let nixpkgs-old = builtins.fetchTarball {
name = "release-18.09";
url = "https://github.com/nixos/nixpkgs/archive/925ff360bc33876fdb6ff967470e34ff375ce65e.tar.gz";
sha256 = "1qbmp6x01ika4kdc7bhqawasnpmhyl857ldz25nmq9fsmqm1vl2s";
};
in
self: super:
let
oldPkgs = import nixpkgs-old { system = super.system; };
in
rec {
glibc = oldPkgs.glibc // { pname = "glibc"; };
glibcLocales = oldPkgs.glibcLocales;
glibcIconv = oldPkgs.glibcIconv;
stdenv = super.stdenv // {
overrides = self2: super2: super.stdenv.overrides self2 super2 // {
glibc = glibc;
linuxHeaders = glibc.linuxHeaders;
};
};
}

0 comments on commit 1a85e36

Please sign in to comment.