Build with the git-lfs library when available

Otherwise use the vendored copy as before.

The library is in Debian testing but not stable. Once it reaches
stable, the vendored copy can be removed.

Did not add it to debian/control because IIRC that's used to build
git-annex on stable too, possibly. However, the Debian maintainer will
probably want to make the package depend on libghc-git-lfs-dev.

This commit was sponsored by Ilya Shlyakhter on Patreon.
This commit is contained in:
Joey Hess 2020-06-22 11:21:25 -04:00
parent aa1ad0b7ca
commit 01eb863a14
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 25 additions and 2 deletions

View file

@ -3,6 +3,8 @@ git-annex (8.20200618) UNRELEASED; urgency=medium
* Fix a deadlock that could occur after git-annex got an unlocked
file, causing the command to hang indefinitely. Known to happen on
vfat filesystems, possibly others.
* Build with the git-lfs library when available, otherwise use the
vendored copy as before.
-- Joey Hess <id@joeyh.name> Thu, 18 Jun 2020 12:21:14 -0400

View file

@ -6,6 +6,7 @@
-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
module Remote.GitLFS (remote, gen, configKnownUrl) where
@ -39,9 +40,14 @@ import Utility.SshHost
import Utility.Url
import Logs.Remote
import Logs.RemoteState
import qualified Utility.GitLFS as LFS
import qualified Git.Config
#ifdef WITH_GIT_LFS
import qualified Network.GitLFS as LFS
#else
import qualified Utility.GitLFS as LFS
#endif
import Control.Concurrent.STM
import Data.String
import Network.HTTP.Types

View file

@ -21,6 +21,9 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
-- This is a vendored copy of Network.GitLFS from the git-lfs package,
-- and will be removed once that package is available in all build
-- environments.
module Utility.GitLFS (
-- * Transfer requests
TransferRequest(..),

View file

@ -289,6 +289,10 @@ Flag NetworkBSD
Description: Build with network-3.0 which split out network-bsd
Default: True
Flag GitLfs
Description: Build with git-lfs library (rather than vendored copy)
Default: True
source-repository head
type: git
location: git://git-annex.branchable.com/
@ -407,6 +411,12 @@ Executable git-annex
else
Build-Depends: network (< 3.0.0.0), network (>= 2.6.3.0)
if flag(GitLfs)
Build-Depends: git-lfs (>= 1.1.0)
CPP-Options: -DWITH_GIT_LFS
else
Other-Modules: Utility.GitLFS
if flag(S3)
Build-Depends: aws (>= 0.20)
CPP-Options: -DWITH_S3
@ -418,6 +428,7 @@ Executable git-annex
Other-Modules:
Remote.WebDAV
Remote.WebDAV.DavLocation
if flag(S3) || flag(WebDAV)
Other-Modules:
Remote.Helper.Http
@ -1059,7 +1070,6 @@ Executable git-annex
Utility.FileSystemEncoding
Utility.Format
Utility.FreeDesktop
Utility.GitLFS
Utility.Glob
Utility.Gpg
Utility.Hash

View file

@ -12,6 +12,7 @@ flags:
debuglocks: false
benchmark: false
networkbsd: false
gitlfs: true
packages:
- '.'
extra-deps:

View file

@ -12,6 +12,7 @@ flags:
debuglocks: false
benchmark: false
networkbsd: false
gitlfs: true
packages:
- '.'
extra-deps: