push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
[hackage-packages.nix]
indent_style = unset
trim_trailing_whitespace = unset

View File

@@ -0,0 +1,335 @@
# Maintainer Workflow
The goal of the [@NixOS/haskell](https://github.com/orgs/NixOS/teams/haskell)
team is to keep the Haskell packages in Nixpkgs up-to-date, while making sure
there are no Haskell-related evaluation errors or build errors that get into
the Nixpkgs `master` branch.
We do this by periodically merging an updated set of Haskell packages on the
`haskell-updates` branch into the `staging` branch. Each member of the team
takes a two week period where they are in charge of merging the
`haskell-updates` branch into `staging`. This is the documentation for this
workflow.
The workflow generally proceeds in three main steps:
1. create the initial `haskell-updates` PR, and update Stackage and Hackage snapshots
1. wait for contributors to fix newly broken Haskell packages
1. merge `haskell-updates` into `staging`
Each of these steps is described in a separate section.
There is a script that automates the workflow for merging the currently open
`haskell-updates` PR into `staging` and opening the next PR. It is described
at the end of this document.
## Initial `haskell-updates` PR
In this section we create the PR for merging `haskell-updates` into `staging`.
1. Make sure the `haskell-updates` branch is up-to-date with a _merge base_ of
`staging` and `master`. `haskell-updates` is not based _on_ `staging`,
so that it can share binary cache with `master`.
1. Update the Stackage Nightly resolver used by Nixpkgs and create a commit:
```console
$ ./maintainers/scripts/haskell/update-stackage.sh --do-commit
```
1. Update the Hackage package set used by Nixpkgs and create a commit:
```console
$ ./maintainers/scripts/haskell/update-hackage.sh --do-commit
```
1. Regenerate the Haskell package set used in Nixpkgs and create a commit:
```console
$ ./maintainers/scripts/haskell/regenerate-hackage-packages.sh --do-commit
```
1. Push these commits to the `haskell-updates` branch of the NixOS/nixpkgs repository.
1. Open a PR on Nixpkgs for merging `haskell-updates` into `staging`. The recommended
PR title and body text are described in the `merge-and-open-pr.sh` section.
## Notify Maintainers and Fix Broken Packages
After you've done the previous steps, Hydra will start building the new and
updated Haskell packages. You can see the progress Hydra is making at
https://hydra.nixos.org/jobset/nixpkgs/haskell-updates. This Hydra jobset is
defined in the file [release-haskell.nix](../../top-level/release-haskell.nix).
### Notify Maintainers
When Hydra finishes building all the updated packages for the `haskell-updates`
jobset, you should generate a build report to notify maintainers of their
newly broken packages. You can do that with the following commands:
```console
$ ./maintainers/scripts/haskell/hydra-report.hs get-report
$ ./maintainers/scripts/haskell/hydra-report.hs ping-maintainers
```
The `hydra-report.hs ping-maintainers` command generates a Markdown document
that you can paste in a GitHub comment on the PR opened above. This
comment describes which Haskell packages are now failing to build. It also
pings the maintainers so that they know to fix up their packages.
It may be helpful to pipe `hydra-report.hs ping-maintainers` into `xclip`
(XOrg) or `wl-copy` (Wayland) in order to post on GitHub.
This build report can be fetched and re-generated for new Hydra evaluations.
It may help contributors to try to keep the GitHub comment updated with the
most recent build report.
Maintainers should be given at least 7 days to fix up their packages when they
break. If maintainers don't fix up their packages within 7 days, then they
may be marked broken before merging `haskell-updates` into `staging`.
### Fix Broken Packages
After getting the build report, you can see which packages and Hydra jobs are
failing to build. The most important jobs are the
[`maintained`](https://hydra.nixos.org/job/nixpkgs/haskell-updates/maintained) and
[`mergeable`](https://hydra.nixos.org/job/nixpkgs/haskell-updates/mergeable)
jobs. These are both defined in
[`release-haskell.nix`](../../top-level/release-haskell.nix).
`mergeable` is a set of the most important Haskell packages, including things
like Pandoc and XMonad. These packages are widely used. We would like to
always keep these building.
`maintained` is a set of Haskell packages that have maintainers in Nixpkgs.
We should be proactive in working with maintainers to keep their packages
building.
Steps to fix Haskell packages that are failing to build is out of scope for
this document, but it usually requires fixing up dependencies that are now
out-of-bounds.
### Mark Broken Packages
Packages that do not get fixed can be marked broken with the following
commands. First check which packages are broken:
```console
$ ./maintainers/scripts/haskell/hydra-report.hs get-report
$ ./maintainers/scripts/haskell/hydra-report.hs mark-broken-list
```
This shows a list of packages that reported a build failure on `x86_64-linux` on Hydra.
Next, run the following command:
```console
$ ./maintainers/scripts/haskell/mark-broken.sh --do-commit
```
This first opens up an editor with the broken package list. Some of these
packages may have a maintainer in Nixpkgs. If these maintainers have not been
given 7 days to fix up their package, then make sure to remove those packages
from the list before continuing. After saving and exiting the editor, the
following will happen:
- Packages from the list will be added to
[`configuration-hackage2nix/broken.yaml`](configuration-hackage2nix/broken.yaml).
This is a list of Haskell packages that are known to be broken.
- [`hackage-packages.nix`](hackage-packages.nix) will be regenerated. This
will mark all Haskell packages in `configuration-hackage2nix/broken.yaml`
as `broken`.
- The
[`configuration-hackage2nix/transitive-broken.yaml`](configuration-hackage2nix/transitive-broken.yaml)
file will be updated. This is a list of Haskell packages that
depend on a package in `configuration-hackage2nix/broken.yaml` or
`configuration-hackage2nix/transitive-broken.yaml`
- `hackage-packages.nix` will be regenerated again. This will set
`hydraPlatforms = none` for all the packages in
`configuration-hackage2nix/transitive-broken.yaml`. This makes
sure that Hydra does not try to build any of these packages.
- All updated files will be committed.
## Merge `haskell-updates` into `staging`
Now it is time to merge the `haskell-updates` PR you opened above.
Before doing this, make sure of the following:
- All Haskell packages that fail to build are correctly marked broken or
transitively broken.
- The `maintained` and `mergeable` jobs are passing on Hydra.
- The maintainers for any maintained Haskell packages that are newly broken
have been pinged on GitHub and given at least a week to fix their packages.
This is especially important for widely-used packages like `cachix`.
- Keep an eye on the next `staging-next` iteration (which is branched off
from `staging`) to confirm that there are no show stopping issues stemming
from interactions between changes on `staging` and `haskell-updates`.
Also be aware that build or eval regressions from a `haskell-updates`
iteration may only become apparent on `staging-next`, especially when the
`haskell-updates` jobset had e.g. Darwin builds disabled.
## Script for Merging `haskell-updates` and Opening a New PR
There is a script that automates merging the current `haskell-updates` PR and
opening the next one. When you want to merge the currently open
`haskell-updates` PR, you can run the script with the following steps:
1. Make sure you have previously authenticated with the `gh` command. The
script uses the `gh` command to merge the current PR and open a new one.
You should only need to do this once.
This command can be used to authenticate:
```console
$ gh auth login
```
This command can be used to confirm that you have already authenticated:
```console
$ gh auth status
```
1. Make sure you have setup your `~/.cabal/config` file for authentication
for uploading the NixOS package versions to Hackage. See the following
section for details on how to do this.
1. Make sure you have correctly marked packages broken. One of the previous
sections explains how to do this.
In short:
```console
$ ./maintainers/scripts/haskell/hydra-report.hs get-report
$ ./maintainers/scripts/haskell/hydra-report.hs mark-broken-list
$ ./maintainers/scripts/haskell/mark-broken.sh --do-commit
```
1. Go to https://hydra.nixos.org/jobset/nixpkgs/haskell-updates and force an
evaluation of the `haskell-updates` jobset. See one of the following
sections for how to do this. Make sure there are no evaluation errors. If
there are remaining evaluation errors, fix them before continuing with this
merge.
1. Run the script to merge `haskell-updates`:
```console
$ ./maintainers/scripts/haskell/merge-and-open-pr.sh PR_NUM_OF_CURRENT_HASKELL_UPDATES_PR
```
Find the PR number easily [here](https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates)
This does the following things:
1. Fetches `origin`, makes sure you currently have the `haskell-updates`
branch checked out, and makes sure your currently checked-out
`haskell-updates` branch is on the same commit as
`origin/haskell-updates`.
1. Merges the currently open `haskell-updates` PR.
1. Updates the version of Haskell packages in NixOS on Hackage.
1. Updates Stackage and Hackage snapshots. Regenerates the Haskell package set.
1. Pushes the commits updating Stackage and Hackage and opens a new
`haskell-updates` PR on Nixpkgs. If you'd like to do this by hand,
look in the script for the recommended PR title and body text.
## Update Hackage Version Information
Remember to regularly update what Hackage displays as the current
version in NixOS for every individual package. To do this you run
`maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh` on a checkout
of `master` (or `nixpkgs-unstable`). See the script for how to provide credentials.
Once you have configured credentials, running this takes only a few seconds.
The best time to do this is after `staging-next` has been merged since this is
the way Haskell package updates propagate to `master`.
## Additional Info
Here are some additional tips that didn't fit in above.
- Hydra tries to evaluate the `haskell-updates` branch (in the
[`nixpkgs:haskell-updates`](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates)
jobset) every 4 hours. It is possible to force a new Hydra evaluation without
waiting 4 hours by the following steps:
1. Log into Hydra with your GitHub or Google account.
1. Go to the [nixpkgs:haskell-updates](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates) jobset.
1. Click the `Actions` button.
1. Select `Evaluate this jobset`.
1. If you refresh the page, there should be a new `Evaluation running since:` line.
1. Evaluations take about 10 minutes to finish.
- It is sometimes helpful to update the version of
[`cabal2nix` / `hackage2nix`](https://github.com/NixOS/cabal2nix) that our
maintainer scripts use. This can be done with the
[`maintainers/scripts/haskell/update-cabal2nix-unstable.sh`](../../../maintainers/scripts/haskell/update-cabal2nix-unstable.sh)
script.
You might want to do this if a user contributes a fix to `cabal2nix` that
will immediately fix a Haskell package in Nixpkgs. First, merge in
the PR to `cabal2nix`, then run `update-cabal2nix-upstable.sh`. Finally, run
[`regenerate-hackage-packages.sh`](../../../maintainers/scripts/haskell/regenerate-hackage-packages.sh)
to regenerate the Hackage package set with the updated version of `hackage2nix`.
- Make sure never to update the Hackage package hashes in
[`pkgs/data/misc/hackage/`](../../../pkgs/data/misc/hackage/), or the
pinned Stackage Nightly versions on the release branches (like
`release-21.05`).
This means that the
[`update-hackage.sh`](../../../maintainers/scripts/haskell/update-hackage.sh)
and
[`update-stackage.sh`](../../../maintainers/scripts/haskell/update-stackage.sh)
scripts should never be used on the release branches.
However, changing other files in `./.` and regenerating the package set is encouraged.
This can be done with
[`regenerate-hackage-packages.sh`](../../../maintainers/scripts/haskell/regenerate-hackage-packages.sh)
as described above.
- The Haskell team members generally hang out in the Matrix room
[#haskell:nixos.org](https://matrix.to/#/#haskell:nixos.org).
- This is a checklist for things that need to happen when a new
member is added to the Nixpkgs Haskell team.
1. Add the person to the
[@NixOS/haskell](https://github.com/orgs/NixOS/teams/haskell)
team. You may need to ask someone in the NixOS organization
to do this, like [@domenkozar](https://github.com/domenkozar).
This gives the new member access to the GitHub repos like
[cabal2nix](https://github.com/NixOS/cabal2nix).
1. Add the person as a maintainer for the following packages
on Hackage:
- https://hackage.haskell.org/package/cabal2nix
- https://hackage.haskell.org/package/distribution-nixpkgs
- https://hackage.haskell.org/package/hackage-db
- https://hackage.haskell.org/package/jailbreak-cabal
- https://hackage.haskell.org/package/language-nix
1. Add the person to the `haskell` team in
[`maintainers/team-list.nix`](../../../maintainers/team-list.nix).
This team is responsible for some important packages in
[release-haskell.nix](../../top-level/release-haskell.nix).
1. Update the
[Nextcloud Calendar](https://cloud.maralorn.de/apps/calendar/p/H6migHmKX7xHoTFa)
and work the new member into the `haskell-updates` rotation.
1. Optionally, have the new member add themselves to the Haskell
section in [`OWNERS`](../../../ci/OWNERS). This
will cause them to get pinged on most Haskell-related PRs.

View File

@@ -0,0 +1,110 @@
# This file defines cabal2nix-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.
{
mkDerivation,
aeson,
ansi-terminal,
base,
bytestring,
Cabal,
containers,
deepseq,
directory,
distribution-nixpkgs,
fetchzip,
filepath,
hackage-db,
hopenssl,
hpack,
language-nix,
lens,
lib,
monad-par,
monad-par-extras,
mtl,
optparse-applicative,
pretty,
prettyprinter,
process,
split,
tasty,
tasty-golden,
text,
time,
transformers,
yaml,
}:
mkDerivation {
pname = "cabal2nix";
version = "2.20.1-unstable-2025-09-17";
src = fetchzip {
url = "https://github.com/NixOS/cabal2nix/archive/3cc36a5df16a10bac9a858208845e3d05b79845d.tar.gz";
sha256 = "1z1knv2ggm9ddyl0v120nhcnjmq50z7q1m88qj7rfz51gx1ifnim";
};
postUnpack = "sourceRoot+=/cabal2nix; echo source root reset to $sourceRoot";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson
ansi-terminal
base
bytestring
Cabal
containers
deepseq
directory
distribution-nixpkgs
filepath
hackage-db
hopenssl
hpack
language-nix
lens
optparse-applicative
pretty
prettyprinter
process
split
text
time
transformers
yaml
];
executableHaskellDepends = [
aeson
base
bytestring
Cabal
containers
directory
distribution-nixpkgs
filepath
hopenssl
language-nix
lens
monad-par
monad-par-extras
mtl
optparse-applicative
pretty
];
testHaskellDepends = [
base
Cabal
containers
directory
filepath
language-nix
lens
pretty
process
tasty
tasty-golden
];
preCheck = ''
export PATH="$PWD/dist/build/cabal2nix:$PATH"
export HOME="$TMPDIR/home"
'';
homepage = "https://github.com/nixos/cabal2nix#readme";
description = "Convert Cabal files into Nix build instructions";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,53 @@
# This file defines distribution-nixpkgs-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.
{
mkDerivation,
aeson,
base,
bytestring,
Cabal,
containers,
deepseq,
directory,
fetchzip,
hspec,
language-nix,
lens,
lib,
pretty,
process,
}:
mkDerivation {
pname = "distribution-nixpkgs";
version = "1.7.1.1-unstable-2025-09-17";
src = fetchzip {
url = "https://github.com/NixOS/cabal2nix/archive/3cc36a5df16a10bac9a858208845e3d05b79845d.tar.gz";
sha256 = "1z1knv2ggm9ddyl0v120nhcnjmq50z7q1m88qj7rfz51gx1ifnim";
};
postUnpack = "sourceRoot+=/distribution-nixpkgs; echo source root reset to $sourceRoot";
enableSeparateDataOutput = true;
libraryHaskellDepends = [
aeson
base
bytestring
Cabal
containers
deepseq
language-nix
lens
pretty
process
];
testHaskellDepends = [
aeson
base
Cabal
deepseq
directory
hspec
language-nix
lens
];
homepage = "https://github.com/NixOS/cabal2nix/tree/master/distribution-nixpkgs#readme";
description = "Types and functions to manipulate the Nixpkgs distribution";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,44 @@
# This file defines hackage-db-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.
{
mkDerivation,
aeson,
base,
bytestring,
Cabal,
containers,
directory,
exceptions,
fetchzip,
filepath,
lib,
tar,
time,
utf8-string,
}:
mkDerivation {
pname = "hackage-db";
version = "2.1.3-unstable-2025-09-17";
src = fetchzip {
url = "https://github.com/NixOS/cabal2nix/archive/3cc36a5df16a10bac9a858208845e3d05b79845d.tar.gz";
sha256 = "1z1knv2ggm9ddyl0v120nhcnjmq50z7q1m88qj7rfz51gx1ifnim";
};
postUnpack = "sourceRoot+=/hackage-db; echo source root reset to $sourceRoot";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson
base
bytestring
Cabal
containers
directory
exceptions
filepath
tar
time
utf8-string
];
homepage = "https://github.com/NixOS/cabal2nix/tree/master/hackage-db#readme";
description = "Access cabal-install's Hackage database via Data.Map";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,41 @@
# This file defines language-nix-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.
{
mkDerivation,
base,
deepseq,
fetchzip,
hspec,
lens,
lib,
parsec-class,
pretty,
QuickCheck,
}:
mkDerivation {
pname = "language-nix";
version = "2.3.0-unstable-2025-09-17";
src = fetchzip {
url = "https://github.com/NixOS/cabal2nix/archive/3cc36a5df16a10bac9a858208845e3d05b79845d.tar.gz";
sha256 = "1z1knv2ggm9ddyl0v120nhcnjmq50z7q1m88qj7rfz51gx1ifnim";
};
postUnpack = "sourceRoot+=/language-nix; echo source root reset to $sourceRoot";
libraryHaskellDepends = [
base
deepseq
lens
parsec-class
pretty
QuickCheck
];
testHaskellDepends = [
base
hspec
lens
parsec-class
pretty
QuickCheck
];
homepage = "https://github.com/NixOS/cabal2nix/tree/master/language-nix#readme";
description = "Data types and functions to represent the Nix language";
license = lib.licenses.bsd3;
}

View File

@@ -0,0 +1,126 @@
# ARM-SPECIFIC OVERRIDES FOR THE HASKELL PACKAGE SET IN NIXPKGS
#
# This extension is applied to all haskell package sets in nixpkgs if
# `stdenv.hostPlatform.isAarch` to apply arm specific workarounds or
# fixes.
#
# The file is split into three parts:
#
# * Overrides that are applied for all arm platforms
# * Overrides for aarch32 platforms
# * Overrides for aarch64 platforms
#
# This may be extended in the future to also include compiler-
# specific sections as compiler and linker related bugs may
# get fixed subsequently.
#
# When adding new overrides, try to research which section they
# belong into. Most likely we'll be favouring aarch64 overrides
# in practice since that is the only platform we can test on
# Hydra. Also take care to group overrides by the issue they
# solve, so refactors and updates to this file are less tedious.
{ pkgs, haskellLib }:
let
inherit (pkgs) lib;
in
with haskellLib;
self: super:
{
# COMMON ARM OVERRIDES
# moved here from configuration-common.nix, no reason given.
servant-docs = dontCheck super.servant-docs;
swagger2 = dontHaddock (dontCheck super.swagger2);
# Similar to https://ghc.haskell.org/trac/ghc/ticket/13062
happy = dontCheck super.happy;
# add arm specific library
wiringPi = overrideCabal (
{
librarySystemDepends ? [ ],
...
}:
{
librarySystemDepends = librarySystemDepends ++ [ pkgs.wiringpi ];
}
) super.wiringPi;
}
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isAarch64 {
# AARCH64-SPECIFIC OVERRIDES
# Doctests fail on aarch64 due to a GHCi linking bug
# https://gitlab.haskell.org/ghc/ghc/-/issues/15275#note_295437
# TODO: figure out if needed on aarch32 as well
BNFC = dontCheck super.BNFC;
C-structs = dontCheck super.C-structs;
Chart-tests = dontCheck super.Chart-tests;
Jikka = dontCheck super.Jikka;
accelerate = dontCheck super.accelerate;
ad = dontCheck super.ad;
autoapply = dontCheck super.autoapply;
construct = dontCheck super.construct;
exact-real = dontCheck super.exact-real;
flight-kml = dontCheck super.flight-kml;
focuslist = dontCheck super.focuslist;
grammatical-parsers = dontCheck super.grammatical-parsers;
greskell = dontCheck super.greskell;
groupBy = dontCheck super.groupBy;
haskell-time-range = dontCheck super.haskell-time-range;
headroom = dontCheck super.headroom;
hgeometry = dontCheck super.hgeometry;
hhp = dontCheck super.hhp;
hsakamai = dontCheck super.hsakamai;
hsemail-ns = dontCheck super.hsemail-ns;
html-validator-cli = dontCheck super.html-validator-cli;
hw-fingertree-strict = dontCheck super.hw-fingertree-strict;
hw-packed-vector = dontCheck super.hw-packed-vector;
hw-prim = dontCheck super.hw-prim;
hw-xml = dontCheck super.hw-xml;
language-nix = dontCheck super.language-nix;
lens-regex = dontCheck super.lens-regex;
meep = dontCheck super.meep;
openapi3 = dontCheck super.openapi3;
orbits = dontCheck super.orbits;
ranged-list = dontCheck super.ranged-list;
rank2classes = dontCheck super.rank2classes;
schedule = dontCheck super.schedule;
static = dontCheck super.static;
strict-writer = dontCheck super.strict-writer;
termonad = dontCheck super.termonad;
trifecta = dontCheck super.trifecta;
twiml = dontCheck super.twiml;
twitter-conduit = dontCheck super.twitter-conduit;
validationt = dontCheck super.validationt;
vgrep = dontCheck super.vgrep;
vinyl = dontCheck super.vinyl;
vulkan-utils = dontCheck super.vulkan-utils;
xml-html-qq = dontCheck super.xml-html-qq;
yaml-combinators = dontCheck super.yaml-combinators;
yesod-paginator = dontCheck super.yesod-paginator;
# https://github.com/ekmett/half/issues/35
half = dontCheck super.half;
# We disable profiling on aarch64, so tests naturally fail
ghc-prof = dontCheck super.ghc-prof;
# Similar RTS issue in test suite:
# rts/linker/elf_reloc_aarch64.c:98: encodeAddendAarch64: Assertion `isInt64(21+12, addend)' failed.
# These still fail sporadically on ghc 9.2
}
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isAarch32 {
# AARCH32-SPECIFIC OVERRIDES
# KAT/ECB/D2 test segfaults on armv7l
# https://github.com/haskell-crypto/cryptonite/issues/367
cryptonite = dontCheck super.cryptonite;
}
// lib.optionalAttrs (with pkgs.stdenv.hostPlatform; isAarch && isAndroid) {
# android is not currently allowed as 'supported-platforms' by hackage2nix
android-activity = unmarkBroken super.android-activity;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,447 @@
# DARWIN-SPECIFIC OVERRIDES FOR THE HASKELL PACKAGE SET IN NIXPKGS
{ pkgs, haskellLib }:
let
inherit (pkgs) lib darwin;
in
with haskellLib;
self: super:
(
{
# the tests for shell-conduit on Darwin illegitimatey assume non-GNU echo
# see: https://github.com/psibi/shell-conduit/issues/12
shell-conduit = dontCheck super.shell-conduit;
conduit-extra = super.conduit-extra.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
spacecookie = super.spacecookie.overrideAttrs (_: {
__darwinAllowLocalNetworking = true;
});
streaming-commons = super.streaming-commons.overrideAttrs (_: {
__darwinAllowLocalNetworking = true;
});
# Hakyll's tests are broken on Darwin (3 failures); and they require util-linux
hakyll = overrideCabal {
testToolDepends = [ ];
doCheck = false;
} super.hakyll;
double-conversion = addExtraLibrary pkgs.libcxx super.double-conversion;
# "erf table" test fails on Darwin
# https://github.com/bos/math-functions/issues/63
math-functions = dontCheck super.math-functions;
# darwin doesn't have sub-second resolution
# https://github.com/hspec/mockery/issues/11
mockery = overrideCabal (drv: {
preCheck = ''
export TRAVIS=true
''
+ (drv.preCheck or "");
}) super.mockery;
# https://github.com/ndmitchell/shake/issues/206
shake = dontCheck super.shake;
filecache = dontCheck super.filecache;
# gtk/gtk3 needs to be told on Darwin to use the Quartz
# rather than X11 backend (see eg https://github.com/gtk2hs/gtk2hs/issues/249).
gtk3 = appendConfigureFlag "-f have-quartz-gtk" super.gtk3;
gtk = appendConfigureFlag "-f have-quartz-gtk" super.gtk;
# issues finding libcharset.h without libiconv in buildInputs on darwin.
with-utf8 = addExtraLibrary pkgs.libiconv super.with-utf8;
git-annex = overrideCabal (drv: {
# We can't use testFlags since git-annex side steps the Cabal test mechanism
preCheck = drv.preCheck or "" + ''
checkFlagsArray+=(
# The addurl test cases require security(1) to be in PATH which we can't
# provide from nixpkgs to my (@sternenseemann) knowledge.
"-p" "!/addurl/"
)
'';
}) super.git-annex;
# on*Finish tests rely on a threadDelay timing differential of 0.1s.
# You'd think that's plenty of time even though immediate rescheduling
# after threadDelay is not guaranteed. However, it appears that these
# tests are quite flaky on Darwin.
immortal = dontCheck super.immortal;
# Prevents needing to add `security_tool` as a run-time dependency for
# everything using x509-system to give access to the `security` executable.
#
# darwin.security_tool is broken in Mojave (#45042)
#
# We will use the system provided security for now.
# Beware this WILL break in sandboxes!
#
# TODO(matthewbauer): If someone really needs this to work in sandboxes,
# I think we can add a propagatedImpureHost dep here, but Im hoping to
# get a proper fix available soonish.
x509-system = overrideCabal (
drv:
lib.optionalAttrs (!pkgs.stdenv.cc.nativeLibc) {
postPatch = ''
substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security
''
+ (drv.postPatch or "");
}
) super.x509-system;
crypton-x509-system = overrideCabal (
drv:
lib.optionalAttrs (!pkgs.stdenv.cc.nativeLibc) {
postPatch = ''
substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security
''
+ (drv.postPatch or "");
}
) super.crypton-x509-system;
# https://github.com/haskell-foundation/foundation/pull/412
foundation = dontCheck super.foundation;
# Test suite attempts to create illegal paths on HFS+
# https://github.com/fpco/haskell-filesystem/issues/37
system-fileio = dontCheck super.system-fileio;
llvm-hs = overrideCabal (oldAttrs: {
# One test fails on darwin.
doCheck = false;
# llvm-hs's Setup.hs file tries to add the lib/ directory from LLVM8 to
# the DYLD_LIBRARY_PATH environment variable. This messes up clang
# when called from GHC, probably because clang is version 7, but we are
# using LLVM8.
preCompileBuildDriver = ''
substituteInPlace Setup.hs --replace "addToLdLibraryPath libDir" "pure ()"
''
+ (oldAttrs.preCompileBuildDriver or "");
}) super.llvm-hs;
sym = markBroken super.sym;
yesod-core = super.yesod-core.overrideAttrs (drv: {
# Allow access to local networking when the Darwin sandbox is enabled, so yesod-core can
# run tests that access localhost.
__darwinAllowLocalNetworking = true;
});
hidapi = super.hidapi.override { systemd = null; };
# Ensure the necessary frameworks are propagatedBuildInputs on darwin
OpenGLRaw = overrideCabal (drv: {
librarySystemDepends = [ ];
libraryHaskellDepends = drv.libraryHaskellDepends;
preConfigure = ''
frameworkPaths=($(for i in $nativeBuildInputs; do if [ -d "$i"/Library/Frameworks ]; then echo "-F$i/Library/Frameworks"; fi done))
frameworkPaths=$(IFS=, ; echo "''${frameworkPaths[@]}")
configureFlags+=$(if [ -n "$frameworkPaths" ]; then echo -n "--ghc-options=-optl=$frameworkPaths"; fi)
''
+ (drv.preConfigure or "");
}) super.OpenGLRaw;
bindings-GLFW = overrideCabal (drv: {
librarySystemDepends = [ ];
}) super.bindings-GLFW;
# cabal2nix likes to generate dependencies on hinotify when hfsevents is
# really required on darwin: https://github.com/NixOS/cabal2nix/issues/146.
hinotify = self.hfsevents;
# FSEvents API is very buggy and tests are unreliable. See
# http://openradar.appspot.com/10207999 and similar issues.
fsnotify = dontCheck super.fsnotify;
HTF = overrideCabal (drv: {
# GNU find is not prefixed in stdenv
postPatch = ''
substituteInPlace scripts/local-htfpp --replace "find=gfind" "find=find"
''
+ (drv.postPatch or "");
}) super.HTF;
# conditional dependency via a cabal flag
cas-store = overrideCabal (drv: {
libraryHaskellDepends = [
self.kqueue
]
++ (drv.libraryHaskellDepends or [ ]);
}) super.cas-store;
# We are lacking pure pgrep at the moment for tests to work
tmp-postgres = dontCheck super.tmp-postgres;
# On darwin librt doesn't exist and will fail to link against,
# however linking against it is also not necessary there
GLHUI = overrideCabal (drv: {
postPatch = ''
substituteInPlace GLHUI.cabal --replace " rt" ""
''
+ (drv.postPatch or "");
}) super.GLHUI;
SDL-image = overrideCabal (drv: {
# Prevent darwin-specific configuration code path being taken
# which doesn't work with nixpkgs' SDL libraries
postPatch = ''
substituteInPlace configure --replace xDarwin noDarwinSpecialCasing
''
+ (drv.postPatch or "");
patches = [
# Work around SDL_main.h redefining main to SDL_main
./patches/SDL-image-darwin-hsc.patch
];
}) super.SDL-image;
# Prevent darwin-specific configuration code path being taken which
# doesn't work with nixpkgs' SDL libraries
SDL-mixer = overrideCabal (drv: {
postPatch = ''
substituteInPlace configure --replace xDarwin noDarwinSpecialCasing
''
+ (drv.postPatch or "");
}) super.SDL-mixer;
# Work around SDL_main.h redefining main to SDL_main
SDL-ttf = appendPatch ./patches/SDL-ttf-darwin-hsc.patch super.SDL-ttf;
# Disable a bunch of test suites that fail because of darwin's case insensitive
# file system: When a test suite has a test suite file that has the same name
# as a module in scope, but in different case (e. g. hedgehog.hs and Hedgehog
# in scope), GHC will complain that the file name and module name differ (in
# the example hedgehog.hs would be Main).
# These failures can easily be fixed by upstream by renaming files, so we
# should create issues for them.
# https://github.com/typeclasses/aws-cloudfront-signed-cookies/issues/2
aws-cloudfront-signed-cookies = dontCheck super.aws-cloudfront-signed-cookies;
# https://github.com/acid-state/acid-state/issues/133
acid-state = dontCheck super.acid-state;
# Otherwise impure gcc is used, which is Apple's weird wrapper
c2hsc = addTestToolDepends [ pkgs.gcc ] super.c2hsc;
http2 = super.http2.overrideAttrs (drv: {
# Allow access to local networking when the Darwin sandbox is enabled, so http2 can run tests
# that access localhost.
__darwinAllowLocalNetworking = true;
});
# https://hydra.nixos.org/build/230964714/nixlog/1
inline-c-cpp = appendPatch (pkgs.fetchpatch {
url = "https://github.com/fpco/inline-c/commit/e8dc553b13bb847409fdced649a6a863323cff8a.patch";
name = "revert-use-system-cxx-std-lib.patch";
sha256 = "sha256-ql1/+8bvmWexyCdFR0VS4M4cY2lD0Px/9dHYLqlKyNA=";
revert = true;
stripLen = 1;
}) super.inline-c-cpp;
# Tests fail on macOS https://github.com/mrkkrp/zip/issues/112
zip = dontCheck super.zip;
http-streams = super.http-streams.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
io-streams = super.io-streams.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
io-streams-haproxy = super.io-streams-haproxy.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
openssl-streams = super.openssl-streams.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
snap = super.snap.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
warp = super.warp.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
ghcjs-dom-hello = overrideCabal (drv: {
libraryHaskellDepends = with self; [
jsaddle
jsaddle-warp
];
executableHaskellDepends = with self; [
ghcjs-dom
jsaddle-wkwebview
];
}) super.ghcjs-dom-hello;
jsaddle-hello = overrideCabal (drv: {
libraryHaskellDepends = with self; [
jsaddle
lens
];
executableHaskellDepends = with self; [
jsaddle-warp
jsaddle-wkwebview
];
}) super.jsaddle-hello;
jsaddle-wkwebview = overrideCabal (drv: {
libraryHaskellDepends = with self; [
aeson
data-default
jsaddle
]; # cabal2nix doesn't add darwin-only deps
}) super.jsaddle-wkwebview;
# cabal2nix doesn't add darwin-only deps
reflex-dom = addBuildDepend self.jsaddle-wkwebview (
super.reflex-dom.override (drv: {
jsaddle-webkit2gtk = null;
})
);
# Remove a problematic assert, the length is sometimes 1 instead of 2 on darwin
di-core = overrideCabal (drv: {
preConfigure = ''
substituteInPlace test/Main.hs --replace \
"2 @=? List.length (List.nub (List.sort (map Di.log_time logs)))" ""
'';
}) super.di-core;
# Require /usr/bin/security which breaks sandbox
http-reverse-proxy = dontCheck super.http-reverse-proxy;
servant-auth-server = dontCheck super.servant-auth-server;
sysinfo = dontCheck super.sysinfo;
network = super.network.overrideAttrs (drv: {
__darwinAllowLocalNetworking = true;
});
# 2025-08-04: Some RNG tests fail only on Darwin
botan-low = overrideCabal (drv: {
testFlags =
drv.testFlags or [ ]
++ (lib.concatMap (x: [ "--skip" ] ++ [ x ]) [
# botan-low-rng-tests
"/rdrand/rngInit/"
"/rdrand/rngGet/"
"/rdrand/rngReseed/"
"/rdrand/rngReseedFromRNGCtx/"
"/rdrand/rngAddEntropy/"
]);
}) super.botan-low;
}
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isAarch64 {
# aarch64-darwin
# Workarounds for justStaticExecutables on aarch64-darwin. Since dead code
# elimination barely works on aarch64-darwin, any package that has a
# dependency that uses a Paths_ module will incur a reference on GHC, making
# it fail with disallowGhcReference (which is set by justStaticExecutables).
#
# To address this, you can either manually remove the references causing this
# after verifying they are indeed erroneous (e.g. cabal2nix) or just disable
# the check, sticking with the status quo. Ideally there'll be zero cases of
# the latter in the future!
cabal2nix = overrideCabal (old: {
postInstall = ''
remove-references-to -t ${self.hpack} "''${!outputBin}/bin/cabal2nix"
# Note: The `data` output is needed at runtime.
remove-references-to -t ${self.distribution-nixpkgs.out} "''${!outputBin}/bin/hackage2nix"
${old.postInstall or ""}
'';
}) super.cabal2nix;
cabal2nix-unstable = overrideCabal (old: {
postInstall = ''
remove-references-to -t ${self.hpack} "''${!outputBin}/bin/cabal2nix"
# Note: The `data` output is needed at runtime.
remove-references-to -t ${self.distribution-nixpkgs-unstable.out} "''${!outputBin}/bin/hackage2nix"
${old.postInstall or ""}
'';
}) super.cabal2nix-unstable;
# https://github.com/fpco/unliftio/issues/87
unliftio = dontCheck super.unliftio;
# This is the same issue as above; the rio tests call functions in unliftio
# that have issues as tracked in the GitHub issue above. Once the unliftio
# tests are fixed, we can remove this as well.
#
# We skip just the problematic tests by replacing 'it' with 'xit'.
rio = overrideCabal (drv: {
preConfigure = ''
sed -i 's/\bit /xit /g' test/RIO/FileSpec.hs
'';
}) super.rio;
# https://github.com/haskell-crypto/cryptonite/issues/360
cryptonite = appendPatch ./patches/cryptonite-remove-argon2.patch super.cryptonite;
# Build segfaults unless `fixity-th` is disabled.
# https://github.com/tweag/ormolu/issues/927
ormolu = overrideCabal (drv: {
libraryHaskellDepends = drv.libraryHaskellDepends ++ [ self.file-embed ];
}) (disableCabalFlag "fixity-th" super.ormolu);
fourmolu = overrideCabal (drv: {
libraryHaskellDepends = drv.libraryHaskellDepends ++ [ self.file-embed ];
}) (disableCabalFlag "fixity-th" super.fourmolu);
Agda = lib.pipe super.Agda [
# https://github.com/NixOS/nixpkgs/issues/149692
(disableCabalFlag "optimise-heavily")
# https://github.com/agda/agda/issues/8016
(appendConfigureFlag "--ghc-option=-Wwarn=deprecations")
];
# https://github.com/NixOS/nixpkgs/issues/198495
eventsourcing-postgresql = dontCheck super.eventsourcing-postgresql;
gargoyle-postgresql-connect = dontCheck super.gargoyle-postgresql-connect;
hs-opentelemetry-instrumentation-postgresql-simple = dontCheck super.hs-opentelemetry-instrumentation-postgresql-simple;
moto-postgresql = dontCheck super.moto-postgresql;
persistent-postgresql = dontCheck super.persistent-postgresql;
pipes-postgresql-simple = dontCheck super.pipes-postgresql-simple;
postgresql-connector = dontCheck super.postgresql-connector;
postgresql-migration = dontCheck super.postgresql-migration;
postgresql-schema = dontCheck super.postgresql-schema;
postgresql-simple = dontCheck super.postgresql-simple;
postgresql-simple-interpolate = dontCheck super.postgresql-simple-interpolate;
postgresql-simple-migration = dontCheck super.postgresql-simple-migration;
postgresql-simple-url = dontCheck super.postgresql-simple-url;
postgresql-transactional = dontCheck super.postgresql-transactional;
postgrest = dontCheck super.postgrest;
rivet-adaptor-postgresql = dontCheck super.rivet-adaptor-postgresql;
tmp-proc-postgres = dontCheck super.tmp-proc-postgres;
}
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isx86_64 {
# x86_64-darwin
# tests appear to be failing to link or something:
# https://hydra.nixos.org/build/174540882/nixlog/9
regex-rure = dontCheck super.regex-rure;
# same
# https://hydra.nixos.org/build/174540882/nixlog/9
jacinda = dontCheck super.jacinda;
# Greater floating point error on x86_64-darwin (!) for some reason
# https://github.com/ekmett/ad/issues/113
ad = overrideCabal (drv: {
testFlags = drv.testFlags or [ ] ++ [
"-p"
"!/issue-108/"
];
}) super.ad;
}
)

View File

@@ -0,0 +1,202 @@
{
config,
pkgs,
haskellLib,
}:
with haskellLib;
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
inherit (pkgs) lib;
in
self: super: {
# Disable GHC 9.0.x core libraries.
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-heap = null;
ghc-prim = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
libiserv = null;
mtl = null;
parsec = null;
pretty = null;
process = null;
rts = null;
stm = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
# GHC only bundles the xhtml library if haddock is enabled, check if this is
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_4_0_0;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# These core package only exist for GHC >= 9.4. The best we can do is feign
# their existence to callPackages, but their is no shim for lower GHC versions.
system-cxx-std-lib = null;
# Becomes a core package in GHC >= 9.8
semaphore-compat = doDistribute self.semaphore-compat_1_0_0;
# Becomes a core package in GHC >= 9.10
os-string = doDistribute self.os-string_1_0_0;
# Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
ghc-internal = null;
# Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
ghc-toolchain = null;
ghc-platform = null;
# Only required for ghc >= 9.2
nothunks = super.nothunks.override {
wherefrom-compat = null;
};
# Needs base-orphans for GHC < 9.8 / base < 4.19
some = addBuildDepend self.base-orphans super.some;
# Jailbreaks & Version Updates
# tar > 0.6 requires os-string which can't be built with bytestring < 0.11
tar = doDistribute (doJailbreak self.tar_0_6_0_0);
# text-metrics >= 0.3.3 requires GHC2021
text-metrics = doDistribute self.text-metrics_0_3_2;
# For GHC < 9.4, some packages need data-array-byte as an extra dependency
primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
# hashable >= 1.5 only supports GHC >= 9.6 / base >= 4.18
hashable = self.hashable_1_4_7_0;
hashable_1_4_7_0 =
# extra deps for GHC < 9.4
addBuildDepends
[
self.data-array-byte
self.base-orphans
]
# For GHC < 9.2, os-string is not required
(super.hashable_1_4_7_0.override { os-string = null; });
# Too strict lower bounds on base
primitive-addr = doJailbreak super.primitive-addr;
hashable-time = doJailbreak super.hashable-time;
tuple = addBuildDepend self.base-orphans super.tuple;
vector-th-unbox = doJailbreak super.vector-th-unbox;
ormolu = self.ormolu_0_5_2_0.override {
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
};
stylish-haskell = doJailbreak super.stylish-haskell_0_14_4_0;
doctest = dontCheck super.doctest;
haskell-language-server =
lib.throwIf config.allowAliases
"haskell-language-server has dropped support for ghc 9.0 in version 2.4.0.0, please use a newer ghc version or an older nixpkgs version"
(markBroken super.haskell-language-server);
# test suite depends on vcr since hpack >= 0.38.1 which requires GHC2021
hpack = dontCheck super.hpack;
# Needs to use ghc-lib due to incompatible GHC
ghc-tags = doDistribute self.ghc-tags_1_5;
# ghc-lib >= 9.6 and friends no longer build with GHC 9.0
ghc-lib-parser = doDistribute self.ghc-lib-parser_9_2_8_20230729;
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_2_1_1;
ghc-lib = doDistribute self.ghc-lib_9_2_8_20230729;
# Test suite sometimes segfaults with GHC 9.0.1 and 9.0.2
# https://github.com/ekmett/reflection/issues/51
# https://gitlab.haskell.org/ghc/ghc/-/issues/21141
reflection = dontCheck super.reflection;
# Disable tests pending resolution of
# https://github.com/Soostone/retry/issues/71
retry = dontCheck super.retry;
ghc-api-compat = unmarkBroken super.ghc-api-compat;
# 2021-09-18: cabal2nix does not detect the need for ghc-api-compat.
hiedb = overrideCabal (old: {
libraryHaskellDepends = old.libraryHaskellDepends ++ [ self.ghc-api-compat ];
}) super.hiedb;
# https://github.com/lspitzner/butcher/issues/7
butcher = doJailbreak super.butcher;
# Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
aeson = dontCheck super.aeson;
# We use a GHC patch to support the fix for https://github.com/fpco/inline-c/issues/127
# which means that the upstream cabal file isn't allowed to add the flag.
inline-c-cpp =
(if isDarwin then appendConfigureFlags [ "--ghc-option=-fcompact-unwind" ] else x: x)
super.inline-c-cpp;
# 2022-05-31: weeder 2.4.* requires GHC 9.2
weeder = doDistribute self.weeder_2_3_1;
# Unnecessarily strict upper bound on lens
weeder_2_3_1 = doJailbreak (
super.weeder_2_3_1.override {
# weeder < 2.6 only supports algebraic-graphs < 0.7
# We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
}
);
# Later versions only support GHC >= 9.2
ghc-exactprint = self.ghc-exactprint_0_6_4;
retrie = dontCheck self.retrie_1_1_0_0;
# Needs OneTuple for ghc < 9.2
binary-orphans = addBuildDepends [ self.OneTuple ] super.binary-orphans;
hspec-megaparsec = super.hspec-megaparsec_2_2_0;
# No instance for (Show B.Builder) arising from a use of print
http-types = dontCheck super.http-types;
# Packages which need compat library for GHC < 9.6
inherit (lib.mapAttrs (_: addBuildDepends [ self.foldable1-classes-compat ]) super)
indexed-traversable
these
;
base-compat-batteries = addBuildDepends [
self.foldable1-classes-compat
self.OneTuple
] super.base-compat-batteries;
OneTuple = addBuildDepends [
self.foldable1-classes-compat
self.base-orphans
] super.OneTuple;
}

View File

@@ -0,0 +1,94 @@
{ pkgs, haskellLib }:
self: super:
with haskellLib;
let
inherit (pkgs) lib;
warnAfterVersion =
ver: pkg:
lib.warnIf (lib.versionOlder ver
super.${pkg.pname}.version
) "override for haskell.packages.ghc910.${pkg.pname} may no longer be needed" pkg;
in
{
# Disable GHC core libraries
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
Cabal-syntax = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-experimental = null;
ghc-heap = null;
ghc-internal = null;
ghc-platform = null;
ghc-prim = null;
ghc-toolchain = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
mtl = null;
os-string = null;
parsec = null;
pretty = null;
process = null;
rts = null;
semaphore-compat = null;
stm = null;
system-cxx-std-lib = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
xhtml = null;
# “Unfortunately we are unable to support GHC 9.10.”
apply-refact = dontDistribute (markBroken super.apply-refact);
#
# Version upgrades
#
# Upgrade to accommodate new core library versions, where the authors have
# already made the relevant changes.
#
# Jailbreaks
#
floskell = doJailbreak super.floskell; # base <4.20
# 2025-04-09: filepath <1.5
haddock-library =
assert super.haddock-library.version == "1.11.0";
doJailbreak super.haddock-library;
tree-sitter = doJailbreak super.tree-sitter; # containers <0.7, filepath <1.5
#
# Test suite issues
#
call-stack = dontCheck super.call-stack; # https://github.com/sol/call-stack/issues/19
fsnotify = dontCheck super.fsnotify; # https://github.com/haskell-fswatch/hfsnotify/issues/115
hinotify = pkgs.haskell.lib.dontCheck super.hinotify; # https://github.com/kolmodin/hinotify/issues/38
monad-dijkstra = dontCheck super.monad-dijkstra; # needs hlint 3.10
}

View File

@@ -0,0 +1,131 @@
{ pkgs, haskellLib }:
self: super:
let
inherit (pkgs) lib;
warnAfterVersion =
ver: pkg:
lib.warnIf (lib.versionOlder ver
super.${pkg.pname}.version
) "override for haskell.packages.ghc912.${pkg.pname} may no longer be needed" pkg;
in
with haskellLib;
{
# Disable GHC core libraries
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
Cabal-syntax = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
file-io = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-experimental = null;
ghc-heap = null;
ghc-internal = null;
ghc-platform = null;
ghc-prim = null;
ghc-toolchain = null;
ghci = null;
haddock-api = null;
haddock-library = null;
haskeline = null;
hpc = null;
integer-gmp = null;
mtl = null;
os-string = null;
parsec = null;
pretty = null;
process = null;
rts = null;
semaphore-compat = null;
stm = null;
system-cxx-std-lib = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
haskellLib.doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
xhtml = null;
#
# Hand pick versions that are compatible with ghc 9.12 and base 4.21
#
extensions = doDistribute self.extensions_0_1_0_3;
ghc-exactprint = doDistribute self.ghc-exactprint_1_12_0_0;
#
# Jailbreaks
#
large-generics = doJailbreak super.large-generics; # base <4.20
cpphs = overrideCabal (drv: {
# jail break manually the conditional dependencies
postPatch = ''
sed -i 's/time >=1.5 \&\& <1.13/time >=1.5 \&\& <=1.14/g' cpphs.cabal
'';
}) super.cpphs;
cabal-install-parsers = doJailbreak super.cabal-install-parsers; # base, Cabal-syntax, etc.
ghc-exactprint_1_12_0_0 = addBuildDepends [
# somehow buildDepends was missing
self.Diff
self.extra
self.ghc-paths
self.silently
self.syb
self.HUnit
] super.ghc-exactprint_1_12_0_0;
timezone-series = doJailbreak super.timezone-series; # time <1.14
timezone-olson = doJailbreak super.timezone-olson; # time <1.14
cabal-plan = doJailbreak super.cabal-plan; # base <4.21
dbus = doJailbreak super.dbus; # template-haskell <2.23
xmobar = doJailbreak super.xmobar; # base <4.21
#
# Test suite issues
#
call-stack = dontCheck super.call-stack; # https://github.com/sol/call-stack/issues/19
relude = dontCheck super.relude;
# https://gitlab.haskell.org/ghc/ghc/-/issues/25930
generic-lens = dontCheck super.generic-lens;
# Cabal 3.14 regression (incorrect datadir in tests): https://github.com/haskell/cabal/issues/10717
alex = overrideCabal (drv: {
preCheck = drv.preCheck or "" + ''
export alex_datadir="$(pwd)/data"
'';
}) super.alex;
# https://github.com/sjakobi/newtype-generics/pull/28/files
newtype-generics = warnAfterVersion "0.6.2" (doJailbreak super.newtype-generics);
# Test failure because of GHC bug:
# https://gitlab.haskell.org/ghc/ghc/-/issues/25937
# https://github.com/sol/interpolate/issues/20
interpolate =
assert super.ghc.version == "9.12.2";
dontCheck super.interpolate;
}

View File

@@ -0,0 +1,54 @@
{ pkgs, haskellLib }:
let
inherit (pkgs) lib;
in
self: super: {
# Disable GHC core libraries
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
Cabal-syntax = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
file-io = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-experimental = null;
ghc-heap = null;
ghc-internal = null;
ghc-platform = null;
ghc-prim = null;
ghc-toolchain = null;
ghci = null;
haddock-api = null;
haddock-library = null;
haskeline = null;
hpc = null;
integer-gmp = null;
mtl = null;
os-string = null;
parsec = null;
pretty = null;
process = null;
rts = null;
semaphore-compat = null;
stm = null;
system-cxx-std-lib = null;
template-haskell = null;
terminfo = null;
text = null;
time = null;
transformers = null;
unix = null;
xhtml = null;
}

View File

@@ -0,0 +1,167 @@
{
config,
pkgs,
haskellLib,
}:
with haskellLib;
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
inherit (pkgs) lib;
in
self: super: {
# Disable GHC 9.2.x core libraries.
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-heap = null;
ghc-prim = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
libiserv = null;
mtl = null;
parsec = null;
pretty = null;
process = null;
rts = null;
stm = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
# GHC only bundles the xhtml library if haddock is enabled, check if this is
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_4_0_0;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# These core package only exist for GHC >= 9.4. The best we can do is feign
# their existence to callPackages, but their is no shim for lower GHC versions.
system-cxx-std-lib = null;
# Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
ghc-internal = null;
# Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
ghc-toolchain = null;
ghc-platform = null;
# Becomes a core package in GHC >= 9.8
semaphore-compat = doDistribute self.semaphore-compat_1_0_0;
# Becomes a core package in GHC >= 9.10
os-string = doDistribute self.os-string_2_0_8;
# weeder >= 2.5 requires GHC 9.4
weeder = doDistribute self.weeder_2_4_1;
# Allow dhall 1.42.*
weeder_2_4_1 = doJailbreak (
super.weeder_2_4_1.override {
# weeder < 2.6 only supports algebraic-graphs < 0.7
# We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
}
);
haskell-language-server =
lib.throwIf config.allowAliases
"haskell-language-server has dropped support for ghc 9.2 in version 2.10.0.0, please use a newer ghc version or an older nixpkgs version"
(markBroken super.haskell-language-server);
# hashable >= 1.5 doesn't support base < 4.18
hashable = self.hashable_1_4_7_0;
# For GHC < 9.4, some packages need data-array-byte as an extra dependency
hashable_1_4_7_0 = addBuildDepends [ self.data-array-byte ] super.hashable_1_4_7_0;
primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
primitive-unlifted = super.primitive-unlifted_0_1_3_1;
# Too strict lower bound on base
primitive-addr = doJailbreak super.primitive-addr;
# Needs base-orphans for GHC < 9.8 / base < 4.19
some = addBuildDepend self.base-orphans super.some;
# Jailbreaks & Version Updates
hashable-time = doJailbreak super.hashable-time;
# Depends on utf8-light which isn't maintained / doesn't support base >= 4.16
# https://github.com/haskell-infra/hackage-trustees/issues/347
# https://mail.haskell.org/pipermail/haskell-cafe/2022-October/135613.html
language-javascript_0_7_0_0 = dontCheck super.language-javascript_0_7_0_0;
# Needs to match ghc-lib version
ghc-tags = doDistribute (doJailbreak self.ghc-tags_1_7);
# Needs to match ghc-lib
hlint = doDistribute self.hlint_3_6_1;
# ghc-lib >= 9.8 and friends no longer build with GHC 9.2 since they require semaphore-compat
ghc-lib-parser = doDistribute (
self.ghc-lib-parser_9_6_7_20250325.override {
happy = self.happy_1_20_1_1; # wants happy < 1.21
}
);
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_6_0_2;
ghc-lib = doDistribute (
self.ghc-lib_9_6_7_20250325.override {
happy = self.happy_1_20_1_1; # wants happy < 1.21
}
);
# 0.2.2.3 requires Cabal >= 3.8
shake-cabal = doDistribute self.shake-cabal_0_2_2_2;
# Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
aeson = dontCheck super.aeson;
# https://github.com/NixOS/cabal2nix/issues/554
# https://github.com/clash-lang/clash-compiler/blob/f0f6275e19b8c672f042026c478484c5fd45191d/README.md#ghc-compatibility
clash-prelude = dontDistribute (markBroken super.clash-prelude);
# Too strict upper bound on bytestring, relevant for GHC 9.2.6 specifically
# https://github.com/protolude/protolude/issues/127#issuecomment-1428807874
protolude = doJailbreak super.protolude;
# https://github.com/fpco/inline-c/pull/131
inline-c-cpp =
(if isDarwin then appendConfigureFlags [ "--ghc-option=-fcompact-unwind" ] else x: x)
super.inline-c-cpp;
# A given major version of ghc-exactprint only supports one version of GHC.
ghc-exactprint = super.ghc-exactprint_1_5_0;
# only broken for >= 9.6
calligraphy = doDistribute (unmarkBroken super.calligraphy);
# Packages which need compat library for GHC < 9.6
inherit (lib.mapAttrs (_: addBuildDepends [ self.foldable1-classes-compat ]) super)
indexed-traversable
OneTuple
these
;
base-compat-batteries = addBuildDepends [
self.foldable1-classes-compat
self.OneTuple
] super.base-compat-batteries;
}

View File

@@ -0,0 +1,188 @@
{ pkgs, haskellLib }:
let
inherit (pkgs) fetchpatch lib;
in
with haskellLib;
self: super: {
# Disable GHC core libraries.
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
Cabal-syntax = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-heap = null;
ghc-prim = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
libiserv = null;
mtl = null;
parsec = null;
pretty = null;
process = null;
rts = null;
stm = null;
system-cxx-std-lib = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
# GHC only bundles the xhtml library if haddock is enabled, check if this is
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_4_0_0;
# Becomes a core package in GHC >= 9.8
semaphore-compat = doDistribute self.semaphore-compat_1_0_0;
# Becomes a core package in GHC >= 9.10
os-string = doDistribute self.os-string_2_0_8;
# Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
ghc-internal = null;
# Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
ghc-toolchain = null;
ghc-platform = null;
# only broken for >= 9.6
calligraphy = doDistribute (unmarkBroken super.calligraphy);
# Jailbreaks & Version Updates
# hashable >= 1.5 needs base >= 4.18
hashable = self.hashable_1_4_7_0;
hashable-time = doJailbreak super.hashable-time;
libmpd = doJailbreak super.libmpd;
# generically needs base-orphans for 9.4 only
base-orphans = dontCheck (doDistribute super.base-orphans);
generically = addBuildDepends [
self.base-orphans
] super.generically;
# Needs base-orphans for GHC < 9.8 / base < 4.19
some = addBuildDepend self.base-orphans super.some;
# the dontHaddock is due to a GHC panic. might be this bug, not sure.
# https://gitlab.haskell.org/ghc/ghc/-/issues/21619
hedgehog = dontHaddock super.hedgehog;
hpack = overrideCabal (drv: {
# Cabal 3.6 seems to preserve comments when reading, which makes this test fail
# 2021-10-10: 9.2.1 is not yet supported (also no issue)
testFlags = [
"--skip=/Hpack/renderCabalFile/is inverse to readCabalFile/"
]
++ drv.testFlags or [ ];
}) (doJailbreak super.hpack);
# 2022-08-01: Tests are broken on ghc 9.2.4: https://github.com/wz1000/HieDb/issues/46
hiedb = dontCheck super.hiedb;
# 2022-10-06: https://gitlab.haskell.org/ghc/ghc/-/issues/22260
ghc-check = dontHaddock super.ghc-check;
ghc-tags = doDistribute (doJailbreak self.ghc-tags_1_7); # aeson < 2.2
# ghc-lib >= 9.8 and friends no longer build with GHC 9.4 since they require semaphore-compat
ghc-lib-parser = doDistribute (
self.ghc-lib-parser_9_6_7_20250325.override {
happy = self.happy_1_20_1_1; # wants happy < 1.21
}
);
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_6_0_2;
ghc-lib = doDistribute (
self.ghc-lib_9_6_7_20250325.override {
happy = self.happy_1_20_1_1; # wants happy < 1.21
}
);
# Last version to not depend on file-io and directory-ospath-streaming,
# which both need unix >= 2.8.
tar = self.tar_0_6_3_0;
# A given major version of ghc-exactprint only supports one version of GHC.
ghc-exactprint = dontCheck super.ghc-exactprint_1_6_1_3;
# Too strict upper bound on template-haskell
# https://github.com/mokus0/th-extras/issues/18
th-extras = doJailbreak super.th-extras;
# https://github.com/kowainik/relude/issues/436
relude = dontCheck super.relude;
haddock-library = doJailbreak super.haddock-library;
apply-refact = addBuildDepend self.data-default-class super.apply-refact;
path = self.path_0_9_5;
inherit
(
let
hls_overlay = lself: lsuper: {
Cabal-syntax = lself.Cabal-syntax_3_10_3_0;
Cabal = lself.Cabal_3_10_3_0;
extensions = dontCheck (doJailbreak (lself.extensions_0_1_0_1));
};
in
lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) {
haskell-language-server = allowInconsistentDependencies (
addBuildDepends [ self.retrie self.floskell ] super.haskell-language-server
);
fourmolu = doJailbreak (dontCheck self.fourmolu_0_14_0_0); # ansi-terminal, Diff
ormolu = doJailbreak self.ormolu_0_7_2_0; # ansi-terminal
hlint = self.hlint_3_6_1;
stylish-haskell = self.stylish-haskell_0_14_5_0;
retrie = doJailbreak (unmarkBroken super.retrie);
floskell = doJailbreak super.floskell;
}
)
retrie
floskell
haskell-language-server
fourmolu
ormolu
hlint
stylish-haskell
;
# directory-ospath-streaming requires the ospath API in core packages
# filepath, directory and unix.
stan = super.stan.override {
directory-ospath-streaming = null;
};
# Packages which need compat library for GHC < 9.6
inherit (lib.mapAttrs (_: addBuildDepends [ self.foldable1-classes-compat ]) super)
indexed-traversable
OneTuple
these
;
base-compat-batteries = addBuildDepends [
self.foldable1-classes-compat
self.OneTuple
] super.base-compat-batteries;
# Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
aeson = dontCheck super.aeson;
# Too strict lower bound on base
primitive-addr = doJailbreak super.primitive-addr;
}

View File

@@ -0,0 +1,233 @@
{ pkgs, haskellLib }:
self: super:
with haskellLib;
let
inherit (pkgs) lib;
warnAfterVersion =
ver: pkg:
lib.warnIf (lib.versionOlder ver
super.${pkg.pname}.version
) "override for haskell.packages.ghc96.${pkg.pname} may no longer be needed" pkg;
in
{
# Disable GHC core libraries
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
Cabal-syntax = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-heap = null;
ghc-prim = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
libiserv = null;
mtl = null;
parsec = null;
pretty = null;
process = null;
rts = null;
stm = null;
system-cxx-std-lib = null;
template-haskell = null;
# terminfo is not built if GHC is a cross compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
xhtml = null;
# Becomes a core package in GHC >= 9.8
semaphore-compat = doDistribute self.semaphore-compat_1_0_0;
# Becomes a core package in GHC >= 9.10
os-string = doDistribute self.os-string_2_0_8;
# Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
ghc-internal = null;
# Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
ghc-toolchain = null;
ghc-platform = null;
# Needs base-orphans for GHC < 9.8 / base < 4.19
some = addBuildDepend self.base-orphans super.some;
#
# Version deviations from Stackage LTS
#
# Too strict upper bound on template-haskell
# https://github.com/mokus0/th-extras/pull/21
th-extras = doJailbreak super.th-extras;
# not in Stackage, needs to match ghc-lib
# since expression is generated for 9.8, ghc-lib dep needs to be added manually
ghc-tags = doDistribute (addBuildDepends [ self.ghc-lib ] self.ghc-tags_1_8);
#
# Too strict bounds without upstream fix
#
# Forbids transformers >= 0.6
quickcheck-classes-base = doJailbreak super.quickcheck-classes-base;
# https://github.com/Gabriella439/Haskell-Break-Library/pull/3
break = doJailbreak super.break;
# Forbids mtl >= 2.3
ChasingBottoms = doJailbreak super.ChasingBottoms;
# Forbids base >= 4.18
cabal-install-solver = doJailbreak super.cabal-install-solver;
cabal-install = doJailbreak super.cabal-install;
# Forbids base >= 4.18, fix proposed: https://github.com/sjakobi/newtype-generics/pull/25
newtype-generics = warnAfterVersion "0.6.2" (doJailbreak super.newtype-generics);
# Jailbreaks for servant <0.20
servant-lucid = doJailbreak super.servant-lucid;
stm-containers = dontCheck super.stm-containers;
regex-tdfa = dontCheck super.regex-tdfa;
hiedb = dontCheck super.hiedb;
# https://github.com/kowainik/relude/issues/436
relude = dontCheck (doJailbreak super.relude);
inherit (pkgs.lib.mapAttrs (_: doJailbreak) super)
ghc-trace-events
gi-cairo-connector # mtl <2.3
ghc-prof # base <4.18
env-guard # doctest <0.21
package-version # doctest <0.21, tasty-hedgehog <1.4
;
# Pending text-2.0 support https://github.com/gtk2hs/gtk2hs/issues/327
gtk = doJailbreak super.gtk;
# 2023-12-23: It needs this to build under ghc-9.6.3.
# A factor of 100 is insufficient, 200 seems seems to work.
hip = appendConfigureFlag "--ghc-options=-fsimpl-tick-factor=200" super.hip;
# This can be removed once https://github.com/typeclasses/ascii-predicates/pull/1
# is merged and in a release that's being tracked.
ascii-predicates = appendPatch (pkgs.fetchpatch {
url = "https://github.com/typeclasses/ascii-predicates/commit/2e6d9ed45987a8566f3a77eedf7836055c076d1a.patch";
name = "ascii-predicates-pull-1.patch";
relative = "ascii-predicates";
sha256 = "sha256-4JguQFZNRQpjZThLrAo13jNeypvLfqFp6o7c1bnkmZo=";
}) super.ascii-predicates;
# This can be removed once https://github.com/typeclasses/ascii-numbers/pull/1
# is merged and in a release that's being tracked.
ascii-numbers = appendPatch (pkgs.fetchpatch {
url = "https://github.com/typeclasses/ascii-numbers/commit/e9474ad91bc997891f1a46afd5d0bdf9b9f7d768.patch";
name = "ascii-numbers-pull-1.patch";
relative = "ascii-numbers";
sha256 = "sha256-buw1UeW57CFefEfqdDUraSyQ+H/NvCZOv6WF2ORiYQg=";
}) super.ascii-numbers;
# Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
aeson = dontCheck super.aeson;
# Apply patch from PR with mtl-2.3 fix.
ConfigFile = overrideCabal (drv: {
editedCabalFile = null;
buildDepends = drv.buildDepends or [ ] ++ [ self.HUnit ];
patches = [
(pkgs.fetchpatch {
# https://github.com/jgoerzen/configfile/pull/12
name = "ConfigFile-pr-12.patch";
url = "https://github.com/jgoerzen/configfile/compare/d0a2e654be0b73eadbf2a50661d00574ad7b6f87...83ee30b43f74d2b6781269072cf5ed0f0e00012f.patch";
sha256 = "sha256-b7u9GiIAd2xpOrM0MfILHNb6Nt7070lNRIadn2l3DfQ=";
})
];
}) super.ConfigFile;
# https://github.com/NixOS/nixpkgs/pull/367998#issuecomment-2598941240
libtorch-ffi-helper = unmarkBroken (doDistribute super.libtorch-ffi-helper);
# Compatibility with core libs of GHC 9.6
# Jailbreak to lift bound on time
kqueue = doJailbreak (
appendPatches [
(pkgs.fetchpatch {
name = "kqueue-ghc-9.6.patch";
url = "https://github.com/hesselink/kqueue/pull/10/commits/a2735e807d761410e776482ec04515d9cf76a7f5.patch";
sha256 = "18rilz4nrwcmlvll3acjx2lp7s129pviggb8fy3hdb0z34ls5j84";
excludes = [ ".gitignore" ];
})
] super.kqueue
);
# This runs into the following GHC bug currently affecting 9.6.* and 9.8.* as
# well as 9.10.1: https://gitlab.haskell.org/ghc/ghc/-/issues/24432
inherit
(lib.mapAttrs (
_:
overrideCabal (drv: {
badPlatforms = drv.badPlatforms or [ ] ++ [ "aarch64-linux" ];
})
) super)
mueval
lambdabot
lambdabot-haskell-plugins
;
singletons-base = dontCheck super.singletons-base;
# A given major version of ghc-exactprint only supports one version of GHC.
ghc-exactprint = addBuildDepend self.extra super.ghc-exactprint_1_7_1_0;
ghc-lib-parser = doDistribute self.ghc-lib-parser_9_8_5_20250214;
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_8_0_2;
haddock-library = doJailbreak super.haddock-library;
apply-refact = addBuildDepend self.data-default-class super.apply-refact;
inherit
(
let
hls_overlay = lself: lsuper: {
Cabal-syntax = lself.Cabal-syntax_3_10_3_0;
Cabal = lself.Cabal_3_10_3_0;
extensions = dontCheck (doJailbreak lself.extensions_0_1_0_1);
};
in
lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) {
haskell-language-server = allowInconsistentDependencies (
addBuildDepends [ self.retrie self.floskell ] super.haskell-language-server
);
ormolu = doDistribute self.ormolu_0_7_4_0;
fourmolu = doDistribute (dontCheck (doJailbreak self.fourmolu_0_15_0_0));
hlint = doDistribute self.hlint_3_8;
stylish-haskell = self.stylish-haskell_0_14_6_0;
retrie = doJailbreak (unmarkBroken super.retrie);
floskell = doJailbreak super.floskell;
}
)
retrie
floskell
haskell-language-server
fourmolu
ormolu
hlint
stylish-haskell
;
}

View File

@@ -0,0 +1,140 @@
{ pkgs, haskellLib }:
self: super:
with haskellLib;
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
inherit (pkgs) lib;
warnAfterVersion =
ver: pkg:
lib.warnIf (lib.versionOlder ver
super.${pkg.pname}.version
) "override for haskell.packages.ghc98.${pkg.pname} may no longer be needed" pkg;
in
{
# Disable GHC core libraries.
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
Cabal-syntax = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-heap = null;
ghc-prim = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
libiserv = null;
mtl = null;
parsec = null;
pretty = null;
process = null;
rts = null;
stm = null;
semaphore-compat = null;
system-cxx-std-lib = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
xhtml = null;
# Becomes a core package in GHC >= 9.10
os-string = doDistribute self.os-string_2_0_8;
# Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
ghc-internal = null;
# Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
ghc-toolchain = null;
ghc-platform = null;
#
# Version upgrades
#
ghc-tags = self.ghc-tags_1_8;
#
# Jailbreaks
#
hashing = doJailbreak super.hashing; # bytestring <0.12
hevm = appendPatch (pkgs.fetchpatch {
url = "https://github.com/hellwolf/hevm/commit/338674d1fe22d46ea1e8582b24c224d76d47d0f3.patch";
name = "release-0.54.2-ghc-9.8.4-patch";
sha256 = "sha256-Mo65FfP1nh7QTY+oLia22hj4eV2v9hpXlYsrFKljA3E=";
}) super.hevm;
HaskellNet-SSL = doJailbreak super.HaskellNet-SSL; # bytestring >=0.9 && <0.12
inflections = doJailbreak super.inflections; # text >=0.2 && <2.1
#
# Test suite issues
#
pcre-heavy = dontCheck super.pcre-heavy; # GHC warnings cause the tests to fail
#
# Other build fixes
#
# 2023-12-23: It needs this to build under ghc-9.6.3.
# A factor of 100 is insufficient, 200 seems seems to work.
hip = appendConfigureFlag "--ghc-options=-fsimpl-tick-factor=200" super.hip;
# A given major version of ghc-exactprint only supports one version of GHC.
ghc-exactprint = doDistribute super.ghc-exactprint_1_8_0_0;
haddock-library = doJailbreak super.haddock-library;
apply-refact = addBuildDepend self.data-default-class super.apply-refact;
ghc-lib-parser = doDistribute self.ghc-lib-parser_9_8_5_20250214;
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_8_0_2;
inherit
(
let
hls_overlay = lself: lsuper: {
Cabal-syntax = lself.Cabal-syntax_3_10_3_0;
Cabal = lself.Cabal_3_10_3_0;
extensions = dontCheck (doJailbreak super.extensions_0_1_0_1);
};
in
lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) {
haskell-language-server = allowInconsistentDependencies (
addBuildDepends [ self.retrie self.floskell ] super.haskell-language-server
);
ormolu = doDistribute self.ormolu_0_7_4_0;
fourmolu = doDistribute (dontCheck (doJailbreak self.fourmolu_0_15_0_0));
hlint = doDistribute self.hlint_3_8;
stylish-haskell = self.stylish-haskell_0_14_6_0;
retrie = doJailbreak (unmarkBroken super.retrie);
floskell = doJailbreak super.floskell;
}
)
retrie
floskell
haskell-language-server
fourmolu
ormolu
hlint
stylish-haskell
;
}

View File

@@ -0,0 +1,63 @@
{ pkgs, haskellLib }:
let
inherit (pkgs) lib;
in
with haskellLib;
# cabal2nix doesn't properly add dependencies conditional on arch(javascript)
(self: super: {
ghcjs-base = addBuildDepends (with self; [
aeson
attoparsec
dlist
hashable
primitive
scientific
unordered-containers
vector
]) super.ghcjs-base;
ghcjs-dom = addBuildDepend self.ghcjs-dom-javascript super.ghcjs-dom;
ghcjs-dom-javascript = addBuildDepend self.ghcjs-base super.ghcjs-dom-javascript;
jsaddle = addBuildDepend self.ghcjs-base super.jsaddle;
jsaddle-dom = addBuildDepend self.ghcjs-base super.jsaddle-dom;
jsaddle-warp = overrideCabal (drv: {
libraryHaskellDepends = [ ];
testHaskellDepends = [ ];
}) super.jsaddle-warp;
entropy = addBuildDepend self.ghcjs-dom super.entropy;
# https://gitlab.haskell.org/ghc/ghc/-/issues/25083#note_578275
patch = haskellLib.disableParallelBuilding super.patch;
reflex-dom-core = haskellLib.disableParallelBuilding super.reflex-dom-core;
reflex-dom = super.reflex-dom.override (drv: {
jsaddle-webkit2gtk = null;
});
miso-examples = pkgs.lib.pipe super.miso-examples [
(addBuildDepends (
with self;
[
aeson
ghcjs-base
jsaddle-warp
miso
servant
]
))
];
# https://github.com/haskellari/splitmix/pull/75
splitmix = appendPatch (pkgs.fetchpatch {
url = "https://github.com/haskellari/splitmix/commit/7ffb3158f577c48ab5de774abea47767921ef3e9.patch";
sha256 = "sha256-n2q4FGf/pPcI1bhb9srHjHLzaNVehkdN6kQgL0F4MMg=";
}) super.splitmix;
# See https://gitlab.haskell.org/ghc/ghc/-/issues/26019#note_621324, without this flag the build OOMs
SHA = haskellLib.appendConfigureFlag "--ghc-option=-fignore-interface-pragmas" super.SHA;
})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,975 @@
# pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml
# This is a list of packages with versions from the latest Stackage LTS release.
#
# The packages and versions in this list cause the `hackage2nix` tool to
# generate the package at the given version.
#
# For instance, with a line like the following:
#
# - aeson ==1.4.6.0
#
# `hackage2nix` will generate the `aeson` package at version 1.4.6.0 in the
# ./hackage-packages.nix file.
#
# Since the packages in the LTS package set are sometimes older than the latest
# on Hackage, `hackage2nix` is smart enough to also generate the latest version
# of a given package.
#
# In the above example with aeson, if there was version 1.5.0.0 of aeson
# available on Hackage, `hackage2nix` would generate two packages, `aeson`
# at version 1.4.6.0 and `aeson_1_5_0_0` at version 1.5.0.0.
#
# WARNING: We import a list of default-package-overrides from stackage which is
# tracked in stackage.yaml. Adding conflicting overrides with stackage here will
# not work.
# keep-sorted start skip_lines=1 case=no numeric=yes
default-package-overrides:
- chs-cabal == 0.1.1.2 # matches Cabal 3.12 (GHC 9.10)
- extensions == 0.1.0.2 # matches Cabal 3.12 (GHC 9.10)
# 2025-07-26: HLS doesn't support hiedb >= 0.7 yet
- hiedb < 0.7
# 2025-09-13: hnix 0.17.0 doesn't support hnix-store-core >= 0.8
# https://github.com/haskell-nix/hnix/pull/1112
- hnix-store-core < 0.7
- hnix-store-remote < 0.7
# 2025-08-03: need to match stackage version of hosc
- hsc3 >= 0.21 && < 0.22
# liquidhaskell-boot 0.9.10.1.2 requires this specific version of liquid-fixpoint
- liquid-fixpoint == 0.9.6.3.2
# liquidhaskell(-boot) support one GHC at a time, so we choose the one matching the current GHC (9.10)
- liquidhaskell == 0.9.10.*
- liquidhaskell-boot == 0.9.10.*
# keep-sorted end
# keep-sorted start skip_lines=1 case=no numeric=yes
extra-packages:
- algebraic-graphs < 0.7 # 2023-08-14: Needed for building weeder < 2.6.0
- ansi-wl-pprint >= 0.6 && < 0.7 # 2025-07-07: used by gren <= 0.5.4
- attoparsec == 0.13.* # 2022-02-23: Needed to compile elm for now
- Cabal == 3.10.*
- Cabal == 3.12.*
- Cabal == 3.14.*
- Cabal == 3.16.* # version required for cabal-install and other packages
- cabal-add == 0.1 # 2025-09-09: Only needed for hls 2.11 can be removed once we are past it.
- Cabal-syntax == 3.6.* # Dummy package that ensures packages depending on Cabal-syntax can work for Cabal < 3.8
- Cabal-syntax == 3.8.* # version required for ormolu and fourmolu on ghc 9.0
- Cabal-syntax == 3.10.*
- Cabal-syntax == 3.12.*
- Cabal-syntax == 3.14.*
- Cabal-syntax == 3.16.* # version required for cabal-install and other packages
- extensions == 0.1.0.1 # 2025-09-21: needed for Cabal 3.10 (fourmolo/ormolu with ghc 9.8)
- fourmolu == 0.14.0.0 # 2023-11-13: for ghc-lib-parser 9.6 compat
- fourmolu == 0.15.0.0 # 2025-09-21: for ghc-lib-parser 9.8 compat
- fuzzyset == 0.2.4 # 2023-12-20: Needed for building postgrest > 10
- ghc-exactprint == 0.6.* # 2022-12-12: needed for GHC < 9.2
- ghc-exactprint == 1.5.* # 2023-03-30: needed for GHC == 9.2
- ghc-exactprint == 1.6.* # 2023-03-30: needed for GHC == 9.4
- ghc-exactprint == 1.7.* # 2025-03-09: needed for GHC == 9.6
- ghc-exactprint == 1.8.* # 2024-05-20: needed for GHC == 9.8
- ghc-exactprint == 1.9.* # 2024-08-27: needed for GHC == 9.10
- ghc-lib == 9.2.* # 2022-02-17: preserve for GHC 8.10, 9.0
- ghc-lib == 9.6.* # 2022-02-17: preserve for GHC 9.2, 9.4
- ghc-lib == 9.10.* # 2024-12-30: preserve for GHC 9.10/ghc-tags 1.9
- ghc-lib-parser == 9.2.* # 2022-02-17: preserve for GHC 8.10, 9.0
- ghc-lib-parser == 9.6.* # 2024-05-19: preserve for GHC 9.2, 9.4
- ghc-lib-parser == 9.8.* # 2024-12-26: preserve for GHC 9.6, 9.8
- ghc-lib-parser-ex == 9.2.* # 2022-07-13: preserve for GHC 8.10, 9.0
- ghc-lib-parser-ex == 9.6.* # 2024-05-19: preserve for GHC 9.2, 9.4
- ghc-lib-parser-ex == 9.8.* # 2024-12-26: preserve for GHC 9.6, 9.8
- ghc-tags == 1.5.* # 2023-02-18: preserve for ghc-lib == 9.2.*
- ghc-tags == 1.7.* # 2023-02-18: preserve for ghc-lib == 9.6.*
- ghc-tags == 1.8.* # 2023-02-18: preserve for ghc-lib == 9.8.*
- ghc-typelits-natnormalise < 0.8 # 2025-09-15: Stackage is stuck at 0.7.10
- happy == 1.20.* # for ghc-lib-parser == 9.6.*
- hashable < 1.5 # 2025-07-30: hashable >= 1.5 requires GHC >= 9.6
- hasql < 1.7 # 2025-01-19: Needed for building postgrest
- hasql-dynamic-statements < 0.3.1.6 # 2025-01-19: Needed for building postgrest
- hasql-implicits < 0.2 # 2025-01-19: Needed for building postgrest
- hasql-notifications < 0.2.3 # 2025-01-19: Needed for building postgrest
- hasql-pool < 1.1 # 2025-01-19: Needed for building postgrest
- hasql-transaction < 1.1.1 # 2025-01-19: Needed for building postgrest
- hlint == 3.6.* # 2025-04-14: needed for hls with ghc-lib-parser 9.6
- hlint == 3.8.* # 2025-09-21: needed for hls with ghc-lib-parser 9.8
- hpack == 0.38.1 # 2025-09-18: to match exact version upstream stack-3.7.1 uses
- hspec-megaparsec == 2.2.0 # 2023-11-18: Latest version compatible with ghc 9.0
- language-javascript == 0.7.0.0 # required by purescript
- network-run == 0.4.0 # 2024-10-20: for GHC 9.10/network == 3.1.*
- ormolu == 0.5.2.0 # 2023-08-08: preserve for ghc 9.0
- ormolu == 0.7.2.0 # 2023-11-13: for ghc-lib-parser 9.6 compat
- ormolu == 0.7.4.0 # 2023-09-21: for ghc-lib-parser 9.8 compat
- os-string == 1.* # 2025-07-30: dummy package we need for pre os-string GHCs
- path == 0.9.5 # 2025-09-21: Pin for hls on ghc 9.4
- postgresql-binary < 0.14 # 2025-01-19: Needed for building postgrest
- primitive-unlifted == 0.1.3.1 # 2024-03-16: preserve for ghc 9.2
- retrie < 1.2.0.0 # 2022-12-30: preserve for ghc < 9.2
- shake-cabal < 0.2.2.3 # 2023-07-01: last version to support Cabal 3.6.*
- ShellCheck == 0.9.0 # 2024-03-21: pinned by haskell-ci
- simple-get-opt < 0.5 # 2025-05-01: for crux-0.7.2
- stylish-haskell == 0.14.4.0 # 2022-09-19: preserve for ghc 9.0
- stylish-haskell == 0.14.5.0 # 2025-04-14: needed for hls with ghc-lib 9.6
- stylish-haskell == 0.14.6.0 # 2025-09-21: needed for hls with ghc-lib 9.8
- stylish-haskell == 0.15.0.1 # 2025-04-14: needed for hls with ghc-lib 9.10
- tar == 0.6.0.0 # 2025-02-08: last version to not require os-string (which can't be built with GHC < 9.2)
- tar == 0.6.3.0 # 2025-08-17: last version to not require file-io and directory-ospath-streaming (for GHC < 9.6)
- text-builder < 1 # 2025-08-27: Needed for building postgrest
- text-builder-dev < 0.4 # 2025-08-27: Needed for building postgrest
- text-metrics < 0.3.3 # 2025-02-08: >= 0.3.3 uses GHC2021
- weeder == 2.3.* # 2022-05-31: preserve for GHC 9.0.2
- weeder == 2.4.* # 2023-02-02: preserve for GHC 9.2.*
# keep-sorted end
# keep-sorted start skip_lines=1 case=no
package-maintainers:
alexfmpe:
- aeson-gadt-th
- android-activity
- basic-sop
- bytestring-aeson-orphans
- cli-extras
- cli-git
- cli-nix
- commutative-semigroups
- constraints-extras
- dependent-map
- dependent-monoidal-map
- dependent-sum
- dependent-sum-aeson-orphans
- dependent-sum-template
- gargoyle
- gargoyle-postgresql
- gargoyle-postgresql-connect
- gargoyle-postgresql-nix
- generics-sop
- ghcjs-base
- ghcjs-dom
- ghcjs-dom-hello
- ghcjs-dom-javascript
- ghcjs-dom-jsaddle
- haveibeenpwned
- jsaddle
- jsaddle-clib
- jsaddle-dom
- jsaddle-hello
- jsaddle-warp
- jsaddle-wkwebview
- json-sop
- large-generics
- large-records
- lens-sop
- linux-namespaces
- monoid-map
- monoidal-containers
- nix-thunk
- patch
- proto-lens-arbitrary
- proto3-suite
- proto3-wire
- records-sop
- reflex
- reflex-dom
- reflex-dom-core
- reflex-gadt-api
- reflex-fsnotify
- th-abstraction
- universe
- universe-some
- vessel
- warp
- which
Anton-Latukha:
- hnix
- hnix-store-core
- hnix-store-remote
artem:
- BNFC-meta
- alex-meta
- happy-meta
- liquid-fixpoint
- liquidhaskell
- liquidhaskell-boot
- smtlib-backends
- smtlib-backends-process
- smtlib-backends-tests
- vector-hashtables
arturcygan:
- hevm
athas:
- futhark
bdesham:
- pinboard-notes-backup
berberman:
- nvfetcher
- arch-web
- uusi
cdepillabout:
- cloudy
- password
- password-instances
- pretty-simple
- stack
- termonad
centromere:
- nfc
dalpd:
- dhall-lsp-server
- ghc-vis
- patat
- svgcairo
danielrolls:
- aws-spend-summary
- byte-count-reader
- shellify
- specup
domenkozar:
- cachix
- cachix-api
dschrempf:
- circular
- covariance
- dirichlet
- elynx
- elynx-markov
- elynx-nexus
- elynx-seq
- elynx-tools
- elynx-tree
- glasso
- mcmc
- pava
- slynx
- tlynx
- xmonad
- xmonad-contrib
erictapen:
- hakyll
Gabriella439:
- annah
- bench
- break
- dhall-bash
- dhall-docs
- dhall-json
- dhall-lsp-server
- dhall-nix
- dhall-nixpkgs
- dhall-openapi
- dhall-text
- dhall-yaml
- dhall
- dirstream
- errors
- foldl
- index-core
- lens-tutorial
- list-transformer
- managed
- mmorph
- morte
- mvc-updates
- mvc
- nix-derivation
- nix-diff
- optional-args
- optparse-generic
- pipes-bytestring
- pipes-concurrency
- pipes-csv
- pipes-extras
- pipes-group
- pipes-http
- pipes-parse
- pipes-safe
- pipes
- server-generic
- total
- turtle
- typed-spreadsheet
gridaphobe:
- located-base
iblech:
- Agda
ivanbrennan:
- xmonad
- xmonad-contrib
jb55:
# - bson-lens
- cased
- elm-export-persistent
# - pipes-mongodb
- streaming-wai
libjared:
- sensei
malo:
- cornelis
mangoiv:
- fused-effects
- htree
- http-barf
- libsodium-bindings
- scoped-codensity
- sel
- text-display
- unclogging
maralorn:
- bluefin
- cabal-fmt
- eventlog2html
- falsify
- generic-optics
- ghc-debug-brick
- ghc-debug-stub
- ghcid
- graphql-client
- haskell-language-server
- hledger
- hledger-ui
- hledger-web
- hlint
- hspec-discover
- jsaddle-warp
- matrix-client
- optics
- pandoc
- pandoc-cli
- postgresql-simple
- purebred-email
- reflex-dom
- replace-megaparsec
- req
- say
- shake-bench
- shh
- shh-extras
- snap
- stm-containers
- streamly
- streamly-bytestring
- string-interpolate
- taskwarrior
- tasty
- threadscope
- tz
- weeder
- witch
mikatammi:
- botan-bindings
- botan-low
mpscholten:
- ihp-hsx
- push-notify-apn
- hs-pkpass
- raven-haskell
- stripe-concepts
- stripe-signature
- http2-client
- zip
- currencies
- string-random
- inflections
- pcre-heavy
- mmark
- mmark-ext
- typerep-map
- minio-hs
- smtp-mail
- pdftotext
- warp-systemd
- amazonka
- libssh2
- sitemap
ncfavier:
- Agda
- agda2hs
- irc-client
- lambdabot
- shake
nomeata:
- cabal-plan-bounds
- lhs2tex
- rec-def
- tasty-expected-failure
peti:
- cabal2spec
- funcmp
- git-annex
- hledger-interest
- hopenssl
- hsdns
- hsemail
- hsyslog
- logging-facade-syslog
- nix-paths
- structured-haskell-mode
- titlecase
- xmonad
- xmonad-contrib
phijor:
- cornelis
poscat:
- hinit
Profpatsch:
- gitit
psibi:
- path-pieces
- persistent
- persistent-sqlite
- persistent-template
- shakespeare
raehik:
- strongweak
- generic-data-functions
- binrep
- rerefined
- symparsec
- bytezap
- bytepatch
- heystone
- refined
- flatparse
roberth:
- arion-compose
- cabal-pkg-config-version-hook
- hercules-ci-agent
- hercules-ci-api
- hercules-ci-api-agent
- hercules-ci-api-core
- hercules-ci-cli
- hercules-ci-cnix-expr
- hercules-ci-cnix-store
- inline-c
- inline-c-cpp
rvl:
- taffybar
- arbtt
- lentil
sellout:
- dualizer
- no-recursion
- yaya
- yaya-containers
- yaya-hedgehog
- yaya-quickcheck
- yaya-unsafe
sheepforce:
- mpi-hs
- mpi-hs-store
- mpi-hs-cereal
- mpi-hs-binary
- cpython
- massiv
- massiv-io
- massiv-test
shlok:
- streamly-archive
- streamly-lmdb
slotThe:
- X11
- X11-xft
- html-parse-util
- kmonad
- optparse-applicative-cmdline-util
- xmonad
- xmonad-contrib
- xmonad-extras
sorki:
- cayenne-lpp
- blockfrost-client
- data-lens-light
- data-stm32
- gcodehs
- hnix
- hnix-store-core
- hnix-store-remote
- implicit
- nix-derivation
- nix-diff
- nix-narinfo
- ttn
- ttn-client
- update-nix-fetchgit
- zre
sternenseemann:
# also maintain upstream package
- cabal2nix
- distribution-nixpkgs
- hackage-db
- language-nix
- jailbreak-cabal
- spacecookie
- gopher-proxy
# other packages I can help out for
- cabal-install
- hledger
- pandoc
- systemd
- fast-logger
- flat
- Euterpea2
- utc
- socket
- gitit
- yarn-lock
- yarn2nix
- large-hashable
- haskell-ci
- diagrams
- rel8
- regex-rure
- jacinda
- citeproc
- mighttpd2
# owothia
- irc-client
- chatter
- envy
t4ccer:
- aeson-better-errors
- cheapskate
- containers-unicode-symbols
- numerals-base
- pattern-arrows
tbidne:
- rest-rewrite
terlar:
- nix-diff
thielema:
- accelerate-arithmetic
- accelerate-fftw
- accelerate-fourier
- accelerate-utility
- align-audio
- alsa-core
- alsa-pcm
- alsa-seq
- apportionment
- audacity
- battleship-combinatorics
- bibtex
- board-games
- buffer-pipe
- cabal-flatpak
- calendar-recycling
- checksum
- check-pvp
- coinor-clp
- combinatorial
- comfort-graph
- comfort-array
- comfort-array-shape
- comfort-fftw
- comfort-glpk
- concurrent-split
- cutter
- data-accessor
- data-accessor-mtl
- data-accessor-template
- data-accessor-transformers
- data-ref
- doctest-exitcode-stdio
- doctest-extract
- doctest-lib
- dsp
- enumset
- equal-files
- event-list
- explicit-exception
- fixed-length
- fftw-ffi
- gnuplot
- group-by-date
- guarded-allocation
- iff
- interpolation
- jack
- latex
- lazyio
- linear-programming
- llvm-ffi
- markov-chain
- midi
- midi-alsa
- midi-music-box
- mbox-utility
- med-module
- monoid-transformer
- non-empty
- non-negative
- numeric-prelude
- numeric-quest
- pathtype
- pooled-io
- probability
- quickcheck-transformer
- reactive-midyim
- reactive-balsa
- reactive-jack
- sample-frame
- sample-frame-np
- set-cover
- shell-utility
- sound-collage
- sox
- soxlib
- split-record
- spreadsheet
- stm-split
- storable-record
- storable-tuple
- storablevector
- synthesizer-core
- synthesizer-dimensional
- synthesizer-alsa
- synthesizer-midi
- tagchup
- tfp
- unicode
- unique-logic
- unique-logic-tf
- unsafe
- utility-ht
- wuerfelschlange
- xml-basic
- youtube
- prelude-compat
- fft
- carray
- lapack-ffi-tools
- netlib-ffi
- blas-ffi
- lapack-ffi
- netlib-carray
- blas-carray
- lapack-carray
- netlib-comfort-array
- blas-comfort-array
- lapack-comfort-array
- comfort-blas
- lapack
- lapack-hmatrix
- hmm-lapack
- magico
- resistor-cube
- linear-circuit
turion:
- Agda
- cabal-gild
- dunai
- essence-of-live-coding
- essence-of-live-coding-gloss
- essence-of-live-coding-pulse
- essence-of-live-coding-quickcheck
- essence-of-live-coding-warp
- finite-typelits
- has-transformers
- monad-bayes
- monad-schedule
- pulse-simple
- rhine
- rhine-gloss
- simple-affine-space
- time-domain
utdemir:
- nix-tree
wolfgangwalther:
- postgres-websockets
- postgrest
zowoq:
- ShellCheck
# keep-sorted end
# keep-sorted start skip_lines=1 case=no
unsupported-platforms:
Allure: [ platforms.darwin ]
bdcs-api: [ platforms.darwin ]
bindings-directfb: [ platforms.darwin ]
bindings-sane: [ platforms.darwin ]
bustle: [ platforms.darwin ] # uses glibc-specific ptsname_r
bytelog: [ platforms.darwin ] # due to posix-api
camfort: [ aarch64-linux ]
chalkboard-viewer: [ platforms.darwin ] # depends on chalkboard
chalkboard: [ platforms.darwin ] # depends on Codec-Image-DevIL
charsetdetect: [ aarch64-linux ] # not supported by vendored lib / not configured properly https://github.com/batterseapower/libcharsetdetect/issues/3
Codec-Image-DevIL: [ platforms.darwin ] # depends on mesa
coinor-clp: [ aarch64-linux ] # aarch64-linux is not supported by required system dependency clp
cut-the-crap: [ platforms.darwin ]
emanote: [ x86_64-darwin ] # Depends on stork which is broken on macOS sdk < 10.14
essence-of-live-coding-PortMidi: [ platforms.darwin ]
Euterpea: [ platforms.darwin ]
follow-file: [ platforms.darwin ]
freenect: [ platforms.darwin ]
FTGL: [ platforms.darwin ]
fuzzytime: [ platforms.darwin ] # https://github.com/kamwitsta/fuzzytime/issues/2
ghc-gc-hook: [ platforms.darwin ] # requires C11 threads which Apple doesn't support
gi-adwaita: [ platforms.darwin ]
gi-dbusmenu: [ platforms.darwin ]
gi-dbusmenugtk3: [ platforms.darwin ]
gi-ggit: [ platforms.darwin ]
gi-gtk-layer-shell: [ platforms.darwin ] # depends on gtk-layer-shell which is not supported on darwin
gi-ibus: [ platforms.darwin ]
gi-javascriptcore: [ platforms.darwin ] # webkitgtk marked broken on darwin
gi-ostree: [ platforms.darwin ]
gi-vte: [ platforms.darwin ]
gi-webkit2: [ platforms.darwin ] # webkitgtk marked broken on darwin
gi-webkit2webextension: [ platforms.darwin ] # webkitgtk marked broken on darwin
gi-wnck: [ platforms.darwin ]
gl: [ platforms.darwin ] # depends on mesa
GLHUI: [ platforms.darwin ] # depends on mesa
gnome-keyring: [ platforms.darwin ]
grid-proto: [ platforms.darwin ]
gtk-sni-tray: [ platforms.darwin ]
h-raylib: [ platforms.darwin ] # depends on mesa
haskell-snake: [ platforms.darwin ]
hcwiid: [ platforms.darwin ]
HDRUtils: [ platforms.darwin ]
hinotify-bytestring: [ platforms.darwin ]
honk: [ platforms.darwin ]
HSoM: [ platforms.darwin ]
intricacy: [ platforms.darwin ] # depends on mesa
iwlib: [ platforms.darwin ]
Jazzkell: [ platforms.darwin ] # depends on Euterpea
jsaddle-webkit2gtk: [ platforms.darwin ]
Kulitta: [ platforms.darwin ] # depends on Euterpea
LambdaHack: [ platforms.darwin ]
libmodbus: [ platforms.darwin ]
libsystemd-journal: [ platforms.darwin ]
libtelnet: [ platforms.darwin ]
libvirt-hs: [ platforms.darwin ] # spidermonkey is not supported on darwin
libzfs: [ platforms.darwin ]
linearEqSolver: [ aarch64-linux ]
lio-fs: [ platforms.darwin ]
logging-facade-journald: [ platforms.darwin ]
longshot: [ aarch64-linux ]
mpi-hs-binary: [ aarch64-linux, platforms.darwin ]
mpi-hs-cereal: [ aarch64-linux, platforms.darwin ]
mpi-hs-store: [ aarch64-linux, platforms.darwin ]
mpi-hs: [ aarch64-linux, platforms.darwin ]
mplayer-spot: [ aarch64-linux, platforms.darwin ]
mptcp-pm: [ platforms.darwin ]
netlink: [ platforms.darwin ]
network-unexceptional: [ platforms.darwin ] # depends on posix-api
notifications-tray-icon: [ platforms.darwin ] # depends on gi-dbusmenu
oculus: [ platforms.darwin ]
ostree-pin: [ platforms.darwin ] # depends on gi-ostree
pam: [ platforms.darwin ]
parport: [ platforms.darwin ]
persist-state: [ aarch64-linux, armv7l-linux ] # https://github.com/minad/persist-state/blob/6fd68c0b8b93dec78218f6d5a1f4fa06ced4e896/src/Data/PersistState.hs#L122-L128
piyo: [ platforms.darwin ]
PortMidi-simple: [ platforms.darwin ]
portmidi-utility: [ platforms.darwin ]
PortMidi: [ platforms.darwin ]
posix-api: [ platforms.darwin ]
Raincat: [ platforms.darwin ]
reactive-balsa: [ platforms.darwin ] # depends on alsa-core
reflex-dom-fragment-shader-canvas: [ platforms.darwin, aarch64-linux ]
reflex-localize-dom: [ platforms.darwin, aarch64-linux ]
rtlsdr: [ platforms.darwin ]
rubberband: [ platforms.darwin ]
SDL-mixer: [ platforms.darwin ] # depends on mesa
SDL-mpeg: [ platforms.darwin ] # depends on mesa
sdl2-mixer: [ platforms.darwin ]
sdl2-ttf: [ platforms.darwin ]
sdr: [ platforms.darwin ] # depends on rtlsdr
sensei: [ platforms.darwin ]
sockets: [ platforms.darwin ] # depends on posix-api
spade: [ platforms.darwin ] # depends on sdl2-mixer, which doesn't work on darwin
synthesizer-alsa: [ platforms.darwin ]
taffybar: [ platforms.darwin ]
termonad: [ platforms.darwin ]
tokyotyrant-haskell: [ platforms.darwin ]
twirl: [ platforms.darwin ] # depends on sdl2-mixer
Unixutils-shadow: [ platforms.darwin ]
verifiable-expressions: [ aarch64-linux ]
vrpn: [ platforms.darwin ]
vulkan-utils: [ platforms.darwin ]
vulkan: [ i686-linux, armv7l-linux, platforms.darwin ]
VulkanMemoryAllocator: [ i686-linux, armv7l-linux, platforms.darwin ]
webkit2gtk3-javascriptcore: [ platforms.darwin ]
wiringPi: [ aarch64-darwin ]
xattr: [ platforms.darwin ]
xgboost-haskell: [ aarch64-linux, armv7l-linux, platforms.darwin ]
xmobar: [ platforms.darwin ]
xmonad-extras: [ platforms.darwin ]
xmonad-volume: [ platforms.darwin ]
xnobar: [ platforms.darwin ]
# keep-sorted end
# keep-sorted start skip_lines=1 case=no
supported-platforms:
alsa-mixer: [ platforms.linux ]
alsa-pcm: [ platforms.linux ]
alsa-seq: [ platforms.linux ]
AWin32Console: [ platforms.windows ]
barbly: [ platforms.darwin ]
bindings-parport: [ platforms.linux ] # parport is a linux kernel component
blake3: [ platforms.x86 ] # uses x86 intrinsics
btrfs: [ platforms.linux ] # depends on linux
bytepatch: [ platforms.x86 ] # due to blake3
cpuid: [ platforms.x86 ] # needs to be i386 compatible (IA-32)
cpython: [ platforms.x86 ] # c2hs errors on glibc headers
crc32c: [ platforms.x86 ] # uses x86 intrinsics
d3d11binding: [ platforms.windows ]
DirectSound: [ platforms.windows ]
dx9base: [ platforms.windows ]
dx9d3d: [ platforms.windows ]
dx9d3dx: [ platforms.windows ]
erebos-tester: [ platforms.linux ] # depends on linux-namespaces
evdev-streamly: [ platforms.linux ]
evdev: [ platforms.linux ]
geomancy-layout: [ platforms.x86 ] # x86 intrinsics
geomancy: [ platforms.x86 ] # x86 intrinsics
ghcjs-base: [ javascript-ghcjs ]
ghcjs-dom-javascript: [ javascript-ghcjs ]
gi-gtkosxapplication: [ platforms.darwin ]
gtk-mac-integration: [ platforms.darwin ]
gtk3-mac-integration: [ platforms.darwin ]
halide-haskell: [ platforms.linux ]
halide-JuicyPixels: [ platforms.linux ]
hb3sum: [ platforms.x86 ] # due to blake3
HFuse: [ platforms.linux ]
hommage-ds: [ platforms.windows ]
hpapi: [ platforms.linux ] # limited by pkgs.papi
HQu: [ platforms.x86 ] # vendored C++ library needs i686/x86_64
hs-swisstable-hashtables-class: [ platforms.x86_64 ] # depends on swisstable, which Needs AVX2
hsignal: [ platforms.x86 ] # -msse2
htune: [ platforms.linux ] # depends on alsa-pcm
hw-prim-bits: [ platforms.x86 ] # x86 assembler
inline-asm: [ platforms.x86 ] # x86 assembler
jsaddle-wkwebview: [ platforms.darwin ]
keid-core: [ x86_64-linux ] # geomancy (only x86), vulkan (no i686, no darwin, …)
keid-frp-banana: [ x86_64-linux ] # geomancy (only x86), vulkan (no i686, no darwin, …)
keid-geometry: [ x86_64-linux ] # geomancy (only x86), vulkan (no i686, no darwin, …)
keid-render-basic: [ x86_64-linux ] # geomancy (only x86), vulkan (no i686, no darwin, …)
keid-resource-gltf: [ x86_64-linux ] # geomancy (only x86), vulkan (no i686, no darwin, …)
keid-sound-openal: [ x86_64-linux ] # geomancy (only x86), vulkan (no i686, no darwin, …)
keid-ui-dearimgui: [ x86_64-linux ] # geomancy (only x86), vulkan (no i686, no darwin, …)
kqueue: [ platforms.netbsd, platforms.freebsd, platforms.openbsd, platforms.darwin ]
libfuse3: [ platforms.linux ]
linux-evdev: [ platforms.linux ]
linux-file-extents: [ platforms.linux ]
linux-inotify: [ platforms.linux ]
linux-mount: [ platforms.linux ]
linux-namespaces: [ platforms.linux ]
lxc: [ platforms.linux ]
memfd: [ platforms.linux ]
midi-alsa: [ platforms.linux ] # alsa-core only supported on linux
midisurface: [ platforms.linux ] # alsa-core only supported on linux
miso-action-logger: [ javascript-ghcjs ] # https://github.com/Lermex/miso-action-logger/issues/1
miso-examples: [ javascript-ghcjs ]
OrderedBits: [ platforms.x86 ] # lacks implementations for non-x86: https://github.com/choener/OrderedBits/blob/401cbbe933b1635aa33e8e9b29a4a570b0a8f044/lib/Data/Bits/Ordered.hs#L316
reactivity: [ platforms.windows ]
reflex-libtelnet: [ platforms.linux ] # pkgs.libtelnet only supports linux
scat: [ platforms.x86 ] # uses scrypt, which requries x86
scrypt: [ platforms.x86 ] # https://github.com/informatikr/scrypt/issues/8
seqalign: [ platforms.x86 ] # x86 intrinsics
streamed: [ platforms.linux] # alsa-core only supported on linux
swisstable: [ platforms.x86_64 ] # Needs AVX2
systemd-api: [ platforms.linux ]
tasty-papi: [ platforms.linux ] # limited by pkgs.papi
tcod-haskell: [ platforms.linux ] # limited by pkgs.libtcod
udev: [ platforms.linux ]
vty-windows: [ platforms.windows ] # depends on Win32
Win32-console: [ platforms.windows ]
Win32-dhcp-server: [ platforms.windows ]
Win32-errors: [ platforms.windows ]
Win32-extras: [ platforms.windows ]
Win32-junction-point: [ platforms.windows ]
Win32-notify: [ platforms.windows ]
Win32-security: [ platforms.windows ]
Win32-services-wrapper: [ platforms.windows ]
Win32-services: [ platforms.windows ]
Win32: [ platforms.windows ]
XInput: [ platforms.windows ]
yesod-auth-simple: [ platforms.x86 ] # requires scrypt which only supports x86
# keep-sorted end
dont-distribute-packages:
# Depends on shine, which is a ghcjs project.
- shine-varying
# these packages depend on software with an unfree license
- accelerate-bignum
- accelerate-blas
- accelerate-cublas
- accelerate-cuda
- accelerate-cufft
- accelerate-examples
- accelerate-fft
- accelerate-fourier-benchmark
- accelerate-io-array
- accelerate-io-bmp
- accelerate-io-bytestring
- accelerate-io-cereal
- accelerate-io-JuicyPixels
- accelerate-io-repa
- accelerate-io-vector
- accelerate-kullback-liebler
- accelerate-llvm-ptx
- bindings-yices
- boolector
- ccelerate-cuda
- containers-accelerate
- cplex-hs
- cublas
- cuda # 2020-08-18 because of dependency nvidia-x11
- cufft
- cusolver
- cusparse
- gloss-raster-accelerate
- hashable-accelerate
- libnvvm
- matlab
- nvvm
- Obsidian
- odpic-raw
- patch-image
# license for input data unclear, dependency not on Hackage
# see https://github.com/NixOS/nixpkgs/pull/88604
- tensorflow-mnist
- yices-easy
- yices-painless
# These packages dont build because they use deprecated libsoup 2.4 versions.
- jsaddle-webkit2gtk
- gi-javascriptcore4
- gi-soup2
- gi-webkit2
- webkit2gtk3-javascriptcore
# These packages dont build because they use deprecated webkit versions.
- diagrams-hsqml
- dialog
- ghcjs-dom-webkit
- hsqml
- hsqml-datamodel
- hsqml-datamodel-vinyl
- hsqml-demo-manic
- hsqml-demo-morris
- hsqml-demo-notes
- hsqml-demo-samples
- hsqml-morris
- hstorchat
- jsc
- lambdacat
- manatee-all
- manatee-browser
- manatee-reader
- markup-preview
- spike
- web-browser-in-haskell
- websnap
# mesos was removed from nixpkgs
- hs-mesos
# Output exceeds Hydra's maximum allowable size
- stripeapi
# Packages that (transitively) depend on insecure packages
- distributed-process-zookeeper # depends on hzk
- HDRUtils # depends on pfstools, which depends on imagemagick
- hzk # depends on zookeeper_mt, which depends on openssl-1.1
- jobqueue # depends on hzk
- persistent-zookeeper # depends on hzk
- pocket-dns # depends on persistent-zookeeper
- zoovisitor # depends on zookeeper_mt, which depends on openssl-1.1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
{ pkgs, haskellLib }:
with haskellLib;
self: super:
let
# This contains updates to the dependencies, without which it would
# be even more work to get it to build.
# As of 2020-04, there's no new release in sight, which is why we're
# pulling from Github.
tensorflow-haskell = pkgs.fetchFromGitHub {
owner = "tensorflow";
repo = "haskell";
rev = "555d90c43202d5a3021893013bfc8e2ffff58c97";
sha256 = "uOuIeD4o+pcjvluTqyVU3GJUQ4e1+p3FhINJ9b6oK+k=";
fetchSubmodules = true;
};
setTensorflowSourceRoot =
dir: drv:
(overrideCabal (drv: { src = tensorflow-haskell; }) drv).overrideAttrs (_oldAttrs: {
sourceRoot = "${tensorflow-haskell.name}/${dir}";
});
in
{
tensorflow-proto = setTensorflowSourceRoot "tensorflow-proto" super.tensorflow-proto;
tensorflow = overrideCabal (drv: {
libraryHaskellDepends = drv.libraryHaskellDepends ++ [ self.vector-split ];
}) (setTensorflowSourceRoot "tensorflow" super.tensorflow);
tensorflow-core-ops = setTensorflowSourceRoot "tensorflow-core-ops" super.tensorflow-core-ops;
tensorflow-logging = setTensorflowSourceRoot "tensorflow-logging" super.tensorflow-logging;
tensorflow-opgen = setTensorflowSourceRoot "tensorflow-opgen" super.tensorflow-opgen;
tensorflow-ops = setTensorflowSourceRoot "tensorflow-ops" super.tensorflow-ops;
}

View File

@@ -0,0 +1,67 @@
{
pkgs,
stdenv,
lib,
haskellLib,
ghc,
all-cabal-hashes,
buildHaskellPackages,
compilerConfig ? (self: super: { }),
packageSetConfig ? (self: super: { }),
overrides ? (self: super: { }),
initialPackages ? import ./initial-packages.nix,
nonHackagePackages ? import ./non-hackage-packages.nix,
configurationCommon ? import ./configuration-common.nix,
configurationNix ? import ./configuration-nix.nix,
configurationArm ? import ./configuration-arm.nix,
configurationDarwin ? import ./configuration-darwin.nix,
configurationJS ? import ./configuration-ghcjs-9.x.nix,
}:
let
inherit (lib) extends makeExtensible;
inherit (haskellLib) makePackageSet;
haskellPackages = pkgs.callPackage makePackageSet {
package-set = initialPackages;
inherit
stdenv
haskellLib
ghc
extensible-self
all-cabal-hashes
buildHaskellPackages
;
};
platformConfigurations =
lib.optionals stdenv.hostPlatform.isAarch [
(configurationArm { inherit pkgs haskellLib; })
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(configurationDarwin { inherit pkgs haskellLib; })
]
++ lib.optionals stdenv.hostPlatform.isGhcjs [
(configurationJS { inherit pkgs haskellLib; })
];
extensions = lib.composeManyExtensions (
[
(nonHackagePackages { inherit pkgs haskellLib; })
(configurationNix { inherit pkgs haskellLib; })
(configurationCommon { inherit pkgs haskellLib; })
]
++ platformConfigurations
++ [
compilerConfig
packageSetConfig
overrides
]
);
extensible-self = makeExtensible (extends extensions haskellPackages);
in
extensible-self

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,99 @@
{
stdenv,
ghc,
pkg-config,
glibcLocales,
cacert,
stack,
makeSetupHook,
lib,
}@depArgs:
{
buildInputs ? [ ],
nativeBuildInputs ? [ ],
extraArgs ? [ ],
LD_LIBRARY_PATH ? [ ],
ghc ? depArgs.ghc,
stack ? depArgs.stack,
...
}@args:
let
stackCmd = "stack --internal-re-exec-version=${stack.version}";
# Add all dependencies in buildInputs including propagated ones to
# STACK_IN_NIX_EXTRA_ARGS.
stackHook = makeSetupHook {
name = "stack-hook";
} ./stack-hook.sh;
in
stdenv.mkDerivation (
args
// {
# Doesn't work in the sandbox. Pass `--option sandbox relaxed` or
# `--option sandbox false` to be able to build this
__noChroot = true;
buildInputs = buildInputs ++ lib.optional (stdenv.hostPlatform.libc == "glibc") glibcLocales;
nativeBuildInputs = nativeBuildInputs ++ [
ghc
pkg-config
stack
stackHook
];
STACK_PLATFORM_VARIANT = "nix";
STACK_IN_NIX_SHELL = 1;
STACK_IN_NIX_EXTRA_ARGS = extraArgs;
# XXX: workaround for https://ghc.haskell.org/trac/ghc/ticket/11042.
LD_LIBRARY_PATH = lib.makeLibraryPath (LD_LIBRARY_PATH ++ buildInputs);
# ^^^ Internally uses `getOutput "lib"` (equiv. to getLib)
# Non-NixOS git needs cert
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
# Fixes https://github.com/commercialhaskell/stack/issues/2358
LANG = "en_US.UTF-8";
preferLocalBuild = true;
preConfigure = ''
export STACK_ROOT=$NIX_BUILD_TOP/.stack
'';
buildPhase =
args.buildPhase or ''
runHook preBuild
${stackCmd} build
runHook postBuild
'';
checkPhase =
args.checkPhase or ''
runHook preCheck
${stackCmd} test
runHook postCheck
'';
doCheck = args.doCheck or true;
installPhase =
args.installPhase or ''
runHook preInstall
${stackCmd} --local-bin-path=$out/bin build --copy-bins
runHook postInstall
'';
}
)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
#! @shell@
COMMAND=$1
shift
exec @hoogle@/bin/hoogle "$COMMAND" --database @database@ "$@"

View File

@@ -0,0 +1,146 @@
# Install not only the Hoogle library and executable, but also a local Hoogle
# database which provides "Source" links to all specified 'packages' -- or the
# current Haskell Platform if no custom package set is provided.
{
lib,
stdenv,
buildPackages,
haskellPackages,
writeText,
runCommand,
}:
# This argument is a function which selects a list of Haskell packages from any
# passed Haskell package set.
#
# Example:
# (hpkgs: [ hpkgs.mtl hpkgs.lens ])
selectPackages:
let
inherit (haskellPackages) ghc hoogle;
packages = selectPackages haskellPackages;
wrapper = ./hoogle-local-wrapper.sh;
haddockExe = "haddock";
ghcDocLibDir = ghc.doc + "/share/doc/ghc*/html/libraries";
prologue = "${ghcDocLibDir}/prologue.txt";
docPackages =
lib.closePropagation
# we grab the doc outputs
(map (lib.getOutput "doc") packages);
# Hoogle database path, relative to `$out`.
databasePath = "share/doc/hoogle/default.hoo";
in
buildPackages.stdenv.mkDerivation (finalAttrs: {
name = "hoogle-with-packages";
buildInputs = [
ghc
hoogle
];
# compiling databases takes less time than copying the results
# between machines.
preferLocalBuild = true;
# we still allow substitutes because a database is relatively small and if it
# is already built downloading is probably faster. The substitution will only
# trigger for users who have already cached the database on a substituter and
# thus probably intend to substitute it.
allowSubstitutes = true;
inherit docPackages;
passAsFile = [ "buildCommand" ];
buildCommand = ''
${
let
# Filter out nulls here to work around https://github.com/NixOS/nixpkgs/issues/82245
# If we don't then grabbing `p.name` here will fail.
packages' = lib.filter (p: p != null) packages;
in
lib.optionalString (packages' != [ ] -> docPackages == [ ]) (
"echo WARNING: localHoogle package list empty, even though"
+ " the following were specified: "
+ lib.concatMapStringsSep ", " (p: p.name) packages'
)
}
mkdir -p $out/share/doc/hoogle
echo importing builtin packages
for docdir in ${ghcDocLibDir}"/"*; do
name="$(basename $docdir)"
if [[ -d $docdir ]]; then
ln -sfn $docdir $out/share/doc/hoogle/$name
fi
done
echo importing other packages
${lib.concatMapStringsSep "\n"
(el: ''
ln -sfn ${el.haddockDir} "$out/share/doc/hoogle/${el.name}"
'')
(
lib.filter (el: el.haddockDir != null) (
map (p: {
haddockDir = if p ? haddockDir then p.haddockDir p else null;
name = p.pname;
}) docPackages
)
)
}
databasePath="$out/"${lib.escapeShellArg databasePath}
echo building hoogle database
hoogle generate --database "$databasePath" --local=$out/share/doc/hoogle
echo building haddock index
# adapted from GHC's gen_contents_index
cd $out/share/doc/hoogle
args=
for hdfile in $(ls -1 *"/"*.haddock | grep -v '/ghc\.haddock' | sort); do
name_version=`echo "$hdfile" | sed 's#/.*##'`
args="$args --read-interface=$name_version,$hdfile"
done
${ghc}/bin/${haddockExe} --gen-index --gen-contents -o . \
-t "Haskell Hierarchical Libraries" \
-p ${prologue} \
$args
echo finishing up
mkdir -p $out/bin
substitute ${wrapper} $out/bin/hoogle \
--subst-var-by shell ${stdenv.shell} \
--subst-var-by database "$databasePath" \
--subst-var-by hoogle ${hoogle}
chmod +x $out/bin/hoogle
'';
passthru = {
isHaskellLibrary = false; # for the filter in ./with-packages-wrapper.nix
# The path to the Hoogle database.
database = "${finalAttrs.finalPackage}/${databasePath}";
tests.can-search-database = runCommand "can-search-database" { } ''
# This succeeds even if no results are found, but `Prelude.map` should
# always be available.
${finalAttrs.finalPackage}/bin/hoogle search Prelude.map > $out
'';
};
meta = {
description = "Local Hoogle database";
platforms = ghc.meta.platforms;
hydraPlatforms = with lib.platforms; none;
maintainers = with lib.maintainers; [ ttuegel ];
};
})

View File

@@ -0,0 +1,6 @@
args@{
pkgs,
lib,
callPackage,
}:
self: (import ./hackage-packages.nix args self)

View File

@@ -0,0 +1,697 @@
# TODO(@Ericson2314): Remove `pkgs` param, which is only used for
# `buildStackProject`, `justStaticExecutables` and `checkUnusedPackages`
{ pkgs, lib }:
rec {
/*
This function takes a file like `hackage-packages.nix` and constructs
a full package set out of that.
*/
makePackageSet = import ../make-package-set.nix;
/*
The function overrideCabal lets you alter the arguments to the
mkDerivation function.
Example:
First, note how the aeson package is constructed in hackage-packages.nix:
"aeson" = callPackage ({ mkDerivation, attoparsec, <snip>
}:
mkDerivation {
pname = "aeson";
<snip>
homepage = "https://github.com/bos/aeson";
})
The mkDerivation function of haskellPackages will take care of putting
the homepage in the right place, in meta.
> haskellPackages.aeson.meta.homepage
"https://github.com/bos/aeson"
> x = haskell.lib.compose.overrideCabal (old: { homepage = old.homepage + "#readme"; }) haskellPackages.aeson
> x.meta.homepage
"https://github.com/bos/aeson#readme"
*/
overrideCabal =
f: drv:
(drv.override (
args:
args
// {
mkDerivation = drv: (args.mkDerivation drv).override f;
}
))
// {
overrideScope = scope: overrideCabal f (drv.overrideScope scope);
};
# : Map Name (Either Path VersionNumber) -> HaskellPackageOverrideSet
# Given a set whose values are either paths or version strings, produces
# a package override set (i.e. (self: super: { etc. })) that sets
# the packages named in the input set to the corresponding versions
packageSourceOverrides =
overrides: self: super:
pkgs.lib.mapAttrs (
name: src:
let
isPath = x: builtins.substring 0 1 (toString x) == "/";
generateExprs = if isPath src then self.callCabal2nix else self.callHackage;
in
generateExprs name src { }
) overrides;
/*
doCoverage modifies a haskell package to enable the generation
and installation of a coverage report.
See https://wiki.haskell.org/Haskell_program_coverage
*/
doCoverage = overrideCabal (drv: {
doCoverage = true;
});
/*
dontCoverage modifies a haskell package to disable the generation
and installation of a coverage report.
*/
dontCoverage = overrideCabal (drv: {
doCoverage = false;
});
/*
doHaddock modifies a haskell package to enable the generation and
installation of API documentation from code comments using the
haddock tool.
*/
doHaddock = overrideCabal (drv: {
doHaddock = true;
});
/*
dontHaddock modifies a haskell package to disable the generation and
installation of API documentation from code comments using the
haddock tool.
*/
dontHaddock = overrideCabal (drv: {
doHaddock = false;
});
/*
doJailbreak enables the removal of version bounds from the cabal
file. You may want to avoid this function.
This is useful when a package reports that it can not be built
due to version mismatches. In some cases, removing the version
bounds entirely is an easy way to make a package build, but at
the risk of breaking software in non-obvious ways now or in the
future.
Instead of jailbreaking, you can patch the cabal file.
Note that jailbreaking at this time, doesn't lift bounds on
conditional branches.
https://github.com/peti/jailbreak-cabal/issues/7 has further details.
*/
doJailbreak = overrideCabal (drv: {
jailbreak = true;
});
/*
dontJailbreak restores the use of the version bounds the check
the use of dependencies in the package description.
*/
dontJailbreak = overrideCabal (drv: {
jailbreak = false;
});
/*
doCheck enables dependency checking, compilation and execution
of test suites listed in the package description file.
*/
doCheck = overrideCabal (drv: {
doCheck = true;
});
/*
dontCheck disables dependency checking, compilation and execution
of test suites listed in the package description file.
*/
dontCheck = overrideCabal (drv: {
doCheck = false;
});
/*
The dontCheckIf variant sets doCheck = false if the condition
applies. In any other case the previously set/default value is used.
This prevents accidentally re-enabling tests in a later override.
*/
dontCheckIf = condition: if condition then dontCheck else lib.id;
/*
doBenchmark enables dependency checking and compilation
for benchmarks listed in the package description file.
Benchmarks are, however, not executed at the moment.
*/
doBenchmark = overrideCabal (drv: {
doBenchmark = true;
});
/*
dontBenchmark disables dependency checking, compilation and execution
for benchmarks listed in the package description file.
*/
dontBenchmark = overrideCabal (drv: {
doBenchmark = false;
});
/*
doDistribute enables the distribution of binaries for the package
via hydra.
*/
doDistribute = overrideCabal (drv: {
# lib.platforms.all is the default value for platforms (since GHC can cross-compile)
hydraPlatforms = lib.subtractLists (drv.badPlatforms or [ ]) (drv.platforms or lib.platforms.all);
});
/*
dontDistribute disables the distribution of binaries for the package
via hydra.
*/
dontDistribute = overrideCabal (drv: {
hydraPlatforms = [ ];
});
/*
appendConfigureFlag adds a single argument that will be passed to the
cabal configure command, after the arguments that have been defined
in the initial declaration or previous overrides.
Example:
> haskell.lib.compose.appendConfigureFlag "--profiling-detail=all-functions" haskellPackages.servant
*/
appendConfigureFlag = x: appendConfigureFlags [ x ];
appendConfigureFlags =
xs:
overrideCabal (drv: {
configureFlags = (drv.configureFlags or [ ]) ++ xs;
});
appendBuildFlag =
x:
overrideCabal (drv: {
buildFlags = (drv.buildFlags or [ ]) ++ [ x ];
});
appendBuildFlags =
xs:
overrideCabal (drv: {
buildFlags = (drv.buildFlags or [ ]) ++ xs;
});
/*
removeConfigureFlag drv x is a Haskell package like drv, but with
all cabal configure arguments that are equal to x removed.
> haskell.lib.compose.removeConfigureFlag "--verbose" haskellPackages.servant
*/
removeConfigureFlag =
x:
overrideCabal (drv: {
configureFlags = lib.remove x (drv.configureFlags or [ ]);
});
addBuildTool = x: addBuildTools [ x ];
addBuildTools =
xs:
overrideCabal (drv: {
buildTools = (drv.buildTools or [ ]) ++ xs;
});
addExtraLibrary = x: addExtraLibraries [ x ];
addExtraLibraries =
xs:
overrideCabal (drv: {
extraLibraries = (drv.extraLibraries or [ ]) ++ xs;
});
addBuildDepend = x: addBuildDepends [ x ];
addBuildDepends =
xs:
overrideCabal (drv: {
buildDepends = (drv.buildDepends or [ ]) ++ xs;
});
addTestToolDepend = x: addTestToolDepends [ x ];
addTestToolDepends =
xs:
overrideCabal (drv: {
testToolDepends = (drv.testToolDepends or [ ]) ++ xs;
});
addPkgconfigDepend = x: addPkgconfigDepends [ x ];
addPkgconfigDepends =
xs:
overrideCabal (drv: {
pkg-configDepends = (drv.pkg-configDepends or [ ]) ++ xs;
});
addSetupDepend = x: addSetupDepends [ x ];
addSetupDepends =
xs:
overrideCabal (drv: {
setupHaskellDepends = (drv.setupHaskellDepends or [ ]) ++ xs;
});
enableCabalFlag = x: drv: appendConfigureFlag "-f${x}" (removeConfigureFlag "-f-${x}" drv);
disableCabalFlag = x: drv: appendConfigureFlag "-f-${x}" (removeConfigureFlag "-f${x}" drv);
markBroken = overrideCabal (drv: {
broken = true;
hydraPlatforms = [ ];
});
unmarkBroken = overrideCabal (drv: {
broken = false;
});
markBrokenVersion =
version: drv:
assert drv.version == version;
markBroken drv;
markUnbroken = overrideCabal (drv: {
broken = false;
});
/*
disableParallelBuilding drops the -j<n> option from the GHC
command line for the given package. This can be useful in rare
situations where parallel building of a package causes GHC to
fail for some reason.
*/
disableParallelBuilding = overrideCabal (drv: {
enableParallelBuilding = false;
});
enableLibraryProfiling = overrideCabal (drv: {
enableLibraryProfiling = true;
});
disableLibraryProfiling = overrideCabal (drv: {
enableLibraryProfiling = false;
});
enableExecutableProfiling = overrideCabal (drv: {
enableExecutableProfiling = true;
});
disableExecutableProfiling = overrideCabal (drv: {
enableExecutableProfiling = false;
});
enableSharedExecutables = overrideCabal (drv: {
enableSharedExecutables = true;
});
disableSharedExecutables = overrideCabal (drv: {
enableSharedExecutables = false;
});
enableSharedLibraries = overrideCabal (drv: {
enableSharedLibraries = true;
});
disableSharedLibraries = overrideCabal (drv: {
enableSharedLibraries = false;
});
enableDeadCodeElimination = overrideCabal (drv: {
enableDeadCodeElimination = true;
});
disableDeadCodeElimination = overrideCabal (drv: {
enableDeadCodeElimination = false;
});
enableStaticLibraries = overrideCabal (drv: {
enableStaticLibraries = true;
});
disableStaticLibraries = overrideCabal (drv: {
enableStaticLibraries = false;
});
enableSeparateBinOutput = overrideCabal (drv: {
enableSeparateBinOutput = true;
});
appendPatch = x: appendPatches [ x ];
appendPatches =
xs:
overrideCabal (drv: {
patches = (drv.patches or [ ]) ++ xs;
});
/*
Set a specific build target instead of compiling all targets in the package.
For example, imagine we have a .cabal file with a library, and 2 executables "dev" and "server".
We can build only "server" and not wait on the compilation of "dev" by using setBuildTarget as follows:
> setBuildTarget "server" (callCabal2nix "thePackageName" thePackageSrc {})
*/
setBuildTargets =
xs:
overrideCabal (drv: {
buildTarget = lib.concatStringsSep " " xs;
});
setBuildTarget = x: setBuildTargets [ x ];
doHyperlinkSource = overrideCabal (drv: {
hyperlinkSource = true;
});
dontHyperlinkSource = overrideCabal (drv: {
hyperlinkSource = false;
});
disableHardening =
flags:
overrideCabal (drv: {
hardeningDisable = flags;
});
/*
Let Nix strip the binary files.
This removes debugging symbols.
*/
doStrip = overrideCabal (drv: {
dontStrip = false;
});
/*
Stop Nix from stripping the binary files.
This keeps debugging symbols.
*/
dontStrip = overrideCabal (drv: {
dontStrip = true;
});
/*
Useful for debugging segfaults with gdb.
This includes dontStrip.
*/
enableDWARFDebugging =
drv:
# -g: enables debugging symbols
# --disable-*-stripping: tell GHC not to strip resulting binaries
# dontStrip: see above
appendConfigureFlag "--ghc-options=-g --disable-executable-stripping --disable-library-stripping" (
dontStrip drv
);
/*
Create a source distribution tarball like those found on hackage,
instead of building the package.
*/
sdistTarball =
pkg:
lib.overrideDerivation pkg (drv: {
name = "${drv.pname}-source-${drv.version}";
# Since we disable the haddock phase, we also need to override the
# outputs since the separate doc output will not be produced.
outputs = [ "out" ];
buildPhase = "./Setup sdist";
haddockPhase = ":";
checkPhase = ":";
installPhase = "install -D dist/${drv.pname}-*.tar.gz $out/${drv.pname}-${drv.version}.tar.gz";
fixupPhase = ":";
});
/*
Create a documentation tarball suitable for uploading to Hackage instead
of building the package.
*/
documentationTarball =
pkg:
pkgs.lib.overrideDerivation pkg (drv: {
name = "${drv.name}-docs";
# Like sdistTarball, disable the "doc" output here.
outputs = [ "out" ];
buildPhase = ''
runHook preHaddock
./Setup haddock --for-hackage
runHook postHaddock
'';
haddockPhase = ":";
checkPhase = ":";
installPhase = ''
runHook preInstall
mkdir -p "$out"
tar --format=ustar \
-czf "$out/${drv.name}-docs.tar.gz" \
-C dist/doc/html "${drv.name}-docs"
runHook postInstall
'';
});
/*
Use the gold linker. It is a linker for ELF that is designed
"to run as fast as possible on modern systems"
*/
linkWithGold = appendConfigureFlag "--ghc-option=-optl-fuse-ld=gold --ld-option=-fuse-ld=gold --with-ld=ld.gold";
/*
link executables statically against haskell libs to reduce
closure size
*/
justStaticExecutables = overrideCabal (drv: {
enableSharedExecutables = false;
enableLibraryProfiling = drv.enableExecutableProfiling or false;
isLibrary = false;
doHaddock = false;
postFixup = drv.postFixup or "" + ''
# Remove every directory which could have links to other store paths.
rm -rf $out/lib $out/nix-support $out/share/doc
'';
disallowGhcReference = true;
});
/*
Build a source distribution tarball instead of using the source files
directly. The effect is that the package is built as if it were published
on hackage. This can be used as a test for the source distribution,
assuming the build fails when packaging mistakes are in the cabal file.
A faster implementation using `cabal-install` is available as
`buildFromCabalSdist` in your Haskell package set.
*/
buildFromSdist =
pkg:
overrideCabal (drv: {
src = "${sdistTarball pkg}/${pkg.pname}-${pkg.version}.tar.gz";
# Revising and jailbreaking the cabal file has been handled in sdistTarball
revision = null;
editedCabalFile = null;
jailbreak = false;
}) pkg;
/*
Build the package in a strict way to uncover potential problems.
This includes buildFromSdist and failOnAllWarnings.
*/
buildStrictly = pkg: buildFromSdist (failOnAllWarnings pkg);
# Disable core optimizations, significantly speeds up build time
disableOptimization = appendConfigureFlag "--disable-optimization";
/*
Turn on most of the compiler warnings and fail the build if any
of them occur.
*/
failOnAllWarnings = appendConfigureFlag "--ghc-option=-Wall --ghc-option=-Werror";
/*
Add a post-build check to verify that dependencies declared in
the cabal file are actually used.
The first attrset argument can be used to configure the strictness
of this check and a list of ignored package names that would otherwise
cause false alarms.
*/
checkUnusedPackages =
{
ignoreEmptyImports ? false,
ignoreMainModule ? false,
ignorePackages ? [ ],
}:
drv:
overrideCabal (_drv: {
postBuild =
let
args = lib.concatStringsSep " " (
lib.optional ignoreEmptyImports "--ignore-empty-imports"
++ lib.optional ignoreMainModule "--ignore-main-module"
++ map (pkg: "--ignore-package ${pkg}") ignorePackages
);
in
"${pkgs.haskellPackages.packunused}/bin/packunused" + lib.optionalString (args != "") " ${args}";
}) (appendConfigureFlag "--ghc-option=-ddump-minimal-imports" drv);
buildStackProject = pkgs.callPackage ../generic-stack-builder.nix { };
/*
Add a dummy command to trigger a build despite an equivalent
earlier build that is present in the store or cache.
*/
triggerRebuild =
i:
overrideCabal (drv: {
postUnpack = drv.postUnpack or "" + ''
# trigger rebuild ${toString i}
'';
});
/*
Override the sources for the package and optionally the version.
This also takes of removing editedCabalFile.
*/
overrideSrc =
{
src,
version ? null,
}:
drv:
overrideCabal (_: {
inherit src;
version = if version == null then drv.version else version;
editedCabalFile = null;
}) drv;
# Get all of the build inputs of a haskell package, divided by category.
getBuildInputs = p: p.getBuildInputs;
# Extract the haskell build inputs of a haskell package.
# This is useful to build environments for developing on that
# package.
getHaskellBuildInputs = p: (getBuildInputs p).haskellBuildInputs;
# Under normal evaluation, simply return the original package. Under
# nix-shell evaluation, return a nix-shell optimized environment.
shellAware = p: if lib.inNixShell then p.env else p;
# Utility to convert a directory full of `cabal2nix`-generated files into a
# package override set
#
# packagesFromDirectory : { directory : Directory, ... } -> HaskellPackageOverrideSet
packagesFromDirectory =
{ directory, ... }:
self: super:
let
haskellPaths = lib.filter (lib.hasSuffix ".nix") (builtins.attrNames (builtins.readDir directory));
toKeyVal = file: {
name = builtins.replaceStrings [ ".nix" ] [ "" ] file;
value = self.callPackage (directory + "/${file}") { };
};
in
builtins.listToAttrs (map toKeyVal haskellPaths);
/*
INTERNAL function retained for backwards compatibility, use
haskell.packages.*.generateOptparseApplicativeCompletions instead!
*/
__generateOptparseApplicativeCompletion =
exeName:
overrideCabal (drv: {
postInstall = (drv.postInstall or "") + ''
bashCompDir="''${!outputBin}/share/bash-completion/completions"
zshCompDir="''${!outputBin}/share/zsh/vendor-completions"
fishCompDir="''${!outputBin}/share/fish/vendor_completions.d"
mkdir -p "$bashCompDir" "$zshCompDir" "$fishCompDir"
"''${!outputBin}/bin/${exeName}" --bash-completion-script "''${!outputBin}/bin/${exeName}" >"$bashCompDir/${exeName}"
"''${!outputBin}/bin/${exeName}" --zsh-completion-script "''${!outputBin}/bin/${exeName}" >"$zshCompDir/_${exeName}"
"''${!outputBin}/bin/${exeName}" --fish-completion-script "''${!outputBin}/bin/${exeName}" >"$fishCompDir/${exeName}.fish"
# Sanity check
grep -F ${exeName} <$bashCompDir/${exeName} >/dev/null || {
echo 'Could not find ${exeName} in completion script.'
exit 1
}
'';
});
/*
Retained for backwards compatibility.
Use haskell.packages.*.generateOptparseApplicativeCompletions
which is cross aware instead.
*/
generateOptparseApplicativeCompletions =
commands: pkg:
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2211)
"haskellLib.generateOptparseApplicativeCompletions is deprecated in favor of haskellPackages.generateOptparseApplicativeCompletions. Please change ${pkg.name} to use the latter and make sure it uses its matching haskell.packages set!"
(pkgs.lib.foldr __generateOptparseApplicativeCompletion pkg commands);
/*
Retained for backwards compatibility.
Use haskell.packages.*.generateOptparseApplicativeCompletions
which is cross aware instead.
*/
generateOptparseApplicativeCompletion =
command: pkg:
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2211)
"haskellLib.generateOptparseApplicativeCompletion is deprecated in favor of haskellPackages.generateOptparseApplicativeCompletions (plural!). Please change ${pkg.name} to use the latter and make sure it uses its matching haskell.packages set!"
(__generateOptparseApplicativeCompletion command pkg);
# Don't fail at configure time if there are multiple versions of the
# same package in the (recursive) dependencies of the package being
# built. Will delay failures, if any, to compile time.
allowInconsistentDependencies = overrideCabal (drv: {
allowInconsistentDependencies = true;
});
# Work around a Cabal bug requiring pkg-config --static --libs to work even
# when linking dynamically, affecting Cabal 3.8 and 3.9.
# https://github.com/haskell/cabal/issues/8455
#
# For this, we treat the runtime system/pkg-config dependencies of a Haskell
# derivation as if they were propagated from their dependencies which allows
# pkg-config --static to work in most cases.
#
# Warning: This function may change or be removed at any time, e.g. if we find
# a different workaround, upstream fixes the bug or we patch Cabal.
__CabalEagerPkgConfigWorkaround =
let
# Take list of derivations and return list of the transitive dependency
# closure, only taking into account buildInputs. Loosely based on
# closePropagationFast.
propagatedPlainBuildInputs =
drvs:
map (i: i.val) (
builtins.genericClosure {
startSet = map (drv: {
key = drv.outPath;
val = drv;
}) drvs;
operator =
{ val, ... }:
if !lib.isDerivation val then
[ ]
else
builtins.concatMap (
drv:
if !lib.isDerivation drv then
[ ]
else
[
{
key = drv.outPath;
val = drv;
}
]
) (val.buildInputs or [ ] ++ val.propagatedBuildInputs or [ ]);
}
);
in
overrideCabal (old: {
benchmarkPkgconfigDepends = propagatedPlainBuildInputs old.benchmarkPkgconfigDepends or [ ];
executablePkgconfigDepends = propagatedPlainBuildInputs old.executablePkgconfigDepends or [ ];
libraryPkgconfigDepends = propagatedPlainBuildInputs old.libraryPkgconfigDepends or [ ];
testPkgconfigDepends = propagatedPlainBuildInputs old.testPkgconfigDepends or [ ];
});
}

View File

@@ -0,0 +1,380 @@
# TODO(@Ericson2314): Remove `pkgs` param, which is only used for
# `buildStackProject`, `justStaticExecutables` and `checkUnusedPackages`
{ pkgs, lib }:
rec {
/*
The same functionality as this haskell.lib, except that the derivation
being overridden is always the last parameter. This permits more natural
composition of several overrides, i.e. without having to nestle one call
between the function name and argument of another. haskell.lib.compose is
preferred for any new code.
*/
compose = import ./compose.nix { inherit pkgs lib; };
/*
This function takes a file like `hackage-packages.nix` and constructs
a full package set out of that.
*/
makePackageSet = compose.makePackageSet;
/*
The function overrideCabal lets you alter the arguments to the
mkDerivation function.
Example:
First, note how the aeson package is constructed in hackage-packages.nix:
"aeson" = callPackage ({ mkDerivation, attoparsec, <snip>
}:
mkDerivation {
pname = "aeson";
<snip>
homepage = "https://github.com/bos/aeson";
})
The mkDerivation function of haskellPackages will take care of putting
the homepage in the right place, in meta.
> haskellPackages.aeson.meta.homepage
"https://github.com/bos/aeson"
> x = haskell.lib.overrideCabal haskellPackages.aeson (old: { homepage = old.homepage + "#readme"; })
> x.meta.homepage
"https://github.com/bos/aeson#readme"
*/
overrideCabal = drv: f: compose.overrideCabal f drv;
# : Map Name (Either Path VersionNumber) -> HaskellPackageOverrideSet
# Given a set whose values are either paths or version strings, produces
# a package override set (i.e. (self: super: { etc. })) that sets
# the packages named in the input set to the corresponding versions
packageSourceOverrides = compose.packageSourceOverrides;
/*
doCoverage modifies a haskell package to enable the generation
and installation of a coverage report.
See https://wiki.haskell.org/Haskell_program_coverage
*/
doCoverage = compose.doCoverage;
/*
dontCoverage modifies a haskell package to disable the generation
and installation of a coverage report.
*/
dontCoverage = compose.dontCoverage;
/*
doHaddock modifies a haskell package to enable the generation and
installation of API documentation from code comments using the
haddock tool.
*/
doHaddock = compose.doHaddock;
/*
dontHaddock modifies a haskell package to disable the generation and
installation of API documentation from code comments using the
haddock tool.
*/
dontHaddock = compose.dontHaddock;
/*
doJailbreak enables the removal of version bounds from the cabal
file. You may want to avoid this function.
This is useful when a package reports that it can not be built
due to version mismatches. In some cases, removing the version
bounds entirely is an easy way to make a package build, but at
the risk of breaking software in non-obvious ways now or in the
future.
Instead of jailbreaking, you can patch the cabal file.
Note that jailbreaking at this time, doesn't lift bounds on
conditional branches.
https://github.com/peti/jailbreak-cabal/issues/7 has further details.
*/
doJailbreak = compose.doJailbreak;
/*
dontJailbreak restores the use of the version bounds the check
the use of dependencies in the package description.
*/
dontJailbreak = compose.dontJailbreak;
/*
doCheck enables dependency checking, compilation and execution
of test suites listed in the package description file.
*/
doCheck = compose.doCheck;
/*
dontCheck disables dependency checking, compilation and execution
of test suites listed in the package description file.
*/
dontCheck = compose.dontCheck;
/*
The dontCheckIf variant sets doCheck = false if the condition
applies. In any other case the previously set/default value is used.
This prevents accidentally re-enabling tests in a later override.
*/
dontCheckIf = drv: condition: compose.dontCheckIf condition drv;
/*
doBenchmark enables dependency checking, compilation and execution
for benchmarks listed in the package description file.
*/
doBenchmark = compose.doBenchmark;
/*
dontBenchmark disables dependency checking, compilation and execution
for benchmarks listed in the package description file.
*/
dontBenchmark = compose.dontBenchmark;
/*
doDistribute enables the distribution of binaries for the package
via hydra.
*/
doDistribute = compose.doDistribute;
/*
dontDistribute disables the distribution of binaries for the package
via hydra.
*/
dontDistribute = compose.dontDistribute;
/*
appendConfigureFlag adds a single argument that will be passed to the
cabal configure command, after the arguments that have been defined
in the initial declaration or previous overrides.
Example:
> haskell.lib.appendConfigureFlag haskellPackages.servant "--profiling-detail=all-functions"
*/
appendConfigureFlag = drv: x: compose.appendConfigureFlag x drv;
appendConfigureFlags = drv: xs: compose.appendConfigureFlags xs drv;
appendBuildFlag = drv: x: compose.appendBuildFlag x drv;
appendBuildFlags = drv: xs: compose.appendBuildFlags xs drv;
/*
removeConfigureFlag drv x is a Haskell package like drv, but with
all cabal configure arguments that are equal to x removed.
> haskell.lib.removeConfigureFlag haskellPackages.servant "--verbose"
*/
removeConfigureFlag = drv: x: compose.removeConfigureFlag x drv;
addBuildTool = drv: x: compose.addBuildTool x drv;
addBuildTools = drv: xs: compose.addBuildTools xs drv;
addExtraLibrary = drv: x: compose.addExtraLibrary x drv;
addExtraLibraries = drv: xs: compose.addExtraLibraries xs drv;
addBuildDepend = drv: x: compose.addBuildDepend x drv;
addBuildDepends = drv: xs: compose.addBuildDepends xs drv;
addTestToolDepend = drv: x: compose.addTestToolDepend x drv;
addTestToolDepends = drv: xs: compose.addTestToolDepends xs drv;
addPkgconfigDepend = drv: x: compose.addPkgconfigDepend x drv;
addPkgconfigDepends = drv: xs: compose.addPkgconfigDepends xs drv;
addSetupDepend = drv: x: compose.addSetupDepend x drv;
addSetupDepends = drv: xs: compose.addSetupDepends xs drv;
enableCabalFlag = drv: x: compose.enableCabalFlag x drv;
disableCabalFlag = drv: x: compose.disableCabalFlag x drv;
markBroken = compose.markBroken;
unmarkBroken = compose.unmarkBroken;
markBrokenVersion = compose.markBrokenVersion;
markUnbroken = compose.markUnbroken;
disableParallelBuilding = compose.disableParallelBuilding;
enableLibraryProfiling = compose.enableLibraryProfiling;
disableLibraryProfiling = compose.disableLibraryProfiling;
enableExecutableProfiling = compose.enableExecutableProfiling;
disableExecutableProfiling = compose.disableExecutableProfiling;
enableSharedExecutables = compose.enableSharedExecutables;
disableSharedExecutables = compose.disableSharedExecutables;
enableSharedLibraries = compose.enableSharedLibraries;
disableSharedLibraries = compose.disableSharedLibraries;
enableDeadCodeElimination = compose.enableDeadCodeElimination;
disableDeadCodeElimination = compose.disableDeadCodeElimination;
enableStaticLibraries = compose.enableStaticLibraries;
disableStaticLibraries = compose.disableStaticLibraries;
enableSeparateBinOutput = compose.enableSeparateBinOutput;
appendPatch = drv: x: compose.appendPatch x drv;
appendPatches = drv: xs: compose.appendPatches xs drv;
/*
Set a specific build target instead of compiling all targets in the package.
For example, imagine we have a .cabal file with a library, and 2 executables "dev" and "server".
We can build only "server" and not wait on the compilation of "dev" by using setBuildTarget as follows:
setBuildTarget (callCabal2nix "thePackageName" thePackageSrc {}) "server"
*/
setBuildTargets = drv: xs: compose.setBuildTargets xs drv;
setBuildTarget = drv: x: compose.setBuildTarget x drv;
doHyperlinkSource = compose.doHyperlinkSource;
dontHyperlinkSource = compose.dontHyperlinkSource;
disableHardening = drv: flags: compose.disableHardening flags drv;
/*
Let Nix strip the binary files.
This removes debugging symbols.
*/
doStrip = compose.doStrip;
/*
Stop Nix from stripping the binary files.
This keeps debugging symbols.
*/
dontStrip = compose.dontStrip;
/*
Useful for debugging segfaults with gdb.
This includes dontStrip.
*/
enableDWARFDebugging = compose.enableDWARFDebugging;
/*
Create a source distribution tarball like those found on hackage,
instead of building the package.
*/
sdistTarball = compose.sdistTarball;
/*
Create a documentation tarball suitable for uploading to Hackage instead
of building the package.
*/
documentationTarball = compose.documentationTarball;
/*
Use the gold linker. It is a linker for ELF that is designed
"to run as fast as possible on modern systems"
*/
linkWithGold = compose.linkWithGold;
/*
link executables statically against haskell libs to reduce
closure size
*/
justStaticExecutables = compose.justStaticExecutables;
/*
Build a source distribution tarball instead of using the source files
directly. The effect is that the package is built as if it were published
on hackage. This can be used as a test for the source distribution,
assuming the build fails when packaging mistakes are in the cabal file.
*/
buildFromSdist = compose.buildFromSdist;
/*
Build the package in a strict way to uncover potential problems.
This includes buildFromSdist and failOnAllWarnings.
*/
buildStrictly = compose.buildStrictly;
# Disable core optimizations, significantly speeds up build time
disableOptimization = compose.disableOptimization;
/*
Turn on most of the compiler warnings and fail the build if any
of them occur.
*/
failOnAllWarnings = compose.failOnAllWarnings;
/*
Add a post-build check to verify that dependencies declared in
the cabal file are actually used.
The first attrset argument can be used to configure the strictness
of this check and a list of ignored package names that would otherwise
cause false alarms.
*/
checkUnusedPackages = compose.checkUnusedPackages;
buildStackProject = compose.buildStackProject;
/*
Add a dummy command to trigger a build despite an equivalent
earlier build that is present in the store or cache.
*/
triggerRebuild = drv: i: compose.triggerRebuild i drv;
/*
Override the sources for the package and optionally the version.
This also takes of removing editedCabalFile.
*/
overrideSrc = drv: src: compose.overrideSrc src drv;
# Get all of the build inputs of a haskell package, divided by category.
getBuildInputs = compose.getBuildInputs;
# Extract the haskell build inputs of a haskell package.
# This is useful to build environments for developing on that
# package.
getHaskellBuildInputs = compose.getHaskellBuildInputs;
# Under normal evaluation, simply return the original package. Under
# nix-shell evaluation, return a nix-shell optimized environment.
shellAware = compose.shellAware;
# Utility to convert a directory full of `cabal2nix`-generated files into a
# package override set
#
# packagesFromDirectory : { directory : Directory, ... } -> HaskellPackageOverrideSet
packagesFromDirectory = compose.packagesFromDirectory;
addOptparseApplicativeCompletionScripts =
exeName: pkg:
lib.warn "addOptparseApplicativeCompletionScripts is deprecated in favor of haskellPackages.generateOptparseApplicativeCompletions. Please change ${pkg.name} to use the latter and make sure it uses its matching haskell.packages set!" (
compose.__generateOptparseApplicativeCompletion exeName pkg
);
/*
Modify a Haskell package to add shell completion scripts for the
given executable produced by it. These completion scripts will be
picked up automatically if the resulting derivation is installed,
e.g. by `nix-env -i`.
Invocation:
generateOptparseApplicativeCompletions command pkg
command: name of an executable
pkg: Haskell package that builds the executables
*/
generateOptparseApplicativeCompletion = compose.generateOptparseApplicativeCompletion;
/*
Modify a Haskell package to add shell completion scripts for the
given executables produced by it. These completion scripts will be
picked up automatically if the resulting derivation is installed,
e.g. by `nix-env -i`.
Invocation:
generateOptparseApplicativeCompletions commands pkg
commands: name of an executable
pkg: Haskell package that builds the executables
*/
generateOptparseApplicativeCompletions = compose.generateOptparseApplicativeCompletions;
# Don't fail at configure time if there are multiple versions of the
# same package in the (recursive) dependencies of the package being
# built. Will delay failures, if any, to compile time.
allowInconsistentDependencies = compose.allowInconsistentDependencies;
}

View File

@@ -0,0 +1,757 @@
# This expression takes a file like `hackage-packages.nix` and constructs
# a full package set out of that.
{
# package-set used for build tools (all of nixpkgs)
buildPackages,
# A haskell package set for Setup.hs, compiler plugins, and similar
# build-time uses.
buildHaskellPackages,
# package-set used for non-haskell dependencies (all of nixpkgs)
pkgs,
# stdenv provides our build and host platforms
stdenv,
# this module provides the list of known licenses and maintainers
lib,
# needed for overrideCabal & packageSourceOverrides
haskellLib,
# hashes for downloading Hackage packages
# This is either a directory or a .tar.gz containing the cabal files and
# hashes of Hackage as exemplified by this repository:
# https://github.com/commercialhaskell/all-cabal-hashes/tree/hackage
all-cabal-hashes,
# compiler to use
ghc,
# A function that takes `{ pkgs, lib, callPackage }` as the first arg and
# `self` as second, and returns a set of haskell packages
package-set,
# The final, fully overridden package set usable with the nixpkgs fixpoint
# overriding functionality
extensible-self,
}:
# return value: a function from self to the package set
self:
let
inherit (stdenv) buildPlatform hostPlatform;
inherit (lib) fix' extends makeOverridable;
inherit (haskellLib) overrideCabal;
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
inherit stdenv;
nodejs = buildPackages.nodejs-slim;
inherit (self)
buildHaskellPackages
ghc
ghcWithHoogle
ghcWithPackages
;
inherit (self.buildHaskellPackages) jailbreak-cabal;
hscolour = overrideCabal (drv: {
isLibrary = false;
doHaddock = false;
hyperlinkSource = false; # Avoid depending on hscolour for this build.
postFixup = "rm -rf $out/lib $out/share $out/nix-support";
}) self.buildHaskellPackages.hscolour;
cpphs =
overrideCabal
(drv: {
isLibrary = false;
postFixup = "rm -rf $out/lib $out/share $out/nix-support";
})
(
self.cpphs.overrideScope (
self: super: {
mkDerivation =
drv:
super.mkDerivation (
drv
// {
enableSharedExecutables = false;
enableSharedLibraries = false;
doHaddock = false;
useCpphs = false;
}
);
}
)
);
};
mkDerivation = makeOverridable mkDerivationImpl;
# manualArgs are the arguments that were explicitly passed to `callPackage`, like:
#
# callPackage foo { bar = null; };
#
# here `bar` is a manual argument.
callPackageWithScope =
scope: fn: manualArgs:
let
# this code is copied from callPackage in lib/customisation.nix
#
# we cannot use `callPackage` here because we want to call `makeOverridable`
# on `drvScope` (we cannot add `overrideScope` after calling `callPackage` because then it is
# lost on `.override`) but determine the auto-args based on `drv` (the problem here
# is that nix has no way to "passthrough" args while preserving the reflection
# info that callPackage uses to determine the arguments).
drv = if lib.isFunction fn then fn else import fn;
drvFunctionArgs = lib.functionArgs drv;
auto = builtins.intersectAttrs drvFunctionArgs scope;
# Converts a returned function to a functor attribute set if necessary
ensureAttrs = v: if builtins.isFunction v then { __functor = _: v; } else v;
# this wraps the `drv` function to add `scope` and `overrideScope` to the result.
# it's a functor, so that we can pass through `functionArgs`
drvScope = {
__functor =
_: allArgs:
ensureAttrs (drv allArgs)
// {
inherit scope;
overrideScope =
f:
let
newScope = mkScope (fix' (extends f scope.__unfix__));
in
# note that we have to be careful here: `allArgs` includes the auto-arguments that
# weren't manually specified. If we would just pass `allArgs` to the recursive call here,
# then we wouldn't look up any packages in the scope in the next interation, because it
# appears as if all arguments were already manually passed, so the scope change would do
# nothing.
callPackageWithScope newScope drv manualArgs;
};
# `drvScope` accepts the same arguments as `drv`
__functionArgs = drvFunctionArgs;
};
in
lib.makeOverridable drvScope (auto // manualArgs);
mkScope =
scope:
let
ps = pkgs.__splicedPackages;
scopeSpliced =
pkgs.splicePackages {
pkgsBuildBuild = scope.buildHaskellPackages.buildHaskellPackages;
pkgsBuildHost = scope.buildHaskellPackages;
pkgsBuildTarget = { };
pkgsHostHost = { };
pkgsHostTarget = scope;
pkgsTargetTarget = { };
}
// {
# Don't splice these
inherit (scope) ghc buildHaskellPackages;
};
in
ps // ps.xorg // ps.gnome2 // { inherit stdenv; } // scopeSpliced;
defaultScope = mkScope self;
callPackage = drv: args: callPackageWithScope defaultScope drv args;
# Use cabal2nix to create a default.nix for the package sources found at 'src'.
haskellSrc2nix =
{
name,
src,
sha256 ? null,
extraCabal2nixOptions ? "",
}:
let
sha256Arg = if sha256 == null then "--sha256=" else ''--sha256="${sha256}"'';
in
buildPackages.runCommand "cabal2nix-${name}"
{
nativeBuildInputs = [ buildPackages.cabal2nix-unwrapped ];
preferLocalBuild = true;
allowSubstitutes = false;
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE = pkgs.lib.optionalString (
buildPlatform.libc == "glibc"
) "${buildPackages.glibcLocales}/lib/locale/locale-archive";
}
''
export HOME="$TMP"
mkdir -p "$out"
cabal2nix --compiler=${self.ghc.haskellCompilerName} --system=${hostPlatform.config} ${sha256Arg} "${src}" ${extraCabal2nixOptions} > "$out/default.nix"
'';
# Given a package name and version, e.g. name = "async", version = "2.2.4",
# gives its cabal file and hashes (JSON file) as discovered from the
# all-cabal-hashes value. If that's a directory, it will copy the relevant
# files to $out; if it's a tarball, it will extract and move them to $out.
all-cabal-hashes-component =
name: version:
buildPackages.runCommand "all-cabal-hashes-component-${name}-${version}" { } ''
mkdir -p $out
if [ -d ${all-cabal-hashes} ]
then
cp ${all-cabal-hashes}/${name}/${version}/${name}.json $out
cp ${all-cabal-hashes}/${name}/${version}/${name}.cabal $out
else
tar --wildcards -xzvf ${all-cabal-hashes} \*/${name}/${version}/${name}.{json,cabal}
mv */${name}/${version}/${name}.{json,cabal} $out
fi
'';
hackage2nix =
name: version:
let
component = all-cabal-hashes-component name version;
in
self.haskellSrc2nix {
name = "${name}-${version}";
sha256 = ''$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' "${component}/${name}.json")'';
src = "${component}/${name}.cabal";
};
# Adds a nix file derived from cabal2nix in the passthru of the derivation it
# produces. This is useful to debug callHackage / callCabal2nix by looking at
# the content of the nix file pointed by `cabal2nixDeriver`.
# However, it does not keep a reference to that file, which may be garbage
# collected, which may be an annoyance.
callPackageKeepDeriver =
src: args:
overrideCabal (orig: {
passthru = orig.passthru or { } // {
# When using callCabal2nix or callHackage, it is often useful
# to debug a failure by inspecting the Nix expression
# generated by cabal2nix. This can be accessed via this
# cabal2nixDeriver field.
cabal2nixDeriver = src;
};
}) (self.callPackage src args);
in
package-set { inherit pkgs lib callPackage; } self
// {
inherit
mkDerivation
callPackage
haskellSrc2nix
hackage2nix
buildHaskellPackages
;
inherit (haskellLib) packageSourceOverrides;
# callHackage :: Text -> Text -> AttrSet -> HaskellPackage
#
# e.g., while overriding a package set:
# '... foo = self.callHackage "foo" "1.5.3" {}; ...'
callHackage = name: version: callPackageKeepDeriver (self.hackage2nix name version);
# callHackageDirect
# :: { pkg :: Text, ver :: Text, sha256 :: Text }
# -> AttrSet
# -> HaskellPackage
#
# This function does not depend on all-cabal-hashes and therefore will work
# for any version that has been released on hackage as opposed to only
# versions released before whatever version of all-cabal-hashes you happen
# to be currently using.
callHackageDirect =
{
pkg,
ver,
sha256,
candidate ? false,
rev ? {
revision = null;
sha256 = null;
},
}:
args:
let
pkgver = "${pkg}-${ver}";
firstRevision = self.callCabal2nix pkg (pkgs.fetchzip {
url =
if candidate then
"mirror://hackage/${pkgver}/candidate/${pkgver}.tar.gz"
else
"mirror://hackage/${pkgver}/${pkgver}.tar.gz";
inherit sha256;
}) args;
in
overrideCabal (orig: {
revision = rev.revision;
editedCabalFile = rev.sha256;
}) firstRevision;
# Creates a Haskell package from a source package by calling cabal2nix on the source.
callCabal2nixWithOptions =
name: src: opts: args:
let
extraCabal2nixOptions = if builtins.isString opts then opts else opts.extraCabal2nixOptions or "";
srcModifier = opts.srcModifier or null;
defaultFilter = path: type: pkgs.lib.hasSuffix ".cabal" path || baseNameOf path == "package.yaml";
expr = self.haskellSrc2nix {
inherit name extraCabal2nixOptions;
src =
if srcModifier != null then
srcModifier src
else if pkgs.lib.canCleanSource src then
pkgs.lib.cleanSourceWith {
inherit src;
filter = defaultFilter;
}
else
src;
};
in
overrideCabal (orig: {
inherit src;
}) (callPackageKeepDeriver expr args);
callCabal2nix =
name: src: args:
self.callCabal2nixWithOptions name src "" args;
# : { root : Path
# , name : Defaulted String
# , source-overrides : Defaulted (Either Path VersionNumber)
# , overrides : Defaulted (HaskellPackageOverrideSet)
# , modifier : Defaulted
# , returnShellEnv : Defaulted
# , withHoogle : Defaulted
# , cabal2nixOptions : Defaulted
# } -> NixShellAwareDerivation
#
# Given a path to a haskell package directory, an optional package name
# which defaults to the base name of the path, an optional set of source
# overrides as appropriate for the 'packageSourceOverrides' function, an
# optional set of arbitrary overrides, and an optional haskell package
# modifier, return a derivation appropriate for nix-build or nix-shell to
# build that package.
#
# If 'returnShellEnv' is true this returns a derivation which will give you
# an environment suitable for developing the listed packages with an
# incremental tool like cabal-install.
#
# If 'withHoogle' is true (the default if a shell environment is requested)
# then 'ghcWithHoogle' is used to generate the derivation (instead of
# 'ghcWithPackages'), see the documentation there for more information.
#
# 'cabal2nixOptions' can contain extra command line arguments to pass to
# 'cabal2nix' when generating the package derivation, for example setting
# a cabal flag with '--flag=myflag'.
developPackage =
{
root,
name ? lib.optionalString (builtins.typeOf root == "path") (baseNameOf root),
source-overrides ? { },
overrides ? self: super: { },
modifier ? drv: drv,
returnShellEnv ? pkgs.lib.inNixShell,
withHoogle ? returnShellEnv,
cabal2nixOptions ? "",
}:
let
drv =
(extensible-self.extend (
pkgs.lib.composeExtensions (self.packageSourceOverrides source-overrides) overrides
)).callCabal2nixWithOptions
name
root
cabal2nixOptions
{ };
in
if returnShellEnv then (modifier drv).envFunc { inherit withHoogle; } else modifier drv;
# This can be used to easily create a derivation containing GHC and the specified set of Haskell packages.
#
# Example:
# $ nix-shell -p 'haskellPackages.ghcWithPackages (hpkgs: [ hpkgs.mtl hpkgs.lens ])'
# $ ghci # in the nix-shell
# Prelude > import Control.Lens
#
# GHC is setup with a package database with all the specified Haskell packages.
#
# ghcWithPackages :: (HaskellPkgSet -> [ HaskellPkg ]) -> Derivation
ghcWithPackages = buildHaskellPackages.callPackage ./with-packages-wrapper.nix {
haskellPackages = self;
inherit (self) hoogleWithPackages;
};
# Put 'hoogle' into the derivation's PATH with a database containing all
# the package's dependencies; run 'hoogle server --local' in a shell to
# host a search engine for the dependencies.
#
# Example usage:
# $ nix-shell -p 'haskellPackages.hoogleWithPackages (p: [ p.mtl p.lens ])'
# [nix-shell] $ hoogle server
#
# hoogleWithPackages :: (HaskellPkgSet -> [ HaskellPkg ]) -> Derivation
#
# To reload the Hoogle server automatically on .cabal file changes try
# this:
# echo *.cabal | entr -r -- nix-shell --run 'hoogle server --local'
hoogleWithPackages = self.callPackage ./hoogle.nix {
haskellPackages = self;
};
hoogleLocal =
{
packages ? [ ],
}:
lib.warn "hoogleLocal is deprecated, use hoogleWithPackages instead" (
self.hoogleWithPackages (_: packages)
);
# This is like a combination of ghcWithPackages and hoogleWithPackages.
# It provides a derivation containing both GHC and Hoogle with an index of
# the given Haskell package database.
#
# Example:
# $ nix-shell -p 'haskellPackages.ghcWithHoogle (hpkgs: [ hpkgs.conduit hpkgs.lens ])'
#
# ghcWithHoogle :: (HaskellPkgSet -> [ HaskellPkg ]) -> Derivation
ghcWithHoogle = self.ghcWithPackages.override {
withHoogle = true;
};
# Returns a derivation whose environment contains a GHC with only
# the dependencies of packages listed in `packages`, not the
# packages themselves. Using nix-shell on this derivation will
# give you an environment suitable for developing the listed
# packages with an incremental tool like cabal-install.
#
# In addition to the "packages" arg and "withHoogle" arg, anything that
# can be passed into stdenv.mkDerivation can be included in the input attrset
#
# # default.nix
# with import <nixpkgs> {};
# haskellPackages.extend (haskell.lib.compose.packageSourceOverrides {
# frontend = ./frontend;
# backend = ./backend;
# common = ./common;
# })
#
# # shell.nix
# let pkgs = import <nixpkgs> {} in
# (import ./.).shellFor {
# packages = p: [p.frontend p.backend p.common];
# withHoogle = true;
# buildInputs = [ pkgs.python pkgs.cabal-install ];
# }
#
# -- cabal.project
# packages:
# frontend/
# backend/
# common/
#
# bash$ nix-shell --run "cabal new-build all"
# bash$ nix-shell --run "python"
shellFor =
{
# Packages to create this development shell for. These are usually
# your local packages.
packages,
# Whether or not to generate a Hoogle database for all the
# dependencies.
withHoogle ? false,
# Whether or not to include benchmark dependencies of your local
# packages. You should set this to true if you have benchmarks defined
# in your local packages that you want to be able to run with cabal benchmark
doBenchmark ? false,
# An optional function that can modify the generic builder arguments
# for the fake package that shellFor uses to construct its environment.
#
# Example:
# let
# # elided...
# haskellPkgs = pkgs.haskell.packages.ghc884.override (hpArgs: {
# overrides = pkgs.lib.composeExtensions (hpArgs.overrides or (_: _: { })) (
# _hfinal: hprev: {
# mkDerivation = args: hprev.mkDerivation ({
# doCheck = false;
# doBenchmark = false;
# doHoogle = true;
# doHaddock = true;
# enableLibraryProfiling = false;
# enableExecutableProfiling = false;
# } // args);
# }
# );
# });
# in
# haskellPkgs.shellFor {
# packages = p: [ p.foo ];
# genericBuilderArgsModifier = args: args // { doCheck = true; doBenchmark = true };
# }
#
# This will disable tests and benchmarks for everything in "haskellPkgs"
# (which will invalidate the binary cache), and then re-enable them
# for the "shellFor" environment (ensuring that any test/benchmark
# dependencies for "foo" will be available within the nix-shell).
genericBuilderArgsModifier ? (args: args),
# Extra dependencies, in the form of cabal2nix build attributes.
#
# An example use case is when you have Haskell scripts that use
# libraries that don't occur in your packages' dependencies.
#
# Example:
#
# extraDependencies = p: {
# libraryHaskellDepends = [ p.releaser ];
# };
extraDependencies ? p: { },
...
}@args:
let
# A list of the packages we want to build a development shell for.
# This is a list of Haskell package derivations.
selected = packages self;
# This is a list of attribute sets, where each attribute set
# corresponds to the build inputs of one of the packages input to shellFor.
#
# Each attribute has keys like buildDepends, executableHaskellDepends,
# testPkgconfigDepends, etc. The values for the keys of the attribute
# set are lists of dependencies.
#
# Example:
# cabalDepsForSelected
# => [
# # This may be the attribute set corresponding to the `backend`
# # package in the example above.
# { buildDepends = [ gcc ... ];
# libraryHaskellDepends = [ lens conduit ... ];
# ...
# }
# # This may be the attribute set corresponding to the `common`
# # package in the example above.
# { testHaskellDepends = [ tasty hspec ... ];
# libraryHaskellDepends = [ lens aeson ];
# benchmarkHaskellDepends = [ criterion ... ];
# ...
# }
# ...
# ]
cabalDepsForSelected = map (p: p.getCabalDeps) selected;
# A predicate that takes a derivation as input, and tests whether it is
# the same as any of the `selected` packages.
#
# Returns true if the input derivation is not in the list of `selected`
# packages.
#
# isNotSelected :: Derivation -> Bool
#
# Example:
#
# isNotSelected common [ frontend backend common ]
# => false
#
# isNotSelected lens [ frontend backend common ]
# => true
isNotSelected = input: pkgs.lib.all (p: input.outPath or null != p.outPath) selected;
# A function that takes a list of list of derivations, filters out all
# the `selected` packages from each list, and concats the results.
#
# zipperCombinedPkgs :: [[Derivation]] -> [Derivation]
#
# Example:
# zipperCombinedPkgs [ [ lens conduit ] [ aeson frontend ] ]
# => [ lens conduit aeson ]
#
# Note: The reason this isn't just the function `pkgs.lib.concat` is
# that we need to be careful to remove dependencies that are in the
# `selected` packages.
#
# For instance, in the above example, if `common` is a dependency of
# `backend`, then zipperCombinedPkgs needs to be careful to filter out
# `common`, because cabal will end up ignoring that built version,
# assuming new-style commands.
zipperCombinedPkgs = vals: pkgs.lib.concatMap (drvList: pkgs.lib.filter isNotSelected drvList) vals;
# Zip `cabalDepsForSelected` into a single attribute list, combining
# the derivations in all the individual attributes.
#
# Example:
# packageInputs
# => # Assuming the value of cabalDepsForSelected is the same as
# # the example in cabalDepsForSelected:
# { buildDepends = [ gcc ... ];
# libraryHaskellDepends = [ lens conduit aeson ... ];
# testHaskellDepends = [ tasty hspec ... ];
# benchmarkHaskellDepends = [ criterion ... ];
# ...
# }
#
# See the Note in `zipperCombinedPkgs` for what gets filtered out from
# each of these dependency lists.
packageInputs = pkgs.lib.zipAttrsWith (_name: zipperCombinedPkgs) (
cabalDepsForSelected ++ [ (extraDependencies self) ]
);
# A attribute set to pass to `haskellPackages.mkDerivation`.
#
# The important thing to note here is that all the fields from
# packageInputs are set correctly.
genericBuilderArgs = {
pname = if pkgs.lib.length selected == 1 then (pkgs.lib.head selected).name else "packages";
version = "0";
license = null;
}
// packageInputs
// pkgs.lib.optionalAttrs doBenchmark {
# `doBenchmark` needs to explicitly be set here because haskellPackages.mkDerivation defaults it to `false`. If the user wants benchmark dependencies included in their development shell, it has to be explicitly enabled here.
doBenchmark = true;
};
# This is a pseudo Haskell package derivation that contains all the
# dependencies for the packages in `selected`.
#
# This is a derivation created with `haskellPackages.mkDerivation`.
#
# pkgWithCombinedDeps :: HaskellDerivation
pkgWithCombinedDeps = self.mkDerivation (genericBuilderArgsModifier genericBuilderArgs);
# The derivation returned from `envFunc` for `pkgWithCombinedDeps`.
#
# This is a derivation that can be run with `nix-shell`. It provides a
# GHC with a package database with all the dependencies of our
# `selected` packages.
#
# This is a derivation created with `stdenv.mkDerivation` (not
# `haskellPackages.mkDerivation`).
#
# pkgWithCombinedDepsDevDrv :: Derivation
pkgWithCombinedDepsDevDrv = pkgWithCombinedDeps.envFunc { inherit withHoogle; };
mkDerivationArgs = removeAttrs args [
"genericBuilderArgsModifier"
"packages"
"withHoogle"
"doBenchmark"
"extraDependencies"
];
in
pkgWithCombinedDepsDevDrv.overrideAttrs (
old:
mkDerivationArgs
// {
nativeBuildInputs = old.nativeBuildInputs ++ mkDerivationArgs.nativeBuildInputs or [ ];
buildInputs = old.buildInputs ++ mkDerivationArgs.buildInputs or [ ];
}
);
ghc = ghc // {
withPackages = self.ghcWithPackages;
withHoogle = self.ghcWithHoogle;
};
/*
Run `cabal sdist` on a source.
Unlike `haskell.lib.sdistTarball`, this does not require any dependencies
to be present, as it uses `cabal-install` instead of building `Setup.hs`.
This makes `cabalSdist` faster than `sdistTarball`.
*/
cabalSdist =
{
src,
name ? if src ? name then "${src.name}-sdist.tar.gz" else "source.tar.gz",
}:
pkgs.runCommandLocal name
{
inherit src;
nativeBuildInputs = [
buildHaskellPackages.cabal-install
# TODO after https://github.com/haskell/cabal/issues/8352
# remove ghc
self.ghc
];
dontUnpack = false;
}
''
unpackPhase
cd "''${sourceRoot:-.}"
patchPhase
mkdir out
HOME=$PWD cabal sdist --output-directory out
mv out/*.tar.gz $out
'';
/*
Like `haskell.lib.buildFromSdist`, but using `cabal sdist` instead of
building `./Setup`.
Unlike `haskell.lib.buildFromSdist`, this does not require any dependencies
to be present. This makes `buildFromCabalSdist` faster than `haskell.lib.buildFromSdist`.
*/
buildFromCabalSdist =
pkg:
haskellLib.overrideSrc {
src = self.cabalSdist { inherit (pkg) src; };
version = pkg.version;
} pkg;
/*
Modify a Haskell package to add shell completion scripts for the
given executables produced by it. These completion scripts will be
picked up automatically if the resulting derivation is installed,
e.g. by `nix-env -i`.
This depends on the `--*-completion` flag `optparse-applicative` provides
automatically. Since we need to invoke installed executables, completions
are not generated if we are cross-compiling.
commands: names of the executables built by the derivation
pkg: Haskell package that builds the executables
Example:
generateOptparseApplicativeCompletions [ "exec1" "exec2" ] pkg
Type: [str] -> drv -> drv
*/
generateOptparseApplicativeCompletions = self.callPackage (
{ stdenv }:
commands: pkg:
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
lib.foldr haskellLib.__generateOptparseApplicativeCompletion pkg commands
else
pkg
) { };
/*
Modify given Haskell package to force GHC to employ the LLVM
codegen backend when compiling. Useful when working around bugs
in a native codegen backend GHC defaults to.
Example:
forceLlvmCodegenBackend tls
Type: drv -> drv
*/
forceLlvmCodegenBackend = overrideCabal (drv: {
configureFlags = drv.configureFlags or [ ] ++ [ "--ghc-option=-fllvm" ];
buildTools =
drv.buildTools or [ ]
++ [ self.ghc.llvmPackages.llvm ]
# GHC >= 9.10 needs LLVM specific assembler, i.e. clang
# On Darwin clang is always required
++ lib.optionals (lib.versionAtLeast self.ghc.version "9.10" || stdenv.hostPlatform.isDarwin) [
self.ghc.llvmPackages.clang
];
});
}

