diff --git a/pkgs/development/libraries/haskell/cabal/cabal.nix b/pkgs/development/libraries/haskell/cabal/cabal.nix index 1fa893d59e56..ba841ff281af 100644 --- a/pkgs/development/libraries/haskell/cabal/cabal.nix +++ b/pkgs/development/libraries/haskell/cabal/cabal.nix @@ -17,7 +17,10 @@ # all packages with haskell- to avoid name clashes for libraries; # if that is not desired (for applications), name can be set to # fname. - name = "haskell-${self.pname}-ghc${ghc.ghc.version}-${self.version}"; + name = if enableLibraryProfiling then + "haskell-${self.pname}-ghc${ghc.ghc.version}-profiling-${self.version}" + else + "haskell-${self.pname}-ghc${ghc.ghc.version}-${self.version}"; # the default download location for Cabal packages is Hackage, # you still have to specify the checksum diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fa2a5967b121..56d948cb95c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2247,6 +2247,7 @@ let haskellPackages_ghc6101 = import ./haskell-packages.nix { inherit pkgs; + enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] false; ghc = import ../development/compilers/ghc/6.10.1.nix { inherit fetchurl stdenv perl ncurses gmp libedit; ghc = ghc6101Binary; @@ -2255,6 +2256,7 @@ let haskellPackages_ghc6102 = import ./haskell-packages.nix { inherit pkgs; + enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] false; ghc = import ../development/compilers/ghc/6.10.2.nix { inherit fetchurl stdenv perl ncurses gmp libedit; ghc = ghc6101Binary; @@ -2263,6 +2265,7 @@ let haskellPackages_ghc6103 = import ./haskell-packages.nix { inherit pkgs; + enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] false; ghc = import ../development/compilers/ghc/6.10.3.nix { inherit fetchurl stdenv perl ncurses gmp libedit; ghc = ghc6101Binary; @@ -2271,6 +2274,7 @@ let haskellPackages_ghc6104 = recurseIntoAttrs (import ./haskell-packages.nix { inherit pkgs; + enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] false; ghc = import ../development/compilers/ghc/6.10.4.nix { inherit fetchurl stdenv perl ncurses gmp libedit; ghc = ghc6101Binary; @@ -2280,6 +2284,7 @@ let # make this ghc default when it's supported by the Haskell Platform haskellPackages_ghc6121 = lowPrio (import ./haskell-packages.nix { inherit pkgs; + enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] false; ghc = import ../development/compilers/ghc/6.12.1.nix { inherit fetchurl stdenv perl ncurses gmp; ghc = ghc6101Binary; @@ -2288,6 +2293,7 @@ let haskellPackages_ghc6122 = lowPrio (import ./haskell-packages.nix { inherit pkgs; + enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] false; ghc = import ../development/compilers/ghc/6.12.2.nix { inherit fetchurl stdenv perl ncurses gmp; ghc = ghc6101Binary; diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 14329b9067ce..425b6754a112 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -1,4 +1,4 @@ -{pkgs, ghc}: +{pkgs, ghc, enableLibraryProfiling ? false}: let ghcReal = pkgs.lowPrio ghc; in @@ -21,7 +21,7 @@ rec { cabal = import ../development/libraries/haskell/cabal/cabal.nix { inherit (pkgs) stdenv fetchurl lib; - inherit ghc; + inherit ghc enableLibraryProfiling; };