Compare commits

..

29 Commits

Author SHA1 Message Date
Brad Bondurant 876de24ed2 use flake for dax 2022-12-16 12:34:52 -05:00
Sebastien Bourdeauducq 2ae839f61a flake: update 2022-12-14 09:36:04 +08:00
Sebastien Bourdeauducq 9c5fc66a0a README: msys2 2022-12-14 09:35:27 +08:00
Sebastien Bourdeauducq 7df7aae25c linien: py3.10 2022-11-30 22:32:17 +08:00
Sebastien Bourdeauducq ef56a6ddb6 flake: update dependencies 2022-11-30 22:22:19 +08:00
Sebastien Bourdeauducq 166655b6d2 flake: update dependencies 2022-11-25 09:50:50 +08:00
Sebastien Bourdeauducq f538572a4a msys2: add qt5-svg dependency 2022-11-18 18:19:31 +08:00
Sebastien Bourdeauducq d0330b387f update ARTIQ 2022-11-15 11:20:45 +08:00
Sebastien Bourdeauducq 051b2e530d flake: update artiq 2022-11-04 15:33:57 +08:00
Sebastien Bourdeauducq 721f1c8792 msys2: remove levenshtein package
Now upstream MSYS2.
2022-11-03 18:19:24 +08:00
Sebastien Bourdeauducq 0a3ec719a7 msys2: add asyncserial 2022-10-24 19:31:51 +08:00
Sebastien Bourdeauducq a6b1cf3f6d msys2: add controllers 2022-10-24 19:29:13 +08:00
Sebastien Bourdeauducq d8986795c6 msys2: add pythonparser 2022-10-24 19:21:53 +08:00
Sebastien Bourdeauducq 2f56fa9b6c msys2: refactor PKGBUILDs 2022-10-24 19:18:06 +08:00
Sebastien Bourdeauducq b5385faa4d flake: update dependencies 2022-10-24 18:53:15 +08:00
Sebastien Bourdeauducq 41459dc77d msys2: add levenshtein package 2022-10-24 18:52:11 +08:00
Sebastien Bourdeauducq 2e9e40e326 add MSYS2 packages 2022-10-24 18:06:21 +08:00
Sebastien Bourdeauducq 59ec3d938d flake: update dependencies 2022-10-08 17:30:03 +08:00
Sebastien Bourdeauducq 6f61205daf remove redundant comment 2022-09-08 19:21:48 +08:00
Sebastien Bourdeauducq 512f170488 linien: add 2022-09-08 19:21:21 +08:00
Sebastien Bourdeauducq 122ca4eed4 conda: update 2022-09-08 17:38:57 +08:00
Sebastien Bourdeauducq 17f655fa63 artiq: update 2022-09-08 17:19:32 +08:00
Sebastien Bourdeauducq fedd6ab115 lda: update 2022-09-08 17:19:13 +08:00
Sebastien Bourdeauducq d104a15479 Revert "dax: bump version, add new dependency"
This reverts commit 6bc2eea14d.
2022-08-12 09:34:18 +08:00
Brad Bondurant 6bc2eea14d dax: bump version, add new dependency 2022-08-11 15:50:14 -04:00
Sebastien Bourdeauducq acd2ea9457 update ARTIQ 2022-08-10 07:01:37 +08:00
Sebastien Bourdeauducq 3d41ed4fef add missing tqdm conda dep 2022-08-10 07:01:11 +08:00
Brad Bondurant e680efcd6a flake: expose `makeCondaChannel` in outputs 2022-07-11 17:12:40 -04:00
Sebastien Bourdeauducq 56946170c6 flake: update inputs 2022-07-08 18:50:22 +08:00
8 changed files with 643 additions and 50 deletions

View File

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

View File

