-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Msys2 #891
Merged
Merged
Msys2 #891
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b7fd5a5
content of the original package + new icon
majkinetor 7e28f9c
(msys2) AU updater; legal; nuspec
majkinetor c7d8a9e
AU updater now uses xz instead of exe
majkinetor 8c6d238
(msys2) new choco install and docs
majkinetor fa83a14
(msys2) repeat pacman until everything installed; docs
majkinetor 043bd5b
(msys2) parameter changed to NoUpdate
majkinetor 26bf393
(ruby) docs updated to mention msys2
majkinetor 52734fe
(msys) extra scripts removed
majkinetor 9532d3c
(msys2) readme fix
majkinetor 763d79b
(msys2) fix AU updater
majkinetor 8f332a3
(msys2) use $install_dir consistently
majkinetor e54f190
(msys2) add uninstaller
majkinetor f2a9eef
(msys2) fix path uninstall
majkinetor ce223c1
(msys2) added proxy handling
majkinetor 89d302a
(msys2) added proxy message
majkinetor 4866eaf
(msys2) version to 0.0
majkinetor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# <img src="" width="48" height="48"/> [msys2](https://chocolatey.org/packages/msys2) | ||
|
||
MSYS2 is a software distro and building platform for Windows. | ||
|
||
At its core is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software. It provides a bash shell, Autotools, revision control systems and the like for building native Windows applications using MinGW-w64 toolchains. | ||
|
||
It features a package management system to provide easy installation of packages, Pacman. It brings many powerful features such as dependency resolution and simple complete system upgrades, as well as straight-forward package building. | ||
|
||
## Package parameters | ||
|
||
- `/InstallDir` - Path to installation directory, by default msys will be installed in `Get-ToolsLocation`. | ||
- `/NoPath` - Do not add msys installation directory to system PATH. | ||
- `/NoUpdate` - Do not automatically update with Pacman according to the [official instructions](https://msys2.github.io). | ||
|
||
## Notes | ||
|
||
- MSYS2 itself will not be installed again on updating or reinstalling the Chocolatey package. Instead, the existing MSYS2 will be updated with Pacman. Manually delete the installation folder to force complete reinstallation. | ||
|
||
### Ruby integration | ||
|
||
This package can be used with [ruby](https://chocolatey.org/packages/ruby) package to provide native building environment for gems. | ||
|
||
- The ruby installer comes with `ridk` function which offers interactive GUI installation wizard of msys2 and hence [can't be used unattended](https://github.com/oneclick/rubyinstaller2/issues/79) (`ridk install 1`). | ||
- Its system update is the same as initialization done with this package (`ridk install 2`). | ||
- Ruby installer offers unattended setup of MSYS2 and MINGW development toolchain (`ridk install 3`). | ||
|
||
You can also just install the msys2 package without system update and use `ridk` afterwards: | ||
|
||
```powershell | ||
cinst ruby # install ruby | ||
cinst msys2 --params "/NoUpdate" # install msys2 without system update | ||
Update-SessionEnvironment # refresh environment vars | ||
ridk install 2 3 # use ruby's ridk to update the system and install development toolchain | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2013, Алексей | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
|
||
* Neither the name of the {organization} nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
VERIFICATION | ||
|
||
Verification is intended to assist the Chocolatey moderators and community | ||
in verifying that this package's contents are trustworthy. | ||
|
||
Package can be verified like this: | ||
|
||
1. Go to | ||
|
||
x32: http://repo.msys2.org/distrib/i686/msys2-base-i686-20161025.tar.xz | ||
x64: http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20161025.tar.xz | ||
|
||
to download the installer. | ||
|
||
2. You can use one of the following methods to obtain the SHA256 checksum: | ||
- Use powershell function 'Get-FileHash' | ||
- Use Chocolatey utility 'checksum.exe' | ||
|
||
checksum32: 8BAFD3D52F5A51528A8671C1CAE5591B36086D6EA5B1E76E17E390965CF6768F | ||
checksum64: BB1F1A0B35B3D96BF9C15092DA8CE969A84A134F7B08811292FBC9D84D48C65D | ||
|
||
File 'LICENSE.txt' is obtained from: | ||
https://raw.githubusercontent.com/Alexpux/MSYS2-packages/master/LICENSE | ||
|
||
File 'COPYING' is obtained from: | ||
https://github.com/Alexpux/MSYS2-pacman/blob/master/COPYING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> | ||
<metadata> | ||
<id>msys2</id> | ||
<version>0.0</version> | ||
<title>MSYS2</title> | ||
<authors>Alexpux, martell, mingwandroid, elieux, renatosilva, niXman</authors> | ||
<owners>chocolatey, userzimmermann, petemounce</owners> | ||
<licenseUrl>https://github.com/userzimmermann/choco-packages/blob/master/msys2/NOTICE</licenseUrl> | ||
<projectUrl>http://msys2.github.io</projectUrl> | ||
<iconUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/icons/msys2.png</iconUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description><![CDATA[MSYS2 is a software distro and building platform for Windows. | ||
|
||
At its core is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software. It provides a bash shell, Autotools, revision control systems and the like for building native Windows applications using MinGW-w64 toolchains. | ||
|
||
It features a package management system to provide easy installation of packages, Pacman. It brings many powerful features such as dependency resolution and simple complete system upgrades, as well as straight-forward package building. | ||
|
||
## Package parameters | ||
|
||
- `/InstallDir` - Path to installation directory, by default msys will be installed in `Get-ToolsLocation`. | ||
- `/NoPath` - Do not add msys installation directory to system PATH. | ||
- `/NoUpdate` - Do not automatically update with Pacman according to the [official instructions](https://msys2.github.io). | ||
|
||
## Notes | ||
|
||
- MSYS2 itself will not be installed again on updating or reinstalling the Chocolatey package. Instead, the existing MSYS2 will be updated with Pacman. Manually delete the installation folder to force complete reinstallation. | ||
|
||
### Ruby integration | ||
|
||
This package can be used with [ruby](https://chocolatey.org/packages/ruby) package to provide native building environment for gems. | ||
|
||
- The ruby installer comes with `ridk` function which offers interactive GUI installation wizard of msys2 and hence [can't be used unattended](https://github.com/oneclick/rubyinstaller2/issues/79) (`ridk install 1`). | ||
- Its system update is the same as initialization done with this package (`ridk install 2`). | ||
- Ruby installer offers unattended setup of MSYS2 and MINGW development toolchain (`ridk install 3`). | ||
|
||
You can also just install the msys2 package without system update and use `ridk` afterwards: | ||
|
||
```powershell | ||
cinst ruby # install ruby | ||
cinst msys2 --params "/NoUpdate" # install msys2 without system update | ||
Update-SessionEnvironment # refresh environment vars | ||
ridk install 2 3 # use ruby's ridk to update the system and install development toolchain | ||
``` | ||
]]></description> | ||
<summary>A Cygwin-derived software distro for Windows using Arch Linux's Pacman</summary> | ||
<releaseNotes>https://github.com/userzimmermann/choco-packages/blob/master/msys2/CHANGES.md</releaseNotes> | ||
<copyright>MSYS2 Copyright (c) 2013, Алексей</copyright> | ||
<tags>msys2 msys cygwin mingw gnu linux unix posix arch pacman bash makepkg gcc shell cli foss development</tags> | ||
<projectSourceUrl>https://github.com/Alexpux/MSYS2-packages</projectSourceUrl> | ||
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/msys2</packageSourceUrl> | ||
<docsUrl>https://github.com/msys2/msys2/wiki</docsUrl> | ||
<dependencies> | ||
<dependency id="chocolatey" version="0.10.8" /> | ||
<dependency id="chocolatey-core.extension" version="1.3.3" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
<file src="legal\**" target="legal" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
$toolsDir = Split-Path $MyInvocation.MyCommand.Definition | ||
|
||
$pp = Import-Clixml $toolsDir\pp.xml | ||
if (!$pp.NoPath) { | ||
$user_path = [System.Environment]::GetEnvironmentVariable('PATH', 'User') | ||
$newPath = $user_path.Replace(";" + $pp.InstallDir, '') | ||
if ($newPath -ne $user_path) { | ||
Write-Host "Removing from user PATH" | ||
[System.Environment]::SetEnvironmentVariable('PATH', $newPath, 'User') | ||
} | ||
} | ||
|
||
Write-Host "Please remove install dir manually when you don't need it anymore." | ||
Write-Host "Install dir: " $pp.InstallDir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
$toolsDir = Split-Path $MyInvocation.MyCommand.Definition | ||
$is64 = (Get-ProcessorBits 64) -and $env:chocolateyForceX86 -ne 'true' | ||
$dir_name = if ($is64) { 'msys64' } else { 'msys32' } | ||
|
||
$pp = Get-PackageParameters | ||
if (!$pp.InstallDir) { $pp.InstallDir = "{0}\{1}" -f (Get-ToolsLocation), $dir_name } | ||
$install_dir = $pp.InstallDir | ||
$pp | Export-Clixml $toolsDir\pp.xml | ||
|
||
if (!(Test-Path $install_dir)) { | ||
Write-Host "Installing to:" $install_dir | ||
$packageArgs = @{ | ||
PackageName = $Env:ChocolateyPackageName | ||
FileFullPath = gi $toolsDir\*-i686* | ||
FileFullPath64 = gi $toolsDir\*-x86_64* | ||
Destination = $install_dir | ||
} | ||
Get-ChocolateyUnzip @packageArgs | ||
rm $toolsPath\*.xz -ea 0 | ||
|
||
$tarFile = gi "$install_dir\*.tar" | ||
Get-ChocolateyUnzip $tarFile $install_dir | ||
rm "$install_dir\*.tar" -ea 0 | ||
$tardir = gi "$install_dir\msys*" | ||
mv $tardir\* $install_dir; rm $tardir | ||
} else { Write-Host "'$install_dir' already exists and will only be updated." } | ||
|
||
if ($proxy = Get-EffectiveProxy) { | ||
Write-Host "Using CLI proxy:" $proxy | ||
$Env:http_proxy = $Env:https_proxy = $proxy | ||
} | ||
|
||
#https://github.com/msys2/msys2/wiki/MSYS2-installation | ||
Write-Host "Starting initialization via msys2_shell.cmd" | ||
Start-Process "$install_dir\msys2_shell.cmd" -Wait -ArgumentList '-c', exit | ||
|
||
if (!$pp.NoPath) { Install-ChocolateyPath $pp.InstallDir } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The path will need to be removed in an uninstall script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
if (!$pp.NoUpdate) { | ||
Write-Host "Repeating system update until there are no more updates or max 5 iterations" | ||
$ErrorActionPreference = 'Continue' #otherwise bash warnings will exit | ||
sal bash "$install_dir\usr\bin\bash.exe" | ||
while (!$done) { | ||
Write-Host "`n================= SYSTEM UPDATE $((++$i)) =================`n" | ||
bash -lc 'pacman --noconfirm -Syuu | tee /update.log' | ||
$done = (gc $install_dir\update.log) -match 'there is nothing to do' | Measure | % { $_.Count -eq 2 } | ||
$done = $done -or ($i -ge 5) | ||
} | ||
rm $install_dir\update.log -ea 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import-module au | ||
|
||
$releases = 'http://repo.msys2.org/distrib' | ||
|
||
function global:au_SearchReplace { | ||
@{ | ||
".\legal\VERIFICATION.txt" = @{ | ||
"(?i)(\s+x32:).*" = "`${1} $($Latest.URL32)" | ||
"(?i)(\s+x64:).*" = "`${1} $($Latest.URL64)" | ||
"(?i)(checksum32:).*" = "`${1} $($Latest.Checksum32)" | ||
"(?i)(checksum64:).*" = "`${1} $($Latest.Checksum64)" | ||
} | ||
} | ||
} | ||
|
||
function global:au_BeforeUpdate { Get-RemoteFiles -Purge -NoSuffix } | ||
|
||
function global:au_GetLatest { | ||
$re = '\.xz$' | ||
|
||
$download_page = Invoke-WebRequest -Uri "$releases/i686" -UseBasicParsing | ||
$url32 = $download_page.Links | ? href -match $re | select -Last 1 | % { "$releases/i686/" + $_.href } | ||
$version32 = $url32 -split '/|-|\.' | select -Last 1 -Skip 2 | ||
|
||
$download_page = Invoke-WebRequest -Uri "$releases/x86_64" -UseBasicParsing | ||
$url64 = $download_page.Links | ? href -match $re | select -Last 1 | % { "$releases/x86_64/" + $_.href } | ||
$version64 = $url64 -split '/|-|\.' | select -Last 1 -Skip 2 | ||
|
||
if ($version32 -ne $version64) { throw "x32 and x64 versions are not the same" } | ||
|
||
@{ | ||
Version = "$version32.0.0" | ||
URL32 = $url32 | ||
URL64 = $url64 | ||
} | ||
} | ||
|
||
update -ChecksumFor none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since allowing custom installation directory, an uninstall script is needed to remove the path on uninstall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original package was not removing the directory. I added a message as was there before as I also think its safer to not delete it. Perhaps there is no harm in removing it but its a minor issue anyway so I opted for the safe side.