diff --git a/.gitignore b/.gitignore index 62ec7b0..2425857 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ .cabal-sandbox/ cabal.sandbox.config +.stack-work/ + *.swp *.exe *.hi diff --git a/README.md b/README.md index d9989ef..75d1a01 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/minghc.cabal b/minghc.cabal index 311fbc6..dd52b94 100644 --- a/minghc.cabal +++ b/minghc.cabal @@ -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 maintainer: Michael Snoyman -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 @@ -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 diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..0c68f35 --- /dev/null +++ b/stack.yaml @@ -0,0 +1,6 @@ +extra-deps: +- nsis-0.3 +resolver: lts-2.20 +flags: {} +packages: +- '.'