Makefile: Support newer versions of cabal that use the new-build system.

Unfortunately, cabal puts the binary in a very complicated path
and does not provide any good way to get it out, leaving no good choice
except to use find.

It may be possible to use cabal (new-)install --symlink-bindir,
and ask it to symlink to pwd, but with my older version of cabal,
that does not work.

The stack branch will probably also break once it uses a newer cabal,
didn't try to deal with that.
This commit is contained in:
Joey Hess 2020-02-20 14:09:53 -04:00
parent 17b3c66a61
commit 3d00a8a1dc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 7 additions and 2 deletions

View file

@ -24,6 +24,7 @@ git-annex (8.20200221) UNRELEASED; urgency=medium
* initremote, enableremote: Set remote.name.skipFetchAll when * initremote, enableremote: Set remote.name.skipFetchAll when
the remote cannot be fetched from by git, so git fetch --all the remote cannot be fetched from by git, so git fetch --all
will not try to use it. will not try to use it.
* Makefile: Support newer versions of cabal that use the new-build system.
-- Joey Hess <id@joeyh.name> Wed, 19 Feb 2020 12:48:58 -0400 -- Joey Hess <id@joeyh.name> Wed, 19 Feb 2020 12:48:58 -0400

View file

@ -44,10 +44,14 @@ tmp/configure-stamp: Build/TestConfig.hs Build/Configure.hs
git-annex: tmp/configure-stamp git-annex: tmp/configure-stamp
$(BUILDER) build $(BUILDERCOMMONOPTIONS) $(BUILDEROPTIONS) $(BUILDER) build $(BUILDERCOMMONOPTIONS) $(BUILDEROPTIONS)
if [ "$(BUILDER)" = stack ]; then \ @if [ "$(BUILDER)" = stack ]; then \
ln -sf $$(stack path $(BUILDERCOMMONOPTIONS) --dist-dir)/build/git-annex/git-annex git-annex; \ ln -sf $$(stack path $(BUILDERCOMMONOPTIONS) --dist-dir)/build/git-annex/git-annex git-annex; \
else \
if [ -d dist-newstyle ]; then \
ln -sf $$(find dist-newstyle/ -executable -type f |grep 'git-annex$$') git-annex; \
else \ else \
ln -sf dist/build/git-annex/git-annex git-annex; \ ln -sf dist/build/git-annex/git-annex git-annex; \
fi; \
fi fi
git-annex-shell: git-annex git-annex-shell: git-annex