File: BundledPrograms.hs

package info (click to toggle)
git-annex 8.20210223-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 68,764 kB
  • sloc: haskell: 70,359; javascript: 9,103; sh: 1,304; makefile: 212; perl: 136; ansic: 44
file content (103 lines) | stat: -rw-r--r-- 2,720 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{- Bundled programs
 -
 - Copyright 2013 Joey Hess <id@joeyh.name>
 -
 - Licensed under the GNU AGPL version 3 or higher.
 -}

{-# LANGUAGE CPP #-}

module Build.BundledPrograms where

import Data.Maybe

import BuildInfo

{- 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
	[ Nothing
#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
#endif
	]

{- 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
	[ Nothing
#ifndef mingw32_HOST_OS
	-- git is not included in the windows bundle; git for windows is used
	, 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"
	, Just "git-shell"
	-- using xargs on windows led to problems, so it's not used there
	, Just "xargs"
	-- rsync is not a core dependency, but good to have.
	-- On windows, bundling rsync required the build be used with a
	-- particular version of git for windows, so not included there.
	, Just "rsync"
	, Just "sh"
	-- used by git-annex when available
	, Just "uname"
#endif
	, BuildInfo.lsof
	, BuildInfo.gcrypt
#ifndef mingw32_HOST_OS
	-- These utilities are included in git for Windows
	, ifset BuildInfo.curl "curl"
	, 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.
	]
  where
#ifndef mingw32_HOST_OS
	ifset True s = Just s
	ifset False _ = Nothing
#endif

magicDLLs :: [FilePath]
#ifdef mingw32_HOST_OS
magicDLLs = ["libmagic-1.dll", "libgnurx-0.dll"]
#else
magicDLLs = []
#endif

magicShare :: [FilePath]
#ifdef mingw32_HOST_OS
magicShare = ["magic.mgc"]
#else
magicShare = []
#endif