Unpacking Software Livestream

Join our monthly Unpacking Software livestream to hear about the latest news, chat and opinion on packaging, software deployment and lifecycle management!

Learn More

Chocolatey Product Spotlight

Join the Chocolatey Team on our regular monthly stream where we put a spotlight on the most recent Chocolatey product releases. You'll have a chance to have your questions answered in a live Ask Me Anything format.

Learn More

Chocolatey Coding Livestream

Join us for the Chocolatey Coding Livestream, where members of our team dive into the heart of open source development by coding live on various Chocolatey projects. Tune in to witness real-time coding, ask questions, and gain insights into the world of package management. Don't miss this opportunity to engage with our team and contribute to the future of Chocolatey!

Learn More

Calling All Chocolatiers! Whipping Up Windows Automation with Chocolatey Central Management

Webinar from
Wednesday, 17 January 2024

We are delighted to announce the release of Chocolatey Central Management v0.12.0, featuring seamless Deployment Plan creation, time-saving duplications, insightful Group Details, an upgraded Dashboard, bug fixes, user interface polishing, and refined documentation. As an added bonus we'll have members of our Solutions Engineering team on-hand to dive into some interesting ways you can leverage the new features available!

Watch On-Demand
Chocolatey Community Coffee Break

Join the Chocolatey Team as we discuss all things Community, what we do, how you can get involved and answer your Chocolatey questions.

Watch The Replays
Chocolatey and Intune Overview

Webinar Replay from
Wednesday, 30 March 2022

At Chocolatey Software we strive for simple, and teaching others. Let us teach you just how simple it could be to keep your 3rd party applications updated across your devices, all with Intune!

Watch On-Demand
Chocolatey For Business. In Azure. In One Click.

Livestream from
Thursday, 9 June 2022

Join James and Josh to show you how you can get the Chocolatey For Business recommended infrastructure and workflow, created, in Azure, in around 20 minutes.

Watch On-Demand
The Future of Chocolatey CLI

Livestream from
Thursday, 04 August 2022

Join Paul and Gary to hear more about the plans for the Chocolatey CLI in the not so distant future. We'll talk about some cool new features, long term asks from Customers and Community and how you can get involved!

Watch On-Demand
Hacktoberfest Tuesdays 2022

Livestreams from
October 2022

For Hacktoberfest, Chocolatey ran a livestream every Tuesday! Re-watch Cory, James, Gary, and Rain as they share knowledge on how to contribute to open-source projects such as Chocolatey CLI.

Watch On-Demand

Downloads:

729,665

Downloads of v 3.10.3.0:

10

Last Update:

17 Jul 2024

Published Date:

17 Jul 2024

Package Maintainer(s):

Software Author(s):

  • Cabal Team

Tags:

cabal ghc haskell

Cabal

(Waiting for Maintainer to take corrective action)

  • 1
  • 2
  • 3

3.10.3.0 | Updated: 17 Jul 2024

Downloads:

729,665

Downloads of v 3.10.3.0:

10

Published:

17 Jul 2024

Maintainer(s):

Software Author(s):

  • Cabal Team

Tags:

cabal ghc haskell

Cabal 3.10.3.0

(Waiting for Maintainer to take corrective action)
  • 1
  • 2
  • 3

Some Checks Have Failed or Are Not Yet Complete

Not All Tests Have Passed


Validation Testing Passed


Verification Testing Failed

Details

Scan Testing Pending

IMPORTANT

This version is in moderation and has not yet been approved. This means it doesn't show up under normal search.

  • Until approved, you should consider this package version unsafe - it could do very bad things to your system (it probably doesn't but you have been warned, that's why we have moderation).
  • This package version can change wildly over the course of moderation until it is approved. If you install it and it later has changes to this version, you will be out of sync with any changes that have been made to the package. Until approved, you should consider that this package version doesn't even exist.
  • You cannot install this package under normal scenarios. See How to install package version under moderation for more information.
  • There are also no guarantees that it will be approved.
WARNING

There are versions of this package awaiting moderation (possibly just this one). See the Version History section below.

Phyx (maintainer) on 12 Jun 2024 19:16:27 +00:00:

User 'Phyx' (maintainer) submitted package.

chocolatey-ops (reviewer) on 12 Jun 2024 19:51:37 +00:00:

cabal has passed automated validation. It may have or may still fail other checks like testing (verification).
NOTE: No required changes that the validator checks have been flagged! It is appreciated if you fix other items, but only Requirements will hold up a package version from approval. A human review could still turn up issues a computer may not easily find.

Guidelines

Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time Guidelines can become Requirements. A package version can be approved without addressing Guideline comments but will reduce the quality of the package.

  • This packages has used a function that doesn't have an automatic undo on uninstall, so it will also need an uninstall script. Please correcting that by adding a chocolateyUninstall.ps1 to the package to undo the action. More...
  • Chocolatey Packages are meant to be thin wrappers on top of the native installation packages, as a result, there is an expectation that the installation scripts will be less than 100 lines. Can the automation scripts be simplified? More...

chocolatey-ops (reviewer) on 12 Jun 2024 23:06:42 +00:00:

cabal has failed automated package testing (verification).
Please visit https://gist.github.com/choco-bot/0a4fad0ba3c6b1a56b736d5c378fa5fc for details.
The package status will be changed and will be waiting on your next actions.

  • NEW! We have a test environment for you to replicate the testing we do. This can be used at any time to test packages! See https://github.com/chocolatey-community/chocolatey-test-environment
  • Please log in and leave a review comment if you have questions and/or comments.
  • If you see the verifier needs to rerun testing against the package without resubmitting (a issue in the test results), you can do that on the package page in the review section.
  • If the verifier is incompatible with the package, please log in and leave a review comment if the package needs to bypass testing (e.g. package installs specific drivers).
  • Automated testing can also fail when a package is not completely silent or has pop ups (AutoHotKey can assist - a great example is the VeraCrypt package).
  • A package that cannot be made completely unattended should have the notSilent tag. Note that this must be approved by moderators.