@ -11,16 +11,15 @@
"src-pythonparser": "src-pythonparser" "src-pythonparser": "src-pythonparser"
}, },
"locked": { "locked": {
"lastModified": 1669341018, "lastModified": 1670943503,
"narHash": "sha256-6tO/7AyiFfRdRLvA4p+lCQt9bRVN3n/dNWyGdKg43GM=", "narHash": "sha256-fCwznzhR6x4W8ZenrWHkYRYDfp0LGMhqvEBM9iPCLts=",
"ref": "release-7", "ref": "refs/heads/master",
"rev": "75d75cc13c15ab57948dbaeb0467fa9c021e84c2", "rev": "874d298ceb68ffa776592f855365ca5e2e885575",
"revCount": 8143, "revCount": 8243,
"type": "git", "type": "git",
"url": "https://github.com/m-labs/artiq.git" "url": "https://github.com/m-labs/artiq.git"
}, },
"original": { "original": {
"ref": "release-7",
"type": "git", "type": "git",
"url": "https://github.com/m-labs/artiq.git" "url": "https://github.com/m-labs/artiq.git"
} }
@ -51,6 +50,66 @@
"type": "github" "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"
}
},
"daxpkgs": {
"inputs": {
"artiq-stubs": "artiq-stubs",
"artiqpkgs": [
"artiq"
],
"flake8-artiq": "flake8-artiq",
"nixpkgs": [
"artiq",
"nixpkgs"
],
"sipyco": [
"artiq",
"sipyco"
],
"trap-dac-utils": "trap-dac-utils"
},
"locked": {
"lastModified": 1671209611,
"narHash": "sha256-IBIdF8inxa21DTkonUKQ25bTy/1twpQQjU1g5rbBWxo=",
"ref": "refs/heads/master",
"rev": "1c47f53cca6ba455df5c2f6566f138f0b8495a4b",
"revCount": 1080,
"type": "git",
"url": "https://gitlab.com/duke-artiq/dax.git"
},
"original": {
"type": "git",
"url": "https://gitlab.com/duke-artiq/dax.git"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
@ -66,6 +125,31 @@
"type": "github" "type": "github"
} }
}, },
"flake8-artiq": {
"inputs": {
"artiqpkgs": [
"daxpkgs",
"artiqpkgs"
],
"nixpkgs": [
"daxpkgs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1669758648,
"narHash": "sha256-nomQRpu/b8YTAma6kmbSRrz5D9l1l0TV+trKHukT1V8=",
"ref": "refs/heads/master",
"rev": "c4949e7a415d5e35a242d552d4bb83614693b92e",
"revCount": 85,
"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": { "mozilla-overlay": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -84,23 +168,24 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1666056570, "lastModified": 1669735802,
"narHash": "sha256-e7EkIY68Tp7NKyp9JSHh6CgPPdsKYYWxiL4wZQN8Cwg=", "narHash": "sha256-qtG/o/i5ZWZLmXw108N2aPiVsxOcidpHJYNkT45ry9Q=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "47edaa313fc3767ce3026037a5b62352f22f3602", "rev": "731cc710aeebecbf45a258e977e8b68350549522",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-22.05", "ref": "nixos-22.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"artiq": "artiq" "artiq": "artiq",
"daxpkgs": "daxpkgs"
} }
}, },
"sipyco": { "sipyco": {
@ -111,11 +196,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1664319253, "lastModified": 1669369686,
"narHash": "sha256-hycJAgy+NFF9f5I6++7yo8KdhMSyKCPKJazRPxeedI4=", "narHash": "sha256-YHez+S3PTUgtuliUNB5WM+RXcj8RKLbHVRvOgELSkwU=",
"owner": "m-labs", "owner": "m-labs",
"repo": "sipyco", "repo": "sipyco",
"rev": "d58ded7280e0f020be2446d4fee70f4393e6045f", "rev": "98db6eacb084c2c5280fb653bee3d313e3ca6df8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -143,11 +228,11 @@
"src-misoc": { "src-misoc": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1665395741, "lastModified": 1669779825,
"narHash": "sha256-7ULMGBPPn5NxZX6rdxU5GheoSNBiJklHQEVf04jU9tI=", "narHash": "sha256-l3lyy6dmbivo9Tppb08KHSyU89ZZG1CCcSjPlNRD210=",
"ref": "master", "ref": "master",
"rev": "4fb0730db4c5de7e86f82fa3bd204e6c4608af85", "rev": "2c255775f732a41ba1a512ab3d2547af4e25f674",
"revCount": 2427, "revCount": 2435,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/m-labs/misoc.git" "url": "https://github.com/m-labs/misoc.git"
@ -173,6 +258,31 @@
"repo": "pythonparser", "repo": "pythonparser",
"type": "github" "type": "github"
} }
},
"trap-dac-utils": {
"inputs": {
"artiqpkgs": [
"daxpkgs",
"artiqpkgs"
],
"nixpkgs": [
"daxpkgs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1671136817,
"narHash": "sha256-6uVX0st+0rp0sl2i9MOepxPpgpjGdlfwZ7jndnNKR9k=",
"ref": "refs/heads/master",
"rev": "8b754f0735c5efd0e467bed7680f9d1d93d027c3",
"revCount": 261,
"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", "root": "root",

215
flake.nix
View File

@ -1,17 +1,27 @@
{ {
description = "Additional packages for ARTIQ"; description = "Additional packages for ARTIQ";
inputs.artiq.url = git+https://github.com/m-labs/artiq.git?ref=release-7; inputs.artiq.url = git+https://github.com/m-labs/artiq.git;
outputs = { self, artiq }: inputs.daxpkgs = {
url = git+https://gitlab.com/duke-artiq/dax.git;
inputs = {
artiqpkgs.follows = "artiq";
nixpkgs.follows = "artiq/nixpkgs";
sipyco.follows = "artiq/sipyco";
};
};
outputs = { self, artiq, daxpkgs }:
let let
pkgs = import artiq.inputs.nixpkgs { system = "x86_64-linux"; }; pkgs = import artiq.inputs.nixpkgs { system = "x86_64-linux"; };
msys2 = import ./msys2 { inherit pkgs; };
condaDeps = with pkgs; [ zlib xorg.libSM xorg.libICE xorg.libX11 xorg.libXau xorg.libXi xorg.libXrender libselinux libGL ]; 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. # Use the full Anaconda distribution, which already contains conda-build and its many dependencies.
condaInstaller = pkgs.fetchurl { condaInstaller = pkgs.fetchurl {
url = "https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh"; url = "https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh";
sha256 = "sha256-/t+eNAA5VX97XoqKhq/6nSmfXpggFEvXuSrp9+4IrGA="; sha256 = "sha256-p8Cv6GL26hmlloAfwTi94EY6vLzht1Po1cR0tQai2y0=";
}; };
condaInstallerEnv = pkgs.buildFHSUserEnv { condaInstallerEnv = pkgs.buildFHSUserEnv {
name = "conda-installer-env"; name = "conda-installer-env";
@ -113,6 +123,7 @@
in rec { in rec {
inherit makeCondaChannel; inherit makeCondaChannel;
inherit (msys2) makeMsys2Package makeMsys2Repos;
packages.x86_64-linux = rec { packages.x86_64-linux = rec {
korad_ka3005p = pkgs.python3Packages.buildPythonPackage { korad_ka3005p = pkgs.python3Packages.buildPythonPackage {
pname = "korad_ka3005p"; pname = "korad_ka3005p";
@ -207,32 +218,9 @@
++ [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco ] ++ [ artiq.inputs.sipyco.packages.x86_64-linux.sipyco ]
++ (with pkgs.python3Packages; [ numpy scipy influxdb pyqtgraph setuptools ]); ++ (with pkgs.python3Packages; [ numpy scipy influxdb pyqtgraph setuptools ]);
}; };
flake8-artiq = pkgs.python3Packages.buildPythonPackage { flake8-artiq = daxpkgs.packages.x86_64-linux.flake8-artiq;
pname = "flake8-artiq"; dax = daxpkgs.packages.x86_64-linux.dax.overridePythonAttrs (oa: { doCheck = false; });
version = "0.1.0"; trap-dac-utils = daxpkgs.packages.x86_64-linux.trap-dac-utils;
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 { dax-applets = pkgs.python3Packages.buildPythonPackage rec {
pname = "dax-applets"; pname = "dax-applets";
version = "0.0.0"; version = "0.0.0";
@ -245,6 +233,62 @@
++ (with pkgs.python3Packages; [ numpy pyqt5 pyqtgraph ]); ++ (with pkgs.python3Packages; [ numpy pyqt5 pyqtgraph ]);
doCheck = false; 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 [ conda-channel = makeCondaChannel [
{ {
name = "sipyco"; name = "sipyco";
@ -342,11 +386,17 @@
src = flake8-artiq.src; src = flake8-artiq.src;
dependencies = [ "flake8" ]; dependencies = [ "flake8" ];
} }
{
name = "trap-dac-utils";
version = trap-dac-utils.version;
src = trap-dac-utils.src;
dependencies = trap-dac-utils.condaDependencies;
}
{ {
name = "dax"; name = "dax";
version = dax.version; version = dax.version;
src = dax.src; src = dax.src;
dependencies = [ "python>=3.7" "artiq" "sipyco" "numpy" "scipy" "pyvcd" "natsort" "pygit2" "matplotlib" "python-graphviz" "h5py" "networkx" "sortedcontainers" ]; dependencies = dax.condaDependencies;
} }
{ {
name = "dax-applets"; name = "dax-applets";
@ -355,6 +405,109 @@
dependencies = [ "python>=3.5" "artiq" "numpy" "pyqt" "pyqtgraph" ]; dependencies = [ "python>=3.5" "artiq" "numpy" "pyqt" "pyqtgraph" ];
} }
]; ];
msys2-pythonparser = msys2.makeMsys2Package rec {
name = "python-pythonparser";
version = artiq.packages.x86_64-linux.pythonparser.version;
src = artiq.packages.x86_64-linux.pythonparser.src;
depends = [ "mingw-w64-x86_64-python-regex" ];
};
msys2-sipyco = msys2.makeMsys2Package {
name = "python-sipyco";
src = artiq.inputs.sipyco.packages.x86_64-linux.sipyco.src;
inherit (artiq.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 = artiq.inputs.artiq-comtools.packages.x86_64-linux.artiq-comtools.src;
inherit (artiq.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";
src = artiq;
inherit (artiq.packages.x86_64-linux.artiq) version;
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 = artiq.packages.x86_64-linux.asyncserial.version;
src = artiq.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; hydraJobs = packages.x86_64-linux;

32
msys2/PKGBUILD.common Normal file
View File

@ -0,0 +1,32 @@
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}
}

75
msys2/default.nix Normal file
View File

@ -0,0 +1,75 @@
{ 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-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 {
makeMsys2Package = { name, version, src, depends }: 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}
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
'';
};
}

24
msys2/make_msys2_packages.sh Executable file
View File

@ -0,0 +1,24 @@
#!/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 | grep -v SigLevel | sed s\|/etc/pacman.d\|$MSYS2DIR/etc/pacman.d\|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

2
msys2/makepkg.conf Normal file
View File

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

197
msys2/msys2_packages.nix Normal file
View File

@ -0,0 +1,197 @@
{ pkgs } : [
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libiconv-1.17-1-any.pkg.tar.zst";
sha256 = "1pb1x5wrlmmpjdpzsc7rs5xk6ydlsd5mval0fwrqq54jf6dxdzpz";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-zlib-1.2.13-1-any.pkg.tar.zst";
sha256 = "0csqhgrsbig312abizx6ywr3xkvjzn2z4lhhfm11nxmvajyzcnpy";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-binutils-2.39-2-any.pkg.tar.zst";
sha256 = "15swxdp3zwqs9wvbqrc0fmchd1797qd81r7ipq3sqrrmf4bmq50g";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-headers-git-10.0.0.r113.g57fd0b77a-1-any.pkg.tar.zst";
sha256 = "0jpbp8lr2w5ri1cbws5gpa15683migava2alqzn7j116l1nxsfpl";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-crt-git-10.0.0.r113.g57fd0b77a-1-any.pkg.tar.zst";
sha256 = "102671kigbp3rdnwx7fsjgjvhxfgm67r2y98zpkr8qwv8pysqxc1";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gmp-6.2.1-3-any.pkg.tar.zst";
sha256 = "170640c8j81gl67kp85kr8kmg5axsl1vqwn9g7cx6vcr638qax9c";
})
(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-mpfr-4.1.0.p13-1-any.pkg.tar.zst";
sha256 = "17klcf17mddd7hsrak920zglqh00drqjdh6dxh3v3c4y62xj1qr6";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-mpc-1.2.1-1-any.pkg.tar.zst";
sha256 = "0761i6aga4982v6mw1hgqrrqznki0c8v93xkpf5fqmsjysfncscc";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libwinpthread-git-10.0.0.r113.g57fd0b77a-1-any.pkg.tar.zst";
sha256 = "139iq1g7y8si0wwsr8rnlah5rcp0fkww8vyg5r07l2345hajgxys";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-libs-12.2.0-4-any.pkg.tar.zst";
sha256 = "0qpnp2jypk5fgl6p3n22ayjx0in0q69s35b5qvpiqcik2c5q81gy";
})
(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.r113.g57fd0b77a-1-any.pkg.tar.zst";
sha256 = "06a0d3g8w4m9jnv36w0vjwrw8m0l12axiz2a49g14izykvv9md8b";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-zstd-1.5.2-2-any.pkg.tar.zst";
sha256 = "1f14wbc1yvjgv3rbwhv75391l55gcm0as6ipba20vw8phz4ax8ds";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-12.2.0-4-any.pkg.tar.zst";
sha256 = "0zxg7mhyl6cvs1zvj0i78sjn3j887nw22w0phllb558jyap8j5fh";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-expat-2.4.9-1-any.pkg.tar.zst";
sha256 = "1a1q03k4w1a0q12bi07l8bdjad3g4dqzag476l6qf35cgp5mwwj3";
})
(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.3-1-any.pkg.tar.zst";
sha256 = "05vh8p9saycj5i6sqbskv3l2l5fybq3j7nnaz1kfrnrklsgv1xaq";
})
(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-3-any.pkg.tar.zst";
sha256 = "1gy7fmn6jc13ipnyyq44gyhv8rvz5cy7gz1dm3wrna80hjnzli5v";
})
(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.3-5-any.pkg.tar.zst";
sha256 = "029z63bw9pwhamw1zi75fr112pxk934nh08by2l54lwdais0vjq8";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libtasn1-4.19.0-1-any.pkg.tar.zst";
sha256 = "09bgm2y25jyjm0pwn2imnr30nxzdd7j71ifmxkpabaqkpsfa5av5";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-p11-kit-0.24.1-3-any.pkg.tar.zst";
sha256 = "18ghwd6sy15hjp0si0ia85yvpv0fnawjdn8lxg3yyr93c6hdfssz";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-ca-certificates-20211016-3-any.pkg.tar.zst";
sha256 = "02x6dnbbyjm6mcl6ii61bc5rkwg3qsbaqd2lyzsp5732hxjcmmq4";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-openssl-1.1.1.q-1-any.pkg.tar.zst";
sha256 = "0rfb3z9jd0y6xjhv4qx1qqyyqgnzzlchbm07icpb4slgwjbm7cjg";
})
(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.1.002-2-any.pkg.tar.zst";
sha256 = "136fp0cymxqzgs4s8dmal1f4v6ns2mw8jn4cbfihxqb2cmf9yil8";
})
(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.39.2-1-any.pkg.tar.zst";
sha256 = "1rhq52cxafwgp73rhszwj2gcfdq20awrbjydg7a5zr6w8p0mvf2b";
})
(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.2.7-1-any.pkg.tar.zst";
sha256 = "1qpnp1wmwlgc4rv7xzvglad64z4spfjqfqimklpv96n2bwj0sdi2";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-tzdata-2022e-1-any.pkg.tar.zst";
sha256 = "0b9qi29sc4ky9whri5rm0ks17shyy251g4ykrjkdwfwspfsifc3m";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-3.10.8-1-any.pkg.tar.zst";
sha256 = "0c5fbr521lny98sxvn0xwshwb4kmmg33bmfhk1ygykyvvjm0jjfl";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-gcc-libgfortran-12.2.0-4-any.pkg.tar.zst";
sha256 = "1s61mkmhc6wqh2ary96xnjxv9k3bl2149g3xkb1qcxal6yssizzq";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-openblas-0.3.21-5-any.pkg.tar.zst";
sha256 = "1mzsc1ffkxn5ima2fv4dwqfgrzdnz52bnwfavlmjyapw2l2xzqjl";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-numpy-1.23.4-1-any.pkg.tar.zst";
sha256 = "1sbspwr0asxwmrwz5agmb4sjamy9ra84p2mvx4j6bwkg5vnwwasc";
})
(pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-setuptools-65.5.0-1-any.pkg.tar.zst";
sha256 = "16vb5r4lai77ljrdlhh4vsrp1jxzasmwmmb3b8jvra2ay3kxd95n";
})
]