1 /** 2 * MSYS installer 3 * 4 * License: 5 * This Source Code Form is subject to the terms of 6 * the Mozilla Public License, v. 2.0. If a copy of 7 * the MPL was not distributed with this file, You 8 * can obtain one at http://mozilla.org/MPL/2.0/. 9 * 10 * Authors: 11 * Vladimir Panteleev <ae@cy.md> 12 */ 13 14 module ae.sys.install.msys; 15 16 import std.file; 17 import std.path; 18 import std..string : format; 19 20 import ae.utils.meta : singleton, I; 21 22 public import ae.sys.install.common; 23 24 /// Installs an MSYS component. 25 final class MSYSComponent : Installer 26 { 27 string componentName, testFile, url; 28 this(string componentName, string testFile, string url) { this.componentName = componentName; this.testFile = testFile; this.url = url; } /// 29 30 @property override string name() { return "%s (MSYS)".format(componentName); } 31 @property override string subdirectory() { return "msys"; } 32 @property override string[] binPaths() { return ["bin"]; } 33 34 override @property bool installedLocally() 35 { 36 return directory.buildPath(testFile).exists; 37 } 38 39 override void atomicInstallImpl() 40 { 41 windowsOnly(); 42 if (!directory.exists) 43 directory.mkdir(); 44 url 45 .I!save() 46 .I!unpack() 47 .atomicMoveInto(directory); 48 assert(installedLocally); 49 } 50 51 static this() 52 { 53 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.18-1/msysCORE-1.0.18-1-msys-1.0.18-bin.tar.lzma" ] = "36d52ca7066eb6ad0da68c6f31214416f4c9dcec"; 54 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/gettext/gettext-0.18.1.1-1/libintl-0.18.1.1-1-msys-1.0.17-dll-8.tar.lzma" ] = "4000b935a5bc30b4c757fde69d27716fa3c2c269"; 55 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/libiconv/libiconv-1.14-1/libiconv-1.14-1-msys-1.0.17-dll-2.tar.lzma" ] = "056d16bfb7a91c3e3b1acf8adb20edea6fceecdd"; 56 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/termcap/termcap-0.20050421_1-2/libtermcap-0.20050421_1-2-msys-1.0.13-dll-0.tar.lzma" ] = "e4273ccfde8ecf3a7631446fb2b01971a24ff9f7"; 57 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/regex/regex-1.20090805-2/libregex-1.20090805-2-msys-1.0.13-dll-1.tar.lzma" ] = "d95faa144cf06625b3932a8e84ed1a6ab6bbe644"; 58 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/coreutils/coreutils-5.97-3/coreutils-5.97-3-msys-1.0.13-bin.tar.lzma" ] = "54ac256a8f0c6a89f1b3c7758f3703b4e56382be"; 59 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/bash/bash-3.1.23-1/bash-3.1.23-1-msys-1.0.18-bin.tar.xz" ] = "b6ef3399b8d76b5fbbd0a88774ebc2a90e8af13a"; 60 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/make/make-3.81-3/make-3.81-3-msys-1.0.13-bin.tar.lzma" ] = "c7264eb13b05cf2e1a982a3c2619837b96203a27"; 61 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/grep/grep-2.5.4-2/grep-2.5.4-2-msys-1.0.13-bin.tar.lzma" ] = "69d03c4415c55b9617850a4991d0708fbe3788f6"; 62 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/sed/sed-4.2.1-2/sed-4.2.1-2-msys-1.0.13-bin.tar.lzma" ] = "ced60ab96ab3f713da0d0a570232f2a5f0ec5270"; 63 urlDigests["https://sourceforge.net/projects/mingw/files/MSYS/Base/diffutils/diffutils-2.8.7.20071206cvs-3/diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin.tar.lzma"] = "674d3e0be4c8ffe84290f48ed1dd8eb21bc3f805"; 64 } 65 } 66 67 /// Definitions for some MSYS components. 68 struct MSYS 69 { 70 alias msysCORE = singleton!(MSYSComponent, "msysCORE" , "bin/msys-1.0.dll" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.18-1/msysCORE-1.0.18-1-msys-1.0.18-bin.tar.lzma" ); /// 71 alias libintl = singleton!(MSYSComponent, "libintl" , "bin/msys-intl-8.dll" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/gettext/gettext-0.18.1.1-1/libintl-0.18.1.1-1-msys-1.0.17-dll-8.tar.lzma" ); /// 72 alias libiconv = singleton!(MSYSComponent, "libiconv" , "bin/msys-iconv-2.dll" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/libiconv/libiconv-1.14-1/libiconv-1.14-1-msys-1.0.17-dll-2.tar.lzma" ); /// 73 alias libtermcap = singleton!(MSYSComponent, "libtermcap", "bin/msys-termcap-0.dll", "https://sourceforge.net/projects/mingw/files/MSYS/Base/termcap/termcap-0.20050421_1-2/libtermcap-0.20050421_1-2-msys-1.0.13-dll-0.tar.lzma" ); /// 74 alias libregex = singleton!(MSYSComponent, "libregex" , "bin/msys-regex-1.dll" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/regex/regex-1.20090805-2/libregex-1.20090805-2-msys-1.0.13-dll-1.tar.lzma" ); /// 75 76 alias coreutils = singleton!(MSYSComponent, "coreutils" , "bin/true.exe" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/coreutils/coreutils-5.97-3/coreutils-5.97-3-msys-1.0.13-bin.tar.lzma" ); /// 77 alias bash = singleton!(MSYSComponent, "bash" , "bin/bash.exe" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/bash/bash-3.1.23-1/bash-3.1.23-1-msys-1.0.18-bin.tar.xz" ); /// 78 alias make = singleton!(MSYSComponent, "make" , "bin/make.exe" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/make/make-3.81-3/make-3.81-3-msys-1.0.13-bin.tar.lzma" ); /// 79 alias grep = singleton!(MSYSComponent, "grep" , "bin/grep.exe" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/grep/grep-2.5.4-2/grep-2.5.4-2-msys-1.0.13-bin.tar.lzma" ); /// 80 alias sed = singleton!(MSYSComponent, "sed" , "bin/sed.exe" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/sed/sed-4.2.1-2/sed-4.2.1-2-msys-1.0.13-bin.tar.lzma" ); /// 81 alias diffutils = singleton!(MSYSComponent, "diffutils" , "bin/diff.exe" , "https://sourceforge.net/projects/mingw/files/MSYS/Base/diffutils/diffutils-2.8.7.20071206cvs-3/diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin.tar.lzma" ); /// 82 }