Phyx (maintainer) on 13 Jun 2024 03:28:02 +00:00:

User 'Phyx' (maintainer) submitted package.

chocolatey-ops (reviewer) on 13 Jun 2024 04:03:38 +00:00:

cabal has failed automated validation.

Requirements

Requirements represent the minimum quality of a package that is acceptable. When a package version has failed requirements, the package version requires fixing and/or response by the maintainer. Provided a Requirement has flagged correctly, it must be fixed before the package version can be approved. The exact same version should be uploaded during moderation review.

  • We were unable to find a package, and are unable to continue validation. Please try uploading the package again. If you encounter this message again, please contact the Site Administrators.

Phyx (maintainer) on 13 Jun 2024 04:31:52 +00:00:

Rerun
Validation Status Change - Validation tests have been set to rerun.

chocolatey-ops (reviewer) on 13 Jun 2024 04:33:44 +00:00:

cabal has passed automated validation. It may have or may still fail other checks like testing (verification).
NOTE: No required changes that the validator checks have been flagged! It is appreciated if you fix other items, but only Requirements will hold up a package version from approval. A human review could still turn up issues a computer may not easily find.

Guidelines

Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time Guidelines can become Requirements. A package version can be approved without addressing Guideline comments but will reduce the quality of the package.

  • This packages has used a function that doesn't have an automatic undo on uninstall, so it will also need an uninstall script. Please correcting that by adding a chocolateyUninstall.ps1 to the package to undo the action. More...
  • Chocolatey Packages are meant to be thin wrappers on top of the native installation packages, as a result, there is an expectation that the installation scripts will be less than 100 lines. Can the automation scripts be simplified? More...

chocolatey-ops (reviewer) on 13 Jun 2024 05:44:53 +00:00:

cabal has failed automated package testing (verification).
Please visit https://gist.github.com/choco-bot/88c16ed135fd40207948747aa02cf843 for details.
The package status will be changed and will be waiting on your next actions.

  • NEW! We have a test environment for you to replicate the testing we do. This can be used at any time to test packages! See https://github.com/chocolatey-community/chocolatey-test-environment
  • Please log in and leave a review comment if you have questions and/or comments.
  • If you see the verifier needs to rerun testing against the package without resubmitting (a issue in the test results), you can do that on the package page in the review section.
  • If the verifier is incompatible with the package, please log in and leave a review comment if the package needs to bypass testing (e.g. package installs specific drivers).
  • Automated testing can also fail when a package is not completely silent or has pop ups (AutoHotKey can assist - a great example is the VeraCrypt package).
  • A package that cannot be made completely unattended should have the notSilent tag. Note that this must be approved by moderators.

Phyx (maintainer) on 14 Jun 2024 04:20:33 +00:00:

User 'Phyx' (maintainer) submitted package.

chocolatey-ops (reviewer) on 14 Jun 2024 04:56:14 +00:00:

cabal has passed automated validation. It may have or may still fail other checks like testing (verification).
NOTE: No required changes that the validator checks have been flagged! It is appreciated if you fix other items, but only Requirements will hold up a package version from approval. A human review could still turn up issues a computer may not easily find.

Guidelines

Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time Guidelines can become Requirements. A package version can be approved without addressing Guideline comments but will reduce the quality of the package.

  • This packages has used a function that doesn't have an automatic undo on uninstall, so it will also need an uninstall script. Please correcting that by adding a chocolateyUninstall.ps1 to the package to undo the action. More...
  • Chocolatey Packages are meant to be thin wrappers on top of the native installation packages, as a result, there is an expectation that the installation scripts will be less than 100 lines. Can the automation scripts be simplified? More...

chocolatey-ops (reviewer) on 14 Jun 2024 05:05:23 +00:00:

cabal has failed automated package testing (verification).
Please visit https://gist.github.com/choco-bot/64c2687c678619abbdf5710bf4aa2c6f for details.
The package status will be changed and will be waiting on your next actions.

  • NEW! We have a test environment for you to replicate the testing we do. This can be used at any time to test packages! See https://github.com/chocolatey-community/chocolatey-test-environment
  • Please log in and leave a review comment if you have questions and/or comments.
  • If you see the verifier needs to rerun testing against the package without resubmitting (a issue in the test results), you can do that on the package page in the review section.
  • If the verifier is incompatible with the package, please log in and leave a review comment if the package needs to bypass testing (e.g. package installs specific drivers).
  • Automated testing can also fail when a package is not completely silent or has pop ups (AutoHotKey can assist - a great example is the VeraCrypt package).
  • A package that cannot be made completely unattended should have the notSilent tag. Note that this must be approved by moderators.

Phyx (maintainer) on 15 Jun 2024 06:18:55 +00:00:

the error is odd, package not found? works fine locally
Verification Status Change - Verification tests have been set to rerun.

chocolatey-ops (reviewer) on 15 Jun 2024 06:20:34 +00:00:

cabal has failed automated package testing (verification).
Please visit https://gist.github.com/choco-bot/9ca077e6ff5a05f68f9fe8cf7a55ec59 for details.
The package status will be changed and will be waiting on your next actions.

  • NEW! We have a test environment for you to replicate the testing we do. This can be used at any time to test packages! See https://github.com/chocolatey-community/chocolatey-test-environment
  • Please log in and leave a review comment if you have questions and/or comments.
  • If you see the verifier needs to rerun testing against the package without resubmitting (a issue in the test results), you can do that on the package page in the review section.
  • If the verifier is incompatible with the package, please log in and leave a review comment if the package needs to bypass testing (e.g. package installs specific drivers).
  • Automated testing can also fail when a package is not completely silent or has pop ups (AutoHotKey can assist - a great example is the VeraCrypt package).
  • A package that cannot be made completely unattended should have the notSilent tag. Note that this must be approved by moderators.

