Skip to content

Commit

Permalink
haskellPackages.mkDerivation: Add support for sourceRoot and `set…
Browse files Browse the repository at this point in the history
…SourceRoot` arguments (NixOS#351226)
  • Loading branch information
maralorn authored Nov 1, 2024
2 parents 567b260 + ff9e352 commit 51031f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/languages-frameworks/haskell.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ and `version` from Hackage.
`sha256`
: Hash to use for the default case of `src`.

`sourceRoot`, `setSourceRoot`
: Passed to `stdenv.mkDerivation`; see [“Variables controlling the unpack
phase”](#variables-controlling-the-unpack-phase).

`revision`
: Revision number of the updated cabal file to fetch from Hackage.
If `null` (which is the default value), the one included in `src` is used.
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ in
, version, revision ? null
, sha256 ? null
, src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; }
, sourceRoot ? null
, setSourceRoot ? null
, buildDepends ? [], setupHaskellDepends ? [], libraryHaskellDepends ? [], executableHaskellDepends ? []
, buildTarget ? ""
, buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [], benchmarkToolDepends ? []
Expand Down Expand Up @@ -825,6 +827,8 @@ stdenv.mkDerivation ({
;

}
// optionalAttrs (args ? sourceRoot) { inherit sourceRoot; }
// optionalAttrs (args ? setSourceRoot) { inherit setSourceRoot; }
// optionalAttrs (args ? preCompileBuildDriver) { inherit preCompileBuildDriver; }
// optionalAttrs (args ? postCompileBuildDriver) { inherit postCompileBuildDriver; }
// optionalAttrs (args ? preUnpack) { inherit preUnpack; }
Expand Down

0 comments on commit 51031f2

Please sign in to comment.