msys2: refactor PKGBUILDs

This commit is contained in:
Sebastien Bourdeauducq 2022-10-24 19:18:06 +08:00
parent b5385faa4d
commit 2f56fa9b6c
6 changed files with 35 additions and 69 deletions

View File

@ -414,30 +414,51 @@
}
];
msys2-levenshtein = msys2.makeMsys2Package {
name = "levenshtein";
msys2-levenshtein = msys2.makeMsys2Package rec {
name = "python-levenshtein";
src = pkgs.fetchFromGitHub {
owner = "maxbachmann";
repo = "Levenshtein";
rev = "v0.17.0";
rev = "v{version}";
sha256 = "sha256-onDC/YC4UC7klyS3TsEwZKsx/40/nVQzLUuSMARnJKg=";
};
version = "0.17.0";
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-sipyco = msys2.makeMsys2Package {
name = "sipyco";
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-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-levenshtein"
"mingw-w64-x86_64-lld"
"mingw-w64-x86_64-artiq-comtools"
];
};
msys2-repos = msys2.makeMsys2Repos [ msys2-levenshtein msys2-sipyco msys2-artiq-comtools msys2-artiq ];
};

View File

@ -1,25 +0,0 @@
pkgbase="mingw-w64-artiq"
pkgname="mingw-w64-x86_64-artiq"
pkgrel=1
pkgdesc="A leading-edge control system for quantum information experiments"
license=("LGPL")
depends=(
"mingw-w64-x86_64-python"
"mingw-w64-x86_64-python-h5py"
"mingw-w64-x86_64-python-pyqt5"
"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-levenshtein"
"mingw-w64-x86_64-lld"
"mingw-w64-x86_64-artiq-comtools"
)
source PKGBUILD.common

View File

@ -1,13 +0,0 @@
pkgbase="mingw-w64-artiq-comtools"
pkgname="mingw-w64-x86_64-artiq-comtools"
pkgrel=1
pkgdesc="Lightweight ARTIQ communication tools"
license=("LGPL")
depends=(
"mingw-w64-x86_64-python"
"mingw-w64-x86_64-python-sipyco"
"mingw-w64-x86_64-python-numpy"
"mingw-w64-x86_64-python-aiohttp"
)
source PKGBUILD.common

View File

@ -1,13 +0,0 @@
pkgbase="mingw-w64-python-levenshtein"
pkgname="mingw-w64-x86_64-python-levenshtein"
pkgrel=1
pkgdesc="Python extension for computing string edit distances and similarities."
license=("GPL2")
depends=(
"mingw-w64-x86_64-python"
"mingw-w64-x86_64-python-sipyco"
"mingw-w64-x86_64-python-numpy"
"mingw-w64-x86_64-python-aiohttp"
)
source PKGBUILD.common

View File

@ -1,12 +0,0 @@
pkgbase="mingw-w64-python-sipyco"
pkgname="mingw-w64-x86_64-python-sipyco"
pkgrel=1
pkgdesc="Simple Python Communications"
license=("LGPL")
depends=(
"mingw-w64-x86_64-python"
"mingw-w64-x86_64-python-numpy"
"mingw-w64-x86_64-python-pybase64"
)
source PKGBUILD.common

View File

@ -25,7 +25,7 @@ let
exec ${pkgs.wineWowPackages.stable}/bin/wine64 $@
'';
in {
makeMsys2Package = { name, version, src }: pkgs.stdenvNoCC.mkDerivation {
makeMsys2Package = { name, version, src, depends }: pkgs.stdenvNoCC.mkDerivation {
pname = "${name}-msys2-pkg";
inherit version;
nativeBuildInputs = [
@ -37,7 +37,15 @@ in {
buildPhase =
''
export DRV_VERSION=${version}
ln -s ${./PKGBUILD.${name}} PKGBUILD
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