chocolatey-ops (reviewer) on 04 Jul 2024 04:58:55 +00:00:

We've found cabal v3.10.3.0 in a submitted status and waiting for your next actions. It has had no updates for 20 or more days since a reviewer has asked for corrections. Please note that if there is no response or fix of the package within 15 days of this message, this package version will automatically be closed (rejected) due to being stale.

Take action:

  • Log in to the site and respond to the review comments.
  • Resubmit fixes for this version.
  • If the package version is failing automated checks, you can self-reject the package.

If your package is failing automated testing, you can use the chocolatey test environment to manually run the verification and determine what may need to be fixed.

Note: We don't like to see packages automatically rejected. It doesn't mean that we don't value your contributions, just that we can not continue to hold packages versions in a waiting status that have possibly been abandoned. If you don't believe you will be able to fix up this version of the package within 15 days, we strongly urge you to log in to the site and respond to the review comments until you are able to.

Phyx (maintainer) on 17 Jul 2024 20:52:56 +00:00:

User 'Phyx' (maintainer) submitted package.

chocolatey-ops (reviewer) on 17 Jul 2024 21:24:43 +00:00:

cabal has passed automated validation. It may have or may still fail other checks like testing (verification).
NOTE: No required changes that the validator checks have been flagged! It is appreciated if you fix other items, but only Requirements will hold up a package version from approval. A human review could still turn up issues a computer may not easily find.

Guidelines

Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time Guidelines can become Requirements. A package version can be approved without addressing Guideline comments but will reduce the quality of the package.

  • This packages has used a function that doesn't have an automatic undo on uninstall, so it will also need an uninstall script. Please correcting that by adding a chocolateyUninstall.ps1 to the package to undo the action. More...
  • Chocolatey Packages are meant to be thin wrappers on top of the native installation packages, as a result, there is an expectation that the installation scripts will be less than 100 lines. Can the automation scripts be simplified? More...

chocolatey-ops (reviewer) on 17 Jul 2024 21:38:59 +00:00:

cabal has failed automated package testing (verification).
Please visit https://gist.github.com/choco-bot/8a8ce718fc652d6e5efb144024f21006 for details.
The package status will be changed and will be waiting on your next actions.

  • NEW! We have a test environment for you to replicate the testing we do. This can be used at any time to test packages! See https://github.com/chocolatey-community/chocolatey-test-environment
  • Please log in and leave a review comment if you have questions and/or comments.
  • If you see the verifier needs to rerun testing against the package without resubmitting (a issue in the test results), you can do that on the package page in the review section.
  • If the verifier is incompatible with the package, please log in and leave a review comment if the package needs to bypass testing (e.g. package installs specific drivers).
  • Automated testing can also fail when a package is not completely silent or has pop ups (AutoHotKey can assist - a great example is the VeraCrypt package).
  • A package that cannot be made completely unattended should have the notSilent tag. Note that this must be approved by moderators.
Description

The 'cabal.exe' command-line program simplifies the process of managing Haskell software by automating the fetching, configuration, compilation and installation of Haskell libraries and programs.

Cabal is a system for building and packaging Haskell libraries and programs. It defines a common interface for package authors and distributors to easily build their applications in a portable way. Cabal is part of a larger infrastructure for distributing, organizing, and cataloging Haskell libraries and programs.

Specifically, the Cabal describes what a Haskell package is, how these packages interact with the language, and what Haskell implementations must to do to support packages. The Cabal also specifies some infrastructure (code) that makes it easy for tool authors to build and distribute conforming packages.

The Cabal is only one contribution to the larger goal. In particular, the Cabal says nothing about more global issues such as how authors decide where in the module name space their library should live; how users can find a package they want; how orphan packages find new owners; and so on.


LICENSE.txt
Copyright (c) 2003-2023, Cabal Development Team.
See the AUTHORS file for the full list of copyright holders.

See */LICENSE for the copyright holders of the subcomponents.

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 Isaac Jones nor the names of other
      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
OWNER 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.
tools\chocolateyBeforeModify.ps1
$version     = '3.10.3.0'
$packageName = 'cabal'
$url         = 'https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-mingw32.zip'
$url64       = 'https://downloads.haskell.org/cabal/cabal-install-3.10.3.0/cabal-install-3.10.3.0-x86_64-windows.zip'

$binRoot         = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
$packageFullName = Join-Path $binRoot ($packageName + '-' + $version)
$is64 = (Get-OSArchitectureWidth 64)  -and $env:chocolateyForceX86 -ne 'true'

$cabal = Join-Path $packageFullName "cabal.exe"
function Find-Entry {
    param( [string] $app )
    Get-Command -ErrorAction SilentlyContinue $app `
      | Select-Object -first 1 `
      | ForEach-Object { Split-Path $_.Path -Parent }
}

Function Execute-Command {
  param( [string] $commandTitle
       , [string] $commandPath
       , [string] $commandArguments
       )
  Try {
    $pinfo = New-Object System.Diagnostics.ProcessStartInfo
    $pinfo.FileName = $commandPath
    $pinfo.RedirectStandardError = $true
    $pinfo.RedirectStandardOutput = $true
    $pinfo.UseShellExecute = $false
    $pinfo.Arguments = $commandArguments
    $pinfo.WindowStyle = [Diagnostics.ProcessWindowStyle]::Hidden
    $pinfo.CreateNoWindow = $true
    $p = New-Object System.Diagnostics.Process
    $p.StartInfo = $pinfo
    $p.Start() | Out-Null
    [pscustomobject]@{
        commandTitle = $commandTitle
        stdout = $p.StandardOutput.ReadToEnd()
        stderr = $p.StandardError.ReadToEnd()
        ExitCode = $p.ExitCode
    }
    $p.WaitForExit()
  }
  Catch {
     exit
  }
}

