Skip to content

Commit

Permalink
libresoc: use fetchgit for mirrors of upstream
Browse files Browse the repository at this point in the history
repos mirrored into github.com/Libre-SOC-mirrors from upstream cgit instance.
use `fetchgit` consistently for all these packages: although unidiomatic in
nixpkgs, `fetchgit` is generic compatible fetcher with the upstream Libre-SOC
repos.

see:
https://github.com/jleightcap/ngipkgs/pull/1#discussion_r1583119470

Signed-off-by: Jack Leightcap <[email protected]>
  • Loading branch information
jleightcap committed Apr 29, 2024
1 parent 5847a16 commit 9b4e1b4
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 42 deletions.
7 changes: 4 additions & 3 deletions pkgs/by-name/libresoc/ieee754fpu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
pytest-output-to-files,
}:
with python39Packages;
buildPythonPackage {
pname = "libresoc-ieee754fpu";
buildPythonPackage rec {
name = "libresoc-ieee754fpu";
pname = "ieee754fpu";
version = "unstable-2024-03-31";

# mirror of https://git.libre-soc.org/git/ieee754fpu.git
# use fetchgit instead of fetchFromGitHub so we can use the same hash across original
# upstream repo and GitHub mirror. For some reason with fetchFromGitHub, even with the
# the same rev we are getting a different hash (unlike every other mirrored repo)
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/ieee754fpu.git";
url = "https://github.com/Libre-SOC-mirrors/${pname}.git";
hash = "sha256-Ghbvg2Y4YlmxVEa3EtcvEVai4hC4VU4q+XIQh4pQ7+c=";
rev = "829dfbc53ba38ec17bc544cb0b862e73cee223db"; # HEAD @ version date
};
Expand Down
8 changes: 4 additions & 4 deletions pkgs/by-name/libresoc/libresoc-c4m-jtag.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
lib,
fetchFromGitHub,
fetchgit,
python39,
python39Packages,
nmigen-soc,
nmigen,
}:
python39Packages.buildPythonPackage rec {
name = "c4m-jtag";
pname = "c4m-jtag";
version = "unstable-2024-03-31";
realVersion = "0.3.dev243+g${lib.substring 0 7 src.rev}";

# mirror of https://git.libre-soc.org/git/c4m-jtag.git
src = fetchFromGitHub {
owner = "Libre-SOC-mirrors";
repo = "c4m-jtag";
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/${pname}.git";
rev = "f5322d804e8228a2a5715c77185c60148ff96da8"; # HEAD @ version date
hash = "sha256-0yF/yqcknCq1fre5pnKux4V7guu2oDa6duPO9mU46n8=3";
};
Expand Down
4 changes: 3 additions & 1 deletion pkgs/by-name/libresoc/libresoc-pyelftools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
}:
python39Packages.pyelftools.overrideAttrs (_: rec {
name = "libresoc-pyelftools";
pname = "pyelftools";
version = "v0.30";

src = fetchgit {
url = "https://git.libre-soc.org/git/pyelftools.git";
url = "https://github.com/Libre-SOC-mirrors/${pname}.git";
rev = version;
sha256 = "sha256-A9etnN7G24/Gu8YlV/YDpxZV+TG2eVXGx2ZjVnA9ZD4=";
};
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/libresoc/mdis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
}:
with python39Packages;
buildPythonPackage rec {
pname = "mdis";
name = "mdis";
pname = name;
version = "0.5.1";

src = fetchPypi {
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/libresoc/nmigen-soc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
}:
with python39Packages;
buildPythonPackage rec {
pname = "nmigen-soc";
name = "nmigen-soc";
pname = name;
version = "unstable-2024-03-31";
# python setup.py --version
realVersion = "0.1.dev243+g${lib.substring 0 7 src.rev}";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/libresoc/nmigen.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
}:
with python39Packages;
buildPythonPackage rec {
pname = "nmigen";
name = "nmigen";
pname = name;
version = "unstable-2024-03-31";
realVersion = "0.3.dev243+g${lib.substring 0 7 src.rev}";

Expand Down
12 changes: 6 additions & 6 deletions pkgs/by-name/libresoc/nmutil.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
lib,
fetchFromGitHub,
fetchgit,
python39Packages,
symbiyosys,
yices,
nmigen,
pytest-output-to-files,
}:
with python39Packages;
buildPythonPackage {
pname = "libresoc-nmutil";
buildPythonPackage rec {
name = "libresoc-nmutil";
pname = "nmutil";
version = "unstable-2024-03-31";

# mirror of https://git.libre-soc.org/git/nmutil.git
src = fetchFromGitHub {
owner = "Libre-SOC-mirrors";
repo = "nmutil";
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/${pname}.git";
rev = "4bf2f20bddc057df1597d14e0b990c0b9bdeb10e"; # HEAD @ version date
hash = "sha256-8jXQGO4IeB6WjGtjuHO8UBh9n3ei7LukmRoXSbNJ1vM=";
};
Expand Down
8 changes: 4 additions & 4 deletions pkgs/by-name/libresoc/openpower-isa.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
python39,
python39Packages,
fetchFromGitHub,
fetchgit,
pkgsCross,
writeShellApplication,
gnumake,
Expand All @@ -14,13 +14,13 @@
with python39Packages;
buildPythonPackage rec {
name = "libresoc-openpower-isa";
pname = "openpower-isa";
version = "unstable-2024-03-31";


# mirror of https://git.libre-soc.org/git/openpower-isa.git";
src = fetchFromGitHub {
owner = "Libre-SOC-mirrors";
repo = "openpower-isa";
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/${pname}.git";
rev = "3cb597b99d414dbdb35336eb3734b5d46edd597f"; # HEAD @ version date
hash= "sha256-OKUb3BmVEZD2iRV8sbNEEA7ANJImWX8FEj06o5+HQwU=";
};
Expand Down
10 changes: 5 additions & 5 deletions pkgs/by-name/libresoc/pinmux.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
stdenv,
fetchFromGitHub,
fetchgit,
python39,
}:
stdenv.mkDerivation {
pname = "libresoc-pinmux";
name = "libresoc-pinmux";
pname = "pinmux";
version = "unstable-2024-03-31";

# mirror of https://git.libre-soc.org/git/pinmux.git
src = fetchFromGitHub {
owner = "Libre-SOC-mirrors";
repo = "pinmux";
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/${pname}.git";
rev = "ee6c6c5020f11e7debfd8262ffdb8abd6e1782c"; # HEAD @ version date
hash = "sha256-Tux2RvcRmlpXMsHwve/+5rOyBRSThg9MVW2NGP3ZJxs=";
};
Expand Down
10 changes: 5 additions & 5 deletions pkgs/by-name/libresoc/power-instruction-analyzer.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
python39Packages,
rustPlatform,
fetchFromGitHub,
fetchgit,
}:
with python39Packages;
with rustPlatform;
buildPythonPackage rec {
pname = "power-instruction-analyzer";
name = "power-instruction-analyzer";
pname = name;
version = "0.2.0";
format = "pyproject";


# mirror of https://git.libre-soc.org/git/power-instruction-analyzer.git
src = fetchFromGitHub {
owner = "Libre-SOC-mirrors";
repo = "power-instruction-analyzer";
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/${name}.git";
rev = "v${version}";
hash = "sha256-UmgDykG9yn413PXrMsI4oRblCZdHbtaIZ55p89YPfQs=";
};
Expand Down
10 changes: 5 additions & 5 deletions pkgs/by-name/libresoc/pytest-output-to-files.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
fetchFromGitHub,
fetchgit,
python39Packages,
}:
with python39Packages;
buildPythonPackage {
buildPythonPackage rec {
name = "pytest-output-to-files";
pname = name;
version = "unstable-2024-03-31";

# mirror of https://git.libre-soc.org/git/pytest-output-to-files.git
src = fetchFromGitHub {
owner = "Libre-SOC-mirrors";
repo = "pytest-output-to-files";
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/${name}.git";
rev = "e4d64e643acb1cd6218fc61910ab6266d3da7573"; # HEAD @ version date
hash = "sha256-ES8zZ9s6wGcqw60NoN4tZf/Dq/sBvl+UDYrXuOgfMxI=";
};
Expand Down
11 changes: 5 additions & 6 deletions pkgs/by-name/libresoc/soc.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
python39Packages,
fetchFromGitHub,
fetchgit,
yosys,
libresoc-c4m-jtag,
libresoc-ieee754fpu,
Expand All @@ -10,14 +10,13 @@
pytest-output-to-files,
}:
with python39Packages;
buildPythonPackage {
pname = "soc";
buildPythonPackage rec {
name = "soc";
version = "unstable-2024-03-31";

# mirror of https://git.libre-soc.org/git/soc.git
src = fetchFromGitHub {
owner = "Libre-SOC-mirrors";
repo = "soc";
src = fetchgit {
url = "https://github.com/Libre-SOC-mirrors/${name}.git";
rev = "2a66fe18cd77dd5533c65930d1b241cf6faac455"; # HEAD @ version date
hash = "sha256-yJshQYf8V0CB2vPCmWLlnxXMhi/sPXiLKzOn6cqgmxw=";
fetchSubmodules = false;
Expand Down

0 comments on commit 9b4e1b4

Please sign in to comment.