2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-28 12:48:26 +08:00
artiq/windows/default.nix

62 lines
1.8 KiB
Nix
Raw Normal View History

2022-04-05 10:12:29 +08:00
{ sipyco, nac3, artiq-comtools, artiq }:
let
pkgs = import nac3.inputs.nixpkgs { system = "x86_64-linux"; };
makeMsys2 = { name, version, src }: pkgs.stdenvNoCC.mkDerivation {
pname = "${name}-msys2-pkg";
inherit version;
nativeBuildInputs = [
pkgs.pacman pkgs.fakeroot pkgs.libarchive pkgs.zstd pkgs.file
nac3.packages.x86_64-w64-mingw32.wine-msys2-build
];
inherit src;
phases = [ "buildPhase" "installPhase" ];
buildPhase =
''
export DRV_VERSION=${version}
ln -s ${./PKGBUILD.${name}} PKGBUILD
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
'';
};
2022-04-05 10:40:52 +08:00
in rec {
2022-04-05 10:12:29 +08:00
sipyco-pkg = makeMsys2 {
name = "sipyco";
src = sipyco;
inherit (sipyco.packages.x86_64-linux.sipyco) version;
};
artiq-comtools-pkg = makeMsys2 {
name = "artiq-comtools";
src = artiq-comtools;
inherit (artiq-comtools.packages.x86_64-linux.artiq-comtools) version;
};
artiq-pkg = makeMsys2 {
name = "artiq";
src = artiq;
inherit (artiq.packages.x86_64-linux.artiq) version;
};
2022-04-05 10:40:52 +08:00
msys2-repos = pkgs.stdenvNoCC.mkDerivation {
name = "msys2-repos";
nativeBuildInputs = [ pkgs.pacman ];
phases = [ "buildPhase" ];
buildPhase =
''
mkdir $out
cd $out
ln -s ${sipyco-pkg}/*.pkg.tar.zst .
ln -s ${artiq-comtools-pkg}/*.pkg.tar.zst .
2022-04-05 10:55:52 +08:00
ln -s ${nac3.packages.x86_64-w64-mingw32.nac3artiq-pkg}/*.pkg.tar.zst .
2022-04-05 10:40:52 +08:00
ln -s ${artiq-pkg}/*.pkg.tar.zst .
repo-add artiq.db.tar.gz *.pkg.tar.zst
'';
};
2022-04-05 10:12:29 +08:00
}