2013-05-15 00:59:14 +00:00
|
|
|
{- Bundled programs
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2013 Joey Hess <id@joeyh.name>
|
2013-05-15 00:59:14 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
{-# LANGUAGE CPP #-}
|
|
|
|
|
|
|
|
module Build.BundledPrograms where
|
|
|
|
|
|
|
|
import Data.Maybe
|
|
|
|
|
|
|
|
import Build.SysConfig as SysConfig
|
|
|
|
|
|
|
|
{- Programs that git-annex uses, to include in the bundle.
|
|
|
|
-
|
|
|
|
- These may be just the command name, or the full path to it. -}
|
|
|
|
bundledPrograms :: [FilePath]
|
2016-02-19 20:19:19 +00:00
|
|
|
bundledPrograms = preferredBundledPrograms ++ extraBundledPrograms
|
|
|
|
|
|
|
|
{- Programs that are only included in the bundle in case the system
|
|
|
|
- doesn't have them. These come after the system PATH.
|
|
|
|
-}
|
|
|
|
extraBundledPrograms :: [FilePath]
|
|
|
|
extraBundledPrograms = catMaybes
|
|
|
|
-- The system gpg is probably better, because it may better
|
|
|
|
-- integrate with the system gpg-agent, etc.
|
2016-02-23 15:33:07 +00:00
|
|
|
-- On Windows, gpg is bundled with git for windows.
|
|
|
|
#ifndef mingw32_HOST_OS
|
2016-02-19 20:19:19 +00:00
|
|
|
[ SysConfig.gpg
|
2016-02-23 16:48:18 +00:00
|
|
|
#else
|
|
|
|
[
|
2016-02-23 16:30:11 +00:00
|
|
|
#endif
|
2016-02-23 16:48:18 +00:00
|
|
|
]
|
2016-02-19 20:19:19 +00:00
|
|
|
|
|
|
|
{- Programs that should be preferred for use from the bundle, over
|
|
|
|
- any that might be installed on the system otherwise. These come before
|
|
|
|
- the system PATH.
|
|
|
|
-
|
|
|
|
- For example, git-annex is built for a specific version of git.
|
|
|
|
-}
|
|
|
|
preferredBundledPrograms :: [FilePath]
|
|
|
|
preferredBundledPrograms = catMaybes
|
2013-05-15 00:59:14 +00:00
|
|
|
[ Nothing
|
|
|
|
#ifndef mingw32_HOST_OS
|
2015-09-10 22:43:31 +00:00
|
|
|
-- git is not included in the windows bundle; git for windows is used
|
2013-05-15 00:59:14 +00:00
|
|
|
, Just "git"
|
2013-12-24 20:28:10 +00:00
|
|
|
-- Not strictly needed in PATH by git-annex, but called
|
|
|
|
-- by git when it sshes to a remote.
|
|
|
|
, Just "git-upload-pack"
|
|
|
|
, Just "git-receive-pack"
|
2013-12-27 20:35:24 +00:00
|
|
|
, Just "git-shell"
|
2013-05-15 00:59:14 +00:00
|
|
|
#endif
|
2013-10-17 19:56:56 +00:00
|
|
|
#ifndef mingw32_HOST_OS
|
|
|
|
-- using xargs on windows led to problems, so it's not used there
|
2013-05-15 00:59:14 +00:00
|
|
|
, Just "xargs"
|
2013-10-17 19:56:56 +00:00
|
|
|
#endif
|
2013-05-15 00:59:14 +00:00
|
|
|
, Just "rsync"
|
2013-12-13 18:25:24 +00:00
|
|
|
#ifndef darwin_HOST_OS
|
2015-05-07 19:43:36 +00:00
|
|
|
#ifndef mingw32_HOST_OS
|
2013-12-13 18:25:24 +00:00
|
|
|
-- OS X has ssh installed by default.
|
2014-12-03 17:26:05 +00:00
|
|
|
-- Linux probably has ssh, but not guaranteed.
|
2015-09-10 22:43:31 +00:00
|
|
|
-- On Windows, git provides ssh.
|
2013-05-15 00:59:14 +00:00
|
|
|
, Just "ssh"
|
2013-11-08 18:29:47 +00:00
|
|
|
, Just "ssh-keygen"
|
2013-12-13 18:25:24 +00:00
|
|
|
#endif
|
2015-05-07 19:43:36 +00:00
|
|
|
#endif
|
2013-05-15 00:59:14 +00:00
|
|
|
#ifndef mingw32_HOST_OS
|
|
|
|
, Just "sh"
|
|
|
|
#endif
|
2014-04-10 16:54:58 +00:00
|
|
|
#ifndef darwin_HOST_OS
|
2016-06-02 01:46:58 +00:00
|
|
|
-- wget on OSX has been problematic, looking for certs in the wrong
|
2014-04-10 16:54:58 +00:00
|
|
|
-- places. Don't ship it, use curl or the OSX's own wget if it has
|
|
|
|
-- one.
|
2013-05-15 00:59:14 +00:00
|
|
|
, ifset SysConfig.wget "wget"
|
2014-04-10 16:54:58 +00:00
|
|
|
#endif
|
2013-05-15 00:59:14 +00:00
|
|
|
, SysConfig.lsof
|
2013-09-13 16:05:47 +00:00
|
|
|
, SysConfig.gcrypt
|
2015-09-10 22:43:31 +00:00
|
|
|
#ifndef mingw32_HOST_OS
|
|
|
|
-- All these utilities are included in git for Windows
|
2015-09-11 18:01:42 +00:00
|
|
|
, ifset SysConfig.curl "curl"
|
2013-05-15 00:59:14 +00:00
|
|
|
, SysConfig.sha1
|
|
|
|
, SysConfig.sha256
|
|
|
|
, SysConfig.sha512
|
|
|
|
, SysConfig.sha224
|
|
|
|
, SysConfig.sha384
|
2015-09-10 22:43:31 +00:00
|
|
|
, Just "cp"
|
|
|
|
#endif
|
2013-11-24 04:26:20 +00:00
|
|
|
#ifdef linux_HOST_OS
|
|
|
|
-- used to unpack the tarball when upgrading
|
|
|
|
, Just "gunzip"
|
|
|
|
, Just "tar"
|
|
|
|
#endif
|
2013-12-01 18:53:15 +00:00
|
|
|
-- nice, ionice, and nocache are not included in the bundle;
|
|
|
|
-- we rely on the system's own version, which may better match
|
|
|
|
-- its kernel, and avoid using them if not available.
|
2013-05-15 00:59:14 +00:00
|
|
|
]
|
|
|
|
where
|
|
|
|
ifset True s = Just s
|
|
|
|
ifset False _ = Nothing
|