git-annex/Build/BundledPrograms.hs

107 lines
2.8 KiB
Haskell
Raw Normal View History

2013-05-15 00:59:14 +00:00
{- Bundled programs
-
- 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 BuildInfo
2013-05-15 00:59:14 +00:00
{- 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]
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.
-- On Windows, gpg is bundled with git for windows.
#ifndef mingw32_HOST_OS
[ BuildInfo.gpg
2016-02-23 16:48:18 +00:00
#else
[
#endif
#ifndef darwin_HOST_OS
#ifndef mingw32_HOST_OS
-- OS X has ssh installed by default.
-- On Windows, git provides ssh.
-- Linux probably has ssh installed system wide,
-- and if so the user probably wants to use that one.
, Just "ssh"
, Just "ssh-keygen"
#endif
2016-02-23 16:30:11 +00:00
#endif
2016-02-23 16:48:18 +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
-- git is not included in the windows bundle; git for windows is used
2013-05-15 00:59:14 +00:00
, Just "git"
-- 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
#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"
#endif
2013-05-15 00:59:14 +00:00
, Just "rsync"
#ifndef mingw32_HOST_OS
, Just "sh"
#endif
#ifndef mingw32_HOST_OS
#ifndef darwin_HOST_OS
-- wget on OSX has been problematic, looking for certs in the wrong
-- places. Don't ship it, use curl or the OSX's own wget if it has
-- one.
, ifset BuildInfo.wget "wget"
#endif
#endif
, BuildInfo.lsof
, BuildInfo.gcrypt
#ifndef mingw32_HOST_OS
-- All these utilities are included in git for Windows
, ifset BuildInfo.curl "curl"
, BuildInfo.sha1
, BuildInfo.sha256
, BuildInfo.sha512
, BuildInfo.sha224
, BuildInfo.sha384
, Just "cp"
#endif
#ifdef linux_HOST_OS
-- used to unpack the tarball when upgrading
, Just "gunzip"
, Just "tar"
-- used by runshell to generate locales
, Just "localedef"
#endif
-- 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