Skip to content

Commit e84d0a7

Browse files
Release 0.7.0.0
2 parents f8401c5 + b325b14 commit e84d0a7

15 files changed

+178
-42
lines changed

.gitignore

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# project
22
/build/
33

4+
# cabal
5+
cabal.project.local
6+
cabal.project.local~
7+
/dist-newstyle/
8+
9+
# nix
10+
result*
11+
412
# stack
513
.stack-work
614
*.yaml.lock
@@ -9,10 +17,5 @@ stack-nix*
917
# stan
1018
/.hie/
1119

12-
# cabal
13-
cabal.project.local
14-
cabal.project.local~
15-
/dist-newstyle/
16-
1720
# vi
1821
.*.swp

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ following conventions:
2424

2525
[KaC]: <https://keepachangelog.com/en/1.0.0/>
2626

27+
## 0.7.0.0 (2021-06-25)
28+
29+
### Breaking
30+
31+
* Fix `--help` when using `optparse-applicative` `0.16`
32+
33+
### Non-Breaking
34+
35+
* Refactor Nix configuration
36+
2737
## 0.6.0.0 (2021-05-27)
2838

2939
### Breaking

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ clean-all: clean # clean package and remove artifacts
105105
> @rm -rf dist-newstyle
106106
> @rm -f *.yaml.lock
107107
> @rm -f cabal.project.local
108+
> @rm -f result*
108109
.PHONY: clean-all
109110

110111
coverage: hr

app/LibOA.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
-- projects as required. If the library grows to a substantial size or others
1212
-- with to use it, I will reconsider.
1313
--
14-
-- Revision: 2021-04-04
14+
-- Revision: 2021-06-24
1515
------------------------------------------------------------------------------
1616

1717
{-# LANGUAGE CPP #-}
@@ -42,6 +42,9 @@ import Data.Monoid ((<>))
4242

4343
-- https://hackage.haskell.org/package/optparse-applicative
4444
import qualified Options.Applicative as OA
45+
#if MIN_VERSION_optparse_applicative (0,16,0)
46+
import qualified Options.Applicative.Builder.Internal as OABI
47+
#endif
4548
import qualified Options.Applicative.Common as OAC
4649
import qualified Options.Applicative.Types as OAT
4750

@@ -59,6 +62,10 @@ helper :: OA.Parser (a -> a)
5962
helper = OA.option helpReader $ mconcat
6063
[ OA.short 'h'
6164
, OA.long "help"
65+
, OA.value id
66+
, OA.metavar ""
67+
, OABI.noGlobal
68+
, OA.noArgError (OA.ShowHelpText Nothing)
6269
, OA.help "show this help text"
6370
, OA.hidden
6471
]

default.nix

Lines changed: 74 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,85 @@
1+
# Nix configuration for QueueSheet
2+
#
3+
# Usage:
4+
#
5+
# * Build QueueSheet with the default compiler:
6+
#
7+
# $ nix-build
8+
#
9+
# * Build QueueSheet with a specific compiler version:
10+
#
11+
# $ nix-build --argstr compiler ghc8104
12+
13+
{ # This string argument specifies the compiler (example: "ghc8104"). When
14+
# not specified, the default compiler (configured below) is used.
15+
compiler ? null
16+
# This path argument specifies the packages to use. When not specified, a
17+
# working revision for the selected compiler is used. When a working
18+
# revision for the selected compiler is not defined (below), the packages
19+
# configured on the filesystem are used.
20+
, nixpkgs ? null
21+
# This boolean argument is used by `shell.nix`. When `True`, build tools
22+
# are added to the derivation.
23+
, isShell ? false
24+
}:
25+
126
let
227

3-
nixpkgsRev = "c92ca95afb5043bc6faa0d526460584eccff2277";
4-
compilerVersion = "ghc8104";
28+
# This string defines the default compiler version.
29+
defaultCompiler = "ghc8104";
530

6-
githubTarball = owner: repo: rev:
7-
builtins.fetchTarball { url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; };
31+
# This set defines working revisions for supported compiler versions.
32+
nixpkgsRevs = {
33+
ghc8104 = "c92ca95afb5043bc6faa0d526460584eccff2277";
34+
ghc884 = "c92ca95afb5043bc6faa0d526460584eccff2277";
35+
# ghc865 = "2d9888f61c80f28b09d64f5e39d0ba02e3923057"; NOTE ginger broken
36+
ghc844 = "6a80140fdf2157d1a5500a04c87033c0dcd6bf9b";
37+
ghc822 = "6a80140fdf2157d1a5500a04c87033c0dcd6bf9b";
38+
};
839

9-
gitIgnore = pkgs.nix-gitignore.gitignoreSourcePure;
40+
# This function fetches the specified nixpkgs revision.
41+
nixpkgsTarball = rev:
42+
builtins.fetchTarball {
43+
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
44+
};
1045

11-
config = {
12-
packageOverrides = super: let self = super.pkgs; in rec {
13-
haskell = super.haskell // {
14-
packageOverrides = self: super: {
15-
haskell-nix = super.callCabal2nix "haskell-nix" (gitIgnore [./.gitignore] ./.) {};
16-
};
17-
};
46+
# This function fetches source from GitHub by tag.
47+
githubTagTarball = owner: repo: tag:
48+
builtins.fetchTarball {
49+
url = "https://github.com/${owner}/${repo}/archive/refs/tags/${tag}.tar.gz";
1850
};
19-
};
2051

21-
pkgs = import (githubTarball "NixOS" "nixpkgs" nixpkgsRev) { inherit config; };
22-
compilerSet = pkgs.haskell.packages."${compilerVersion}";
52+
# The compiler is explicitly specified or the default.
53+
compiler' = if isNull compiler then defaultCompiler else compiler;
2354

24-
in {
55+
# Packages are explicitly specified, those for the revision defined for the
56+
# selected compiler, or those configured on the filesystem.
57+
pkgs = if isNull nixpkgs
58+
then if nixpkgsRevs ? ${compiler'}
59+
then import (nixpkgsTarball nixpkgsRevs.${compiler'}) {}
60+
else import <nixpkgs> {}
61+
else nixpkgs;
2562

26-
inherit pkgs;
63+
# Git ignore functionality from a fixed `nixpkgs` revision is used. Old
64+
# revisions do not work, proably due to an API change.
65+
gitIgnore = (
66+
import (nixpkgsTarball nixpkgsRevs.ghc8104) {}
67+
).nix-gitignore.gitignoreSourcePure;
2768

28-
shell = compilerSet.shellFor {
29-
packages = p: [p.haskell-nix];
30-
buildInputs = with pkgs; [
31-
compilerSet.cabal-install
32-
];
33-
};
69+
in
3470

35-
}
71+
# Configure the development environment for the package using the selected
72+
# packages and compiler.
73+
pkgs.haskell.packages.${compiler'}.developPackage {
74+
root = gitIgnore [./.gitignore] ./.;
75+
name = "queue-sheet";
76+
source-overrides = {
77+
ttc = githubTagTarball "ExtremaIS" "ttc-haskell" "ttc-haskell-1.1.0.0";
78+
};
79+
modifier = drv:
80+
if isShell
81+
then pkgs.haskell.lib.addBuildTools drv
82+
[ pkgs.cabal-install pkgs.texlive.combined.scheme-small
83+
]
84+
else drv;
85+
}

doc/queue-sheet.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.\" Automatically generated by Pandoc 2.9.1.1
1+
.\" Automatically generated by Pandoc 2.11.4
22
.\"
3-
.TH "QUEUE-SHEET" "1" "" "queue-sheet-haskell 0.6.0.0 (2021-05-27)" "queue-sheet Manual"
3+
.TH "QUEUE-SHEET" "1" "" "queue-sheet-haskell 0.7.0.0 (2021-06-25)" "queue-sheet Manual"
44
.nh
55
.SH NAME
66
.PP
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# `queue-sheet-haskell` `0.7.0.0` Release Notes
2+
3+
Date
4+
: 2021-06-25
5+
6+
## Overview
7+
8+
This release of Queue Sheet fixes a bug and makes changes to the [Nix][]
9+
configuration. There are no changes to the Queue Sheet CLI.
10+
11+
[Nix]: <https://nixos.org/>
12+
13+
### Big Fix
14+
15+
This release includes a fix for a bug that broke `--help` output. The issue
16+
only affected builds using `optparse-applicative` `0.16`, so none of the
17+
published builds were affected.
18+
19+
### Nix Configuration
20+
21+
The Nix configuration now supports testing against the following GHC versions
22+
using known working `nixpkgs` revisions:
23+
24+
* GHC 8.2.2
25+
* GHC 8.4.4
26+
* GHC 8.8.4
27+
* GHC 8.10.4
28+
29+
Note that testing against the following GHC version using Nix is currently not
30+
working:
31+
32+
* GHC 8.6.5, because `ginger` is marked as broken

queue-sheet.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: queue-sheet
2-
version: 0.6.0.0
2+
version: 0.7.0.0
33
category: Utils
44
synopsis: queue sheet utility
55
description:

shell.nix

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
(import ./default.nix).shell
1+
# Nix shell configuration for QueueSheet development
2+
#
3+
# Usage:
4+
#
5+
# * Run a Nix shell with the default compiler:
6+
#
7+
# $ nix-shell
8+
#
9+
# * Run a Nix shell with a specific compiler version:
10+
#
11+
# $ nix-shell --argstr compiler ghc8104
12+
13+
{ # This string argument specifies the compiler (example: "ghc8104"). When
14+
# not specified, the default compiler is used.
15+
compiler ? null
16+
# This path argument specifies the packages to use. When not specified, a
17+
# working revision for the selected compiler is used. When a working
18+
# revision for the selected compiler is not defined (below), the packages
19+
# configured on the filesystem are used.
20+
, nixpkgs ? null
21+
}@args:
22+
23+
import ./default.nix (args // { isShell = true; })

stack-8.10.4.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
resolver: lts-17.13
1+
resolver: lts-18.0
22

33
packages:
44
- .
5-
6-
extra-deps:
7-
- ttc-0.4.0.0

0 commit comments

Comments
 (0)