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

Remove uf2conv Python propagated input #60

Merged
merged 2 commits into from
Sep 26, 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
6 changes: 1 addition & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,5 @@
formatter = pkgs.alejandra;
});
in
# Recursive-merge attrsets to compose the final flake outputs attrset.
builtins.foldl' nixpkgs.lib.attrsets.recursiveUpdate {} [
no_system_outputs
all_system_outputs
];
no_system_outputs // all_system_outputs;
}
5 changes: 1 addition & 4 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
pkgs,
inputs,
...
}:
rec {
}: rec {
ncurses5-fhs = pkgs.callPackage ./ncurses5-fhs.nix {};
fpga-udev-rules = pkgs.callPackage ./fpga-udev-rules {};

Expand All @@ -30,8 +29,6 @@ rec {
veridian = pkgs.callPackage ./veridian/default.nix {inherit sv-lang_6;};

riscv64-gcc = pkgs.pkgsCross.riscv64.buildPackages.gcc;
}
// pkgs.lib.optionalAttrs (pkgs.system == "x86_64-linux") {
lowrisc-toolchain-gcc-rv32imcb = pkgs.callPackage ./lowrisc-toolchain-gcc-rv32imcb.nix {};
lowrisc-toolchain-gcc-rv64imac = pkgs.callPackage ./lowrisc-toolchain-gcc-rv64imac.nix {};
}
4 changes: 4 additions & 0 deletions pkgs/lowrisc-toolchain-gcc-rv32imcb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ stdenv.mkDerivation rec {
patchelf --set-rpath ${lib.makeLibraryPath ["$out" stdenv.cc.cc ncurses5]} "$f" || true
done
'';

meta = {
platforms = ["x86_64-linux"];
};
}
4 changes: 4 additions & 0 deletions pkgs/lowrisc-toolchain-gcc-rv64imac.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ stdenv.mkDerivation rec {
patchelf --set-rpath ${lib.makeLibraryPath ["$out" stdenv.cc.cc ncurses5]} "$f" || true
done
'';

meta = {
platforms = ["x86_64-linux"];
};
}
1 change: 1 addition & 0 deletions pkgs/sv-lang.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ in
license = licenses.mit;
maintainers = with maintainers; [sharzy];
mainProgram = "slang";
broken = stdenv.system == "x86_64-darwin";
platforms = platforms.all;
};
}
42 changes: 27 additions & 15 deletions pkgs/uf2conv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,32 @@
{
python3Packages,
fetchFromGitHub,
stdenv,
lib,
}:
python3Packages.buildPythonPackage rec {
name = "uf2conv";
version = "0.0.1";
src = fetchFromGitHub {
owner = "makerdiary";
repo = "uf2utils";
rev = "61d9f3ff4913461b9813e666cce62b022652144a";
hash = "sha256-3mXOvzkHmTV0k8qoy2k5TGBFX2l9EgPuaZPLyTdBHzQ=";
}: let
app = python3Packages.buildPythonApplication rec {
name = "uf2conv";
version = "0.0.1";
src = fetchFromGitHub {
owner = "makerdiary";
repo = "uf2utils";
rev = "61d9f3ff4913461b9813e666cce62b022652144a";
hash = "sha256-3mXOvzkHmTV0k8qoy2k5TGBFX2l9EgPuaZPLyTdBHzQ=";
};
meta = {
description = "uf2conv is an open source Python based tool for packing and unpacking UF2 files.";
homepage = "https://github.com/makerdiary/uf2utils";
license = lib.licenses.mit;
};
};
meta = {
description = "uf2conv is an open source Python based tool for packing and unpacking UF2 files.";
homepage = "https://github.com/makerdiary/uf2utils";
license = lib.licenses.mit;
};
}
in
# `buildPythonApplication` sets `propagatedBuildInputs` which in turn pulls Python into path
# when used in `mkShell`. Launder it through custom derivation to remove it.
stdenv.mkDerivation {
inherit (app) name version meta;
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
ln -s ${app}/bin/uf2conv $out/bin
'';
}