centralize/simplify version management

This commit is contained in:
Sebastien Bourdeauducq 2019-02-15 22:34:56 +08:00
parent ee649bf364
commit 065f6edb95
5 changed files with 19 additions and 14 deletions

View File

@ -1,21 +1,18 @@
{ pkgs }:
{ artiqSrc, boardBinaries, target, variant }:
{ target, variant, boardBinaries }:
with pkgs;
let
version = import ./pkgs/artiq-version.nix;
fakeCondaSource = runCommand "fake-condasrc-artiq-board-${target}-${variant}" { }
''
cp --no-preserve=mode,ownership -R ${artiqSrc} $out
mkdir $out/fake-conda;
mkdir -p $out/fake-conda;
cat << EOF > $out/fake-conda/meta.yaml
package:
name: artiq-board-${target}-${variant}
version: 5e.{{ environ["GIT_FULL_HASH"][:8] }}
source:
git_url: ..
version: ${version}
build:
noarch: python

View File

@ -4,18 +4,25 @@ with pkgs;
let
artiqSrc = import ./pkgs/artiq-src.nix { inherit fetchgit; };
version = import ./pkgs/artiq-version.nix;
fakeCondaSource = runCommand "fake-condasrc-artiq" { }
''
cp --no-preserve=mode,ownership -R ${artiqSrc} $out
mkdir $out/fake-conda;
mkdir -p $out/fake-conda;
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
cp --no-preserve=mode,ownership -R ${artiqSrc} workaround-conda
pushd workaround-conda
tar cf $out/src.tar .
popd
rm -rf workaround-conda
cat << EOF > $out/fake-conda/meta.yaml
package:
name: artiq
version: 5e.{{ environ["GIT_FULL_HASH"][:8] }}
version: ${version}
source:
git_url: ..
url: ../src.tar
{% set data = load_setup_py_data() %}

View File

@ -22,10 +22,9 @@ let
start // {
"artiq-board-${board.target}-${board.variant}" = boardBinaries;
"conda-artiq-board-${board.target}-${board.variant}" = import ./conda-artiq-board.nix { inherit pkgs; } {
artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
boardBinaries = boardBinaries;
target = board.target;
variant = board.variant;
boardBinaries = boardBinaries;
};
}) {} boards;
in rec {

View File

@ -64,7 +64,8 @@ pyqtgraph-qt5 = python3Packages.buildPythonPackage rec {
in
python3Packages.buildPythonPackage rec {
name = "artiq";
name = "artiq-${version}";
version = import ./artiq-version.nix;
src = import ./artiq-src.nix { inherit fetchgit; };
buildInputs = [ git ];
propagatedBuildInputs = with python3Packages; [ binutils-or1k llvm-or1k llvmlite levenshtein pyqtgraph-qt5 aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ];

View File

@ -15,6 +15,7 @@ let
leaveDotGit = true;
}
EOF
echo \"5e.`cut -c1-8 <<< $REV`\" > $out/pkgs/artiq-version.nix
'';
artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; };
jobs = builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiqpkgs;