Merge pull request #121679 from sternenseemann/cabal2nix-latest-unstable-date

This commit is contained in:
maralorn 2021-05-04 13:56:03 +02:00 committed by GitHub
commit 88a71bb6a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-latest -I nixpkgs=.
#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-unstable -I nixpkgs=.
# This script is used to regenerate nixpkgs' Haskell package set, using a tool
# called hackage2nix. hackage2nix looks at
@ -9,7 +9,7 @@
# companion tool cabal2nix.
#
# Related scripts are update-hackage.sh, for updating the snapshot of the
# Hackage database used by hackage2nix, and update-cabal2nix-latest.sh,
# Hackage database used by hackage2nix, and update-cabal2nix-unstable.sh,
# for updating the version of hackage2nix used to perform this task.
set -euo pipefail

View File

@ -1,7 +1,7 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils curl jq gnused haskellPackages.cabal2nix-latest -I nixpkgs=.
#! nix-shell -i bash -p coreutils curl jq gnused haskellPackages.cabal2nix-unstable -I nixpkgs=.
# Updates cabal2nix-latest to the latest master of the nixos/cabal2nix repository.
# Updates cabal2nix-unstable to the latest master of the nixos/cabal2nix repository.
# See regenerate-hackage-packages.sh for details on the purpose of this script.
set -euo pipefail
@ -13,5 +13,5 @@ commit="$(jq -r .commit.sha <<< "$head_info")"
# extract commit timestamp and convert to date
date="$(date "--date=$(jq -r .commit.commit.committer.date <<< "$head_info")" +%F)"
# generate nix expression from cabal file, replacing the version with the commit date
echo '# This file defines cabal2nix-latest, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.' > pkgs/development/haskell-modules/cabal2nix-latest.nix
cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-latest.nix
echo '# This file defines cabal2nix-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.' > pkgs/development/haskell-modules/cabal2nix-unstable.nix
cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"unstable-$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-unstable.nix

View File

@ -1,4 +1,4 @@
# This file defines cabal2nix-latest, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.
# This file defines cabal2nix-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.
{ mkDerivation, aeson, ansi-wl-pprint, base, bytestring, Cabal
, containers, deepseq, directory, distribution-nixpkgs, fetchzip
, filepath, hackage-db, hopenssl, hpack, language-nix, lens, lib
@ -8,7 +8,7 @@
}:
mkDerivation {
pname = "cabal2nix";
version = "2021-05-01";
version = "unstable-2021-05-01";
src = fetchzip {
url = "https://github.com/NixOS/cabal2nix/archive/849a3507c849e3e2331efbc5ebe391b70a215ddc.tar.gz";
sha256 = "0g91d2bd72l3kkykc47a2raymvgw6427n7cg9ayzvrpldkd0silc";

View File

@ -1793,8 +1793,8 @@ self: super: {
# https://github.com/obsidiansystems/database-id/issues/1
database-id-class = doJailbreak super.database-id-class;
cabal2nix-latest = overrideCabal super.cabal2nix-latest {
passthru.updateScript = ../../../maintainers/scripts/haskell/update-cabal2nix-latest.sh;
cabal2nix-unstable = overrideCabal super.cabal2nix-unstable {
passthru.updateScript = ../../../maintainers/scripts/haskell/update-cabal2nix-unstable.sh;
};
# Too strict version bounds on base and optparse-applicative

View File

@ -13,7 +13,7 @@ self: super: {
# Used by maintainers/scripts/regenerate-hackage-packages.sh, and generated
# from the latest master instead of the current version on Hackage.
cabal2nix-latest = self.callPackage ./cabal2nix-latest.nix { };
cabal2nix-unstable = self.callPackage ./cabal2nix-unstable.nix { };
# https://github.com/channable/vaultenv/issues/1
vaultenv = self.callPackage ../tools/haskell/vaultenv { };