treewide: name -> pname where possible

Changes "name = '...-${version}" -> "pname = '...'" syntax everywhere
that is easy.
This matches current best nixpkgs convention.
The nixpkgs standard derivation will convert this to name =
"${pname}-${version}" automatically.
This also has the added benefit of adding the version to the filepath
for several packages that didn't have it before.

The only remaining files are ./artiq-full/extras.nix &
./artiq-fast/pkgs/python-deps.nix.
extras.nix had a
semi-confusing function that I didn't want to mess with.
This commit is contained in:
Drew Risinger 2020-12-14 20:30:21 -05:00 committed by Sebastien Bourdeauducq
parent beb99234fe
commit ca28925120
10 changed files with 44 additions and 32 deletions

View File

@ -44,7 +44,8 @@ let
condaNoarch = { condaNoarch = {
conda-pythonparser = import ./conda/build.nix { inherit pkgs; } { conda-pythonparser = import ./conda/build.nix { inherit pkgs; } {
name = "conda-pythonparser"; pname = "conda-pythonparser";
inherit (pythonDeps.pythonparser) version;
src = import ./conda/fake-source.nix { inherit pkgs; } { src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "pythonparser"; name = "pythonparser";
inherit (pythonDeps.pythonparser) version src; inherit (pythonDeps.pythonparser) version src;
@ -53,7 +54,8 @@ let
}; };
}; };
conda-sipyco = import ./conda/build.nix { inherit pkgs; } { conda-sipyco = import ./conda/build.nix { inherit pkgs; } {
name = "conda-sipyco"; pname = "conda-sipyco";
inherit (pythonDeps.sipyco) version;
src = import ./conda/fake-source.nix { inherit pkgs; } { src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "sipyco"; name = "sipyco";
inherit (pythonDeps.sipyco) version src; inherit (pythonDeps.sipyco) version src;
@ -61,14 +63,16 @@ let
}; };
}; };
conda-quamash = import ./conda/build.nix { inherit pkgs; } { conda-quamash = import ./conda/build.nix { inherit pkgs; } {
name = "conda-quamash"; pname = "conda-quamash";
inherit (pkgs.python3Packages.quamash) version;
src = import ./conda/fake-source.nix { inherit pkgs; } { src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "quamash"; name = "quamash";
inherit (pkgs.python3Packages.quamash) version src; inherit (pkgs.python3Packages.quamash) version src;
}; };
}; };
conda-qasync = import ./conda/build.nix { inherit pkgs; } { conda-qasync = import ./conda/build.nix { inherit pkgs; } {
name = "conda-qasync"; pname = "conda-qasync";
inherit (pythonDeps.qasync) version;
src = import ./conda/fake-source.nix { inherit pkgs; } { src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "qasync"; name = "qasync";
inherit (pythonDeps.qasync) version src; inherit (pythonDeps.qasync) version src;
@ -80,7 +84,8 @@ let
}; };
conda-artiq = import ./conda/artiq.nix { inherit pkgs; }; conda-artiq = import ./conda/artiq.nix { inherit pkgs; };
conda-asyncserial = import ./conda/build.nix { inherit pkgs; } { conda-asyncserial = import ./conda/build.nix { inherit pkgs; } {
name = "conda-asyncserial"; pname = "conda-asyncserial";
inherit (pythonDeps.asyncserial) version;
src = import ./conda/fake-source.nix { inherit pkgs; } { src = import ./conda/fake-source.nix { inherit pkgs; } {
name = "asyncserial"; name = "asyncserial";
inherit (pythonDeps.asyncserial) version src; inherit (pythonDeps.asyncserial) version src;

View File

@ -1,7 +1,7 @@
{ stdenv, lib, pythonDeps, fetchgit, git, python3Packages, qt5, binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }: { stdenv, lib, pythonDeps, fetchgit, git, python3Packages, qt5, binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }:
python3Packages.buildPythonPackage rec { python3Packages.buildPythonPackage rec {
name = "artiq-${version}"; pname = "artiq";
version = import ./artiq-version.nix { inherit stdenv fetchgit git; }; version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; }; src = import ./artiq-src.nix { inherit fetchgit; };

View File

@ -1,6 +1,6 @@
{ stdenv, fetchgit, git, rustc }: { stdenv, fetchgit, git, rustc }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libartiq-support-${version}"; pname = "libartiq-support";
version = import ./artiq-version.nix { inherit stdenv fetchgit git; }; version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; }; src = import ./artiq-src.nix { inherit fetchgit; };

View File

@ -25,10 +25,10 @@ let
''; '';
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "llvm-or1k"; pname = "llvm-or1k";
version = "6.0.0";
passthru.llvm-src = llvm-src; passthru.llvm-src = llvm-src;
src = llvm-clang-src; src = llvm-clang-src;
version = "6.0.0";
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind; buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind;

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }: { stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }:
python3Packages.buildPythonPackage rec { python3Packages.buildPythonPackage rec {
name = "llvmlite-artiq"; pname = "llvmlite-artiq";
version = "0.23.0.dev"; version = "0.23.0.dev";
src = fetchFromGitHub { src = fetchFromGitHub {
rev = "158f9d3a898dbf055ca513d69505df288c681fea"; rev = "158f9d3a898dbf055ca513d69505df288c681fea";

View File

@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, autoreconfHook, libftdi, libusb1, pkgconfig, hidapi }: { stdenv, fetchFromGitHub, autoreconfHook, libftdi, libusb1, pkgconfig, hidapi }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "openocd-mlabs-${version}"; pname = "openocd-mlabs";
version = "0.10.0"; version = "0.10.0";
src = fetchFromGitHub { src = fetchFromGitHub {

View File

@ -3,7 +3,7 @@
rec { rec {
# User dependencies # User dependencies
sipyco = python3Packages.buildPythonPackage rec { sipyco = python3Packages.buildPythonPackage rec {
name = "sipyco"; pname = "sipyco";
version = "1.1"; version = "1.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
@ -15,7 +15,7 @@ rec {
}; };
asyncserial = python3Packages.buildPythonPackage rec { asyncserial = python3Packages.buildPythonPackage rec {
name = "asyncserial"; pname = "asyncserial";
version = "0.1"; version = "0.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
@ -27,7 +27,7 @@ rec {
}; };
pythonparser = python3Packages.buildPythonPackage rec { pythonparser = python3Packages.buildPythonPackage rec {
name = "pythonparser"; pname = "pythonparser";
version = "1.3"; version = "1.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
@ -40,7 +40,7 @@ rec {
}; };
pyqtgraph-qt5 = python3Packages.buildPythonPackage rec { pyqtgraph-qt5 = python3Packages.buildPythonPackage rec {
name = "pyqtgraph_qt5-${version}"; pname = "pyqtgraph_qt5";
version = "0.11.0"; version = "0.11.0";
doCheck = false; doCheck = false;
pythonImportsCheck = [ "pyqtgraph" ]; pythonImportsCheck = [ "pyqtgraph" ];
@ -74,7 +74,8 @@ rec {
# Development/firmware dependencies # Development/firmware dependencies
artiq-netboot = python3Packages.buildPythonPackage rec { artiq-netboot = python3Packages.buildPythonPackage rec {
name = "artiq-netboot"; pname = "artiq-netboot";
version = "unstable-2020-10-15";
src = fetchgit { src = fetchgit {
url = "https://git.m-labs.hk/m-labs/artiq-netboot.git"; url = "https://git.m-labs.hk/m-labs/artiq-netboot.git";
@ -84,8 +85,9 @@ rec {
}; };
misoc = python3Packages.buildPythonPackage { misoc = python3Packages.buildPythonPackage {
name = "misoc"; pname = "misoc";
version = if misoc-new then "unstable-2020-10-06" else "unstable-2020-05-29";
src = if misoc-new src = if misoc-new
then (fetchFromGitHub { then (fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
@ -104,7 +106,7 @@ rec {
# TODO: fix misoc bitrot and re-enable tests # TODO: fix misoc bitrot and re-enable tests
doCheck = false; doCheck = false;
propagatedBuildInputs = with python3Packages; [ pyserial jinja2 numpy asyncserial migen ]; propagatedBuildInputs = with python3Packages; [ pyserial jinja2 numpy asyncserial migen ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
@ -116,7 +118,8 @@ rec {
}; };
migen = python3Packages.buildPythonPackage rec { migen = python3Packages.buildPythonPackage rec {
name = "migen"; pname = "migen";
version = "unstable-2020-11-11";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
@ -136,7 +139,8 @@ rec {
}; };
microscope = python3Packages.buildPythonPackage rec { microscope = python3Packages.buildPythonPackage rec {
name = "microscope"; pname = "microscope";
version = "unstable-2019-05-17";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
@ -156,7 +160,8 @@ rec {
}; };
jesd204b = python3Packages.buildPythonPackage rec { jesd204b = python3Packages.buildPythonPackage rec {
name = "jesd204b"; pname = "jesd204b";
version = "0.11";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
@ -193,7 +198,8 @@ rec {
}; };
ramda = python3Packages.buildPythonPackage { ramda = python3Packages.buildPythonPackage {
name = "ramda"; pname = "ramda";
version = "unstable-2019-02-01";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "peteut"; owner = "peteut";
@ -221,7 +227,8 @@ rec {
}; };
migen-axi = python3Packages.buildPythonPackage { migen-axi = python3Packages.buildPythonPackage {
name = "migen-axi"; pname = "migen-axi";
version = "unstable-2020-11-11";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "peteut"; owner = "peteut";

View File

@ -7,7 +7,7 @@ rustPlatform.buildRustPackage rec {
# Note: we can't build cargo 1.28.0 because rustc tightened the borrow checker rules and broke # Note: we can't build cargo 1.28.0 because rustc tightened the borrow checker rules and broke
# backward compatibility, which affects old cargo versions. # backward compatibility, which affects old cargo versions.
# There are also issues with asm/llvm_asm with recent rustc and cargo versions prior to 1.39. # There are also issues with asm/llvm_asm with recent rustc and cargo versions prior to 1.39.
name = "cargo-${version}"; pname = "cargo";
version = "1.39.0"; version = "1.39.0";
src = fetchurl { src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-1.39.0-src.tar.gz"; url = "https://static.rust-lang.org/dist/rustc-1.39.0-src.tar.gz";

View File

@ -26,7 +26,7 @@ let
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "rustc-${version}"; pname = "rustc";
inherit version; inherit version;
inherit src; inherit src;

View File

@ -4,12 +4,12 @@ let
ise = import ./ise.nix { inherit pkgs; }; ise = import ./ise.nix { inherit pkgs; };
vivado = import ../artiq-fast/vivado.nix { inherit pkgs; }; vivado = import ../artiq-fast/vivado.nix { inherit pkgs; };
buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation { buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "urukul-cpld-${version}"; pname = "urukul-cpld";
inherit src; inherit src version;
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise); buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"]; phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/urukul_impl.py"; buildPhase = "python $src/urukul_impl.py";
installPhase = installPhase =
'' ''
mkdir -p $out $out/nix-support mkdir -p $out $out/nix-support
cp build/urukul.jed $out cp build/urukul.jed $out
@ -17,12 +17,12 @@ let
''; '';
}; };
buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation { buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation {
name = "mirny-cpld-${version}"; pname = "mirny-cpld";
inherit src; inherit src version;
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise); buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
phases = ["buildPhase" "installPhase"]; phases = ["buildPhase" "installPhase"];
buildPhase = "python $src/mirny_impl.py"; buildPhase = "python $src/mirny_impl.py";
installPhase = installPhase =
'' ''
mkdir -p $out $out/nix-support mkdir -p $out $out/nix-support
cp build/mirny.jed $out cp build/mirny.jed $out