haskellPackages.cabal2nix-unstable: 2024-02-05 -> 2024-04-21

This removes (some of) the special casing for git-annex which we need to
replicate using overrides. As a first step, we recreate an equivalent
set of overrides to the former gitAnnexHook, the only difference being
that we use the default installPhase over a custom implementation.

A big flaw of the current expression (which was shared by the previous
iteration) is that they ignore the testFlags argument. Unfortunately, we
can't do that without changing the generic builder implementation.
This commit is contained in:
sternenseemann 2024-04-21 20:43:55 +02:00
parent dc3f85a891
commit bce71e97a0
3 changed files with 80 additions and 39 deletions

View file

@ -8,10 +8,10 @@
}:
mkDerivation {
pname = "cabal2nix";
version = "unstable-2024-02-05";
version = "unstable-2024-04-21";
src = fetchzip {
url = "https://github.com/NixOS/cabal2nix/archive/173e8a5fa70dc95a1aeb0bd877bf5fee6d5e6b4a.tar.gz";
sha256 = "1pld7jfsjmw486ch6li1fqci1jj5p2nvfq7nrkxrmf5p2ja5528g";
url = "https://github.com/NixOS/cabal2nix/archive/f8e6bf749a158a5ed866c57deee907b5f16c38e5.tar.gz";
sha256 = "0c73mvza65iy46fv8c8cadsy7klk4jzmimm1mfdavvm8i2cr5476";
};
postUnpack = "sourceRoot+=/cabal2nix; echo source root reset to $sourceRoot";
isLibrary = true;

View file

@ -719,7 +719,28 @@ self: super: builtins.intersectAttrs super {
})
(addBuildTools (with pkgs.buildPackages; [makeWrapper python3Packages.sphinx]) super.futhark);
git-annex = overrideCabal (drv: {
git-annex = let
# Executables git-annex needs at runtime. git-annex detects these at configure
# time and expects to be able to execute them. This means that cross-compiling
# git-annex is not possible and strictDeps must be false (runtimeExecDeps go
# into executableSystemDepends/buildInputs).
runtimeExecDeps = [
pkgs.bup
pkgs.curl
pkgs.git
pkgs.gnupg
pkgs.lsof
pkgs.openssh
pkgs.perl
pkgs.rsync
pkgs.wget
pkgs.which
];
in
overrideCabal (drv: {
executableSystemDepends = runtimeExecDeps;
enableSharedExecutables = false;
# This is an instance of https://github.com/NixOS/nix/pull/1085
# Fails with:
# gpg: can't connect to the agent: File name too long
@ -728,6 +749,42 @@ self: super: builtins.intersectAttrs super {
--replace ', testCase "crypto" test_crypto' ""
'' + (drv.postPatch or "");
preConfigure = drv.preConfigure or "" + ''
export HOME=$TEMPDIR
patchShebangs .
'';
# git-annex ships its test suite as part of the final executable instead of
# using a Cabal test suite.
checkPhase = ''
runHook preCheck
# Setup PATH for the actual tests
ln -sf dist/build/git-annex/git-annex git-annex
ln -sf git-annex git-annex-shell
PATH+=":$PWD"
echo checkFlags: $checkFlags ''${checkFlagsArray:+"''${checkFlagsArray[@]}"}
# Doesn't use Cabal's test mechanism
git-annex test $checkFlags ''${checkFlagsArray:+"''${checkFlagsArray[@]}"}
runHook postCheck
'';
# Use default installPhase of pkgs/stdenv/generic/setup.sh. We need to set
# the environment variables it uses via the preInstall hook since the Haskell
# generic builder doesn't accept them as arguments.
preInstall = drv.preInstall or "" + ''
installTargets="install install-completions"
installFlagsArray+=(
"BUILDER=:"
"PREFIX="
"DESTDIR=$out"
)
'';
installPhase = null;
# Ensure git-annex uses the exact same coreutils it saw at build-time.
# This is especially important on Darwin but also in Linux environments
# where non-GNU coreutils are used by default.

View file

@ -121898,34 +121898,32 @@ self: {
"git-annex" = callPackage
({ mkDerivation, aeson, ansi-terminal, async, attoparsec, aws, base
, blaze-builder, bloomfilter, bup, byteable, bytestring, Cabal
, blaze-builder, bloomfilter, byteable, bytestring, Cabal
, case-insensitive, clientsession, concurrent-output, conduit
, containers, crypto-api, crypton, curl, data-default, DAV, dbus
, deepseq, directory, disk-free-space, dlist, edit-distance
, exceptions, fdo-notify, feed, filepath, filepath-bytestring, free
, git, git-lfs, gnupg, hinotify, http-client
, http-client-restricted, http-client-tls, http-conduit, http-types
, IfElse, lsof, magic, memory, microlens, monad-control
, monad-logger, mountpoints, mtl, network, network-bsd
, network-info, network-multicast, network-uri, old-locale, openssh
, optparse-applicative, path-pieces, perl, persistent
, containers, crypto-api, crypton, data-default, DAV, dbus, deepseq
, directory, disk-free-space, dlist, edit-distance, exceptions
, fdo-notify, feed, filepath, filepath-bytestring, free, git-lfs
, hinotify, http-client, http-client-restricted, http-client-tls
, http-conduit, http-types, IfElse, magic, memory, microlens
, monad-control, monad-logger, mountpoints, mtl, network
, network-bsd, network-info, network-multicast, network-uri
, old-locale, optparse-applicative, path-pieces, persistent
, persistent-sqlite, persistent-template, process, QuickCheck
, random, regex-tdfa, resourcet, rsync, SafeSemaphore, sandi
, securemem, shakespeare, socks, split, stm, stm-chans, tagsoup
, tasty, tasty-hunit, tasty-quickcheck, tasty-rerun
, template-haskell, text, time, torrent, transformers, unix
, unix-compat, unliftio-core, unordered-containers, utf8-string
, uuid, vector, wai, wai-extra, warp, warp-tls, wget, which, yesod
, yesod-core, yesod-form, yesod-static
, random, regex-tdfa, resourcet, SafeSemaphore, sandi, securemem
, shakespeare, socks, split, stm, stm-chans, tagsoup, tasty
, tasty-hunit, tasty-quickcheck, tasty-rerun, template-haskell
, text, time, torrent, transformers, unix, unix-compat
, unliftio-core, unordered-containers, utf8-string, uuid, vector
, wai, wai-extra, warp, warp-tls, yesod, yesod-core, yesod-form
, yesod-static
}:
mkDerivation {
pname = "git-annex";
version = "10.20240227";
sha256 = "07py6xfss8jpw5yhvj203g4yd7qqx600j20hz0kqk80dpn7i3nqq";
configureFlags = [
"-fassistant" "-f-benchmark" "-fdbus" "-f-debuglocks" "-fmagicmime"
"-fnetworkbsd" "-fpairing" "-fproduction" "-fs3" "-ftorrentparser"
"-fwebapp" "-fwebdav"
"-fassistant" "-f-benchmark" "-fcrypton" "-fdbus" "-f-debuglocks"
"-fmagicmime" "-fpairing" "-fproduction" "-ftorrentparser"
];
isLibrary = false;
isExecutable = true;
@ -121952,25 +121950,11 @@ self: {
utf8-string uuid vector wai wai-extra warp warp-tls yesod
yesod-core yesod-form yesod-static
];
executableSystemDepends = [
bup curl git gnupg lsof openssh perl rsync wget which
];
preConfigure = "export HOME=$TEMPDIR; patchShebangs .";
postBuild = ''
ln -sf dist/build/git-annex/git-annex git-annex
ln -sf git-annex git-annex-shell
'';
installPhase = "make PREFIX=$out BUILDER=: install install-completions";
checkPhase = ''PATH+=":$PWD" git-annex test'';
enableSharedExecutables = false;
description = "manage files with git, without checking their contents into git";
license = lib.licenses.agpl3Only;
mainProgram = "git-annex";
maintainers = [ lib.maintainers.peti lib.maintainers.roosemberth ];
}) {inherit (pkgs) bup; inherit (pkgs) curl; inherit (pkgs) git;
inherit (pkgs) gnupg; inherit (pkgs) lsof; inherit (pkgs) openssh;
inherit (pkgs) perl; inherit (pkgs) rsync; inherit (pkgs) wget;
inherit (pkgs) which;};
}) {};
"git-brunch" = callPackage
({ mkDerivation, base, brick, extra, hspec, microlens