function Find-MSYS2 {
  param()

  # See if the user has msys2 already installed.
  $msys2 = Find-Entry "msys2_shell.cmd"
  if (($null -eq $msys2) -or ($msys2 -eq "")) {
    $msys2 = Find-Entry "mingw*_shell.bat"
  }

  $dir_name = if ($is64) { 'msys64' } else { 'msys32' }

  # Check for standalone msys2 installs
  if (($null -eq $msys2) -or ($msys2 -eq "")) {
    $tmp = Join-Path $Env:SystemDrive $dir_name
    if (Test-Path $tmp -PathType Container) {
      Write-Host "Standalone msys2 detected. Using default paths."
      $msys2 = $tmp
    }
  }

  if (($null -eq $msys2) -or ($msys2 -eq "")) {
    # msys2 was not found already installed, assume user will install
    # it in the default directory, so create the expected default msys2
    # installation path.
    $msys2    = "{0}\\{1}" -f (Get-ToolsLocation), $dir_name
  }

  Write-Debug "Msys2 directory: ${msys2}"
  return $msys2
}

function ReadCabal-Config {
  param( [string] $key )

  $prog = "$cabal"
  $cmd  = "user-config diff -a ${key}:"

  $proc = Execute-Command "Reading cabal config key '${key}'." $prog $cmd

  if ($proc.ExitCode -ne 0) {
    Write-Error $proc.stdout
    Write-Error $proc.stderr
    throw ("Could not read cabal configuration key '${key}'.")
  }

  $option = [System.StringSplitOptions]::RemoveEmptyEntries
  $procout = $proc.stdout.Split([Environment]::NewLine) | Select-String "- ${key}" | Select-Object -First 1
  if (!$procout) {
    Write-Debug "No Cabal config for ${key}"
    return {@()}.Invoke()
  } else {
    $value = $procout.ToString().Split(@(':'), 2, $option)[1].ToString()
    $value = $value.Split([Environment]::NewLine)[0].Trim()
    Write-Debug "Read Cabal config ${key}: ${value}"
    return {$value.Replace('"','').Split(@(','), $option)}.Invoke()
  }
}

