Skip to content

Commit

Permalink
try to permit building with GHC 9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
raehik committed Sep 15, 2024
1 parent 6e68390 commit b05c2b5
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 40 deletions.
36 changes: 15 additions & 21 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 41 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,49 @@
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.haskell-flake.flakeModule ];
perSystem = { self', pkgs, config, ... }: {
packages.default = self'.packages.fortran-src;
haskellProjects.default = {};
packages.default = self'.packages.fortran-src-ghc92-fortran-src;
devShells.default = self'.devShells.fortran-src-ghc92;

haskellProjects.ghc92 = import ./haskell-flake-ghc92.nix pkgs;
haskellProjects.fortran-src-ghc92 = {
basePackages = config.haskellProjects.ghc92.outputs.finalPackages;
devShell = {
tools = hp: {
# use nixpkgs cabal-install
cabal-install = pkgs.cabal-install;

# disable these while unused (often slow/annoying to build)
haskell-language-server = null;
ghcid = null;
hlint = null;
};
};
};

haskellProjects.ghc94 = import ./haskell-flake-ghc94.nix pkgs;
haskellProjects.fortran-src-ghc94 = {
basePackages = config.haskellProjects.ghc94.outputs.finalPackages;
devShell = {
tools = hp: {
# use nixpkgs cabal-install
cabal-install = pkgs.cabal-install;

# disable these while unused (often slow/annoying to build)
haskell-language-server = null;
ghcid = null;
hlint = null;
};
};
};

haskellProjects.ghc96 = {
basePackages = pkgs.haskell.packages.ghc96;
};
};
};
}
20 changes: 10 additions & 10 deletions fortran-src.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.37.0.
-- This file has been generated from package.yaml by hpack version 0.35.2.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -200,9 +200,9 @@ library
, mtl >=2.2 && <3
, pretty >=1.1 && <2
, process >=1.2.0.0
, singletons >=3.0 && <3.2
, singletons-base >=3.0 && <3.2
, singletons-th >=3.0 && <3.2
, singletons ==3.0.*
, singletons-base >=3.0 && <3.3
, singletons-th >=3.0 && <3.3
, temporary >=1.2 && <1.4
, text >=1.2 && <2.1
, uniplate >=1.6 && <2
Expand Down Expand Up @@ -264,9 +264,9 @@ executable fortran-src
, mtl >=2.2 && <3
, pretty >=1.1 && <2
, process >=1.2.0.0
, singletons >=3.0 && <3.2
, singletons-base >=3.0 && <3.2
, singletons-th >=3.0 && <3.2
, singletons ==3.0.*
, singletons-base >=3.0 && <3.3
, singletons-th >=3.0 && <3.3
, temporary >=1.2 && <1.4
, text >=1.2 && <2.1
, uniplate >=1.6 && <2
Expand Down Expand Up @@ -363,9 +363,9 @@ test-suite spec
, mtl >=2.2 && <3
, pretty >=1.1 && <2
, process >=1.2.0.0
, singletons >=3.0 && <3.2
, singletons-base >=3.0 && <3.2
, singletons-th >=3.0 && <3.2
, singletons ==3.0.*
, singletons-base >=3.0 && <3.3
, singletons-th >=3.0 && <3.3
, temporary >=1.2 && <1.4
, text >=1.2 && <2.1
, uniplate >=1.6 && <2
Expand Down
30 changes: 30 additions & 0 deletions haskell-flake-ghc92.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pkgs: {
# disable local project options (always do this for package sets)
defaults.packages = {};
devShell.enable = false;
autoWire = [];

basePackages = pkgs.haskell.packages.ghc92;
packages = {
# GHC 9.2 libraries
singletons-th.source = "3.1";
singletons-base.source = "3.1";
singletons.source = "3.0.1"; # req because singletons-th-3.1 had bad bounds
th-desugar.source = "1.13.1";
th-abstraction.source = "0.4.5.0";
};

# (note this is actually unused/we have to duplicate because it doesn't get
# packed into basePackages or any key we can use... but nice to document here)
devShell = {
tools = hp: {
# by default, haskell-flake uses the Haskell packages versions of these
# tools (from hp). be warned, these can be a pain to build alternatively,
# you may use nixpkgs versions via pkgs

# as of 2024-09-13 nixpkgs-unstable can't build cabal-install on GHC 9.2.
# no problem, use nixpkgs version (shouldn't really matter how built)
cabal-install = pkgs.cabal-install;
};
};
}
30 changes: 30 additions & 0 deletions haskell-flake-ghc94.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pkgs: {
# disable local project options (always do this for package sets)
defaults.packages = {};
devShell.enable = false;
autoWire = [];

basePackages = pkgs.haskell.packages.ghc94;
packages = {
# GHC 9.4 libraries
singletons-th.source = "3.1.1";
singletons-base.source = "3.1.1";
#singletons.source = "3.0.1";
th-desugar.source = "1.14";
th-abstraction.source = "0.4.5.0";
};

# (note this is actually unused/we have to duplicate because it doesn't get
# packed into basePackages or any key we can use... but nice to document here)
devShell = {
tools = hp: {
# by default, haskell-flake uses the Haskell packages versions of these
# tools (from hp). be warned, these can be a pain to build alternatively,
# you may use nixpkgs versions via pkgs

# as of 2024-09-13 nixpkgs-unstable can't build cabal-install on GHC 9.4.
# no problem, use nixpkgs version (shouldn't really matter how built)
cabal-install = pkgs.cabal-install;
};
};
}
9 changes: 5 additions & 4 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ dependencies:
- either ^>=5.0.1.1
- process >= 1.2.0.0

# 3.0 requires GHC 9.0; 3.1 requires GHC 9.2
- singletons >= 3.0 && < 3.2
- singletons-th >= 3.0 && < 3.2
- singletons-base >= 3.0 && < 3.2
- singletons >= 3.0 && < 3.1

# 3.0 = GHC 9.0, 3.1 = GHC 9.2, 3.1.1 = GHC 9.4, 3.2 = GHC 9.6
- singletons-th >= 3.0 && < 3.3
- singletons-base >= 3.0 && < 3.3

library:
source-dirs: src
Expand Down

0 comments on commit b05c2b5

Please sign in to comment.