wfvm: automate make_msys_packages.sh

This commit is contained in:
Sebastien Bourdeauducq 2020-06-15 14:03:46 +08:00
parent 107340b08a
commit dcb8e499df
1 changed files with 33 additions and 43 deletions

View File

@ -1,52 +1,42 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Obtain the list with e.g. pacman -Sp %TOOLPREF%gcc %TOOLPREF%binutils make autoconf automake libtool texinfo set -e
read -r -d '' packages << EOM nix-build -E "
http://repo.msys2.org/mingw/i686/mingw-w64-i686-libiconv-1.16-1-any.pkg.tar.xz let
http://repo.msys2.org/mingw/i686/mingw-w64-i686-zlib-1.2.11-7-any.pkg.tar.xz pkgs = import <nixpkgs> {};
http://repo.msys2.org/mingw/i686/mingw-w64-i686-binutils-2.34-3-any.pkg.tar.zst wfvm = import ../default.nix { inherit pkgs; };
http://repo.msys2.org/mingw/i686/mingw-w64-i686-headers-git-8.0.0.5905.066f1b3c-1-any.pkg.tar.zst in
http://repo.msys2.org/mingw/i686/mingw-w64-i686-crt-git-8.0.0.5905.066f1b3c-1-any.pkg.tar.zst wfvm.utils.wfvm-run {
http://repo.msys2.org/mingw/i686/mingw-w64-i686-isl-0.22.1-1-any.pkg.tar.xz name = \"get-msys-packages\";
http://repo.msys2.org/mingw/i686/mingw-w64-i686-gmp-6.2.0-1-any.pkg.tar.xz image = wfvm.makeWindowsImage { installCommands = [ wfvm.layers.msys2 ]; };
http://repo.msys2.org/mingw/i686/mingw-w64-i686-mpfr-4.0.2-2-any.pkg.tar.xz script = ''
http://repo.msys2.org/mingw/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz cat > getmsyspackages.bat << EOF
http://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst set MSYS=C:\\MSYS64
http://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-10.1.0-3-any.pkg.tar.zst set ARCH=32
http://repo.msys2.org/mingw/i686/mingw-w64-i686-windows-default-manifest-6.4-3-any.pkg.tar.xz set TOOLPREF=mingw-w64-i686-
http://repo.msys2.org/mingw/i686/mingw-w64-i686-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst set TRIPLE=x86_64-pc-mingw32
http://repo.msys2.org/mingw/i686/mingw-w64-i686-zstd-1.4.5-1-any.pkg.tar.zst set PATH=%MSYS%\usr\bin;%MSYS%\mingw%ARCH%\bin;%PATH%
http://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-10.1.0-3-any.pkg.tar.zst pacman -Sp %TOOLPREF%gcc %TOOLPREF%binutils make autoconf automake libtool texinfo > packages.txt
http://repo.msys2.org/msys/x86_64/make-4.3-1-x86_64.pkg.tar.xz EOF
http://repo.msys2.org/msys/x86_64/m4-1.4.18-2-x86_64.pkg.tar.xz \${wfvm.utils.win-put}/bin/win-put getmsyspackages.bat
http://repo.msys2.org/msys/x86_64/diffutils-3.7-1-x86_64.pkg.tar.xz \${wfvm.utils.win-exec}/bin/win-exec getmsyspackages
http://repo.msys2.org/msys/x86_64/autoconf-2.69-5-any.pkg.tar.xz \${wfvm.utils.win-get}/bin/win-get packages.txt
http://repo.msys2.org/msys/x86_64/automake1.6-1.6.3-2-any.pkg.tar.xz '';
http://repo.msys2.org/msys/x86_64/automake1.7-1.7.9-2-any.pkg.tar.xz }
http://repo.msys2.org/msys/x86_64/automake1.8-1.8.5-3-any.pkg.tar.xz "
http://repo.msys2.org/msys/x86_64/automake1.9-1.9.6-2-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake1.10-1.10.3-3-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake1.11-1.11.6-3-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake1.12-1.12.6-3-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake1.13-1.13.4-4-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake1.14-1.14.1-3-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake1.15-1.15.1-1-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake1.16-1.16.1-1-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/automake-wrapper-11-1-any.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/libltdl-2.4.6-9-x86_64.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/tar-1.32-1-x86_64.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz
http://repo.msys2.org/msys/x86_64/texinfo-6.7-1-x86_64.pkg.tar.xz
EOM
echo "{ pkgs } : [" ./result/bin/wfvm-run-get-msys-packages
for package in $packages; do
echo "{ pkgs } : [" > msys_packages.nix
while read package; do
hash=$(nix-prefetch-url $package) hash=$(nix-prefetch-url $package)
echo " echo "
(pkgs.fetchurl { (pkgs.fetchurl {
url = \"$package\"; url = \"$package\";
sha256 = \"$hash\"; sha256 = \"$hash\";
})" })" >> msys_packages.nix
done done < packages.txt
echo "]" echo "]" >> msys_packages.nix
rm result getmsyspackages.bat packages.txt