View File

@@ -0,0 +1,58 @@
{ pkgs, haskellLib }:
let
inherit (pkgs) lib;
inherit (lib.strings) hasSuffix removeSuffix;
pathsByName = lib.concatMapAttrs (
name: type:
lib.optionalAttrs (type == "regular" && hasSuffix ".nix" name) {
${removeSuffix ".nix" name} = ./replacements-by-name + "/${name}";
}
) (builtins.readDir ./replacements-by-name);
in
# EXTRA HASKELL PACKAGES NOT ON HACKAGE
#
# This file should only contain packages that are not in ./hackage-packages.nix.
# Attributes in this set should be nothing more than a callPackage call.
# Overrides to these packages should go to either configuration-nix.nix,
# configuration-common.nix or to one of the compiler specific configuration
# files.
self: super:
{
changelog-d = self.callPackage ../misc/haskell/changelog-d { };
dconf2nix = self.callPackage ../tools/haskell/dconf2nix/dconf2nix.nix { };
# Used by maintainers/scripts/regenerate-hackage-packages.sh, and generated
# from the latest master instead of the current version on Hackage.
cabal2nix-unstable = self.callPackage ./cabal2nix-unstable/cabal2nix.nix {
distribution-nixpkgs = self.distribution-nixpkgs-unstable;
hackage-db = self.hackage-db-unstable;
language-nix = self.language-nix-unstable;
};
distribution-nixpkgs-unstable = self.callPackage ./cabal2nix-unstable/distribution-nixpkgs.nix {
language-nix = self.language-nix-unstable;
};
hackage-db-unstable = self.callPackage ./cabal2nix-unstable/hackage-db.nix { };
language-nix-unstable = self.callPackage ./cabal2nix-unstable/language-nix.nix { };
ghc-settings-edit = self.callPackage ../tools/haskell/ghc-settings-edit { };
# https://github.com/channable/vaultenv/issues/1
vaultenv = self.callPackage ../tools/haskell/vaultenv { };
# spago-legacy is not released to Hackage.
# https://github.com/spacchetti/spago/issues/512
spago-legacy = self.callPackage ../../by-name/sp/spago-legacy/spago-legacy.nix { };
# Unofficial fork until PRs are merged https://github.com/pcapriotti/optparse-applicative/pulls/roberth
# cabal2nix --maintainer roberth https://github.com/hercules-ci/optparse-applicative.git > pkgs/development/misc/haskell/hercules-ci-optparse-applicative.nix
hercules-ci-optparse-applicative =
self.callPackage ../misc/haskell/hercules-ci-optparse-applicative.nix
{ };
}
// lib.mapAttrs (_name: path: self.callPackage path { }) pathsByName

View File

@@ -0,0 +1,33 @@
{
runCommand,
haskellPackages,
lib,
all-cabal-hashes,
}:
let
# Checks if the version looks like a Haskell PVP version which is the format
# Hackage enforces. This will return false if the version strings is empty or
# we've overridden the package to ship an unstable version of the package
# (sadly there's no good way to show something useful on hackage in this case).
isPvpVersion = v: builtins.match "([0-9]+)(\\.[0-9]+)*" v != null;
pkgLine =
name: pkg:
let
version = pkg.version or "";
in
lib.optionalString (isPvpVersion version && (pkg.meta.hydraPlatforms or null) != lib.platforms.none)
''"${name}","${version}","http://hydra.nixos.org/job/nixpkgs/trunk/haskellPackages.${name}.x86_64-linux"'';
all-haskellPackages = builtins.toFile "all-haskellPackages" (
lib.concatStringsSep "\n" (lib.filter (x: x != "") (lib.mapAttrsToList pkgLine haskellPackages))
);
in
runCommand "hackage-package-list" { }
# This command will make a join between all packages on hackage and haskellPackages.*.
# It ignores packages marked as broken (according to hydraPlatforms)
# It creates a valid csv file which can be uploaded to hackage.haskell.org.
# The call is wrapped in echo $(...) to trim trailing newline, which hackage requires.
''
mkdir -p $out/bin
echo -n "$(tar -t -f ${all-cabal-hashes} | sed 's![^/]*/\([^/]*\)/.*!"\1"!' | sort -u | join -t , - ${all-haskellPackages})" > $out/nixos-hackage-packages.csv
''

View File

@@ -0,0 +1,12 @@
diff --git a/GLUT.cabal b/GLUT.cabal
index f370d6c..a404e1e 100644
--- a/GLUT.cabal
+++ b/GLUT.cabal
@@ -103,6 +103,7 @@ library
else
cpp-options: "-DCALLCONV=ccall"
cc-options: "-DUSE_DLSYM"
+ pkgconfig-depends: glut
executable BOGLGP01-OnYourOwn1
if !flag(BuildExamples)

View File

@@ -0,0 +1,17 @@
diff --git a/HSH/ShellEquivs.hs b/HSH/ShellEquivs.hs
index f9287e8..b132737 100644
--- a/HSH/ShellEquivs.hs
+++ b/HSH/ShellEquivs.hs
@@ -223,9 +223,9 @@ catToFIFO fp ichan =
return (ChanString "")
fifoOpen :: FilePath -> IO Handle
-fifoOpen fp =
- do fd <- throwErrnoPathIf (< 0) "HSH fifoOpen" fp $
- openFd fp WriteOnly Nothing defaultFileFlags
+fifoOpen fp =
+ do fd <- throwErrnoPathIf (< 0) "HSH fifoOpen" fp $
+ openFd fp WriteOnly defaultFileFlags
fdToHandle fd
#endif

View File

@@ -0,0 +1,9 @@
--- SDL-image-0.6.2.0/Graphics/UI/SDL/Image/Version.hsc.orig 2021-08-06 01:21:05.000000000 +0200
+++ SDL-image-0.6.2.0/Graphics/UI/SDL/Image/Version.hsc 2021-08-06 01:21:56.000000000 +0200
@@ -1,4 +1,6 @@
#include "SDL_image.h"
+-- override SDL_main.h redefining main to SDL_main on darwin
+#define main main
module Graphics.UI.SDL.Image.Version
( compiledFor
, linkedWith

View File

@@ -0,0 +1,9 @@
--- SDL-ttf-0.6.3.0/Graphics/UI/SDL/TTF/Version.hsc.orig 2021-08-06 01:31:39.000000000 +0200
+++ SDL-ttf-0.6.3.0/Graphics/UI/SDL/TTF/Version.hsc 2021-08-06 01:32:03.000000000 +0200
@@ -1,4 +1,6 @@
#include "SDL_ttf.h"
+-- override SDL_main.h redefining main to SDL_main on darwin
+#define main main
module Graphics.UI.SDL.TTF.Version
( compiledFor
, linkedWith

View File

@@ -0,0 +1,11 @@
--- a/cabal-install.cabal
+++ b/cabal-install.cabal
@@ -275,7 +275,7 @@
, directory >=1.3.1.0
else
build-depends:
- , unix >= 2.5 && < 2.8 || >= 2.8.6.0 && < 2.9
+ , unix >= 2.5 && < 2.9
if flag(lukko)
build-depends:

View File

@@ -0,0 +1,23 @@
diff --git a/Cheapskate/Parse.hs b/Cheapskate/Parse.hs
index b90d8e5..2925132 100644
--- a/Cheapskate/Parse.hs
+++ b/Cheapskate/Parse.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE CPP #-}
module Cheapskate.Parse (
markdown
) where
@@ -21,6 +22,12 @@ import Control.Applicative
import qualified Data.Map as M
import Data.List (intercalate)
+#if MIN_VERSION_mtl(2, 3, 0)
+import Control.Monad (guard, unless, replicateM)
+#else
+#endif
+
+
import Debug.Trace
-- | Parses the input as a markdown document. Note that 'Doc' is an instance

View File

@@ -0,0 +1,69 @@
diff --git a/Crypto/KDF/Argon2.hs b/Crypto/KDF/Argon2.hs
index 044ba00..31dc6f1 100644
--- a/Crypto/KDF/Argon2.hs
+++ b/Crypto/KDF/Argon2.hs
@@ -12,6 +12,7 @@
-- File started from Argon2.hs, from Oliver Charles
-- at https://github.com/ocharles/argon2
--
+{-# LANGUAGE DataKinds #-}
module Crypto.KDF.Argon2
(
Options(..)
@@ -32,6 +33,7 @@ import Control.Monad (when)
import Data.Word
import Foreign.C
import Foreign.Ptr
+import Data.Proxy
-- | Which variant of Argon2 to use. You should choose the variant that is most
-- applicable to your intention to hash inputs.
@@ -100,33 +102,12 @@ defaultOptions =
}
hash :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out)
- => Options
+ => [Proxy "cryptonite:Crypto.KDF.Argon2.hash is known to be broken on this architecture. See https://github.com/haskell-crypto/cryptonite/issues/360"]
-> password
-> salt
-> Int
-> CryptoFailable out
-hash options password salt outLen
- | saltLen < saltMinLength = CryptoFailed CryptoError_SaltTooSmall
- | outLen < outputMinLength = CryptoFailed CryptoError_OutputLengthTooSmall
- | outLen > outputMaxLength = CryptoFailed CryptoError_OutputLengthTooBig
- | otherwise = CryptoPassed $ B.allocAndFreeze outLen $ \out -> do
- res <- B.withByteArray password $ \pPass ->
- B.withByteArray salt $ \pSalt ->
- argon2_hash (iterations options)
- (memory options)
- (parallelism options)
- pPass
- (csizeOfInt passwordLen)
- pSalt
- (csizeOfInt saltLen)
- out
- (csizeOfInt outLen)
- (cOfVariant $ variant options)
- (cOfVersion $ version options)
- when (res /= 0) $ error "argon2: hash: internal error"
- where
- saltLen = B.length salt
- passwordLen = B.length password
+hash options password salt outLen = error "cryptonite:Crypto.KDF.Argon2.hash is known to be broken on this architecture. See https://github.com/haskell-crypto/cryptonite/issues/360"
data Pass
data Salt
diff --git a/tests/KAT_Argon2.hs b/tests/KAT_Argon2.hs
index a347fc5..fdba079 100644
--- a/tests/KAT_Argon2.hs
+++ b/tests/KAT_Argon2.hs
@@ -32,7 +32,7 @@ kdfTests = zipWith toKDFTest is vectors
where
toKDFTest i v =
testCase (show i)
- (CryptoPassed (kdfResult v) @=? Argon2.hash (kdfOptions v) (kdfPass v) (kdfSalt v) (B.length $ kdfResult v))
+ (pure ())
is :: [Int]
is = [1..]

View File

@@ -0,0 +1,24 @@
diff -rN -u old-darcs.net/darcs.cabal new-darcs.net/darcs.cabal
--- old-darcs.net/darcs.cabal 2025-09-13 02:45:32.790227974 +0200
+++ new-darcs.net/darcs.cabal 2025-09-13 02:45:32.791227985 +0200
@@ -124,7 +124,7 @@
custom-setup
setup-depends: base >= 4.10 && < 4.20,
- Cabal >= 2.4 && < 3.11,
+ Cabal >= 2.4 && < 3.13,
process >= 1.2.3.0 && < 1.7,
filepath >= 1.4.1 && < 1.5.0.0,
directory >= 1.2.7 && < 1.4
diff -rN -u old-darcs.net/Setup.hs new-darcs.net/Setup.hs
--- old-darcs.net/Setup.hs 2025-09-13 02:45:32.789227964 +0200
+++ new-darcs.net/Setup.hs 2025-09-13 02:45:32.790227974 +0200
@@ -8,7 +8,7 @@
import Distribution.Package ( packageVersion )
import Distribution.Version( Version )
import Distribution.Simple.LocalBuildInfo
- ( LocalBuildInfo(..), absoluteInstallDirs )
+ ( LocalBuildInfo(..), absoluteInstallDirs, buildDir )
import Distribution.Simple.InstallDirs (mandir, CopyDest (NoCopyDest))
import Distribution.Simple.Setup
(buildVerbosity, copyDest, copyVerbosity, fromFlag,

View File

@@ -0,0 +1,32 @@
diff -rN -u old-darcs.net/darcs.cabal new-darcs.net/darcs.cabal
--- old-darcs.net/darcs.cabal 2025-09-13 02:46:05.662572580 +0200
+++ new-darcs.net/darcs.cabal 2025-09-13 02:46:05.748573468 +0200
@@ -123,7 +123,7 @@
-- ----------------------------------------------------------------------
custom-setup
- setup-depends: base >= 4.10 && < 4.20,
+ setup-depends: base >= 4.10 && < 4.21,
Cabal >= 2.4 && < 3.13,
process >= 1.2.3.0 && < 1.7,
filepath >= 1.4.1 && < 1.5.0.0,
@@ -412,7 +412,7 @@
else
build-depends: unix >= 2.7.1.0 && < 2.9
- build-depends: base >= 4.10 && < 4.20,
+ build-depends: base >= 4.10 && < 4.21,
safe >= 0.3.20 && < 0.4,
stm >= 2.1 && < 2.6,
binary >= 0.5 && < 0.11,
@@ -447,7 +447,7 @@
temporary >= 1.2.1 && < 1.4,
process >= 1.2.3.0 && < 1.7,
array >= 0.5.1.0 && < 0.6,
- hashable >= 1.2.3.3 && < 1.5,
+ hashable >= 1.2.3.3 && < 1.6,
mmap >= 0.5.9 && < 0.6,
zlib >= 0.6.1.2 && < 0.8,
network-uri >= 2.6 && < 2.8,

View File

@@ -0,0 +1,67 @@
From 67bb87ceff53f0178c988dd4e15eeb2daee92b84 Mon Sep 17 00:00:00 2001
From: Gregor Kleen <pngwjpgh@users.noreply.github.com>
Date: Tue, 20 Feb 2018 17:46:24 +0100
Subject: [PATCH] Relax upper version bounds on dependencies
---
Setup.hs | 20 ++++++++++++++++----
encoding.cabal | 4 ++--
stack.yaml | 4 ++--
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/Setup.hs b/Setup.hs
index de719e6..fe5b84c 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,13 +1,25 @@
+{-# LANGUAGE CPP #-}
+
module Main where
import Distribution.Simple
import Data.Encoding.Preprocessor.Mapping
import Data.Encoding.Preprocessor.XMLMappingBuilder
+#if MIN_VERSION_Cabal(2,0,0)
+main = defaultMainWithHooks (simpleUserHooks
+ {hookedPreProcessors = ( ("mapping" , \_ _ _ -> mappingPreprocessor)
+ : ("mapping2", \_ _ _ -> mappingPreprocessor)
+ : ("xml" , \_ _ _ -> xmlPreprocessor)
+ : (hookedPreProcessors simpleUserHooks)
+ )
+ })
+#else
main = defaultMainWithHooks (simpleUserHooks
- {hookedPreProcessors = (("mapping",\_ _ -> mappingPreprocessor)
- :("mapping2",\_ _ -> mappingPreprocessor)
- :("xml",\_ _ -> xmlPreprocessor)
- :(hookedPreProcessors simpleUserHooks)
+ {hookedPreProcessors = ( ("mapping" , \_ _ -> mappingPreprocessor)
+ : ("mapping2", \_ _ -> mappingPreprocessor)
+ : ("xml" , \_ _ -> xmlPreprocessor)
+ : (hookedPreProcessors simpleUserHooks)
)
})
+#endif
diff --git a/encoding.cabal b/encoding.cabal
index ec20617..f221715 100644
--- a/encoding.cabal
+++ b/encoding.cabal
@@ -36,7 +36,7 @@ Source-Repository this
Custom-Setup
Setup-Depends: base >=3 && <5,
- Cabal >=1.24 && <1.25,
+ Cabal >=1.24 && <2.1,
containers,
filepath,
ghc-prim,
@@ -51,7 +51,7 @@ Library
extensible-exceptions >=0.1 && <0.2,
ghc-prim >=0.3 && <0.6,
mtl >=2.0 && <2.3,
- regex-compat >=0.71 && <0.95
+ regex-compat >=0.71 && <0.96
Extensions: CPP

View File

@@ -0,0 +1,43 @@
diff -Naur ghc-paths-0.1.0.9/GHC/Paths.hs ghc-paths-0.1.0.9-new/GHC/Paths.hs
--- ghc-paths-0.1.0.9/GHC/Paths.hs 2012-12-16 13:53:45.720148396 +0100
+++ ghc-paths-0.1.0.9-new/GHC/Paths.hs 2012-12-16 17:22:12.765576568 +0100
@@ -1,13 +1,35 @@
{-# LANGUAGE CPP #-}
+{-# LANGUAGE ScopedTypeVariables #-}
module GHC.Paths (
ghc, ghc_pkg, libdir, docdir
) where
+import Control.Exception as E
+import Data.Maybe
+import System.Environment
+import System.IO.Unsafe
+
+-- Yes, there's lookupEnv now, but we want to be compatible
+-- with older GHCs.
+checkEnv :: String -> IO (Maybe String)
+checkEnv var = E.catch (fmap Just (getEnv var))
+ (\ (e :: IOException) -> return Nothing)
+
+nixLibdir, nixDocdir, nixGhc, nixGhcPkg :: Maybe FilePath
+nixLibdir = unsafePerformIO (checkEnv "NIX_GHC_LIBDIR")
+nixDocdir = unsafePerformIO (checkEnv "NIX_GHC_DOCDIR")
+nixGhc = unsafePerformIO (checkEnv "NIX_GHC")
+nixGhcPkg = unsafePerformIO (checkEnv "NIX_GHCPKG")
+{-# NOINLINE nixLibdir #-}
+{-# NOINLINE nixDocdir #-}
+{-# NOINLINE nixGhc #-}
+{-# NOINLINE nixGhcPkg #-}
+
libdir, docdir, ghc, ghc_pkg :: FilePath
-libdir = GHC_PATHS_LIBDIR
-docdir = GHC_PATHS_DOCDIR
+libdir = fromMaybe GHC_PATHS_LIBDIR nixLibdir
+docdir = fromMaybe GHC_PATHS_DOCDIR nixDocdir
-ghc = GHC_PATHS_GHC
-ghc_pkg = GHC_PATHS_GHC_PKG
+ghc = fromMaybe GHC_PATHS_GHC nixGhc
+ghc_pkg = fromMaybe GHC_PATHS_GHC_PKG nixGhcPkg

View File

@@ -0,0 +1,13 @@
diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs
index 896b89b991..6cbb4f90ae 100644
--- a/Utility/FreeDesktop.hs
+++ b/Utility/FreeDesktop.hs
@@ -106,7 +106,7 @@ desktopfile f = toOsPath $ f ++ ".desktop"
{- Directory used for installation of system wide data files.. -}
systemDataDir :: OsPath
-systemDataDir = literalOsPath "/usr/share"
+systemDataDir = literalOsPath "/share"
{- Directory used for installation of system wide config files. -}
systemConfigDir :: OsPath

View File

@@ -0,0 +1,40 @@
diff --git a/Data/GraphViz/Commands.hs b/Data/GraphViz/Commands.hs
index 20e7dbe..514c29d 100644
--- a/Data/GraphViz/Commands.hs
+++ b/Data/GraphViz/Commands.hs
@@ -63,14 +63,14 @@ import System.IO (Handle, hPutStrLn, hSetBinaryMode, stderr)
-- -----------------------------------------------------------------------------
showCmd :: GraphvizCommand -> String
-showCmd Dot = "dot"
-showCmd Neato = "neato"
-showCmd TwoPi = "twopi"
-showCmd Circo = "circo"
-showCmd Fdp = "fdp"
-showCmd Sfdp = "sfdp"
-showCmd Osage = "osage"
-showCmd Patchwork = "patchwork"
+showCmd Dot = "@graphviz@/bin/dot"
+showCmd Neato = "@graphviz@/bin/neato"
+showCmd TwoPi = "@graphviz@/bin/twopi"
+showCmd Circo = "@graphviz@/bin/circo"
+showCmd Fdp = "@graphviz@/bin/fdp"
+showCmd Sfdp = "@graphviz@/bin/sfdp"
+showCmd Osage = "@graphviz@/bin/osage"
+showCmd Patchwork = "@graphviz@/bin/patchwork"
-- | The default command for directed graphs.
dirCommand :: GraphvizCommand
@@ -312,8 +312,11 @@ runGraphvizCanvas' d = runGraphvizCanvas (commandFor d) d
-- | Is the Graphviz suite of tools installed? This is determined by
-- whether @dot@ is available in the @PATH@.
+--
+-- Note: With nixpkgs, this will always return 'True' as graphviz'
+-- store paths are hardcoded instead of looking at @PATH@.
isGraphvizInstalled :: IO Bool
-isGraphvizInstalled = liftM isJust . findExecutable $ showCmd Dot
+isGraphvizInstalled = pure True -- :)
-- | If Graphviz does not seem to be available, print the provided
-- error message and then exit fatally.

View File

@@ -0,0 +1,52 @@
diff -rN -u old-mbox/Data/MBox/String.hs new-mbox/Data/MBox/String.hs
--- old-mbox/Data/MBox/String.hs 2022-11-22 19:14:52.332543098 +0100
+++ new-mbox/Data/MBox/String.hs 2022-11-22 19:14:52.332543098 +0100
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
{- |
@@ -31,7 +32,11 @@
-- | Reads a date header as a UTCTime
parseDateHeader :: String -> Maybe UTCTime
parseDateHeader header = listToMaybe . catMaybes $ map tryParse formats where
+#if MIN_VERSION_time(1,9,0)
+ tryParse f = parseTimeM True LC.defaultTimeLocale f header
+#else
tryParse f = parseTime LC.defaultTimeLocale f header
+#endif
formats =
[ "%a, %_d %b %Y %T %z"
, "%a, %_d %b %Y %T %Z"
diff -rN -u old-mbox/Data/MBox.hs new-mbox/Data/MBox.hs
--- old-mbox/Data/MBox.hs 2022-11-22 19:14:52.332543098 +0100
+++ new-mbox/Data/MBox.hs 2022-11-22 19:14:52.332543098 +0100
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE ViewPatterns #-}
-----------------------------------------------------------------------------
@@ -34,7 +35,11 @@
parseDateHeader :: T.Text -> Maybe UTCTime
parseDateHeader txt = listToMaybe . catMaybes $ map tryParse formats where
header = T.unpack txt
+#if MIN_VERSION_time(1,9,0)
+ tryParse f = parseTimeM True LC.defaultTimeLocale f header
+#else
tryParse f = parseTime LC.defaultTimeLocale f header
+#endif
formats =
[ "%a, %_d %b %Y %T %z"
, "%a, %_d %b %Y %T %Z"
diff -rN -u old-mbox/mbox.cabal new-mbox/mbox.cabal
--- old-mbox/mbox.cabal 2022-11-22 19:14:52.332543098 +0100
+++ new-mbox/mbox.cabal 2022-11-22 19:14:52.332543098 +0100
@@ -13,7 +13,7 @@
Cabal-Version: >= 1.6
library
- build-depends: base >= 4, base < 6, safe, time < 1.9, time-locale-compat, text
+ build-depends: base >= 4, base < 6, safe, time, time-locale-compat, text
exposed-modules: Data.MBox, Data.MBox.String
ghc-options: -Wall

View File

@@ -0,0 +1,137 @@
From ae9f8db059b6093092f6bd5155d55557c0892a4e Mon Sep 17 00:00:00 2001
From: Markus Theil <theil.markus@gmail.com>
Date: Sat, 5 Oct 2024 11:44:45 +0200
Subject: [PATCH] regenerate test certificate to work with OpenSSL security
level 2
Signed-off-by: Markus Theil <theil.markus@gmail.com>
---
test/cert.pem | 43 ++++++++++++++++++++++++---------
test/key.pem | 67 +++++++++++++++++++++++++++++++++++++++------------
2 files changed, 83 insertions(+), 27 deletions(-)
diff --git a/test/cert.pem b/test/cert.pem
index 13a87f5..a9dd418 100644
--- a/test/cert.pem
+++ b/test/cert.pem
@@ -1,14 +1,33 @@
-----BEGIN CERTIFICATE-----
-MIICOzCCAaQCCQChUcwtek3F7DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQGEwJD
-SDEPMA0GA1UECAwGWnVyaWNoMQ8wDQYDVQQHDAZadXJpY2gxFzAVBgNVBAoMDlNu
-YXAgRnJhbWV3b3JrMRgwFgYDVQQDDA9HcmVnb3J5IENvbGxpbnMwHhcNMTAxMjEx
-MTk1MjA0WhcNMzgwNDI3MTk1MjA0WjBiMQswCQYDVQQGEwJDSDEPMA0GA1UECAwG
-WnVyaWNoMQ8wDQYDVQQHDAZadXJpY2gxFzAVBgNVBAoMDlNuYXAgRnJhbWV3b3Jr
-MRgwFgYDVQQDDA9HcmVnb3J5IENvbGxpbnMwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
-MIGJAoGBAMcWrmVJ0xn3JcKf+b8Y+Bs+rRacodl/R+N7UJXTyfkByB7bzN6VR2h8
-oRYJu7DhETs/w4o/Af9vNwsJBJVovcbV6FAAbl45TMDq2QZVtPwwTDi8R52QbRIR
-WBxge3aHeMUz1hV32iMzGPVe4jKSaO2KcbVOFphwc8VmA59GvShfAgMBAAEwDQYJ
-KoZIhvcNAQEFBQADgYEAXsRchaVlL4RP5V+r1npL7n4W3Ge2O7F+fQ2dX6tNyqeo
-tMAdc6wYahg3m+PejWASVCh0vVEjBx2WYOMRPsmk/DYLUi4UwZYPrvZtbfSbMrD+
-mYmZhqCDM4316qAg5OwcTON3+VZXMwbXCVM+vUCvZIw4xh6ywNjvuQjCzy7oKMg=
+MIIFpTCCA42gAwIBAgIUJuFs2fMmpGUlm+CT7l6v2LdnpeEwDQYJKoZIhvcNAQEL
+BQAwYjELMAkGA1UEBhMCQ0gxDzANBgNVBAgMBlp1cmljaDEPMA0GA1UEBwwGWnVy
+aWNoMRcwFQYDVQQKDA5TbmFwIEZyYW1ld29yazEYMBYGA1UEAwwPR3JlZ29yeSBD
+b2xsaW5zMB4XDTI0MTAwNTA5NDM1NFoXDTQ0MDkzMDA5NDM1NFowYjELMAkGA1UE
+BhMCQ0gxDzANBgNVBAgMBlp1cmljaDEPMA0GA1UEBwwGWnVyaWNoMRcwFQYDVQQK
+DA5TbmFwIEZyYW1ld29yazEYMBYGA1UEAwwPR3JlZ29yeSBDb2xsaW5zMIICIjAN
+BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA26OMdBRG9IybxVYY49z5xp4adabK
+QKMgBctSbY9+AXQ8dR0mPswQRMNG0upQyJJPTFXUBvKr2N2K00XbWIMifwhCfkBo
+9/JsOuQLNH1Dc627/amx9fuRrJJBnVUOZ9YOg9ytjaItXQ0rngv+lz8EH8IL8SB5
+AQJr+MRRNr5JD44+/+au3oyL3eoDkb/MT3y2dyUCX7Kuk49h5iiTsPDp6DLQLxl2
+YegJNh67qrw0gBSjhB0s0Yv7EqVeKTNEx89SkIdOSXh+S3Sf1foAU0Aq3v0a6aIh
+MLrN5Fo3TjQbhF9mlRjYZOM7HbrZsz7X6t77y9Ac4lgFWhbrCdtKFnwP3X1qHAou
+jfzwmnC7Z7h7rzoS0opjE29UcuOPaA7Jw/rbl3SpAab1UVVhOdMxvkJ+gshdJT8W
+uAoovhuyhtimM7l4vkwPqSD5y+h+zNiW5Lx1H1kAsyHeQ8zOI/wnuW4VjvhUb/Q+
+LZWXmzEBZdGXZloj11py6B3b83atHU+R2LZQnDhnjU15JBG7WN7/anExz3Q7rRfs
+oYHa5qoV+sol53VIJDj+6nsJGfbr1WAonLxDOc8B3E7uu6fGSLeoTZj+hKCZhhsD
+1jnlGG1skpYqf+ECXgq8TGlFRjn6ae3Z7Tq/UFu0a+cbsHHBSUwKG17mtaaqbDeY
+8kWUWNDKtUSewb0CAwEAAaNTMFEwHQYDVR0OBBYEFDj0ry4aPDK4/pbxzbLdUrtN
+4EuXMB8GA1UdIwQYMBaAFDj0ry4aPDK4/pbxzbLdUrtN4EuXMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQELBQADggIBACct1UKUYYORYcjV96HuPVQSN00iLLUj
+C2QWfF2rF6sToX46oEHfwtIpBT3kATB2G8Ltt5OBohek0eLpGIaJyMYlhiRb6ubz
+O8jcgD2d0FKEBAIEYK+UvuKakWKY3C72zNzL89KOkCqS5o8dYXhMtxPi/ncAdyUa
+jIKHhZx1gYIkaYRVgnnLk4NrpIH3WZmwGj5y/k8ha4vvbfg4pf04FAWliqmD+30E
+qyF0GtxhVN7ZffEn610i9DCsxQet5DiThlZMB9gSZK0VqvTdaKR7qmAohEe5mKBr
+/MbERm8E36B1sW3uGTJLu/irFZtoez2IYNBJaatkKjk3bv+cHKV3E/VTKMMKFtLS
+poLtaAZpuLr4Lg1RS1dCU2f6NaNYuKl30ROAf8ro++8Rnn1WMVc+8x3EhyMJzJYT
++NLnB+8PnoOj2jkc0lY+AqbwSREIivRoN1frbqHfsyZc8Mkds1FUCHLun77LMBVi
+HwmG1frnJ6X9actf1sQqXSqD0URenqTpZSu8YKAkhH3oaKm5I0IyYUeynCk1ck8G
+PyiRk2sj4II7nrzZOCJSJsgDweZdqoul3qKki4V/4+sMgmsAIHJYy/nCwl1HThQ8
+XY15cF3dnf1bcly1ooj7bL4DrPuG1oWpzDIlIkJ+ZTsPrKK3/Vy2pUkklKowmq3w
+qHcAZ2oKVR1s
-----END CERTIFICATE-----
diff --git a/test/key.pem b/test/key.pem
index 3db6603..ef99b04 100644
--- a/test/key.pem
+++ b/test/key.pem
@@ -1,15 +1,52 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXgIBAAKBgQDHFq5lSdMZ9yXCn/m/GPgbPq0WnKHZf0fje1CV08n5Acge28ze
-lUdofKEWCbuw4RE7P8OKPwH/bzcLCQSVaL3G1ehQAG5eOUzA6tkGVbT8MEw4vEed
-kG0SEVgcYHt2h3jFM9YVd9ojMxj1XuIykmjtinG1ThaYcHPFZgOfRr0oXwIDAQAB
-AoGBAIr+p9UpfIvFRASkYd3sFdQXpwqBYnIR7ePBBVsFWR5TAx+gP2ErAYbOdDyJ
-oRN1nu0psGBFaySlxd0bd6rETLFXMWbA0uDJcqASrlsOhsbhgPH7aExYfAi7eX8h
-FAwD//j2E1sS6WvNWu0YANKR2yrM9R0vcbt0GF7hlmyV7lhRAkEA+6DCI6nfbdvR
-jkvaxzOdC9jY/eBI9a4BbyjPLUSlTuQsGrp6s0Sj1LOQscItzqkPSutugM3f1dlG
-lqq31/fnqQJBAMqMOknRBlOZY8DBfCorvNXAjIenoqlqE1D4yTL+tE5C3zEyvTcF
-jPAaX220vf1OkL1bX4jKUxx8uXIqiYND9McCQQCWoWWWc9qMqUqJJF+TYBJjRSyg
-zeLfL4ssQAHF15Id5/l/BqLtLenlKpkz0EobrJi7ALTl5lhYa/kVuJzVbFIBAkEA
-shE17U9mUHi5yexQTILHMORmp5wo1Of8s2ME/2ANBACmV4pT7ttiXHPTEY+kt90q
-Qk7iXlABYToFjuj2nABSYQJAO6W9P18mM2p6vkiBuNReW6VN/ftYqq5TLK3hXh2Q
-0d5v0eW9ce7CiQueH5kxq44EVVTIDiVLe2pk+BQIntMC8w==
------END RSA PRIVATE KEY-----
+-----BEGIN PRIVATE KEY-----
+MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDbo4x0FEb0jJvF
+Vhjj3PnGnhp1pspAoyAFy1Jtj34BdDx1HSY+zBBEw0bS6lDIkk9MVdQG8qvY3YrT
+RdtYgyJ/CEJ+QGj38mw65As0fUNzrbv9qbH1+5GskkGdVQ5n1g6D3K2Noi1dDSue
+C/6XPwQfwgvxIHkBAmv4xFE2vkkPjj7/5q7ejIvd6gORv8xPfLZ3JQJfsq6Tj2Hm
+KJOw8OnoMtAvGXZh6Ak2HruqvDSAFKOEHSzRi/sSpV4pM0THz1KQh05JeH5LdJ/V
++gBTQCre/RrpoiEwus3kWjdONBuEX2aVGNhk4zsdutmzPtfq3vvL0BziWAVaFusJ
+20oWfA/dfWocCi6N/PCacLtnuHuvOhLSimMTb1Ry449oDsnD+tuXdKkBpvVRVWE5
+0zG+Qn6CyF0lPxa4Cii+G7KG2KYzuXi+TA+pIPnL6H7M2JbkvHUfWQCzId5DzM4j
+/Ce5bhWO+FRv9D4tlZebMQFl0ZdmWiPXWnLoHdvzdq0dT5HYtlCcOGeNTXkkEbtY
+3v9qcTHPdDutF+yhgdrmqhX6yiXndUgkOP7qewkZ9uvVYCicvEM5zwHcTu67p8ZI
+t6hNmP6EoJmGGwPWOeUYbWySlip/4QJeCrxMaUVGOfpp7dntOr9QW7Rr5xuwccFJ
+TAobXua1pqpsN5jyRZRY0Mq1RJ7BvQIDAQABAoICAAIB114rM5p3W31nmUV3Ju2J
+Uy6+kLbGVtv+skOP42P82DLuH9lEkPnT5VvhlM3pxQw/9OFVtTt/i3h9TlvGIln8
+rRY4HU12G3DuqxSLzYKV30kvlGcDVB7lMkYkuW46VE/LrpFZXqaXoM2qXeVWHSye
+H8ZQbef+tJZlfY7YGSpUJOAT+gaiIa1sPqPwbQalRN9HXmNvVQLtCpppcK9rWt6K
+nQDv2mIFgRS2c1rEKrWomqBHNPo67YHg3YCtDYScRiyjHpRzeQdUVZlFa4cskl0P
+J+sOgSpPwWMZbkvKaZ2hfTpBFnSA6Bt63OjzWtKfFDgrWsw4Z4odz1WRJGGauM62
+HwroFPCXCit2KCieu23hmsy+Bzh9kdKby8Y3IIdCkTxpslc8au5Psz9uETOXCRwG
+XrANA+OjIawNb3M6Lp3//F07V5eTdWNGrkCByfe0O6/tbnQXPnpqb4u39mnRDQgM
+O69TUCZNaHFQoN7cVJl6hMM6+i3ymMbNOk46hqiqe12KeO8iN/kp/GyGKEP0+H+K
+K2xniIYvm4s+1BE4klkU3S1TQhlZInYu5DFKtGb++n2+UfUlC6bLvA7aAh0K/yOC
+zECPZV8InyTwOaom/CHfWEnBUSEvqvaw/r1DNYqsRR8QSFzlNxx7rDwcEsfy0rJt
+0Ru9jSGCYBRR/EeBHY5JAoIBAQDvqF0K5k/WUIRdybygi22pkEcXbajC0s0Z7Wm/
+/Uh2zOw2tDv2wfN26Jk9YvPFuZzkgTZSSHBtVHLaju8LXzIDtbD7990KyWKTm/QX
+ynm/Depp7HWbKVxgWAa0Q0DNUNl/vTGHtj9MDGYx798GzGfrQvIs50jBvjnw1QcN
++vkNkkEFTOc3XYKWdPMsqfUowgVC73aiK3Bq1g514F5hj6OPuiyAbrWluS0jsOLG
+fWGbo9Aw7PmAD8oCjrkpGslLuIVjw0j9Ro0o6iK8+5rzdyai5WsSRBeBsBw5N3pg
+OzDXiBm8mfu9TDk7O7ZXM9Jw/jrV5lGks+XHMsPm1Flrtx7pAoIBAQDqnbj1uwH/
+Z1fd4+hVygXsHju77IoSx5mgSuXhDn+tl35IbUR0rgPNNLc/TVo4FHuJuKHdH3/G
+un9tYLfo/CCMZOMM/Tlh5ZSm1d9BCniCxlmbdXka5DXJ34TTAL2ssdwBagRmaj7n
+8o1EhOdqB+DszGoLWm2NUXPZOFCaMD30vjQ6xeY+YkePCsPpffr4YeTDtgsX7URE
+sTNfyAXtK5boQg1VkowlAP+EYqggnu10sOn3Hddxq2YHTi2cCDSSuctCfqyvfVea
+LudIh5pIfwxie8w09znMxKJhUij1duRcv+L9z/O+zjSW2gPPlvqgw7gcg3cCp1RM
++WGX9V2jPE+1AoIBAGL+echp0CqnwbV4AmmSjm7PQP5ldqNbLgt6rQb4Gbmw9hW2
+p1pLTUUd2UapHCbdf/hHg2fDsmUG0BaFmippXSB5Ka06+lxdSVHNxqsZIOcRWXX9
+jarVD+pgEgzeBuOIdP816EK1vjmsmX4hJlAJmRdt5Nk1hDE7YXWgmTRmKgA4HJGS
+7aNKBgoeLuCRJ8p5MnEutyNPrDUFTJ3WW0YTbi2Napp2oKPe9M1cYKA65FnE9ddv
+27PRUdFyoPtgrCuSAc9uuDSesupmpIjJqXzOB/CbsXmvFMKmO1JLH0qmyIsPFgp4
+1Kqh1LYp+SzWJCQ2b5kxdSICiXSZ/J/ZsUI0NxkCggEBAKzYSd1vSod5ATjNoOsj
+DL3pgCRwnUA8oKeAxl7JqbKf+z8skNRNJyvU/HO8bw0FugW6ajVX8XDdEOfp61PP
++8KyyLtXCyFeW+eVhQaLykC+FGH9Z50yJ5Zz/4zb7OD/n4/DJT62Y2XKQd0K9Noe
+t8x8xFtc4XzNV0XewTL2+44FWsE57uhiy0lMqwyn7W9z3293/DBCcpsQ2UJlQEh8
+Zo7xqpUyg+D3HUfQzwBJVbM0awnNiF2L4nzbUaq0ONcn3eE9Jceb1iAXEflTPYzP
+XLZpcgZLZN/AtchxGQ/N6WuTSo2m2HHnxMKmF0ymdDpgNpF7IQBpeifDSe0DrVqH
+IkkCggEBAKdRzi+vHk2sNAM+oRt6wnSxmVi38YhqQY3jB/BUKrmG9yeU/5NrLnLV
+UHEw8X+bAIaDXcjW8nH9l8mmCpWRv6Atk69KCAYCnyHkDmMjyEbFkG+VW1mJKeQD
+J7MA8QMwg8nW3t6GdyGNupLP65EIVaOd0+W27qzHOinWq/vlrJLi7DAk7ZxDbZxa
+YsE0Dy6oko0M0cN+NhgfsOE2/E9u3u+OfM7WqJjvKs7nPBh1mlSmGXB0srbsdF5X
+zSi2PxEM87K9FjhwdLRg1Wgq1hqK5xeFpvQETd5dCwrbPDnWd4H91jycquVQ29+f
+F3fTQNKQ93zJWtUhTUSPO2BzPnZh8UE=
+-----END PRIVATE KEY-----
--
2.46.0

View File

@@ -0,0 +1,12 @@
diff --git a/src/Control/PatternArrows.hs b/src/Control/PatternArrows.hs
index d382c19..0b067dd 100644
--- a/src/Control/PatternArrows.hs
+++ b/src/Control/PatternArrows.hs
@@ -23,6 +23,7 @@ import qualified Control.Category as C
import Control.Category ((>>>))
import qualified Control.Arrow as A
import Control.Arrow ((***), (<+>))
+import Data.Function (fix)
-- |
-- A first-order pattern match

View File

@@ -0,0 +1,31 @@
diff -Naurd PortMidi-0.2.0.0/portmidi/pm_linux/pmlinuxalsa.c PortMidi-0.2.0.0-alsafix/portmidi/pm_linux/pmlinuxalsa.c
--- PortMidi-0.2.0.0/portmidi/pm_linux/pmlinuxalsa.c 2023-12-13 11:35:12.517413022 +0000
+++ PortMidi-0.2.0.0-alsafix/portmidi/pm_linux/pmlinuxalsa.c 2023-12-13 11:35:12.565413037 +0000
@@ -719,6 +719,18 @@
}
+static void set_alsa_plugin_path( void )
+{
+ char *existing;
+
+ existing = getenv("ALSA_PLUGIN_DIR");
+ if (NULL != existing) {
+ return;
+ }
+ setenv("ALSA_PLUGIN_DIR", "@alsa_plugin_dir@", 0);
+}
+
+
PmError pm_linuxalsa_init( void )
{
int err;
@@ -726,6 +738,8 @@
snd_seq_port_info_t *pinfo;
unsigned int caps;
+ set_alsa_plugin_path();
+
/* Previously, the last parameter was SND_SEQ_NONBLOCK, but this
* would cause messages to be dropped if the ALSA buffer fills up.
* The correct behavior is for writes to block until there is

View File

@@ -0,0 +1,8 @@
--- a/Setup.hs 2021-02-04 14:01:09.557970245 +0100
+++ b/Setup.hs 2021-02-04 14:07:45.047443753 +0100
@@ -3,4 +3,4 @@
import Distribution.Simple
main :: IO ()
-main = defaultMainWithHooks defaultUserHooks
+main = defaultMainWithHooks autoconfUserHooks

View File

@@ -0,0 +1,19 @@
diff -rN -u old-regex-compat-tdfa/Text/Regex.hs new-regex-compat-tdfa/Text/Regex.hs
--- old-regex-compat-tdfa/Text/Regex.hs 2022-02-20 13:42:36.828752458 +0100
+++ new-regex-compat-tdfa/Text/Regex.hs 2022-02-20 13:42:36.828752458 +0100
@@ -139,7 +139,7 @@
splitRegex :: Regex -> String -> [String]
splitRegex _ [] = []
splitRegex delim strIn =
- let matches = map (!0) (matchAll delim strIn)
+ let matches = map (! 0) (matchAll delim strIn)
go _i str [] = str : []
go i str ((off,len):rest) =
let i' = off+len
@@ -194,4 +194,4 @@
then [firstline,""]
else firstline : loop remainder
--}
\ No newline at end of file
+-}

View File

@@ -0,0 +1,75 @@
diff --git a/servant-client-core.cabal b/servant-client-core.cabal
index 5789da601..3faf65bb4 100644
--- a/servant-client-core.cabal
+++ b/servant-client-core.cabal
@@ -96,6 +96,7 @@ test-suite spec
main-is: Spec.hs
other-modules:
Servant.Client.Core.Internal.BaseUrlSpec
+ Servant.Client.Core.RequestSpec
-- Dependencies inherited from the library. No need to specify bounds.
build-depends:
diff --git a/src/Servant/Client/Core/Request.hs b/src/Servant/Client/Core/Request.hs
index 73756e702..0276d46f8 100644
--- a/src/Servant/Client/Core/Request.hs
+++ b/src/Servant/Client/Core/Request.hs
@@ -64,8 +64,32 @@ data RequestF body path = Request
, requestHeaders :: Seq.Seq Header
, requestHttpVersion :: HttpVersion
, requestMethod :: Method
- } deriving (Generic, Typeable, Eq, Show, Functor, Foldable, Traversable)
+ } deriving (Generic, Typeable, Eq, Functor, Foldable, Traversable)
+instance (Show a, Show b) =>
+ Show (Servant.Client.Core.Request.RequestF a b) where
+ showsPrec p req
+ = showParen
+ (p >= 11)
+ ( showString "Request {requestPath = "
+ . showsPrec 0 (requestPath req)
+ . showString ", requestQueryString = "
+ . showsPrec 0 (requestQueryString req)
+ . showString ", requestBody = "
+ . showsPrec 0 (requestBody req)
+ . showString ", requestAccept = "
+ . showsPrec 0 (requestAccept req)
+ . showString ", requestHeaders = "
+ . showsPrec 0 (redactSensitiveHeader <$> requestHeaders req))
+ . showString ", requestHttpVersion = "
+ . showsPrec 0 (requestHttpVersion req)
+ . showString ", requestMethod = "
+ . showsPrec 0 (requestMethod req)
+ . showString "}"
+ where
+ redactSensitiveHeader :: Header -> Header
+ redactSensitiveHeader ("Authorization", _) = ("Authorization", "<REDACTED>")
+ redactSensitiveHeader h = h
instance Bifunctor RequestF where bimap = bimapDefault
instance Bifoldable RequestF where bifoldMap = bifoldMapDefault
instance Bitraversable RequestF where
diff --git a/test/Servant/Client/Core/RequestSpec.hs b/test/Servant/Client/Core/RequestSpec.hs
new file mode 100644
index 000000000..99a1db7d3
--- /dev/null
+++ b/test/Servant/Client/Core/RequestSpec.hs
@@ -0,0 +1,19 @@
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# LANGUAGE OverloadedStrings #-}
+module Servant.Client.Core.RequestSpec (spec) where
+
+
+import Prelude ()
+import Prelude.Compat
+import Control.Monad
+import Data.List (isInfixOf)
+import Servant.Client.Core.Request
+import Test.Hspec
+
+spec :: Spec
+spec = do
+ describe "Request" $ do
+ describe "show" $ do
+ it "redacts the authorization header" $ do
+ let request = void $ defaultRequest { requestHeaders = pure ("authorization", "secret") }
+ isInfixOf "secret" (show request) `shouldBe` False

View File

@@ -0,0 +1,86 @@
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Internal.hs sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs
--- sexpr-0.2.1/Codec/Sexpr/Internal.hs 2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs 2018-08-03 01:38:08.000000000 +0200
@@ -62,11 +62,6 @@
return $ List []]
arbSexpr n = oneof [Atom <$> arbitrary,
List <$> (resize (n `div` 2) arbitrary)]
- coarbitrary (Atom s) = variant 0 . coarbitrary s
- coarbitrary (HintedAtom h s) = variant 1 . coarbitrary_h . coarbitrary s
- where coarbitrary_h =
- foldr (\a b -> variant (ord a) . variant 1 . b) (variant 0) h
- coarbitrary (List ss) = variant 2 . coarbitrary ss
-- |@fold f s@ applies f to each sub-S-expression of s, from each leaf
-- to the root. @f@ need not preserve the shape of @s@, in contrast
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Printer.hs sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs
--- sexpr-0.2.1/Codec/Sexpr/Printer.hs 2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs 2018-08-03 01:41:56.000000000 +0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, OverlappingInstances #-}
+{-# LANGUAGE FlexibleInstances #-}
-- | Export S-expressions in any of the three ordinary forms:
--
@@ -17,6 +17,8 @@
module Codec.Sexpr.Printer where
+import Prelude hiding ((<>))
+
import Codec.Sexpr.Internal
import Data.Binary.Put
@@ -30,7 +32,7 @@
instance Show (Sexpr String) where
show s = advancedString s
-instance Show s => Show (Sexpr s) where
+instance {-# OVERLAPPABLE #-} Show s => Show (Sexpr s) where
show s = advancedString $ fmap show s
raw :: String -> String -> String
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Tests.hs sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs
--- sexpr-0.2.1/Codec/Sexpr/Tests.hs 2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs 2018-08-03 01:46:32.000000000 +0200
@@ -67,11 +67,9 @@
instance Arbitrary B.ByteString where
arbitrary = B.pack `fmap` arbitrary
- coarbitrary = undefined
instance Arbitrary Char where
arbitrary = choose (32,255) >>= \n -> return (chr n)
- coarbitrary n = variant (ord n)
main :: IO ()
diff -Naurw sexpr-0.2.1/sexpr.cabal sexpr-0.2.1-patched/sexpr.cabal
--- sexpr-0.2.1/sexpr.cabal 2018-08-03 01:36:11.000000000 +0200
+++ sexpr-0.2.1-patched/sexpr.cabal 2018-08-03 01:49:13.000000000 +0200
@@ -13,23 +13,9 @@
maintainer: bts@evenmere.org
build-type: Simple
-flag testing
- description: build test executable
- default: False
-
library
- if flag(testing)
- ghc-options: -Wall
- Build-Depends: base, base64-string, pretty, bytestring, binary
+ Build-Depends: base, base64-string, pretty, bytestring, binary, QuickCheck
Exposed-modules: Codec.Sexpr
-
-executable sexpr-test
- if !flag(testing)
- buildable: False
- ghc-options: -Wall
- main-is: Codec/Sexpr/Tests.hs
- other-modules: Codec.Sexpr
- Codec.Sexpr.Parser
+ other-modules: Codec.Sexpr.Parser
Codec.Sexpr.Printer
Codec.Sexpr.Internal
- build-depends: QuickCheck, random

View File

@@ -0,0 +1,16 @@
diff --git a/System/Xattr.hsc b/System/Xattr.hsc
index adaf9cb..9b49996 100644
--- a/System/Xattr.hsc
+++ b/System/Xattr.hsc
@@ -45,11 +45,7 @@ module System.Xattr
where
#include <sys/types.h>
-#ifdef __APPLE__
#include <sys/xattr.h>
-#else
-#include <attr/xattr.h>
-#endif
import Data.Functor ((<$>))
import Foreign.C

View File

@@ -0,0 +1,7 @@
# haskell-modules/replacements-by-name
This directory is scanned, and all `.nix` files are called in order to replace their respective packages in the `haskellPackages` set.
They're loaded after `hackage-packages.nix` but before any overrides are applied.
See [non-hackage-packages.nix](../non-hackage-packages.nix) for the implementation.
This is used for selective backports of updates, as the hackage package set won't be updated in its entirety.

View File

@@ -0,0 +1,11 @@
addStackArgs () {
if [ -n "$(echo $1/lib/lib*)" ]; then
STACK_IN_NIX_EXTRA_ARGS+=" --extra-lib-dirs=$1/lib"
fi
if [ -d "$1/include" ]; then
STACK_IN_NIX_EXTRA_ARGS+=" --extra-include-dirs=$1/include"
fi
}
addEnvHooks "$targetOffset" addStackArgs

View File

@@ -0,0 +1,211 @@
{
lib,
stdenv,
haskellPackages,
symlinkJoin,
makeWrapper,
# GHC will have LLVM available if necessary for the respective target,
# so useLLVM only needs to be changed if -fllvm is to be used for a
# platform that has NCG support
useLLVM ? false,
withHoogle ? false,
# Whether to install `doc` outputs for GHC and all included libraries.
installDocumentation ? true,
hoogleWithPackages,
postBuild ? "",
}:
# This argument is a function which selects a list of Haskell packages from any
# passed Haskell package set.
#
# Example:
# (hpkgs: [ hpkgs.mtl hpkgs.lens ])
selectPackages:
# It's probably a good idea to include the library "ghc-paths" in the
# compiler environment, because we have a specially patched version of
# that package in Nix that honors these environment variables
#
# NIX_GHC
# NIX_GHCPKG
# NIX_GHC_DOCDIR
# NIX_GHC_LIBDIR
#
# instead of hard-coding the paths. The wrapper sets these variables
# appropriately to configure ghc-paths to point back to the wrapper
# instead of to the pristine GHC package, which doesn't know any of the
# additional libraries.
#
# A good way to import the environment set by the wrapper below into
# your shell is to add the following snippet to your ~/.bashrc:
#
# if [ -e ~/.nix-profile/bin/ghc ]; then
# eval $(grep export ~/.nix-profile/bin/ghc)
# fi
let
inherit (haskellPackages) ghc;
hoogleWithPackages' = if withHoogle then hoogleWithPackages selectPackages else null;
packages = selectPackages haskellPackages ++ [ hoogleWithPackages' ];
isHaLVM = ghc.isHaLVM or false;
ghcCommand' = "ghc";
ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
ghcCommandCaps = lib.toUpper ghcCommand';
libDir =
if isHaLVM then
"$out/lib/HaLVM-${ghc.version}"
else
"$out/lib/${ghc.targetPrefix}${ghc.haskellCompilerName}"
+ lib.optionalString (ghc ? hadrian) "/lib";
docDir = "$out/share/doc/ghc/html";
packageCfgDir = "${libDir}/package.conf.d";
paths = lib.concatLists (
map (pkg: [ pkg ] ++ lib.optionals installDocumentation [ (lib.getOutput "doc" pkg) ]) (
lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages)
)
);
hasLibraries = lib.any (x: x.isHaskellLibrary) paths;
# Clang is needed on Darwin for -fllvm to work.
# GHC >= 9.10 needs an LLVM specific assembler which we use clang for.
# https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
llvm = lib.makeBinPath (
[ ghc.llvmPackages.llvm ]
++ lib.optionals (lib.versionAtLeast ghc.version "9.10" || stdenv.targetPlatform.isDarwin) [
ghc.llvmPackages.clang
]
);
in
if paths == [ ] && !useLLVM then
ghc
else
symlinkJoin {
# this makes computing paths from the name attribute impossible;
# if such a feature is needed, the real compiler name should be saved
# as a dedicated drv attribute, like `compiler-name`
name = ghc.name + "-with-packages";
paths = paths ++ [ ghc ] ++ lib.optionals installDocumentation [ (lib.getOutput "doc" ghc) ];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
# wrap compiler executables with correct env variables
for prg in ${ghcCommand} ${ghcCommand}i ${ghcCommand}-${ghc.version} ${ghcCommand}i-${ghc.version}; do
if [[ -x "${ghc}/bin/$prg" ]]; then
rm -f $out/bin/$prg
makeWrapper ${ghc}/bin/$prg $out/bin/$prg \
--add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \
--set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \
--set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \
--set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \
--set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" \
${lib.optionalString useLLVM ''--prefix "PATH" ":" "${llvm}"''}
fi
done
for prg in runghc runhaskell; do
if [[ -x "${ghc}/bin/$prg" ]]; then
rm -f $out/bin/$prg
makeWrapper ${ghc}/bin/$prg $out/bin/$prg \
--add-flags "-f $out/bin/${ghcCommand}" \
--set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \
--set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \
--set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \
--set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}"
fi
done
for prg in ${ghcCommand}-pkg ${ghcCommand}-pkg-${ghc.version}; do
if [[ -x "${ghc}/bin/$prg" ]]; then
rm -f $out/bin/$prg
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "--global-package-db=${packageCfgDir}"
fi
done
# haddock was referring to the base ghc, https://github.com/NixOS/nixpkgs/issues/36976
if [[ -x "${ghc}/bin/haddock" ]]; then
rm -f $out/bin/haddock
makeWrapper ${ghc}/bin/haddock $out/bin/haddock \
--add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \
--set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}"
fi
''
+ (lib.optionalString (stdenv.targetPlatform.isDarwin && !stdenv.targetPlatform.isiOS) ''
# Work around a linker limit in macOS Sierra (see generic-builder.nix):
local packageConfDir="${packageCfgDir}";
local dynamicLinksDir="$out/lib/links";
mkdir -p $dynamicLinksDir
# Clean up the old links that may have been (transitively) included by
# symlinkJoin:
rm -f $dynamicLinksDir/*
dynamicLibraryDirs=()
for pkg in $($out/bin/ghc-pkg list --simple-output); do
dynamicLibraryDirs+=($($out/bin/ghc-pkg --simple-output field "$pkg" dynamic-library-dirs))
done
for dynamicLibraryDir in $(echo "''${dynamicLibraryDirs[@]}" | tr ' ' '\n' | sort -u); do
echo "Linking $dynamicLibraryDir/*.dylib from $dynamicLinksDir"
find "$dynamicLibraryDir" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \;
done
for f in $packageConfDir/*.conf; do
# Initially, $f is a symlink to a read-only file in one of the inputs
# (as a result of this symlinkJoin derivation).
# Replace it with a copy whose dynamic-library-dirs points to
# $dynamicLinksDir
cp $f $f-tmp
rm $f
sed "N;s,dynamic-library-dirs:\s*.*\n,dynamic-library-dirs: $dynamicLinksDir\n," $f-tmp > $f
rm $f-tmp
done
'')
+ ''
${lib.optionalString hasLibraries ''
# GHC 8.10 changes.
# Instead of replacing package.cache[.lock] with the new file,
# ghc-pkg is now trying to open the file. These file are symlink
# to another nix derivation, so they are not writable. Removing
# them allow the correct behavior of ghc-pkg recache
# See: https://github.com/NixOS/nixpkgs/issues/79441
rm ${packageCfgDir}/package.cache.lock
rm ${packageCfgDir}/package.cache
$out/bin/${ghcCommand}-pkg recache
''}
$out/bin/${ghcCommand}-pkg check
''
+ postBuild;
preferLocalBuild = true;
passthru = {
inherit (ghc) version targetPrefix;
hoogle = hoogleWithPackages';
# Inform users about backwards incompatibilities with <= 21.05
override =
_:
throw ''
The ghc.withPackages wrapper itself can now be overridden, but no longer
the result of calling it (as before). Consequently overrides need to be
adjusted: Instead of
(ghc.withPackages (p: [ p.my-package ])).override { withLLLVM = true; }
use
(ghc.withPackages.override { useLLVM = true; }) (p: [ p.my-package ])
Also note that withLLVM has been renamed to useLLVM for consistency with
the GHC Nix expressions.'';
};
pos = __curPos;
meta = ghc.meta // {
# To be fixed by <https://github.com/NixOS/nixpkgs/pull/440774>.
broken = useLLVM;
};
}