diff --git a/.nix/nixpkgs.json b/.nix/nixpkgs.json new file mode 100644 index 0000000..e8989c8 --- /dev/null +++ b/.nix/nixpkgs.json @@ -0,0 +1,7 @@ +{ + "url": "https://github.com/nixos/nixpkgs-channels", + "rev": "f3fa5a101eb74a10f6c53b504e18b42bacccbaeb", + "date": "2019-12-03T16:52:39+00:00", + "sha256": "0mf8n78xhni57f5pgc5rc7l3sgnar95998gi06a1anf8gqnrrhn1", + "fetchSubmodules": false +} diff --git a/.nix/nixpkgs.nix b/.nix/nixpkgs.nix new file mode 100644 index 0000000..f97ebb9 --- /dev/null +++ b/.nix/nixpkgs.nix @@ -0,0 +1,10 @@ +{ owner ? "NixOS" +, repo ? "nixpkgs-channels" +, rev ? "f3fa5a101eb74a10f6c53b504e18b42bacccbaeb" +, sha256 ? "0mf8n78xhni57f5pgc5rc7l3sgnar95998gi06a1anf8gqnrrhn1" +}: + +import (builtins.fetchTarball { + url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; + inherit sha256; +}) {} diff --git a/README b/README deleted file mode 100644 index 97125fc..0000000 --- a/README +++ /dev/null @@ -1,78 +0,0 @@ -Haskell Report README -~~~~~~~~~~~~~~~~~~~~~ - -These are the sources to the Haskell report, including all the source -files you will need to generate either the PDF or the HTML version of -the report. - - -Tools you will need -~~~~~~~~~~~~~~~~~~~ - -PDF version: a decent LaTeX installation with pdflatex. We use the -following additional packages: - - - times - - makeidx - - graphicx - - url - - color - - hyperref - -Also you need the following tools - - - makeindex - -all of which are usually available with a good TeX distribution -(e.g. TeX Live). - -The following are also required for building the tools: - - - flex - - GHC - -The HTML version additionally requires - - - tex4ht (e.g. install 'tex4ht' on a Debian or Ubuntu system, or - 'tetex-tex4ht' on a Fedora system) - -Building the report -~~~~~~~~~~~~~~~~~~~ - -Firstly: - - $ cd tools - $ make - -should build a few tools required for building the report itself. -Then you should be able to say - - $ cd report - $ make - -This will create: - - - PDF version: report/haskell.pdf - - - HTML version: report/ht/haskell.html - (NB. requires report/ht/*.{html,png,css}) - - -Roadmap -~~~~~~~ - -SOURCE FILES - - report/ The Language and Libraries Reports (now together - in a single document) - - tools/ Tools needed to build the Reports - (cd into here and type make) - - Makefile Build a distribution of the Reports - - -.verb files -~~~~~~~~~~~ - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..869523d --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +Haskell Report +============== + +These are the sources to the Haskell report, including all the source files you +will need to generate either the PDF or the HTML version of the report. + + +Building via Nix +---------------- + +To build using the [Nix](https://nixos.org/nix/) package manager, simply run +`nix-build`. The PDF and HTML versions can then be found in the `result` +subdirectory. + +Alternatively, you can invoke `nix-shell` to enter a shell with the environment +needed to build the report. Once in the shell you can use `make` as normal. + +Building manually +----------------- + +### Tools you will need + +PDF version: a decent LaTeX installation with pdflatex. We use the following +additional packages: + + - times + - makeidx + - graphicx + - url + - color + - hyperref + +Also you need the following tools + + - makeindex + +all of which are usually available with a good TeX distribution (e.g. TeX Live). + +The following are also required for building the tools: + + - flex + - GHC + +The HTML version additionally requires + + - tex4ht (e.g. install `tex4ht` on a Debian or Ubuntu system, or + `tetex-tex4ht` on a Fedora system) + +### Building + +Firstly: + + $ cd tools + $ make + +should build a few tools required for building the report itself. Then you +should be able to say + + $ cd report + $ make + +This will create: + + - PDF version: report/haskell.pdf + + - HTML version: report/ht/haskell.html + (NB. requires report/ht/*.{html,png,css}) + + +Roadmap +------- + +Source files + + - `report/` The Language and Libraries Reports (now together in a single document) + - `tools/` Tools needed to build the Reports (cd into here and type make) + - `Makefile` Build a distribution of the Reports diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..6c7d091 --- /dev/null +++ b/default.nix @@ -0,0 +1,36 @@ +with (import ./.nix/nixpkgs.nix {}); + +stdenv.mkDerivation rec { + pname = "haskell-report"; + version = "2020"; + + src = ./.; + + buildInputs = [ + (texlive.combine { + inherit (texlive) + scheme-basic + tex4ht + tabulary + collection-fontsrecommended; + }) + flex + ghc + perl528 + ghostscript + ]; + + buildCommand = '' + cp -r ${src} haskell-report + chmod -R u+w haskell-report + + cd haskell-report + export HOME=$TMPDIR + + make + + mkdir $out + cp report/haskell.pdf $out/haskell-report.pdf + cp -r report/ht $out/ht + ''; +}