Skip to content

Commit

Permalink
Package updates 2024 06 (#20)
Browse files Browse the repository at this point in the history
* Use bellroy-nix-foss

* flake.lock: Update

Flake lock file updates:

• Added input 'bellroy-nix-foss':
    'github:bellroy/bellroy-nix-foss/b6c032e0c9aeb1886538d9db10809bc441dd2bac?narHash=sha256-7pEJ5a%2BhbpeCmKqRt%2BN5ddhsBD8IwDRenMN8WPnB8MQ%3D' (2024-06-25)
• Added input 'bellroy-nix-foss/flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04)
• Added input 'bellroy-nix-foss/flake-utils':
    'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a?narHash=sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ%3D' (2024-03-11)
• Added input 'bellroy-nix-foss/flake-utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D' (2023-04-09)
• Added input 'bellroy-nix-foss/nixpkgs':
    'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681?narHash=sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs%3D' (2024-06-22)
• Removed input 'flake-utils'
• Removed input 'flake-utils/systems'
• Removed input 'nixpkgs'

* Update cabal bounds

* Update tested-with and regenerate CI
  • Loading branch information
JackKelly-Bellroy authored Jun 26, 2024
1 parent 5dc681c commit 84d3c3e
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 118 deletions.
58 changes: 18 additions & 40 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.16.6
# version: 0.18.1
#
# REGENDATA ("0.16.6",["github","cached-io.cabal"])
# REGENDATA ("0.18.1",["github","cached-io.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -28,14 +28,14 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.8.1
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.1
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.2
- compiler: ghc-9.6.4
compilerKind: ghc
compilerVersion: 9.6.2
compilerVersion: 9.6.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.5
Expand All @@ -58,32 +58,17 @@ jobs:
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
allow-failure: false
fail-fast: false
steps:
- name: apt
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -95,20 +80,13 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down
4 changes: 2 additions & 2 deletions cached-io.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ author: SumAll, Inc.
maintainer: Bellroy Tech Team <[email protected]>
category: Development
build-type: Simple
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.5 || ==9.6.2 || ==9.8.1
tested-with: GHC ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.5 || ==9.6.4 || ==9.8.2
extra-doc-files:
CHANGELOG.md
README.md
Expand All @@ -22,7 +22,7 @@ source-repository head
location: https://github.com/bellroy/haskell-cached-io.git

common deps
build-depends: base >=4.13.0.0 && <4.20
build-depends: base >=4.13.0.0 && <4.21

library
import: deps
Expand Down
25 changes: 8 additions & 17 deletions cached-io.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
{ mkDerivation
, lib
, base
, exceptions
, stm
, time
, transformers
}:
{ mkDerivation, base, exceptions, lib, stm, time, transformers }:
mkDerivation {
pname = "cached-io";
version = "1.1.0.0";
version = "1.3.0.0";
src = ./.;
libraryHaskellDepends = [
base
exceptions
stm
time
transformers
];
description = "A simple library to cache a single IO action with timeout";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [ base exceptions stm time transformers ];
executableHaskellDepends = [ base ];
description = "A simple library to cache IO actions";
license = lib.licenses.asl20;
mainProgram = "test-cachedIO";
}
59 changes: 47 additions & 12 deletions flake.lock

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

67 changes: 20 additions & 47 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,26 @@
description = "A simple library to cache a single IO action with timeout";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
bellroy-nix-foss.url = "github:bellroy/bellroy-nix-foss";
};

outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
rec
{
# This becomes the list of package and devShell names.
supportedCompilers = [
"ghc88"
"ghc810"
"ghc90"
"ghc92"
"ghc94"
"ghc96"
"ghc98"
];

packages = builtins.listToAttrs (
builtins.map
(compiler: {
name = compiler;
value = pkgs.haskell.packages.${compiler}.callPackage ./cached-io.nix { };
})
supportedCompilers
);

devShells' = (builtins.mapAttrs
(compiler: v: v.env.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs
++ [ pkgs.nixpkgs-fmt ]
++ (with pkgs.haskell.packages.${compiler}; [
cabal-fmt
cabal-install
doctest
haskell-ci
haskell-language-server
hlint
]);
}))
packages
);

devShells = devShells' // { default = devShells'.ghc92; };
});
outputs = inputs:
inputs.bellroy-nix-foss.lib.haskellProject {
cabalPackages = [
{
name = "cached-io";
path = ./cached-io.nix;
}
];
supportedCompilers = [
"ghc810"
"ghc90"
"ghc92"
"ghc94"
"ghc96"
"ghc98"
"ghc910"
];
defaultCompiler = "ghc96";
};
}

0 comments on commit 84d3c3e

Please sign in to comment.