Compare commits

..

14 Commits

8 changed files with 86 additions and 681 deletions

View File

@ -2,6 +2,6 @@ ARTIQ extrapkg
==============
This contains additional packages and infrastructure for ARTIQ:
* MSYS2 and Conda packages
* Conda packages
* Controllers/NDSPs
* Windows tests

168
flake.lock generated
View File

@ -1,14 +1,39 @@
{
"nodes": {
"artiq": {
"inputs": {
"artiq-comtools": "artiq-comtools",
"mozilla-overlay": "mozilla-overlay",
"nixpkgs": "nixpkgs",
"sipyco": "sipyco",
"src-migen": "src-migen",
"src-misoc": "src-misoc",
"src-pythonparser": "src-pythonparser"
},
"locked": {
"lastModified": 1682904938,
"narHash": "sha256-oKvzonx0bo/EnkH/h+znft+qu+E2YxjyR27JVvnqm7k=",
"ref": "release-7",
"rev": "dbd5a1765db8a5446f55aded66ea5d01f45716af",
"revCount": 8166,
"type": "git",
"url": "https://github.com/m-labs/artiq.git"
},
"original": {
"ref": "release-7",
"type": "git",
"url": "https://github.com/m-labs/artiq.git"
}
},
"artiq-comtools": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"artiqpkgs",
"artiq",
"nixpkgs"
],
"sipyco": [
"artiqpkgs",
"artiq",
"sipyco"
]
},
@ -26,90 +51,6 @@
"type": "github"
}
},
"artiq-stubs": {
"inputs": {
"artiqpkgs": [
"daxpkgs",
"artiqpkgs"
],
"flake8-artiq": [
"daxpkgs",
"flake8-artiq"
],
"nixpkgs": [
"daxpkgs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1670448913,
"narHash": "sha256-ZCg7Rd5qpYl5Y8FEtLObnFRUiSJVZuSBdpa57SMVoNE=",
"ref": "refs/heads/master",
"rev": "d592ccd1db4d9a97331d5397560d25b59c7820bb",
"revCount": 26,
"type": "git",
"url": "https://gitlab.com/duke-artiq/artiq-stubs.git"
},
"original": {
"type": "git",
"url": "https://gitlab.com/duke-artiq/artiq-stubs.git"
}
},
"artiqpkgs": {
"inputs": {
"artiq-comtools": "artiq-comtools",
"mozilla-overlay": "mozilla-overlay",
"nixpkgs": "nixpkgs",
"sipyco": "sipyco",
"src-migen": "src-migen",
"src-misoc": "src-misoc",
"src-pythonparser": "src-pythonparser"
},
"locked": {
"lastModified": 1682844949,
"narHash": "sha256-o2qsfskZZliN4sFFITv7otu3IzcQ23sq3a8kLeOAHTQ=",
"ref": "refs/heads/master",
"rev": "3ff0be6540b5a9eb252cd95db6a812d75e7c8ed2",
"revCount": 8342,
"type": "git",
"url": "https://github.com/m-labs/artiq.git"
},
"original": {
"type": "git",
"url": "https://github.com/m-labs/artiq.git"
}
},
"daxpkgs": {
"inputs": {
"artiq-stubs": "artiq-stubs",
"artiqpkgs": [
"artiqpkgs"
],
"flake8-artiq": "flake8-artiq",
"nixpkgs": [
"artiqpkgs",
"nixpkgs"
],
"sipyco": [
"artiqpkgs",
"sipyco"
],
"trap-dac-utils": "trap-dac-utils"
},
"locked": {
"lastModified": 1682793563,
"narHash": "sha256-tj+VwGBjcaeQCsrwrepfqVslDX2IDElIvVeEdsl1wIo=",
"ref": "refs/heads/master",
"rev": "bb4e18743dcab017765d09b6ce1c3bba88be073e",
"revCount": 1160,
"type": "git",
"url": "https://gitlab.com/duke-artiq/dax.git"
},
"original": {
"type": "git",
"url": "https://gitlab.com/duke-artiq/dax.git"
}
},
"flake-utils": {
"locked": {
"lastModified": 1659877975,
@ -125,27 +66,6 @@
"type": "github"
}
},
"flake8-artiq": {
"inputs": {
"nixpkgs": [
"daxpkgs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1681932181,
"narHash": "sha256-DffFqCG/xWb7KGuKYCUH8ItnaqgjcSpVy3g2bI/bIgs=",
"ref": "refs/heads/master",
"rev": "8247f653ffc643ad8db00fd7fb52663aff4a48ef",
"revCount": 97,
"type": "git",
"url": "https://gitlab.com/duke-artiq/flake8-artiq.git"
},
"original": {
"type": "git",
"url": "https://gitlab.com/duke-artiq/flake8-artiq.git"
}
},
"mozilla-overlay": {
"flake": false,
"locked": {
@ -164,30 +84,29 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1682173319,
"narHash": "sha256-tPhOpJJ+wrWIusvGgIB2+x6ILfDkEgQMX0BTtM5vd/4=",
"lastModified": 1682600000,
"narHash": "sha256-ha4BehR1dh8EnXSoE1m/wyyYVvHI9txjW4w5/oxsW5Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ee7ec1c71adc47d2e3c2d5eb0d6b8fbbd42a8d1c",
"rev": "50fc86b75d2744e1ab3837ef74b53f103a9b55a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"artiqpkgs": "artiqpkgs",
"daxpkgs": "daxpkgs"
"artiq": "artiq"
}
},
"sipyco": {
"inputs": {
"nixpkgs": [
"artiqpkgs",
"artiq",
"nixpkgs"
]
},
@ -254,27 +173,6 @@
"repo": "pythonparser",
"type": "github"
}
},
"trap-dac-utils": {
"inputs": {
"nixpkgs": [
"daxpkgs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1681932204,
"narHash": "sha256-ZvnaEiNWH7bWWt/MLHZrEeeqgTGBl0EBKS61N+YsiTs=",
"ref": "refs/heads/master",
"rev": "d3af0ff98d6f2d065f04013533de8b760f8e47e5",
"revCount": 278,
"type": "git",
"url": "https://gitlab.com/duke-artiq/trap-dac-utils.git"
},
"original": {
"type": "git",
"url": "https://gitlab.com/duke-artiq/trap-dac-utils.git"
}
}
},
"root": "root",

274
flake.nix
View File

@ -1,27 +1,17 @@
{
description = "Additional packages for ARTIQ";
inputs.artiqpkgs.url = git+https://github.com/m-labs/artiq.git;
inputs.artiq.url = git+https://github.com/m-labs/artiq.git?ref=release-7;
inputs.daxpkgs = {
url = git+https://gitlab.com/duke-artiq/dax.git;
inputs = {
artiqpkgs.follows = "artiqpkgs";
nixpkgs.follows = "artiqpkgs/nixpkgs";
sipyco.follows = "artiqpkgs/sipyco";
};
};
outputs = { self, artiqpkgs, daxpkgs }:
outputs = { self, artiq }:
let
pkgs = import artiqpkgs.inputs.nixpkgs { system = "x86_64-linux"; };
msys2 = import ./msys2 { inherit pkgs; };
pkgs = import artiq.inputs.nixpkgs { system = "x86_64-linux"; };
condaDeps = with pkgs; [ zlib xorg.libSM xorg.libICE xorg.libX11 xorg.libXau xorg.libXi xorg.libXrender libselinux libGL ];
# Use the full Anaconda distribution, which already contains conda-build and its many dependencies.
condaInstaller = pkgs.fetchurl {
url = "https://repo.anaconda.com/archive/Anaconda3-2023.03-Linux-x86_64.sh";
sha256 = "sha256-GXN9XCeyOh2HQMXLJBS/YlMYTOdF0KkSuyNaISoV4HU=";
url = "https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh";
sha256 = "sha256-/t+eNAA5VX97XoqKhq/6nSmfXpggFEvXuSrp9+4IrGA=";
};
condaInstallerEnv = pkgs.buildFHSUserEnv {
name = "conda-installer-env";
@ -42,7 +32,7 @@
installPhase =
''
conda-installer-env -c "./conda-installer.sh -p $out -b"
substituteInPlace $out/lib/python3.10/site-packages/conda/gateways/disk/__init__.py \
substituteInPlace $out/lib/python3.9/site-packages/conda/gateways/disk/__init__.py \
--replace "os.chmod(path, 0o2775)" "pass"
'';
};
@ -122,11 +112,8 @@
};
in rec {
inherit pkgs;
inherit makeCondaChannel;
inherit (msys2) makeMsys2Package makeMsys2Repos;
packages.x86_64-linux = rec {
inherit (artiqpkgs.packages.x86_64-linux) artiq openocd-bscanspi;
korad_ka3005p = pkgs.python3Packages.buildPythonPackage {
pname = "korad_ka3005p";
version = "1.1";
@ -136,7 +123,7 @@
rev = "a1898409cb188b388ed1cf84e76ca69e9c8a74eb";
sha256 = "0h20qss70nssqiagc2fx75mravq1pji7rizhag3nq8xrcz2w20nc";
};
propagatedBuildInputs = [ artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco artiqpkgs.packages.x86_64-linux.asyncserial ];
propagatedBuildInputs = [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco artiq.packages.x86_64-linux.asyncserial ];
};
novatech409b = pkgs.python3Packages.buildPythonPackage {
pname = "novatech409b";
@ -147,7 +134,7 @@
rev = "3bd559753972f07d881df66b7c6819afc5436053";
sha256 = "1g9qv6fn5h7d393mb1v7w8sg6fimqg34blqdj22qnayb4agw1wyg";
};
propagatedBuildInputs = [ artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco artiqpkgs.packages.x86_64-linux.asyncserial ];
propagatedBuildInputs = [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco artiq.packages.x86_64-linux.asyncserial ];
};
lda = pkgs.python3Packages.buildPythonPackage {
name = "lda";
@ -158,7 +145,7 @@
rev = "2d8af1e9080a4c1ab4a32370b3f926bfba8c00b2";
sha256 = "sha256-bImAsQiGmMauasltUrlkCRU3+p40d41DTlJvOjCfrP0=";
};
propagatedBuildInputs = [ artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco ];
propagatedBuildInputs = [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco ];
postPatch = ''
substituteInPlace lda/hidapi.py \
--replace "hidapi_lib_path = None"\
@ -174,7 +161,7 @@
rev = "0cb0c15fc7e660a150e193245f5338d48f8b97db";
sha256 = "1n4zmjcj2kpd97217y602pq6x8s80w39fgyi6qjmal92aicqdg07";
};
propagatedBuildInputs = [ artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco artiqpkgs.packages.x86_64-linux.asyncserial ];
propagatedBuildInputs = [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco artiq.packages.x86_64-linux.asyncserial ];
};
newfocus8742 = pkgs.python3Packages.buildPythonPackage {
pname = "newfocus8742";
@ -185,7 +172,7 @@
rev = "9f6092b724b33b934aa4d3a1d6a20c295cd1d02d";
sha256 = "0qf05ghylnqf3l5vjx5dc748wi84xn6p6lb6f9r8p6f1z7z67fb8";
};
propagatedBuildInputs = [ artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco pkgs.python3Packages.pyusb ];
propagatedBuildInputs = [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco pkgs.python3Packages.pyusb ];
# no unit tests so do a simple smoke test
checkPhase = "python -m newfocus8742.aqctl_newfocus8742 -h";
};
@ -198,7 +185,7 @@
rev = "68369d5d63d233827840a9a752d90454a4e03baa";
sha256 = "0r832c0icz8v3w27ci13024bqfslj1gx6dwhjv11ksw229xdcghd";
};
propagatedBuildInputs = [ artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco ];
propagatedBuildInputs = [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco ];
# no unit tests without hardware so do a simple smoke test
checkPhase = "python -m hut2.aqctl_hut2 -h";
};
@ -216,13 +203,36 @@
postFixup = ''
wrapQtApp "$out/bin/wand_gui"
'';
propagatedBuildInputs = [ artiqpkgs.packages.x86_64-linux.artiq artiqpkgs.packages.x86_64-linux.qasync ]
++ [ artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco ]
propagatedBuildInputs = [ artiq.packages.x86_64-linux.artiq artiq.packages.x86_64-linux.qasync ]
++ [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco ]
++ (with pkgs.python3Packages; [ numpy scipy influxdb pyqtgraph setuptools ]);
};
flake8-artiq = daxpkgs.packages.x86_64-linux.flake8-artiq;
dax = daxpkgs.packages.x86_64-linux.dax.overridePythonAttrs (oa: { doCheck = false; });
trap-dac-utils = daxpkgs.packages.x86_64-linux.trap-dac-utils;
flake8-artiq = pkgs.python3Packages.buildPythonPackage {
pname = "flake8-artiq";
version = "0.1.0";
src = pkgs.fetchgit {
url = "https://gitlab.com/duke-artiq/flake8-artiq.git";
rev = "1216092974140a561850905734fc22fdacdc2cde";
sha256 = "0rkab2qdwyzms6nxc44jzb5grvkkbpjwwmfv2zj96cm6cm8d9pdr";
};
propagatedBuildInputs = [ pkgs.python3Packages.flake8 ];
checkInputs = [ pkgs.python3Packages.pytestCheckHook ];
};
dax = pkgs.python3Packages.buildPythonPackage rec {
pname = "dax";
version = "6.7";
src = pkgs.fetchgit {
url = "https://gitlab.com/duke-artiq/dax.git";
rev = "v${version}";
sha256 = "0rgvqqiypqvxjzrsixn3h7dn93isqw5vc2wrmpkxhzvw9lh5ihm7";
};
VERSIONEER_OVERRIDE = version;
inherit (pkgs.python3Packages.pygit2) SSL_CERT_FILE;
doCheck = false; # tests only pass for the latest stable ARTIQ version
propagatedBuildInputs = [ artiq.packages.x86_64-linux.artiq artiq.inputs.sipyco.packages.x86_64-linux.sipyco ]
++ (with pkgs.python3Packages; [ numpy scipy pyvcd natsort pygit2 matplotlib graphviz h5py networkx sortedcontainers ]);
checkInputs = [ pkgs.python3Packages.pytestCheckHook ];
};
dax-applets = pkgs.python3Packages.buildPythonPackage rec {
pname = "dax-applets";
version = "0.0.0";
@ -231,93 +241,37 @@
rev = "0f0196b6941b0c44a33c85d8c02047ca65466463";
sha256 = "0mx6yjvprhdnkdigwns8mg6v5daqxpgbv7mf63fa76i1iv2wvak4";
};
propagatedBuildInputs = [ artiqpkgs.packages.x86_64-linux.artiq ]
propagatedBuildInputs = [ artiq.packages.x86_64-linux.artiq ]
++ (with pkgs.python3Packages; [ numpy pyqt5 pyqtgraph ]);
doCheck = false;
};
linien-client = pkgs.python3Packages.buildPythonPackage rec {
pname = "linien-client";
version = "0.5.3";
src = pkgs.fetchFromGitHub {
owner = "linien-org";
repo = "linien";
rev = "v${version}";
sha256 = "sha256-VOT/mw4o9dbkrtMxL0Ar5UcnxsZ7CYcoTj+VVrWADR4=";
};
propagatedBuildInputs = (with pkgs.python3Packages; [ numpy paramiko plumbum rpyc scipy ]);
doCheck = false; # tests ask for pyqt, migen, etc.
patchPhase =
''
echo ${version} > linien/VERSION
substituteInPlace setup_client.py --replace "\"uuid>=1.30\"," ""
substituteInPlace setup_client.py --replace "rpyc>=4.0,<5.0" "rpyc>=4.0"
ln -s setup_client.py setup.py
'';
};
linien-gui-internal = pkgs.python3Packages.buildPythonPackage rec {
pname = "linien-gui-internal";
inherit (linien-client) version src;
propagatedBuildInputs = (with pkgs.python3Packages; [ click numpy paramiko plumbum pyqtgraph pyqt5 rpyc scipy superqt appdirs ]) ++ [ linien-client ];
doCheck = false;
patchPhase =
''
echo ${version} > linien/VERSION
substituteInPlace setup_gui.py --replace "rpyc>=4.0,<5.0" "rpyc>=4.0"
ln -s setup_gui.py setup.py
'';
postInstall =
''
# conflicts with linien-client
rm -rf $out/lib/python3.10/site-packages/linien/__pycache__
'';
};
# replace broken (as usual) setuptools launcher
linien-gui = pkgs.stdenvNoCC.mkDerivation {
name = "linien-gui";
phases = [ "installPhase" "fixupPhase" ];
installPhase =
''
mkdir -p $out/bin
cat > $out/bin/linien << EOF
#!${pkgs.python3.withPackages(ps: [ linien-gui-internal ])}/bin/python
import linien.gui.app
linien.gui.app.run_application()
EOF
chmod 755 $out/bin/linien
'';
nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ];
dontWrapQtApps = true;
postFixup = ''
wrapQtApp "$out/bin/linien"
'';
};
conda-channel = makeCondaChannel [
{
name = "sipyco";
version = artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco.version;
src = artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco.src;
version = artiq.inputs.sipyco.packages.x86_64-linux.sipyco.version;
src = artiq.inputs.sipyco.packages.x86_64-linux.sipyco.src;
dependencies = [ "numpy" "pybase64" ];
}
{
name = "pythonparser";
version = artiqpkgs.packages.x86_64-linux.pythonparser.version;
src = artiqpkgs.packages.x86_64-linux.pythonparser.src;
version = artiq.packages.x86_64-linux.pythonparser.version;
src = artiq.packages.x86_64-linux.pythonparser.src;
dependencies = [ "regex" ];
}
{
name = "artiq-comtools";
version = artiqpkgs.inputs.artiq-comtools.packages.x86_64-linux.artiq-comtools.version;
src = artiqpkgs.inputs.artiq-comtools.packages.x86_64-linux.artiq-comtools.src;
version = artiq.inputs.artiq-comtools.packages.x86_64-linux.artiq-comtools.version;
src = artiq.inputs.artiq-comtools.packages.x86_64-linux.artiq-comtools.src;
dependencies = [ "numpy" "aiohttp" "sipyco" ];
}
{
name = "artiq";
version = artiqpkgs.packages.x86_64-linux.artiq.version;
src = artiqpkgs.packages.x86_64-linux.artiq.src;
version = artiq.packages.x86_64-linux.artiq.version;
src = artiq.packages.x86_64-linux.artiq.src;
preSetup =
''
export VERSIONEER_OVERRIDE=${artiqpkgs.packages.x86_64-linux.artiq.version}
export VERSIONEER_REV=${artiqpkgs.sourceInfo.rev}
export VERSIONEER_OVERRIDE=${artiq.packages.x86_64-linux.artiq.version}
export VERSIONEER_REV=${artiq.sourceInfo.rev}
'';
dependencies = [
"pythonparser"
@ -336,7 +290,6 @@
"llvm-tools"
"lld"
"tqdm"
"python-lmdb"
"artiq-comtools"
];
}
@ -389,17 +342,11 @@
src = flake8-artiq.src;
dependencies = [ "flake8" ];
}
{
name = "trap-dac-utils";
version = trap-dac-utils.version;
src = trap-dac-utils.src;
dependencies = trap-dac-utils.condaDependencies;
}
{
name = "dax";
version = dax.version;
src = dax.src;
dependencies = dax.condaDependencies;
dependencies = [ "python>=3.7" "artiq" "sipyco" "numpy" "scipy" "pyvcd" "natsort" "pygit2" "matplotlib" "python-graphviz" "h5py" "networkx" "sortedcontainers" ];
}
{
name = "dax-applets";
@ -408,125 +355,8 @@
dependencies = [ "python>=3.5" "artiq" "numpy" "pyqt" "pyqtgraph" ];
}
];
msys2-pythonparser = msys2.makeMsys2Package rec {
name = "python-pythonparser";
version = artiqpkgs.packages.x86_64-linux.pythonparser.version;
src = artiqpkgs.packages.x86_64-linux.pythonparser.src;
depends = [ "mingw-w64-x86_64-python-regex" ];
};
msys2-sipyco = msys2.makeMsys2Package {
name = "python-sipyco";
src = artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco.src;
inherit (artiqpkgs.inputs.sipyco.packages.x86_64-linux.sipyco) version;
depends = [ "mingw-w64-x86_64-python" "mingw-w64-x86_64-python-numpy" "mingw-w64-x86_64-python-pybase64" ];
};
msys2-artiq-comtools = msys2.makeMsys2Package {
name = "artiq-comtools";
src = artiqpkgs.inputs.artiq-comtools.packages.x86_64-linux.artiq-comtools.src;
inherit (artiqpkgs.inputs.artiq-comtools.packages.x86_64-linux.artiq-comtools) version;
depends = [ "mingw-w64-x86_64-python" "mingw-w64-x86_64-python-sipyco" "mingw-w64-x86_64-python-numpy" "mingw-w64-x86_64-python-aiohttp" ];
};
msys2-artiq = msys2.makeMsys2Package {
name = "artiq";
inherit (artiqpkgs.packages.x86_64-linux.artiq) version src;
prepare =
''
export VERSIONEER_OVERRIDE=${artiqpkgs.packages.x86_64-linux.artiq.version}
export VERSIONEER_REV=${artiqpkgs.sourceInfo.rev}
'';
depends = [
"mingw-w64-x86_64-python"
"mingw-w64-x86_64-python-h5py"
"mingw-w64-x86_64-python-pyqt5"
"mingw-w64-x86_64-qt5-svg"
"mingw-w64-x86_64-python-qasync"
"mingw-w64-x86_64-python-pyqtgraph"
"mingw-w64-x86_64-python-numpy"
"mingw-w64-x86_64-python-scipy"
"mingw-w64-x86_64-python-dateutil"
"mingw-w64-x86_64-python-prettytable"
"mingw-w64-x86_64-python-tqdm"
"mingw-w64-x86_64-python-pygit2"
"mingw-w64-x86_64-python-sipyco"
"mingw-w64-x86_64-python-llvmlite"
"mingw-w64-x86_64-python-pythonparser"
"mingw-w64-x86_64-python-levenshtein"
"mingw-w64-x86_64-lld"
"mingw-w64-x86_64-artiq-comtools"
];
};
msys2-asyncserial = msys2.makeMsys2Package {
name = "python-asyncserial";
version = artiqpkgs.packages.x86_64-linux.asyncserial.version;
src = artiqpkgs.packages.x86_64-linux.asyncserial.src;
depends = [ "mingw-w64-x86_64-python" ];
};
msys2-korad_ka3005p = msys2.makeMsys2Package {
name = "korad_ka3005p";
version = korad_ka3005p.version;
src = korad_ka3005p.src;
depends = [ "mingw-w64-x86_64-python-sipyco" "mingw-w64-x86_64-python-asyncserial" ];
};
msys2-novatech409b = msys2.makeMsys2Package {
name = "novatech409b";
version = novatech409b.version;
src = novatech409b.src;
depends = [ "mingw-w64-x86_64-python-sipyco" "mingw-w64-x86_64-python-asyncserial" ];
};
msys2-lda = msys2.makeMsys2Package {
name = "lda";
version = lda.version;
src = lda.src;
depends = [ "mingw-w64-x86_64-python-sipyco" ];
};
msys2-thorlabs_tcube = msys2.makeMsys2Package {
name = "thorlabs_tcube";
version = thorlabs_tcube.version;
src = thorlabs_tcube.src;
depends = [ "mingw-w64-x86_64-python-sipyco" "mingw-w64-x86_64-python-asyncserial" ];
};
msys2-newfocus8742 = msys2.makeMsys2Package {
name = "newfocus8742";
version = newfocus8742.version;
src = newfocus8742.src;
depends = [ "mingw-w64-x86_64-python-sipyco" ];
};
msys2-hut2 = msys2.makeMsys2Package {
name = "hut2";
version = hut2.version;
src = hut2.src;
depends = [ "mingw-w64-x86_64-python-sipyco" ];
};
msys2-flake8-artiq = msys2.makeMsys2Package {
name = "flake8-artiq";
version = flake8-artiq.version;
src = flake8-artiq.src;
depends = [ "mingw-w64-x86_64-python-flake8" ];
};
msys2-repos = msys2.makeMsys2Repos [
msys2-pythonparser msys2-sipyco msys2-artiq-comtools msys2-artiq
msys2-asyncserial
msys2-korad_ka3005p
msys2-novatech409b
msys2-lda
msys2-thorlabs_tcube
msys2-newfocus8742
msys2-hut2
msys2-flake8-artiq
];
};
hydraJobs = packages.x86_64-linux;
devShells.x86_64-linux.msys2 = pkgs.mkShell {
name = "dev-shell-msys2";
buildInputs = with pkgs; [
curl
pacman
fakeroot
msys2.wine-msys2
];
};
};
}

