git: allow parallel build
[unleashed-userland.git] / components / developer / git / Makefile
blob62ed9f4dbe59b8d11d8ed2c0f48f0b419d7c3c80
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
21 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
23 include ../../../make-rules/shared-macros.mk
25 COMPONENT_NAME= git
26 COMPONENT_VERSION= 2.14.2
27 COMPONENT_PROJECT_URL= https://git-scm.com/
28 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
29 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
30 COMPONENT_ARCHIVE_HASH= sha256:50e9723996114ad1eec4dda89960d9fe34461749ae42031008a261fedd03c7a1
31 COMPONENT_ARCHIVE_URL= https://www.kernel.org/pub/software/scm/git/$(COMPONENT_ARCHIVE)
32 COMPONENT_BUGDB= utility/git
33 COMPONENT_FMRI= developer/versioning/git
34 COMPONENT_LICENSE= GPLv2
35 COMPONENT_LICENSE_FILE= git.license
36 COMPONENT_SUMMARY= git - Fast Version Control System
37 COMPONENT_DESCRIPTION= Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
38 COMPONENT_CLASSIFICATION= Development/Source Code Management
41 # man pages are a separate archive
43 COMPONENT_ARCHIVE_1= $(COMPONENT_NAME)-manpages-$(COMPONENT_VERSION).tar.xz
44 COMPONENT_ARCHIVE_HASH_1= sha256:6dd350d1e9d00159a549f0fad08a9f954b1d12576fc8d5865fbed9dee15105fc
45 COMPONENT_ARCHIVE_URL_1= https://www.kernel.org/pub/software/scm/git/$(COMPONENT_ARCHIVE_1)
47 include $(WS_MAKE_RULES)/prep.mk
48 include $(WS_MAKE_RULES)/configure.mk
49 include $(WS_MAKE_RULES)/ips.mk
51 LDFLAGS += -lnsl
53 CONFIGURE_BINDIR.64 = $(CONFIGURE_BINDIR.32)
54 CONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib
56 CONFIGURE_PREFIX = /usr
57 CONFIGURE_OPTIONS += --with-libpcre
58 CONFIGURE_OPTIONS += --without-openssl
59 CONFIGURE_OPTIONS += --libexecdir=/usr/lib
60 CONFIGURE_OPTIONS += --with-perl=$(PERL)
61 CONFIGURE_OPTIONS += --with-perl=$(PERL)
62 CONFIGURE_OPTIONS += --without-tcltk
63 CONFIGURE_OPTIONS += CPPFLAGS="-I/usr/include/pcre"
65 ENV = puname env
66 COMPONENT_BUILD_ENV+= NO_PERL_MAKEMAKER=1
67 COMPONENT_INSTALL_ENV+= NO_PERL_MAKEMAKER=1
68 COMPONENT_INSTALL_ENV+= PERL_LIB=$(shell $(PERL) -MConfig -e 'print "$$Config{installvendorarch}"')
69 COMPONENT_INSTALL_ARGS+= INSTALL="$(INSTALL)"
71 # This runs configure but configure doesn't generate a Makefile.
72 # Instead a Makefile comes with git.
73 # Anyways viewpathing doesn't work.
74 # Therefore we need cloney to copy a set of files to build.
75 # Overwrite symliked tests, because they relying on test assets being regular files.
77 COMPONENT_PRE_CONFIGURE_ACTION = \
78 (chmod u+x $(COMPONENT_SRC)/t/*.sh && $(CLONEY) $(SOURCE_DIR) $(@D) && \
79 $(RM) -r $(@D)/t && $(CP) -rp $(COMPONENT_SRC)/t $(@D))
81 PKG_HARDLINKS += usr/lib/git-core/git
82 PKG_HARDLINKS += usr/lib/git-core/git-cvsserver
83 PKG_HARDLINKS += usr/lib/git-core/git-gui
84 PKG_HARDLINKS += usr/lib/git-core/git-remote-ftps
85 PKG_HARDLINKS += usr/lib/git-core/git-shell
86 PKG_HARDLINKS += usr/lib/git-core/git-upload-pack
88 # We want the perl modules to install the vendor_perl directory, and their
89 # manpages to install in the normal perl manpage directory, but the default
90 # behavior is to put the modules in /usr/lib. Setting these four variables
91 # massages the perl to get files to go where we want.
92 COMPONENT_INSTALL_ARGS+= INSTALL="$(INSTALL)"
93 COMPONENT_INSTALL_ARGS+= VENDORPREFIX=$(call PERL_CONFIG,installvendorlib)
94 COMPONENT_INSTALL_ARGS+= PERLPREFIX=$(call PERL_CONFIG,installprefix)
95 COMPONENT_INSTALL_ARGS+= INSTALLVENDORLIB='$$(VENDORPREFIX)'
96 COMPONENT_INSTALL_ARGS+= INSTALLVENDORMAN3DIR='$$(INSTALLMAN3DIR)'
98 # Some tests (like t9402-git-cvsserver-refs.sh) need GNU diff.
99 COMPONENT_TEST_ENV += PATH="$(GNUBIN):$(PATH)"
101 # many failures; keep going; later versions of git are much cleaner
102 COMPONENT_TEST_ARGS += -k -i
103 # If GITTEST_JOBS is set, then run the jobs in parallel (to that number)
104 COMPONENT_TEST_ARGS += $(if $(GITTEST_JOBS),-j$(GITTEST_JOBS),)
105 COMPONENT_TEST_TARGETS = test
106 # Enable tests requiring Apache
107 COMPONENT_TEST_TARGETS += LIB_HTTPD_PATH=/usr/apache2/2.4/bin/httpd
108 COMPONENT_TEST_TARGETS += LIB_HTTPD_MODULE_PATH=/usr/apache2/2.4/libexec
109 # Put each test result in a file; necessary if jobs run in parallel
110 COMPONENT_TEST_TARGETS += GIT_TEST_OPTS=--tee
111 COMPONENT_TEST_TARGETS += DEFAULT_TEST_TARGET=test-noclean
112 # Compile the test results and put that into the test output file instead
113 COMPONENT_POST_TEST_ACTION = \
114 (cd $(COMPONENT_TEST_DIR)/t/test-results; for i in *.out; do \
115 echo "*** $${i%.out}.sh ***"; \
116 cat $$i; \
117 done; \
118 cd ..; \
119 $(GMAKE) -s aggregate-results) &> $(COMPONENT_TEST_OUTPUT)
122 # These man pages come in a separate archive with no Makefile
123 # and Solaris likes some of them moved around hence we'll just
124 # do it manually here.
126 $(BUILD_DIR)/.manpages: build
127 cd $(BUILD_DIR) ; $(UNPACK) $(UNPACK_ARGS) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1)
128 $(MKDIR) $(PROTOUSRSHAREMAN1DIR)
129 $(MKDIR) $(PROTOUSRSHAREMAN4DIR)
130 $(MKDIR) $(PROTOUSRSHAREMAN5DIR)
131 cd $(BUILD_DIR) ; for manfile in man*/* ; \
132 do \
133 filename=`basename $$manfile`; \
134 fname=$${filename%.*}; \
135 ext=$${filename##*.}; \
136 newext=1; \
137 if [ $$ext = 5 ]; then newext=4; fi; \
138 if [ $$ext = 7 ]; then newext=5; fi; \
139 $(GSED) -e 's/\\m\[blue\]//g' -e 's/\\m\[\]//g' \
140 -e 's/"5"/"4"/' -e 's/(5)/(4)/g' \
141 -e 's/"7"/"5"/' -e 's/(7)/(5)/g' $$manfile > \
142 $(PROTOUSRSHAREMANDIR)/man$$newext/$$fname.$$newext; \
143 done
144 $(TOUCH) $@
146 $(BUILD_DIR_64)/.contrib: build
147 $(MKDIR) $(PROTOUSRSHAREDIR)/bash-completion/completions $(PROTOUSRBINDIR)
148 $(GMAKE) -C $(BUILD_DIR_64)/contrib/diff-highlight
149 $(CP) -RLp $(BUILD_DIR_64)/contrib/diff-highlight/diff-highlight $(PROTOUSRBINDIR)/diff-highlight
150 $(CP) -RLp $(BUILD_DIR_64)/contrib/completion/git-completion.bash $(PROTOUSRSHAREDIR)/bash-completion/completions/git
151 (cd $(PROTOUSRSHAREDIR)/bash-completion/completions; $(LN) -sf git gitk)
152 $(TOUCH) $@
154 build: $(BUILD_64)
156 install: $(INSTALL_64) $(BUILD_DIR)/.manpages $(BUILD_DIR_64)/.contrib
158 test: $(TEST_64)
160 # Test dependencies
161 REQUIRED_PACKAGES += system/library/iconv/extra
162 REQUIRED_PACKAGES += system/library/iconv/unicode
163 REQUIRED_PACKAGES += system/library/iconv/utf-8
164 REQUIRED_PACKAGES += library/perl-5/sqlite-dbi
165 REQUIRED_PACKAGES += library/perl-5/subversion
166 REQUIRED_PACKAGES += locale/is
167 REQUIRED_PACKAGES += locale/is-extra
169 # Auto-generated dependencies
170 REQUIRED_PACKAGES += SUNWcs
171 REQUIRED_PACKAGES += library/expat
172 REQUIRED_PACKAGES += library/pcre
173 REQUIRED_PACKAGES += library/zlib
174 REQUIRED_PACKAGES += runtime/perl-522
175 REQUIRED_PACKAGES += runtime/python-27
176 REQUIRED_PACKAGES += shell/bash
177 REQUIRED_PACKAGES += system/library
178 REQUIRED_PACKAGES += web/curl