function UpdateCabal-Config {
  param( [string] $key
       , [string[]] $values
       )

  if ((!$values) -or ($values.Count -eq 0)) {
    $values = ""
  } else {
    #$value = '"' + [String]::Join("`",`"", $values) + '"'
    $value = [String]::Join(",", $values)
  }
  $prog = "$cabal"
  $cmd  = "user-config update -a `"${key}: $value`""

  $proc = Execute-Command "Update cabal config key '${key}'." $prog $cmd

  if ($proc.ExitCode -ne 0) {
    Write-Error $proc.stdout
    Write-Error $proc.stderr
    throw ("Could not update cabal configuration key '${key}'.")
  }

  Write-Debug "Wrote Cabal config ${key}: ${value}"
}

function Restore-Config-Cabal {
  param()

  $ErrorActionPreference = 'Stop'
  $msys2_path   = Find-MSYS2
  $prog_path    = ReadCabal-Config "extra-prog-path"
  $lib_dirs     = ReadCabal-Config "extra-lib-dirs"
  $include_dirs = ReadCabal-Config "extra-include-dirs"

  $native_path = if ($is64) { 'mingw64' } else { 'mingw32' }
  $native_path = Join-Path $msys2_path $native_path
  $msys_lib_dir = Join-Path $native_path "lib"

  # Build new binary paths
  $native_bin     = Join-Path $native_path "bin"
  $new_prog_paths = {$prog_path}.Invoke()
  $new_prog_paths.Remove((Join-Path (Join-Path $msys2_path "usr") "bin")) | Out-Null
  $new_prog_paths.Remove(($native_bin)) | Out-Null
  $new_prog_paths = $new_prog_paths | Select-Object -Unique

  # Build new library paths
  $new_lib_dirs = {$lib_dirs}.Invoke()
  $new_lib_dirs.Remove((Join-Path $native_path "lib")) | Out-Null
  $new_lib_dirs = $new_lib_dirs | Select-Object -Unique

  # Build new include paths
  $new_include_dirs = {$include_dirs}.Invoke()
  $new_include_dirs.Remove((Join-Path $native_path "include")) | Out-Null
  $new_include_dirs = $new_include_dirs | Select-Object -Unique

  UpdateCabal-Config "extra-prog-path"    $new_prog_paths
  UpdateCabal-Config "extra-lib-dirs"     $new_lib_dirs
  UpdateCabal-Config "extra-include-dirs" $new_include_dirs

  Write-Host "Restored cabal configuration."
}

# Now execute cabal configuration updates
Restore-Config-Cabal
Uninstall-ChocolateyEnvironmentVariable -VariableName '_MSYS2_BASH'
Uninstall-ChocolateyEnvironmentVariable -VariableName '_MSYS2_PREFIX'
# Cleanup the batch file we created
Get-Command "mingw64-pkg.bat" -ErrorAction SilentlyContinue `
  | ForEach-Object { Remove-Item -Force $_ -ErrorAction SilentlyContinue }
tools\chocolateyInstall.ps1
$version     = '3.10.3.0'
$packageName = 'cabal'
$url         = 'https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-mingw32.zip'
$url64       = 'https://downloads.haskell.org/cabal/cabal-install-3.10.3.0/cabal-install-3.10.3.0-x86_64-windows.zip'
$binRoot         = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
$packageFullName = Join-Path $binRoot ($packageName + '-' + $version)
$is64 = (Get-OSArchitectureWidth 64)  -and $env:chocolateyForceX86 -ne 'true'
$is32 = (Get-OSArchitectureWidth 32)  -or $env:chocolateyForceX86 -eq 'true'

if($is32)
  {
      Write-Host "#     # ####### ####### ###  #####  #######"
      Write-Host "##    # #     #    #     #  #     # #      "
      Write-Host "# #   # #     #    #     #  #       #      "
      Write-Host "#  #  # #     #    #     #  #       #####  "
      Write-Host "#   # # #     #    #     #  #       #      "
      Write-Host "#    ## #     #    #     #  #     # #      "
      Write-Host "#     # #######    #    ###  #####  #######"
      Write-Host ""
      Write-Host " 32 bit binary for Windows is not available."
      Write-Host "cabal 3.2.0.0 will be installed instead."
      Write-Host ""
      # rewrite the version to 3.2.0.0 so installer works
      $version = '3.2.0.0'
  }

Install-ChocolateyZipPackage `
  -PackageName $packageName `
  -UnzipLocation $packageFullName `
  -Url $url -ChecksumType sha256 -Checksum 01e14a9c4ec96452087b5cc90157693bbc4e0045b9c11e48f5f324b7977d837b `
  -Url64bit $url64 -ChecksumType64 sha256 -Checksum64 b651ca732998eba5c0e54f4329c147664a7fb3fe3e74eac890c31647ce1e179a

$cabal = Join-Path $packageFullName "cabal.exe"
# Simplified version of Install-ChocolateyPath that prepends instead of
# Appends to a path.  We use this in certain cases when we need to Override an
# existing path entry.  Such as on AppVeyor which adds both cygwin and msys2
# on PATH.
function Install-AppVeyorPath {
param(
  [parameter(Mandatory=$true, Position=0)][string] $pathToInstall
)

  Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
  ## Called from chocolateysetup.psm1 - wrap any Write-Host in try/catch

  $pathType = [System.EnvironmentVariableTarget]::Machine

  # get the PATH variable
  Update-SessionEnvironment
  $envPath = $env:PATH
  if (!$envPath.ToLower().Contains($pathToInstall.ToLower()))
  {
    try {
      Write-Host "PATH environment variable does not have $pathToInstall in it. Adding..."
    } catch {
      Write-Verbose "PATH environment variable does not have $pathToInstall in it. Adding..."
    }

    $actualPath = Get-EnvironmentVariable -Name 'Path' -Scope $pathType -PreserveVariables

    $statementTerminator = ";"
    if (!$pathToInstall.EndsWith($statementTerminator)) {$pathToInstall = $pathToInstall + $statementTerminator}
    $actualPath = $pathToInstall + $actualPath

    Set-EnvironmentVariable -Name 'Path' -Value $actualPath -Scope $pathType

    # add it to the local path as well so users will be off and running
    $envPSPath = $env:PATH
    $env:Path = $pathToInstall + $envPSPath
  }
}

# uninstall a path entry from AppVeyor
function UnInstall-AppVeyorPath {
  param(
    [parameter(Mandatory=$true, Position=0)][string] $pathToRemove
  )

    Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
    ## Called from chocolateysetup.psm1 - wrap any Write-Host in try/catch

    $pathType = [System.EnvironmentVariableTarget]::Machine

    # get the PATH variable
    Update-SessionEnvironment
    $envPath = $env:PATH
    if ($envPath.ToLower().Contains($pathToRemove.ToLower()))
    {
      try {
        Write-Host "PATH environment variable contains $pathToRemove in it. Removing..."
      } catch {
        Write-Verbose "PATH environment variable contains $pathToRemove in it. Removing..."
      }

      $statementTerminator = ";"
      $actualPath = Get-EnvironmentVariable -Name 'Path' -Scope $pathType -PreserveVariables
      $actualPath = ($path.Split($statementTerminator) | Where-Object { $_ -ne $pathToRemove }) -join $statementTerminator

      Set-EnvironmentVariable -Name 'Path' -Value $actualPath -Scope $pathType

      # Remove it from the local path as well so users will be off and running
      $env:Path = $actualPath
    }
  }


function Find-Entry {
    param( [string] $app )
    Get-Command -ErrorAction SilentlyContinue $app `
      | Select-Object -first 1 `
      | ForEach-Object { Split-Path $_.Path -Parent }
}

Function Execute-Command {
  param( [string] $commandTitle
       , [string] $commandPath
       , [string] $commandArguments
       )
  Try {
    $pinfo = New-Object System.Diagnostics.ProcessStartInfo
    $pinfo.FileName = $commandPath
    $pinfo.RedirectStandardError = $true
    $pinfo.RedirectStandardOutput = $true
    $pinfo.UseShellExecute = $false
    $pinfo.Arguments = $commandArguments
    $pinfo.WindowStyle = [Diagnostics.ProcessWindowStyle]::Hidden
    $pinfo.CreateNoWindow = $true
    $p = New-Object System.Diagnostics.Process
    $p.StartInfo = $pinfo
    $p.Start() | Out-Null
    [pscustomobject]@{
        commandTitle = $commandTitle
        stdout = $p.StandardOutput.ReadToEnd()
        stderr = $p.StandardError.ReadToEnd()
        ExitCode = $p.ExitCode
    }
    $p.WaitForExit()
  }
  Catch {
     exit
  }
}

function Detect-GHC-Versions {
  return Get-ChildItem "C:\ghc\ghc-*\bin" -ErrorAction SilentlyContinue `
    | Sort-Object CreationTime -Descending `
    | ForEach-Object { $_.ToString() }
}

function Find-MSYS2 {
  param()

  # See if the user has msys2 already installed.
  $msys2 = Find-Entry "msys2_shell.cmd"
  if (($null -eq $msys2) -or ($msys2 -eq "")) {
    $msys2 = Find-Entry "mingw*_shell.bat"
  }

  $dir_name = if ($is64) { 'msys64' } else { 'msys32' }
  # Detect AppVeyor installs
  if (($null -ne $Env:APPVEYOR) -and ("" -ne $Env:APPVEYOR)) {
    Write-Host "AppVeyor detected. Using AppVeyor default paths."
    $msys2 = Join-Path $Env:SystemDrive $dir_name
  }

  # Check for standalone msys2 installs
  if (($null -eq $msys2) -or ($msys2 -eq "")) {
    $tmp = Join-Path $Env:SystemDrive $dir_name
    if (Test-Path $tmp -PathType Container) {
      Write-Host "Standalone msys2 detected. Using default paths."
      $msys2 = $tmp
    }
  }

  if (($null -eq $msys2) -or ($msys2 -eq "")) {
    # msys2 was not found already installed, assume user will install
    # it in the default directory, so create the expected default msys2
    # installation path.
    $msys2    = "{0}\{1}" -f (Get-ToolsLocation), $dir_name
  }

  Write-Debug "Msys2 directory: ${msys2}"
  return $msys2
}

function ReadCabal-Config {
  param( [string] $key )

  $prog = "$cabal"
  $cmd  = "user-config diff -a ${key}:"

  $proc = Execute-Command "Reading cabal config key '${key}'." $prog $cmd

  if ($proc.ExitCode -ne 0) {
    Write-Debug $proc.stdout
    Write-Debug $proc.stderr
    Write-Host "Could not read cabal configuration key '${key}'."
  }

  $option = [System.StringSplitOptions]::RemoveEmptyEntries
  $procout = $proc.stdout.Split([Environment]::NewLine) | Select-String "- ${key}" | Select-Object -First 1
  if (!$procout) {
    Write-Debug "No Cabal config for ${key}"
    return {@()}.Invoke()
  } else {
    $value = $procout.ToString().Split(@(':'), 2, $option)[1].ToString()
    $value = $value.Split([Environment]::NewLine)[0].Trim()
    Write-Debug "Read Cabal config ${key}: ${value}"
    return {$value.Replace('"','').Split(@(','), $option)}.Invoke()
  }
}

function UpdateCabal-Config {
  param( [string] $key
       , [string[]] $values
       )

  if ((!$values) -or ($values.Count -eq 0)) {
    $values = ""
  } else {
    #$value = '"' + [String]::Join("`",`"", $values) + '"'
    $value = [String]::Join(",", $values)
  }
  $prog = "$cabal"
  $cmd  = "user-config update -a `"${key}: $value`""

  $proc = Execute-Command "Update cabal config key '${key}'." $prog $cmd

  if ($proc.ExitCode -ne 0) {
    Write-Error $proc.stdout
    Write-Error $proc.stderr
    throw ("Could not update cabal configuration key '${key}'.")
  }

  Write-Debug "Wrote Cabal config ${key}: ${value}"
}

function UpdateCabal-Config-Raw {
  param( [string] $value
       )

  $prog = "$cabal"
  $cmd  = "user-config update $value"

  $proc = Execute-Command "Update cabal config key '${value}'." $prog $cmd

  if ($proc.ExitCode -ne 0) {
    Write-Error $proc.stdout
    Write-Error $proc.stderr
    throw ("Could not update cabal configuration key '${value}'.")
  }

  Write-Debug "Wrote Cabal config ${value}"
}

function Configure-Cabal {
  param()

  $ErrorActionPreference = 'Stop'
  $msys2_path   = Find-MSYS2

  # Initialize cabal
  $prog_path    = ReadCabal-Config "extra-prog-path"
  $lib_dirs     = ReadCabal-Config "extra-lib-dirs"
  $include_dirs = ReadCabal-Config "extra-include-dirs"
  $method       = ReadCabal-Config "install-method"
  $native_path  = if ($is64) { 'mingw64' } else { 'mingw32' }
  $native_path  = Join-Path $msys2_path $native_path
  $msys_lib_dir = Join-Path $native_path "lib"

  # Build new binary paths
  $native_bin     = Join-Path $native_path "bin"
  $new_prog_paths = @()
  $new_prog_paths += $native_bin
  $new_prog_paths += $prog_path
  $new_prog_paths += Join-Path (Join-Path $Env:APPDATA "cabal") "bin"
  $new_prog_paths += Join-Path (Join-Path $msys2_path "usr") "bin"
  $new_prog_paths = $new_prog_paths | Select-Object -Unique

  # Build new library paths

  # If the directory doesn't exist, we can't add it to prevent GHC from throwing
  # an error when the linker tries to add the dir.
  if (Test-Path $msys_lib_dir -PathType Container)
    {
      $new_lib_dirs = @($msys_lib_dir)
    }
  else
    {
      $new_lib_dirs = @()
    }
  $new_lib_dirs += $lib_dirs
  $new_lib_dirs = $new_lib_dirs | Select-Object -Unique

  # Build new include paths
  $new_include_dirs = @(Join-Path $native_path "include")
  $new_include_dirs += $include_dirs
  $new_include_dirs = $new_include_dirs | Select-Object -Unique

  # Set install method if no default is set
  if ($method -ne "copy" -and $method -ne "symlink" -and $method -ne "auto")
    {
      UpdateCabal-Config "install-method"     "copy"
    }

  UpdateCabal-Config "extra-prog-path"    $new_prog_paths
  UpdateCabal-Config "extra-lib-dirs"     $new_lib_dirs
  UpdateCabal-Config "extra-include-dirs" $new_include_dirs

  Write-Host "Updated cabal configuration."

  $cabal_path = Join-Path (Join-Path "$Env:APPDATA" "cabal") "bin"
  Install-ChocolateyPath "$cabal_path"

  # Add a PATH to pkg-config location if exists
  $pkg_config = Join-Path $native_bin "pkg-config.exe"
  if (Test-Path $pkg_config)
    {
      UpdateCabal-Config-Raw `
        "-a `"program-locations`" -a `" pkg-config-location: $pkg_config`""
    }

  # If running on Github actions, configure the package to pick things up
  if (($null -ne $Env:GITHUB_ACTIONS) -and ("" -ne $Env:GITHUB_ACTIONS)) {
    # Update the path on github actions as without so it won't be able to find
    # cabal.
    echo "$cabal_path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

    # We probably don't need this since choco itself is already on the PATH
    # But it won't hurt to make sure.
    $choco_bin = Join-Path $env:ChocolateyInstall "bin"
    echo "$choco_bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

    # New GHC Packages will add themselves to the PATH, but older ones don't.
    # So let's find which one the user installed and add them to the pathh.
    $files = get-childitem $binRoot -include ghc.exe -recurse

    foreach ($file in $files) {
      $fileDir = Split-Path "$file"
      echo "$fileDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
    }

    # Also set a global SR.
    UpdateCabal-Config "store-dir" "$($env:SystemDrive)\SR"
  }

  # If running on Appveyor, configure the package to pick things up
  if (($null -ne $Env:APPVEYOR) -and ("" -ne $Env:APPVEYOR)) {
    Write-Host "Configuring AppVeyor PATH."
    # We need to fix up some paths for AppVeyor
    $ghcpaths = Detect-GHC-Versions
    ForEach ($path in $ghcpaths) { Install-ChocolateyPath $path }

    # Remove the global /usr/bin that's before the local one.
    UnInstall-AppVeyorPath (Join-Path (Join-Path "${msys2_path}" "usr") "bin")

    # Override msys2 git with git for Windows
    Install-AppVeyorPath "$($env:SystemDrive)\Program Files\Git\cmd"
    Install-AppVeyorPath "$($env:SystemDrive)\Program Files\Git\mingw64\bin"

    # I'm not a fan of doing this, but we need auto-reconf available.
    # Add the /usr/bin path first so it appears last in the list
    Install-AppVeyorPath (Join-Path (Join-Path "${msys2_path}" "usr") "bin")
    Install-AppVeyorPath (Join-Path (Join-Path "${msys2_path}" "mingw64") "bin")

    # Also set a global SR.
    UpdateCabal-Config "store-dir" "$($env:SystemDrive)\SR"
  }
}