View File

@ -1,32 +0,0 @@
arch=("any")
mingw_arch=("mingw64")
pkgver=${DRV_VERSION}
url="https://m-labs.hk"
source=("source.tar")
sha256sums=("SKIP")
build() {
mkdir mingw64
export PYTHONPATH=`pwd`/mingw64/lib/python3.10/site-packages
chmod +w -R source
cd source
wine-msys2-build python setup.py install --single-version-externally-managed --prefix=../mingw64 --record=setuptools-sucks.txt
cd ..
# setuptools creates this file if it doesn't already exist, which causes conflicts between pacman packages
# see: https://corte.si/posts/code/setuptoolssucks/
rm -f mingw64/lib/python3.10/site-packages/easy-install.pth
# patch broken shebangs (Z:/nix/store/...)
for entrypoint in mingw64/bin/*-script.py; do
[ -f "$entrypoint" ] || continue
sed -i "1s|#!.*|#!python|" $entrypoint
done
for entrypoint in mingw64/bin/*-script.pyw; do
[ -f "$entrypoint" ] || continue
sed -i "1s|#!.*|#!pythonw|" $entrypoint
done
}
package() {
cp -R mingw64 ${pkgdir}
}

View File

@ -1,83 +0,0 @@
{ pkgs }:
let
msys2-env = pkgs.stdenvNoCC.mkDerivation rec {
name = "msys2-env";
srcs = import ./msys2_packages.nix { inherit pkgs; };
buildInputs = [ pkgs.gnutar pkgs.zstd ];
phases = [ "installPhase" ];
installPhase = (pkgs.lib.strings.concatStringsSep "\n" (["mkdir $out"] ++ (map (p: "tar xvf ${p} -C $out") srcs)));
};
silenceFontconfig = # silence flood of "Fontconfig error: Cannot load default config file: No such file: (null)"
''
export FONTCONFIG_PATH=$HOME/fonts
mkdir $FONTCONFIG_PATH
cat > $FONTCONFIG_PATH/fonts.conf << EOF
<fontconfig>
</fontconfig>
EOF
'';
wine-msys2 = pkgs.writeShellScriptBin "wine-msys2"
''
export WINEDEBUG=-all
export WINEPATH=Z:${msys2-env}/mingw64/bin
exec ${pkgs.wineWowPackages.stable}/bin/wine64 cmd
'';
wine-msys2-build = pkgs.writeShellScriptBin "wine-msys2-build"
''
export HOME=`mktemp -d`
export WINEDEBUG=-all
export WINEPATH=Z:${msys2-env}/mingw64/bin
${silenceFontconfig}
exec ${pkgs.wineWowPackages.stable}/bin/wine64 $@
'';
in {
inherit wine-msys2;
makeMsys2Package = { name, version, src, depends, prepare ? "" }: pkgs.stdenvNoCC.mkDerivation {
pname = "${name}-msys2-pkg";
inherit version;
nativeBuildInputs = [
pkgs.pacman pkgs.fakeroot pkgs.libarchive pkgs.zstd pkgs.file
wine-msys2-build
];
inherit src;
phases = [ "buildPhase" "installPhase" ];
buildPhase =
''
export DRV_VERSION=${version}
${prepare}
cat > PKGBUILD << HEREDOC
pkgbase="mingw-w64-${name}"
pkgname="mingw-w64-x86_64-${name}"
pkgrel=1
depends=(
${pkgs.lib.concatStringsSep "\n" (map (depend: "\"${depend}\"") depends)}
)
source PKGBUILD.common
HEREDOC
ln -s ${./PKGBUILD.common} PKGBUILD.common
ln -s $src source
tar cfh source.tar source
rm source
makepkg --config ${./makepkg.conf} --nodeps
'';
installPhase =
''
mkdir $out $out/nix-support
cp *.pkg.tar.zst $out
echo file msys2 $out/*.pkg.tar.zst >> $out/nix-support/hydra-build-products
'';
};
makeMsys2Repos = constituents: pkgs.stdenvNoCC.mkDerivation {
name = "msys2-repos";
nativeBuildInputs = [ pkgs.pacman ];
phases = [ "buildPhase" ];
buildPhase =
''
mkdir $out
cd $out
${pkgs.lib.concatStringsSep "\n"
(map (constituent: "ln -s ${constituent}/*.pkg.tar.zst .") constituents)}
repo-add artiq.db.tar.gz *.pkg.tar.zst
'';
};
}

View File

@ -1,24 +0,0 @@
#!/usr/bin/env bash
set -e
cd $(dirname $0)
MSYS2DIR=`pwd`/msys2
mkdir -p $MSYS2DIR/var/lib/pacman $MSYS2DIR/msys/etc
curl -L https://mirror.msys2.org/msys/x86_64/pacman-mirrors-20220205-1-any.pkg.tar.zst | tar xvf - -C $MSYS2DIR --zstd
curl -L https://raw.githubusercontent.com/msys2/MSYS2-packages/master/pacman/pacman.conf | sed -e "s|/etc/pacman.d|$MSYS2DIR/etc/pacman.d|g" -e "s|SigLevel = Required|SigLevel = Never|g" > $MSYS2DIR/etc/pacman.conf
fakeroot pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf -Syy
pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf --cachedir $MSYS2DIR/msys/cache -Sp mingw-w64-x86_64-cc mingw-w64-x86_64-python3.10 mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-setuptools > $MSYS2DIR/packages.txt
echo "{ pkgs } : [" > msys2_packages.nix
while read package; do
hash=$(nix-prefetch-url $package)
echo "
(pkgs.fetchurl {
url = \"$package\";
sha256 = \"$hash\";
})" >> msys2_packages.nix
done < $MSYS2DIR/packages.txt
echo "]" >> msys2_packages.nix

View File

@ -1,2 +0,0 @@
PKGEXT='.pkg.tar.zst'
SRCEXT='.src.tar.gz'

View File

@ -1,182 +0,0 @@
{ pkgs } : [
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libwinpthread-git-10.0.0.r258.g530c58e17-1-any.pkg.tar.zst";
sha256 = "1p2dcs8m50r3lk6myi1y79hmbwsyqr9r8v6k9gl0xa9vda4m7a5s";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-libs-12.2.0-10-any.pkg.tar.zst";
sha256 = "1hql9jmmcpdr97p2ynj45hb70az4l41hcirjk0j1xjg31m2jgfr9";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-zstd-1.5.5-1-any.pkg.tar.zst";
sha256 = "19jr14l5anl1qr1lvcmdpnpgyxghf2mds2j7iiq4j99kfg7ig2s0";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-binutils-2.40-2-any.pkg.tar.zst";
sha256 = "1xa3ni7qg9wzlr903lsqgqisdyvnl28kb3wz2kva21l9i7wwbs7c";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-headers-git-10.0.0.r258.g530c58e17-1-any.pkg.tar.zst";
sha256 = "0lxw9hvdniczz5k24ipjvbwcc9p35b97nkn69vb7k8rdp3l95klf";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-crt-git-10.0.0.r258.g530c58e17-2-any.pkg.tar.zst";
sha256 = "12rwwc41as55wqjsi143wfb4722s1zjqzibs05a0gj9c23mivc3q";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gmp-6.2.1-5-any.pkg.tar.zst";
sha256 = "1v19jx0hrsib7ak5jzbhss7p5zjg9y4kj06bcs8sakqvmyby8mlq";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-isl-0.25-1-any.pkg.tar.zst";
sha256 = "0hky9gmd6iz1s3irmp9fk2j10cpqrrw8l810riwr58ynj3i10j2k";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libiconv-1.17-3-any.pkg.tar.zst";
sha256 = "061dlpg69ph2205xabshya827m6dqchxxn3jvhnnicja6bsb8ivh";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-mpfr-4.2.0-1-any.pkg.tar.zst";
sha256 = "1iqpk6i5isf77rmvscmdv1ggrnhbvbfc3g4cyc6xgbp99s616724";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-mpc-1.3.1-1-any.pkg.tar.zst";
sha256 = "1r7h4xyc56d9n4z6ay315gsb82zmyvrkd7xki9y03y72ym194jlk";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-windows-default-manifest-6.4-4-any.pkg.tar.zst";
sha256 = "1ylipf8k9j7bgmwndkib2l29mds394i7jcij7a6ciag4kynlhsvi";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-winpthreads-git-10.0.0.r258.g530c58e17-1-any.pkg.tar.zst";
sha256 = "19h7z6svwnfpyhqh5zjz48jwd2nkvnbj1hbvvs524gdjpi3nxprz";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-zlib-1.2.13-3-any.pkg.tar.zst";
sha256 = "19r9hf111zb41i7r45ixsx26l4sk8g8apryv1xgj03hq54barikz";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-12.2.0-10-any.pkg.tar.zst";
sha256 = "182560g1bl52260v8dbggybl4mir3isyad22zvkb6sndid3iaakw";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-expat-2.5.0-1-any.pkg.tar.zst";
sha256 = "09hrzvdfkr2zaq239z87m1j3zyq0pvjhsyikg65wrbljrir6wc6r";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-bzip2-1.0.8-2-any.pkg.tar.zst";
sha256 = "1kqg3aw439cdyhnf02rlfr1pw1n8v9xxvq2alhn7aw6nd8qhw7z5";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libffi-3.4.4-1-any.pkg.tar.zst";
sha256 = "1na3giynh9f3i0xg2mr0dm4bm6zhv8h908rrrv4kcxfawr8nyjdy";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-mpdecimal-2.5.1-1-any.pkg.tar.zst";
sha256 = "0cpyacmciyzbsar1aka5y592g2gpa4i6a58j3bjdmfjdnpm0j08a";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gettext-0.21.1-1-any.pkg.tar.zst";
sha256 = "17h4qnv75jns7fq54hqp375v45snmrrn451izyp2nmmr0fw2p0bc";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libtre-git-r128.6fb7206-2-any.pkg.tar.xz";
sha256 = "0dp3ca83j8jlx32gml2qvqpwp5b42q8r98gf6hyiki45d910wb7x";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libsystre-1.0.1-4-any.pkg.tar.xz";
sha256 = "037gkzaaj8kp5nspcbc8ll64s9b3mj8d6m663lk1za94bq2axff1";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-ncurses-6.4.20230211-1-any.pkg.tar.zst";
sha256 = "0h62y3c45bkff6z3aa8ailz2l16x3s9g3pbyifqx6kwwzv80crgp";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-openssl-3.1.0-1-any.pkg.tar.zst";
sha256 = "01niwg58fass37im83jj1msdhm7kfwnyhvgsgmvh7qhpvfgzfmxl";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-termcap-1.3.1-6-any.pkg.tar.zst";
sha256 = "1wgbzj53vmv1vm3igjan635j5ims4x19s2y6mgvvc46zgndc2bvq";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-readline-8.2.001-6-any.pkg.tar.zst";
sha256 = "0a6s6kq2hmz96cg7hxzcgldh16sk7dvpzfdfqchq3c07rwzhqhiq";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-tcl-8.6.12-1-any.pkg.tar.zst";
sha256 = "0z66xic67k3j56jvvrwn8sym5yxylyza7ig686z5937nsd29kdw1";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-sqlite3-3.41.2-1-any.pkg.tar.zst";
sha256 = "0s1kzipdz7rczpk32wkbc90yjw6wbcxmzlgnd7j99fzwaawblbnp";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-tk-8.6.12-1-any.pkg.tar.zst";
sha256 = "1pnznf4a195ij3b1g921k0llkn62wf0piijldj2c7qlbcq73v66c";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-xz-5.4.2-1-any.pkg.tar.zst";
sha256 = "0w63y7rg76jnzy7ijhda1jzi9jgy1sdfvzq32zyj8yibkcpfxlll";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-tzdata-2023c-1-any.pkg.tar.zst";
sha256 = "0ifavpqi1ykn9962ic4sh5l18y2mvz9pj6742fgw85s9wixbj7fl";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-3.10.11-1-any.pkg.tar.zst";
sha256 = "0fl3jrmp59180is4l9d8qimslnpqrzvl7wprqjhag2c7ki9c0gg4";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-libgfortran-12.2.0-10-any.pkg.tar.zst";
sha256 = "1xilwrasyj3xbrv4wjvc53bv45k7szpzgnnakdnl1jg81960byx5";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-openblas-0.3.23-1-any.pkg.tar.zst";
sha256 = "1zqxcpmw3mbw1axsf90sk7vmswq95g1b3pj826zrf42bjcjbsjpk";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-numpy-1.24.2-3-any.pkg.tar.zst";
sha256 = "0d81782q72ygkycfn1y2yvsp7g55190zdklkv42pizzapn8h3a2l";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-setuptools-67.7.1-1-any.pkg.tar.zst";
sha256 = "0d4j7n133q4whs8ipjqn9azqfc1bx60dylmjwgq62vn3fxbf307p";
})
]