Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix update and cleanups #83

Merged
merged 6 commits into from
Jan 4, 2024
Merged
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
15 changes: 0 additions & 15 deletions dependencies/edalize.nix

This file was deleted.

44 changes: 4 additions & 40 deletions dependencies/flake.lock

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

164 changes: 73 additions & 91 deletions dependencies/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,85 @@
description = "ibex simple_system dependencies";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
lowrisc_fusesoc_src = { url = "github:lowRISC/fusesoc?ref=ot-0.2"; flake = false; };
lowrisc_edalize_src = { url = "github:lowRISC/edalize?ref=ot-0.2"; flake = false; };
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
};

outputs = {self, nixpkgs,
lowrisc_fusesoc_src, lowrisc_edalize_src,
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {allowUnfree = true;};
};

lowRISC_python_overrides = pfinal: pprev: {
fusesoc = pprev.fusesoc.overridePythonAttrs (oldAttrs: {
version = "0.3.3.dev";
src = lowrisc_fusesoc_src;
});
edalize = pprev.edalize.overridePythonAttrs (oldAttrs: {
version = "0.3.3.dev";
src = lowrisc_edalize_src;
});
};
lowRISC_spike_override = final: prev: {
riscv-isa-sim = prev.riscv-isa-sim.overrideAttrs (oldAttrs: rec {
version = "ibex-cosim-v0.3";
src = pkgs.fetchFromGitHub {
owner = "lowrisc";
repo = oldAttrs.pname;
rev = version;
sha256 = "sha256-pKuOpzybOI8UqWV1TSFq4hqTHf7Bft/3WL19fRpwmfU=";
};
});
};

lowRISC_spike_override = final: prev: {
riscv-isa-sim = prev.riscv-isa-sim.overrideAttrs (oldAttrs: rec {
version = "ibex-cosim-v0.3";
src = pkgs.fetchFromGitHub {
owner = "lowrisc";
repo = oldAttrs.pname;
rev = version;
sha256 = "sha256-pKuOpzybOI8UqWV1TSFq4hqTHf7Bft/3WL19fRpwmfU=";
};
});
};
# Using requireFile prevents rehashing each time.
# This saves much seconds during rebuilds.
vivado_bundled_installer_src = pkgs.requireFile rec {
name = "vivado_bundled.tar.gz";
sha256 = "1yxx6crvawhzvary9js0m8bzm35vv6pzfqdkv095r84lb13fyp7b";
# Print the following message if the name / hash are not
# found in the store.
message = ''
requireFile :
file/dir not found in /nix/store
file = ${name}
hash = ${sha256}

# Using requireFile prevents rehashing each time.
# This saves much seconds during rebuilds.
vivado_bundled_installer_src = pkgs.requireFile rec {
name = "vivado_bundled.tar.gz";
sha256 = "1yxx6crvawhzvary9js0m8bzm35vv6pzfqdkv095r84lb13fyp7b";
# Print the following message if the name / hash are not
# found in the store.
message = ''
requireFile :
file/dir not found in /nix/store
file = ${name}
hash = ${sha256}
This nix expression requires that ${name} is already part of the store.
- Login to xilinx.com
- Download Unified Installer from https://www.xilinx.com/support/download.html,
- Run installer, specify a 'Download Image (Install Seperately)'
- Gzip the bundled installed image directory
- Rename the file to ${name}
- Add it to the nix store with
nix-prefetch-url --type sha256 file:/path/to/${name}
- Change the sha256 key above to $HASH
'';
};

This nix expression requires that ${name} is already part of the store.
- Login to xilinx.com
- Download Unified Installer from https://www.xilinx.com/support/download.html,
- Run installer, specify a 'Download Image (Install Seperately)'
- Gzip the bundled installed image directory
- Rename the file to ${name}
- Add it to the nix store with
nix-prefetch-url --type sha256 file:/path/to/${name}
- Change the sha256 key above to $HASH
vivado = pkgs.callPackage (import ./vivado.nix) {
# We need to prepare the pre-downloaded installer to
# execute within a nix build. Make use of the included java deps,
# but we still need to do a little patching to make it work.
vivado-src = pkgs.stdenv.mkDerivation rec {
pname = "vivado_src";
version = "2022.2";
src = vivado_bundled_installer_src;
postPatch = ''
patchShebangs .
patchelf \
--set-interpreter $(cat ${pkgs.stdenv.cc}/nix-support/dynamic-linker) \
tps/lnx64/jre*/bin/java
'';
dontBuild = true;
dontFixup = true;
installPhase = ''
mkdir -p $out
cp -R * $out
'';
};

vivado = pkgs.callPackage (import ./vivado.nix) {
# We need to prepare the pre-downloaded installer to
# execute within a nix build. Make use of the included java deps,
# but we still need to do a little patching to make it work.
vivado-src = pkgs.stdenv.mkDerivation rec {
pname = "vivado_src";
version = "2022.2";
src = vivado_bundled_installer_src;
postPatch = ''
patchShebangs .
patchelf \
--set-interpreter $(cat ${pkgs.stdenv.cc}/nix-support/dynamic-linker) \
tps/lnx64/jre*/bin/java
'';
dontBuild = true; dontFixup = true;
installPhase = ''
mkdir -p $out
cp -R * $out
'';
};
};

in
{
overlay_pkgs = pkgs.lib.composeManyExtensions [
(import ./overlay.nix)
lowRISC_spike_override
(final: prev: {
inherit vivado;
})
];
overlay_python = pkgs.lib.composeManyExtensions [
(import ./python-overlay.nix)
lowRISC_python_overrides
];
};
};
in {
overlay_pkgs = pkgs.lib.composeManyExtensions [
(import ./overlay.nix)
lowRISC_spike_override
(final: prev: {
inherit vivado;
})
];
};
}
15 changes: 0 additions & 15 deletions dependencies/fusesoc.nix

This file was deleted.

12 changes: 0 additions & 12 deletions dependencies/ipyxact.nix

This file was deleted.

12 changes: 0 additions & 12 deletions dependencies/okonomiyaki.nix

This file was deleted.

1 change: 0 additions & 1 deletion dependencies/overlay.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
final: prev: {
riscv-gcc-toolchain-lowrisc = prev.callPackage ./riscv-gcc-toolchain-lowrisc.nix {};
riscv-isa-sim = prev.callPackage ./riscv-isa-sim.nix {};
}
8 changes: 0 additions & 8 deletions dependencies/python-overlay.nix

This file was deleted.

32 changes: 0 additions & 32 deletions dependencies/riscv-gcc-toolchain-lowrisc.nix

This file was deleted.

18 changes: 10 additions & 8 deletions dependencies/riscv-isa-sim.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{ lib, stdenv, fetchFromGitHub,
dtc
{
lib,
stdenv,
fetchFromGitHub,
dtc,
}:

stdenv.mkDerivation rec {
name = "spike";
pname = "riscv-isa-sim";
Expand All @@ -16,17 +18,17 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;
# buildInputs = [ ];
nativeBuildInputs = [ dtc ];
configureFlags = [ "--enable-commitlog" "--enable-misaligned" ];
nativeBuildInputs = [dtc];
configureFlags = ["--enable-commitlog" "--enable-misaligned"];

doCheck = false;
dontInstall = false;

meta = with lib; {
description = "Riscv golden-reference simulator Spike";
homepage = "https://github.com/riscv-software-src/riscv-isa-sim";
license = with licenses; [];
platforms = platforms.unix;
homepage = "https://github.com/riscv-software-src/riscv-isa-sim";
license = with licenses; [];
platforms = platforms.unix;
maintainers = with maintainers; [];
};
}
Loading