File: meson.build

package info (click to toggle)
git 1%3A2.50.1-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 61,696 kB
  • sloc: ansic: 302,907; sh: 260,696; perl: 27,874; tcl: 22,303; makefile: 4,280; python: 3,442; javascript: 772; csh: 45; lisp: 12
file content (148 lines) | stat: -rw-r--r-- 3,929 bytes parent folder | download
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
project('git-gui',
  meson_version: '>=0.61.0',
)

fs = import('fs')

shell = find_program('sh')
tclsh = find_program('tclsh')
wish = find_program('wish')

build_options_config = configuration_data()
if target_machine.system() == 'windows'
  build_options_config.set('GITGUI_RELATIVE', '1')
else
  build_options_config.set('GITGUI_RELATIVE', '')
endif
build_options_config.set_quoted('GITGUI_GITEXECDIR', get_option('prefix') / get_option('libexecdir') / 'git-core')
build_options_config.set_quoted('GITGUI_LIBDIR', get_option('prefix') / get_option('datadir') / 'git-gui/lib')
build_options_config.set_quoted('SHELL_PATH', fs.as_posix(shell.full_path()))
build_options_config.set_quoted('TCLTK_PATH', fs.as_posix(wish.full_path()))
build_options_config.set_quoted('TCL_PATH', fs.as_posix(tclsh.full_path()))
if target_machine.system() == 'darwin'
  tkexecutables = [
    '/Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish',
    '/System/Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish',
    '/System/Library/Frameworks/Tk.framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell',
  ]
  tkexecutable = find_program(tkexecutables)
  build_options_config.set_quoted('TKEXECUTABLE', tkexecutable.full_path())
else
  build_options_config.set('TKEXECUTABLE', '')
endif

build_options = configure_file(
  input: 'GIT-GUI-BUILD-OPTIONS.in',
  output: 'GIT-GUI-BUILD-OPTIONS',
  configuration: build_options_config,
)

version_file = custom_target(
  input: 'GIT-VERSION-GEN',
  output: 'GIT-VERSION-FILE',
  command: [
    shell,
    '@INPUT@',
    meson.current_source_dir(),
    '@OUTPUT@',
  ],
  build_always_stale: true,
)

configure_file(
  input: 'git-gui--askpass',
  output: 'git-gui--askpass',
  copy: true,
  install: true,
  install_dir: get_option('libexecdir') / 'git-core',
)

gitgui_main = 'git-gui'
gitgui_main_install_dir = get_option('libexecdir') / 'git-core'

if target_machine.system() == 'windows'
  gitgui_main = 'git-gui.tcl'

  configure_file(
    input: 'windows/git-gui.sh',
    output: 'git-gui',
    copy: true,
    install: true,
    install_dir: get_option('libexecdir') / 'git-core',
  )
elif target_machine.system() == 'darwin'
  gitgui_main = 'git-gui.tcl'
  gitgui_main_install_dir = get_option('datadir') / 'git-gui/lib'

  custom_target(
    output: 'git-gui',
    command: [
      shell,
      meson.current_source_dir() / 'generate-macos-wrapper.sh',
      '@OUTPUT@',
      meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS',
      meson.current_build_dir() / 'GIT-VERSION-FILE',
    ],
    depends: [
      version_file,
    ],
    depend_files: [
      build_options,
    ],
    install: true,
    install_dir: get_option('libexecdir') / 'git-core',
  )

  custom_target(
    output: 'Git Gui.app',
    command: [
      shell,
      meson.current_source_dir() / 'generate-macos-app.sh',
      meson.current_source_dir(),
      meson.current_build_dir() / 'Git Gui.app',
      meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS',
      meson.current_build_dir() / 'GIT-VERSION-FILE',
    ],
    depends: [
      version_file,
    ],
    depend_files: [
      build_options,
      'macosx/AppMain.tcl',
      'macosx/Info.plist',
      'macosx/git-gui.icns',
    ],
    build_by_default: true,
    install: true,
    install_dir: get_option('datadir') / 'git-gui/lib',
  )
endif

custom_target(
  input: 'git-gui.sh',
  output: gitgui_main,
  command: [
    shell,
    meson.current_source_dir() / 'generate-git-gui.sh',
    '@INPUT@',
    '@OUTPUT@',
    meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS',
    meson.current_build_dir() / 'GIT-VERSION-FILE',
  ],
  depends: [
    version_file,
  ],
  depend_files: [
    build_options,
  ],
  install: true,
  install_dir: gitgui_main_install_dir,
)

install_symlink('git-citool',
  install_dir: get_option('libexecdir') / 'git-core',
  pointing_to: 'git-gui',
)

subdir('lib')
subdir('po')