Skip to content

Commit

Permalink
Merge pull request #80 from fpco/use-stack
Browse files Browse the repository at this point in the history
Use stack; update cabal file and README (fixes #71 & #79)
  • Loading branch information
snoyberg committed Aug 5, 2015
2 parents a76d744 + e9861b5 commit 620944a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
.cabal-sandbox/
cabal.sandbox.config

.stack-work/

*.swp
*.exe
*.hi
Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,33 @@ _Caveats:_

There are two existing ways to get GHC on Windows, straight from the [GHC distribution](https://www.haskell.org/ghc/) and using the [Haskell Platform](https://www.haskell.org/platform/). The GHC distribution is hard to unpack (`.xv` files are not Windows friendly), doesn't setup the `%PATH%`, lacks Cabal and cannot build the `network` library on its own. The Haskell Platform is easy to install and comes with more libraries, but still won't build the `network` library and usually lags the GHC release by months. This installer is the GHC distribution with all the issues above fixed.

## Building the Installer
## Building

Users of the installer have no need to build it, these are mostly notes for developers of the installer. To build one of the installers:
Users of MinGHC installers do not need to build it themselves. Below are instructions for anyone who wants to contribute to future installers.

* Download [NSIS](http://nsis.sourceforge.net/) and put it on your `%PATH%`.
* Make sure you have copies of `tar`, `wget`, `bunzip`, `gzip`, and `7z` on your `%PATH%`. For `tar`, a version of BSD Tar is recommended.
* For convenience, consider using the [minimal dependency bundle](https://s3.amazonaws.com/download.fpcomplete.com/minghc/minghcdeps-bin.zip), which includes all the necessary tools.
* [GNU on Windows (GOW)](https://github.com/bmatzelle/gow) is a heavier option.
* Run `cabal install --only-dependencies`.
* Run `cabal run`. That will generate a file `.build/minghc-7.10.1.exe`.
* To build for other versions of GHC, pass the version on the command line, for example `cabal run -- 7.8.4`.
### System Dependencies

You need NSIS installed:

* Download [NSIS 3.0b1](http://nsis.sourceforge.net/), install it, and place the installation directory on your `PATH`.
* Patch NSIS with the [large strings build for 3.0b1](http://prdownloads.sourceforge.net/nsis/nsis-3.0b1-strlen_8192.zip?download)
found among its [special builds](http://nsis.sourceforge.net/Special_Builds). (The patch is applied by copying
the files in the patch archive over top the NSIS installation.)

### Building Installers

Creating installers requires a two-step process: 1) build the installer-generation script and then 2) run the script
to create installers.

1. To build the installer-generation script, run `stack build`.
2. To execute the installer generator, run `stack exec minghc-generate`.

By default, the installer generator will create an installer for the most recent GHC release (32-bit).
You can build installers for other official releases by providing a version number and possibly `--arch64` to use 64-bit
GHC.

For example, the following will build an older release as 64-bit.

> stack exec minghc-generate -- 7.8.4 --arch64

The resulting installer can be found in the `.build` directory.
16 changes: 7 additions & 9 deletions minghc.cabal
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
cabal-version: >= 1.10
build-type: Simple
name: minghc
version: 0.1
cabal-version: >= 1.10
build-type: Simple
license: MIT
license-file: LICENSE
category: Development
author: Michael Snoyman <[email protected]>
maintainer: Michael Snoyman <[email protected]>
copyright: Michael Snoyman 2014
copyright: Michael Snoyman 2014-2015
synopsis: Generate installers for GHC
description:
Generate an installer for GHC, which bundles Cabal (so you can install stuff)
and MSYS (so you can install network).
homepage: https://github.com/snoyberg/haskell-windows-installer/
bug-reports: https://github.com/snoyberg/haskell-windows-installer/issues
extra-source-files:
msys-1.0.zip
homepage: https://github.com/fpco/minghc
bug-reports: https://github.com/fpco/minghc/issues

source-repository head
type: git
location: https://github.com/snoyberg/haskell-windows-installer.git
location: https://github.com/fpco/minghc.git

executable minghc-generate
default-language: Haskell2010
Expand All @@ -29,7 +27,7 @@ executable minghc-generate
directory,
extra >= 0.8,
shake >= 0.14,
nsis >= 0.2.4,
nsis >= 0.3,
bytestring,
http-client,
http-client-tls
Expand Down
6 changes: 6 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extra-deps:
- nsis-0.3
resolver: lts-2.20
flags: {}
packages:
- '.'

0 comments on commit 620944a

Please sign in to comment.