function Find-Bash {
  param()
  $ErrorActionPreference = 'Stop'
  $msys2_path = Find-MSYS2
  $bin        = Join-Path (Join-Path $msys2_path "usr") "bin"
  $bash       = Join-Path $bin "bash.exe"
  return $bash
}

function Fudge-Config-Cabal {
  param()

  $ErrorActionPreference = 'Stop'

  Write-Host "Finding cabal config file..."
  $prog = "$cabal"
  $cmd  = "user-config init"

  $proc = Execute-Command "Detecting cabal config file location." $prog $cmd

  if ($proc.ExitCode -ne 0) {
    $ln = $proc.stderr.Split([Environment]::NewLine) | Select -First 1
    $skip = "cabal.exe: ".Length + 7
    $conf = $ln.Substring($skip, $ln.Length - $skip).Split(' ')[0]

    Write-Host "Detected config file: '${conf}'."
    $content = Get-Content -Path $conf -Raw
    # replace the broken unix line
    $content = $content -replace 'nix: ', '-- nix: '

    Set-Content -Path $conf -Value $content

    Write-Host "Forcibly correct backwards incompatible cabal configurations."
  } else {
    Write-Host "No cabal file hacks needed. Left config alone."
  }
}


# Now execute cabal configuration updates
Configure-Cabal
Fudge-Config-Cabal
$bash = Find-Bash
$prefix = if ($is64) { 'x86_64' } else { 'i686' }
Install-ChocolateyEnvironmentVariable "_MSYS2_BASH" "$bash"
Install-ChocolateyEnvironmentVariable "_MSYS2_PREFIX" "$prefix"
$psFile = Join-Path $(Split-Path -Parent $MyInvocation.MyCommand.Definition) "mingw64-pkg.ps1"
Install-ChocolateyPowershellCommand -PackageName '${packageName}.powershell' -PSFileFullPath $psFile
tools\mingw64-pkg.ps1
<#
.SYNOPSIS
    Install a Mingw-w64 native package such that cabal and ghc will recognize them.
.DESCRIPTION
    This CmdLet makes it easier to install native Mingw-w64 packages into MSYS2 such
    that cabal-install and GHC can use them without any other configuration required.

    This will not allow installation of MSYS2 packages.  Your global namespace will
    not be poluted by the use of this CmdLet.
.PARAMETER Action
    The action to perform. Must be one of install, uninstall, update or shell.

    - install: install a new native package
    - uninstall: remove native package
    - update: sync the repositories, will not upgrade any packages.
    - shell: open a bash shell
.PARAMETER Package
    The name of the Mingw64 package to install into the msys2 environment.
.PARAMETER NoConfirm
    Indicates whether or not an interactive prompt should be used to confirm before
    action is carried out.
.EXAMPLE
    C:\PS> mingw-pkg install gtk2
.NOTES
    Author: Tamar Christina
    Date:   February 16, 2019
#>

Param(
  [ValidateSet("install","uninstall", "update", "shell")]
  [String] $Action
, [string] $Package
, [string] $NoConfirm = "--confirm"
)

$bash = $Env:_MSYS2_BASH
$prefix = $Env:_MSYS2_PREFIX
if ((!$bash) -or ($bash -eq "") -or (!$prefix) -or ($prefix -eq "")) {
  throw ("Bash environment variable found, are you sure you installed cabal and msys2 via chocolatey?")
}

if(![System.IO.File]::Exists($bash)){
  throw ("Bash not found, try `choco install msys2' first.")
}

$package = "mingw-w64-${prefix}-${Package}"
$shell = $false

