blob: 416c2afa911349c07cd576b894cae73f5486b103 [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/package.gni")
package("git") {
system_image = true
deps = [
":all",
]
binaries = [
{
name = "git"
},
{
name = "git-daemon"
},
{
name = "git-http-backend"
},
{
name = "git-http-fetch"
},
{
name = "git-http-push"
},
{
name = "git-remote-http"
},
{
name = "git-remote-http"
},
{
name = "git-upload-pack"
},
]
}
config("git_config") {
cflags = [
"-Wno-sign-compare",
"-Wno-missing-field-initializers",
"-Wno-pointer-bool-conversion",
"-Wno-tautological-compare",
]
defines = [
"BINDIR=\"/bin\"",
"DEFAULT_PAGER=\"cat\"",
"ETC_GITATTRIBUTES=\"/etc/gitattributes\"",
"ETC_GITCONFIG=\"/etc/gitconfig\"",
"GAWK",
"GIT_EXEC_PATH=\"\"",
"GIT_HTML_PATH=\"/html\"",
"GIT_INFO_PATH=\"/info\"",
"GIT_LOCALE_PATH=\"/share/locale\"",
"GIT_MAN_PATH=\"/man\"",
"GIT_USER_AGENT=\"git\"",
"GIT_VERSION=\"\"",
"HAVE_CLOCK_GETTIME",
"HAVE_CLOCK_MONOTONIC",
"HAVE_GETDELIM",
"HAVE_SYS_IOCTL_H",
"NO_MBSUPPORT",
"NO_MMAP",
"NO_PERL",
"NO_REGEX",
"NO_SYS_POLL_H",
"PAGER_ENV=\"LESS=FRX LV=-c\"",
"PREFIX=\"/system/bin\"",
]
include_dirs = [
".",
"compat/regex",
]
}
source_set("git_srcs") {
sources = [
"abspath.c",
"advice.c",
"advice.h",
"alias.c",
"alloc.c",
"apply.c",
"apply.h",
"archive-tar.c",
"archive-zip.c",
"archive.c",
"archive.h",
"argv-array.c",
"argv-array.h",
"attr.c",
"attr.h",
"base85.c",
"bisect.c",
"bisect.h",
"blob.c",
"blob.h",
"block-sha1/sha1.c",
"block-sha1/sha1.h",
"branch.c",
"branch.h",
"bulk-checkin.c",
"bulk-checkin.h",
"bundle.c",
"bundle.h",
"cache-tree.c",
"cache-tree.h",
"cache.h",
# "check-racy.c",
"color.c",
"color.h",
"column.c",
"column.h",
"combine-diff.c",
"commit-slab.h",
"commit.c",
"commit.h",
"common-main.c",
"compat/bswap.h",
"compat/fopen.c",
"compat/hstrerror.c",
"compat/memmem.c",
"compat/mkdir.c",
"compat/mkdtemp.c",
"compat/mmap.c",
"compat/obstack.c",
"compat/obstack.h",
"compat/poll/poll.c",
"compat/poll/poll.h",
"compat/pread.c",
"compat/qsort.c",
"compat/qsort_s.c",
"compat/regex/regex.c",
"compat/regex/regex.h",
"compat/setenv.c",
"compat/snprintf.c",
"compat/stat.c",
"compat/strcasestr.c",
"compat/strlcpy.c",
"compat/strtoimax.c",
"compat/strtoumax.c",
"compat/terminal.c",
"compat/terminal.h",
"config.c",
"connect.c",
"connect.h",
"connected.c",
"connected.h",
"convert.c",
"convert.h",
"copy.c",
# "credential-cache--daemon.c",
# "credential-cache.c",
# "credential-store.c",
"credential.c",
"credential.h",
"csum-file.c",
"csum-file.h",
"ctype.c",
"date.c",
"decorate.c",
"decorate.h",
"delta.h",
"diff-delta.c",
"diff-lib.c",
"diff-no-index.c",
"diff.c",
"diff.h",
"diffcore-break.c",
"diffcore-delta.c",
"diffcore-order.c",
"diffcore-pickaxe.c",
"diffcore-rename.c",
"diffcore.h",
"dir-iterator.c",
"dir-iterator.h",
"dir.c",
"dir.h",
"editor.c",
"entry.c",
"environment.c",
"ewah/bitmap.c",
"ewah/ewah_bitmap.c",
"ewah/ewah_io.c",
"ewah/ewah_rlw.c",
"ewah/ewok.h",
"ewah/ewok_rlw.h",
"exec_cmd.c",
"exec_cmd.h",
# "fast-import.c",
"fetch-pack.c",
"fetch-pack.h",
"fmt-merge-msg.h",
"fsck.c",
"fsck.h",
"gettext.c",
"gettext.h",
"git-compat-util.h",
"gpg-interface.c",
"gpg-interface.h",
"graph.c",
"graph.h",
"grep.c",
"grep.h",
"hash.h",
"hashmap.c",
"hashmap.h",
"help.c",
"help.h",
"hex.c",
"ident.c",
# "imap-send.c",
"iterator.h",
"khash.h",
"kwset.c",
"kwset.h",
"levenshtein.c",
"levenshtein.h",
"line-log.c",
"line-log.h",
"line-range.c",
"line-range.h",
"list-objects.c",
"list-objects.h",
"list.h",
"ll-merge.c",
"ll-merge.h",
"lockfile.c",
"lockfile.h",
"log-tree.c",
"log-tree.h",
"mailinfo.c",
"mailinfo.h",
"mailmap.c",
"mailmap.h",
"match-trees.c",
"merge-blobs.c",
"merge-blobs.h",
"merge-recursive.c",
"merge-recursive.h",
"merge.c",
"mergesort.c",
"mergesort.h",
"mru.c",
"mru.h",
"name-hash.c",
"notes-cache.c",
"notes-cache.h",
"notes-merge.c",
"notes-merge.h",
"notes-utils.c",
"notes-utils.h",
"notes.c",
"notes.h",
"object.c",
"object.h",
"oidset.c",
"oidset.h",
"pack-bitmap-write.c",
"pack-bitmap.c",
"pack-bitmap.h",
"pack-check.c",
"pack-objects.c",
"pack-objects.h",
"pack-revindex.c",
"pack-revindex.h",
"pack-write.c",
"pack.h",
"pager.c",
"parse-options-cb.c",
"parse-options.c",
"parse-options.h",
"patch-delta.c",
"patch-ids.c",
"patch-ids.h",
"path.c",
"pathspec.c",
"pathspec.h",
"pkt-line.c",
"pkt-line.h",
"preload-index.c",
"pretty.c",
"prio-queue.c",
"prio-queue.h",
"progress.c",
"progress.h",
"prompt.c",
"prompt.h",
"quote.c",
"quote.h",
"reachable.c",
"reachable.h",
"read-cache.c",
"ref-filter.c",
"ref-filter.h",
"reflog-walk.c",
"reflog-walk.h",
"refs.c",
"refs.h",
"refs/files-backend.c",
"refs/iterator.c",
"refs/refs-internal.h",
# "remote-testsvn.c",
"remote.c",
"remote.h",
"replace_object.c",
"rerere.c",
"rerere.h",
"resolve-undo.c",
"resolve-undo.h",
"revision.c",
"revision.h",
"run-command.c",
"run-command.h",
"send-pack.c",
"send-pack.h",
"sequencer.c",
"sequencer.h",
"server-info.c",
"setup.c",
# "sh-i18n--envsubst.c",
"sha1-array.c",
"sha1-array.h",
"sha1-lookup.c",
"sha1-lookup.h",
"sha1_file.c",
"sha1_name.c",
"shallow.c",
# "shell.c",
"shortlog.h",
# "show-index.c",
"sideband.c",
"sideband.h",
"sigchain.c",
"sigchain.h",
"split-index.c",
"split-index.h",
"strbuf.c",
"strbuf.h",
"streaming.c",
"streaming.h",
"string-list.c",
"string-list.h",
"submodule-config.c",
"submodule-config.h",
"submodule.c",
"submodule.h",
"symlinks.c",
"tag.c",
"tag.h",
"tar.h",
"tempfile.c",
"tempfile.h",
"thread-utils.c",
"thread-utils.h",
"tmp-objdir.c",
"tmp-objdir.h",
"trace.c",
"trace.h",
"trailer.c",
"trailer.h",
"transport-helper.c",
"transport.c",
"transport.h",
"tree-diff.c",
"tree-walk.c",
"tree-walk.h",
"tree.c",
"tree.h",
"unicode_width.h",
"unix-socket.c",
"unix-socket.h",
"unpack-trees.c",
"unpack-trees.h",
"url.c",
"url.h",
"urlmatch.c",
"urlmatch.h",
"usage.c",
"userdiff.c",
"userdiff.h",
"utf8.c",
"utf8.h",
"varint.c",
"varint.h",
"vcs-svn/fast_export.c",
"vcs-svn/fast_export.h",
"vcs-svn/line_buffer.c",
"vcs-svn/line_buffer.h",
"vcs-svn/repo_tree.c",
"vcs-svn/repo_tree.h",
"vcs-svn/sliding_window.c",
"vcs-svn/sliding_window.h",
"vcs-svn/svndiff.c",
"vcs-svn/svndiff.h",
"vcs-svn/svndump.c",
"vcs-svn/svndump.h",
"version.c",
"version.h",
"versioncmp.c",
"walker.c",
"walker.h",
"wildmatch.c",
"wildmatch.h",
"worktree.c",
"worktree.h",
"wrapper.c",
"write_or_die.c",
"ws.c",
"wt-status.c",
"wt-status.h",
"xdiff-interface.c",
"xdiff-interface.h",
"xdiff/xdiff.h",
"xdiff/xdiffi.c",
"xdiff/xdiffi.h",
"xdiff/xemit.c",
"xdiff/xemit.h",
"xdiff/xhistogram.c",
"xdiff/xinclude.h",
"xdiff/xmacros.h",
"xdiff/xmerge.c",
"xdiff/xpatience.c",
"xdiff/xprepare.c",
"xdiff/xprepare.h",
"xdiff/xtypes.h",
"xdiff/xutils.c",
"xdiff/xutils.h",
"zlib.c",
]
public_deps = [
"//third_party/boringssl:crypto",
"//third_party/boringssl:ssl",
"//third_party/curl:libcurl",
"//third_party/expat",
"//third_party/zlib",
]
public_configs = [ ":git_config" ]
libs = [ "launchpad" ]
}
executable("git-bin") {
output_name = "git"
sources = [
"builtin.h",
"builtin/add.c",
"builtin/am.c",
"builtin/annotate.c",
"builtin/apply.c",
"builtin/archive.c",
"builtin/bisect--helper.c",
"builtin/blame.c",
"builtin/branch.c",
"builtin/bundle.c",
"builtin/cat-file.c",
"builtin/check-attr.c",
"builtin/check-ignore.c",
"builtin/check-mailmap.c",
"builtin/check-ref-format.c",
"builtin/checkout-index.c",
"builtin/checkout.c",
"builtin/clean.c",
"builtin/clone.c",
"builtin/column.c",
"builtin/commit-tree.c",
"builtin/commit.c",
"builtin/config.c",
"builtin/count-objects.c",
"builtin/credential.c",
"builtin/describe.c",
"builtin/diff-files.c",
"builtin/diff-index.c",
"builtin/diff-tree.c",
"builtin/diff.c",
"builtin/difftool.c",
"builtin/fast-export.c",
"builtin/fetch-pack.c",
"builtin/fetch.c",
"builtin/fmt-merge-msg.c",
"builtin/for-each-ref.c",
"builtin/fsck.c",
"builtin/gc.c",
"builtin/get-tar-commit-id.c",
"builtin/grep.c",
"builtin/hash-object.c",
"builtin/help.c",
"builtin/index-pack.c",
"builtin/init-db.c",
"builtin/interpret-trailers.c",
"builtin/log.c",
"builtin/ls-files.c",
"builtin/ls-remote.c",
"builtin/ls-tree.c",
"builtin/mailinfo.c",
"builtin/mailsplit.c",
"builtin/merge-base.c",
"builtin/merge-file.c",
"builtin/merge-index.c",
"builtin/merge-ours.c",
"builtin/merge-recursive.c",
"builtin/merge-tree.c",
"builtin/merge.c",
"builtin/mktag.c",
"builtin/mktree.c",
"builtin/mv.c",
"builtin/name-rev.c",
"builtin/notes.c",
"builtin/pack-objects.c",
"builtin/pack-redundant.c",
"builtin/pack-refs.c",
"builtin/patch-id.c",
"builtin/prune-packed.c",
"builtin/prune.c",
"builtin/pull.c",
"builtin/push.c",
"builtin/read-tree.c",
"builtin/rebase--helper.c",
"builtin/receive-pack.c",
"builtin/reflog.c",
"builtin/remote-ext.c",
"builtin/remote-fd.c",
"builtin/remote.c",
"builtin/repack.c",
"builtin/replace.c",
"builtin/rerere.c",
"builtin/reset.c",
"builtin/rev-list.c",
"builtin/rev-parse.c",
"builtin/revert.c",
"builtin/rm.c",
"builtin/send-pack.c",
"builtin/shortlog.c",
"builtin/show-branch.c",
"builtin/show-ref.c",
"builtin/stripspace.c",
"builtin/submodule--helper.c",
"builtin/symbolic-ref.c",
"builtin/tag.c",
"builtin/unpack-file.c",
"builtin/unpack-objects.c",
"builtin/update-index.c",
"builtin/update-ref.c",
"builtin/update-server-info.c",
"builtin/upload-archive.c",
"builtin/var.c",
"builtin/verify-commit.c",
"builtin/verify-pack.c",
"builtin/verify-tag.c",
"builtin/worktree.c",
"builtin/write-tree.c",
"git.c",
]
deps = [
":git_srcs",
]
}
template("gitprogram") {
executable("git-" + target_name) {
sources = [
invoker.target_name + ".c",
]
if (defined(invoker.sources)) {
sources += invoker.sources
}
deps = [
":git_srcs",
]
}
}
gitprogram("daemon") {
}
gitprogram("http-backend") {
}
gitprogram("http-fetch") {
sources = [
"http-walker.c",
"http.c",
"http.h",
]
}
gitprogram("http-push") {
sources = [
"http.c",
"http.h",
]
}
gitprogram("upload-pack") {
}
executable("git-remote-http") {
sources = [
"http-walker.c",
"http.c",
"remote-curl.c",
]
deps = [
":git_srcs",
]
}
group("all") {
public_deps = [
":git-bin",
":git-daemon",
":git-http-backend",
":git-http-fetch",
":git-http-push",
":git-remote-http",
":git-upload-pack",
]
}