switch ($Action){
  "install" {
    $cmd = "-S"
    if((!$Package) -or ($Package -eq "")){
      throw ("Package name required when installing package.")
    }
    break
  }
  "uninstall" {
    $cmd = "-R"
    if((!$Package) -or ($Package -eq "")){
      throw ("Package name required when removing package.")
    }
    break
  }
  "update" {
    $cmd = "-Sy"
    $package = ""
    break
  }
  "shell" {
    $shell = $true
    break
  }
  default {
    Write-Host ".SYNOPSIS
  Install a Mingw-w64 native package such that cabal and ghc will recognize them.
.DESCRIPTION
  This CmdLet makes it easier to install native Mingw-w64 packages into MSYS2 such
  that cabal-install and GHC can use them without any other configuration required.

  This will not allow installation of MSYS2 packages.  Your global namespace will
  not be poluted by the use of this CmdLet.
.PARAMETER Action
  The action to perform. Must be one of install, uninstall, update or shell.

  - install: install a new native package
  - uninstall: remove native package
  - update: sync the repositories, will not upgrade any packages.
  - shell: open a bash shell
.PARAMETER Package
  The name of the Mingw64 package to install into the msys2 environment.
.PARAMETER NoConfirm
  Indicates whether or not an interactive prompt should be used to confirm before
  action is carried out.
.EXAMPLE
  C:\PS> mingw-pkg install gtk2 [--confirm|--noconfirm]
.NOTES
  Author: Tamar Christina
  Date:   February 16, 2019"
    return
  }
}

switch ($NoConfirm){
  "--noconfirm" {
    $arg = "--noconfirm"
    break
  }
  "--confirm" {
    $arg = "--confirm"
    break
  }
  default {
    Write-Error "Unkown option $NoConfirm. Expected --confirm or --noconfirm."
    return;
  }
}


$osBitness = "64"
if ($prefix -eq "i686") {
  $osBitness = "32"
}

# Set the APPDATA path which does not get inherited during these invokes
# and set MSYSTEM to make sure we're using the right system
$envdata = "export APPDATA=""" + $Env:AppData + """ && export MSYSTEM=MINGW" + $osBitness + " && "

if ($false -eq $shell) {
  $proc = Start-Process -NoNewWindow -UseNewEnvironment -Wait $bash `
                        -ArgumentList '--login', '-c', "'$envdata pacman $cmd $arg $package'" `
                        -PassThru

  if ((-not $ignoreExitCode) -and ($proc.ExitCode -ne 0)) {
      throw ("`'${bash}`' did not complete successfully. ExitCode: " + $proc.ExitCode)
  }
} else {
  $proc = Start-Process -NoNewWindow -UseNewEnvironment -Wait $bash `
                        -ArgumentList '--login' `
                        -PassThru
}

No results available for this package. We are building up results for older packages over time so expect to see results. If this is a new package, it should have results within a day or two.

Add to Builder Version Downloads Last Updated Status
Cabal 3.10.3.0 10 Wednesday, July 17, 2024
Waiting for Maintainer
Cabal 3.10.1.1 56153 Thursday, March 23, 2023 Approved
Cabal 3.8.1.0 136241 Tuesday, August 9, 2022 Approved
Cabal 3.6.2.0 161312 Wednesday, October 13, 2021 Approved
Cabal 3.6.0.0 784 Wednesday, October 13, 2021 Approved
Cabal 3.4.1.0 7526 Wednesday, October 13, 2021 Approved
Cabal 3.4.0.1-rc3 5146 Thursday, December 24, 2020 Approved
Cabal 3.4.0.0 100116 Friday, February 26, 2021 Approved
Cabal 3.4.0.0-rc5 2686 Sunday, January 3, 2021 Exempted
Cabal 3.4.0.0-rc3 330 Saturday, October 10, 2020 Exempted
Cabal 3.2.0.0 112511 Friday, April 10, 2020 Approved
Cabal 3.0.0.0 31345 Thursday, August 29, 2019 Approved
Cabal 2.4.1.0 28778 Monday, November 26, 2018 Approved
Cabal 2.4.0.20180922 2569 Sunday, September 23, 2018 Approved
Cabal 2.4.0.0 1561 Saturday, September 22, 2018 Approved
Cabal 2.2.0.0 6403 Thursday, March 29, 2018 Approved
Cabal 2.0.0.1 2792 Tuesday, February 6, 2018 Approved
Cabal 2.0.0.0 5723 Thursday, August 17, 2017 Approved
Cabal 1.24.0.2 4666 Saturday, January 14, 2017 Approved
Cabal 1.24.0.0 5052 Saturday, May 14, 2016 Approved
Cabal 1.22.0.0 419 Saturday, May 14, 2016 Approved
Cabal 1.20.0.3 466 Tuesday, May 17, 2016 Approved
Cabal 1.20.0.2 470 Saturday, May 14, 2016 Approved
Cabal 1.20.0.1 442 Saturday, May 14, 2016 Approved
Cabal 1.18.0.3 438 Saturday, May 14, 2016 Approved
Cabal 1.18.0.2 415 Saturday, May 14, 2016 Approved
Cabal 1.18.0.1 458 Saturday, May 14, 2016 Approved
Cabal 0.14.0 436 Saturday, May 14, 2016 Approved
Cabal 0.10.2 420 Saturday, May 14, 2016 Approved
Cabal 0.8.2 477 Saturday, May 14, 2016 Approved
Cabal 0.8.0 432 Saturday, May 14, 2016 Approved
Cabal 0.6.4 435 Saturday, May 14, 2016 Approved
Cabal 0.6.2 478 Saturday, May 14, 2016 Approved
Cabal 0.6.0 485 Saturday, May 14, 2016 Approved

This package has no dependencies.

Discussion for the Cabal Package

Ground Rules:

  • This discussion is only about Cabal and the Cabal package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Cabal, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus