Browse Source

git: import from packages

Signed-off-by: Peter Wagner <tripolar@gmx.at>
Peter Wagner 10 years ago
parent
commit
306378c90d

+ 70
- 0
net/git/Makefile View File

@@ -0,0 +1,70 @@
1
+#
2
+# Copyright (C) 2009-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=git
11
+PKG_VERSION:=2.0.0
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15
+PKG_SOURCE_URL:=@KERNEL/software/scm/git/
16
+PKG_MD5SUM:=0646202ae979e4339f3e47f2375b5773
17
+
18
+PKG_INSTALL:=1
19
+PKG_BUILD_PARALLEL:=1
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+
23
+define Package/git
24
+  SECTION:=net
25
+  CATEGORY:=Network
26
+  SUBMENU:=Version Control Systems
27
+  DEPENDS:=+libopenssl +libpthread
28
+  TITLE:=The fast version control system
29
+  URL:=http://git-scm.com
30
+endef
31
+
32
+define Package/git/description
33
+ Git is a free & open source, distributed version control system
34
+ designed to handle everything from small to very large projects
35
+ with speed and efficiency.
36
+endef
37
+
38
+MAKE_FLAGS := \
39
+	CC="$(TARGET_CC)" \
40
+	CFLAGS="$(TARGET_CFLAGS)" \
41
+	CPPFLAGS="$(TARGET_CPPFLAGS)" \
42
+	LDFLAGS="$(TARGET_LDFLAGS)" \
43
+	NO_CURL="YesPlease" \
44
+	NO_EXPAT="YesPlease" \
45
+	NO_MKSTEMPS="YesPlease" \
46
+	NO_GETTEXT="YesPlease" \
47
+	NO_UNIX_SOCKETS="YesPlease" \
48
+	NO_IPV6="YesPlease" \
49
+	NO_ICONV="YesPlease" \
50
+	NO_NSEC="YesPlease" \
51
+	NO_PERL="YesPlease" \
52
+	NO_PYTHON="YesPlease" \
53
+	NO_TCLTK="YesPlease"
54
+
55
+define Build/Configure
56
+	$(MAKE) -C $(PKG_BUILD_DIR) \
57
+		configure
58
+
59
+	( cd $(PKG_BUILD_DIR); \
60
+		./configure --prefix=/usr \
61
+	);
62
+endef
63
+
64
+define Package/git/install
65
+	$(INSTALL_DIR) $(1)
66
+	$(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
67
+	$(CP) $(PKG_INSTALL_DIR)/* $(1)/
68
+endef
69
+
70
+$(eval $(call BuildPackage,git))

+ 233
- 0
net/git/patches/100-convert_builtin.patch View File

@@ -0,0 +1,233 @@
1
+--- a/Makefile
2
++++ b/Makefile
3
+@@ -532,16 +532,7 @@ EXTRA_PROGRAMS =
4
+ # ... and all the rest that could be moved out of bindir to gitexecdir
5
+ PROGRAMS += $(EXTRA_PROGRAMS)
6
+ 
7
+-PROGRAM_OBJS += credential-store.o
8
+-PROGRAM_OBJS += daemon.o
9
+-PROGRAM_OBJS += fast-import.o
10
+-PROGRAM_OBJS += http-backend.o
11
+-PROGRAM_OBJS += imap-send.o
12
+-PROGRAM_OBJS += sh-i18n--envsubst.o
13
+-PROGRAM_OBJS += shell.o
14
+-PROGRAM_OBJS += show-index.o
15
+-PROGRAM_OBJS += upload-pack.o
16
+-PROGRAM_OBJS += remote-testsvn.o
17
++PROGRAM_OBJS =
18
+ 
19
+ # Binary suffix, set to .exe for Windows builds
20
+ X =
21
+@@ -1002,6 +993,12 @@ BUILTIN_OBJS += builtin/var.o
22
+ BUILTIN_OBJS += builtin/verify-pack.o
23
+ BUILTIN_OBJS += builtin/verify-tag.o
24
+ BUILTIN_OBJS += builtin/write-tree.o
25
++BUILTIN_OBJS += builtin/daemon.o
26
++BUILTIN_OBJS += builtin/fast-import.o
27
++BUILTIN_OBJS += builtin/http-backend.o
28
++BUILTIN_OBJS += builtin/imap-send.o
29
++BUILTIN_OBJS += builtin/shell.o
30
++BUILTIN_OBJS += builtin/upload-pack.o
31
+ 
32
+ GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
33
+ EXTLIBS =
34
+@@ -1165,7 +1162,7 @@ endif
35
+ EXTLIBS += -lz
36
+ 
37
+ ifndef NO_OPENSSL
38
+-	OPENSSL_LIBSSL = -lssl
39
++	EXTLIBS += -lssl
40
+ 	ifdef OPENSSLDIR
41
+ 		BASIC_CFLAGS += -I$(OPENSSLDIR)/include
42
+ 		OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
43
+@@ -2049,10 +2046,6 @@ endif
44
+ git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
45
+ 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
46
+ 
47
+-git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS)
48
+-	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
49
+-		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
50
+-
51
+ git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
52
+ 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
53
+ 		$(LIBS) $(CURL_LIBCURL)
54
+@@ -2364,24 +2357,22 @@ endif
55
+ 	bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
56
+ 	execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
57
+ 	{ test "$$bindir/" = "$$execdir/" || \
58
+-	  for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
59
++	  for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
60
+ 		$(RM) "$$execdir/$$p" && \
61
+ 		test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
62
+-		ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
63
++		ln -s git "$$execdir/$$p" 2>/dev/null || \
64
+ 		cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
65
+ 	  done; \
66
+ 	} && \
67
+ 	for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
68
+ 		$(RM) "$$bindir/$$p" && \
69
+ 		test -z "$(NO_INSTALL_HARDLINKS)" && \
70
+-		ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
71
+ 		ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
72
+ 		cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
73
+ 	done && \
74
+ 	for p in $(BUILT_INS); do \
75
+ 		$(RM) "$$execdir/$$p" && \
76
+ 		test -z "$(NO_INSTALL_HARDLINKS)" && \
77
+-		ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
78
+ 		ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
79
+ 		cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
80
+ 	done && \
81
+--- a/builtin.h
82
++++ b/builtin.h
83
+@@ -136,5 +136,11 @@ extern int cmd_verify_pack(int argc, con
84
+ extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
85
+ extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
86
+ extern int cmd_replace(int argc, const char **argv, const char *prefix);
87
++extern int cmd_daemon(int argc, char **argv, const char *prefix);
88
++extern int cmd_fast_import(int argc, char **argv, const char *prefix);
89
++extern int cmd_http_backend(int argc, char **argv, const char *prefix);
90
++extern int cmd_imap_send(int argc, char **argv, const char *prefix);
91
++extern int cmd_shell(int argc, char **argv, const char *prefix);
92
++extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
93
+ 
94
+ #endif
95
+--- /dev/null
96
++++ b/builtin/daemon.c
97
+@@ -0,0 +1 @@
98
++#include "../daemon.c"
99
+--- /dev/null
100
++++ b/builtin/fast-import.c
101
+@@ -0,0 +1 @@
102
++#include "../fast-import.c"
103
+--- /dev/null
104
++++ b/builtin/http-backend.c
105
+@@ -0,0 +1 @@
106
++#include "../http-backend.c"
107
+--- /dev/null
108
++++ b/builtin/imap-send.c
109
+@@ -0,0 +1 @@
110
++#include "../imap-send.c"
111
+--- /dev/null
112
++++ b/builtin/shell.c
113
+@@ -0,0 +1 @@
114
++#include "../shell.c"
115
+--- /dev/null
116
++++ b/builtin/upload-pack.c
117
+@@ -0,0 +1 @@
118
++#include "../upload-pack.c"
119
+--- a/daemon.c
120
++++ b/daemon.c
121
+@@ -1125,7 +1125,7 @@ static int serve(struct string_list *lis
122
+ 	return service_loop(&socklist);
123
+ }
124
+ 
125
+-int main(int argc, char **argv)
126
++int cmd_daemon(int argc, char **argv, const char *prefix)
127
+ {
128
+ 	int listen_port = 0;
129
+ 	struct string_list listen_addr = STRING_LIST_INIT_NODUP;
130
+--- a/fast-import.c
131
++++ b/fast-import.c
132
+@@ -3356,7 +3356,7 @@ static void parse_argv(void)
133
+ 		read_marks();
134
+ }
135
+ 
136
+-int main(int argc, char **argv)
137
++int cmd_fast_import(int argc, char **argv, const char *prefix)
138
+ {
139
+ 	unsigned int i;
140
+ 
141
+--- a/git.c
142
++++ b/git.c
143
+@@ -275,11 +275,11 @@ static int handle_alias(int *argcp, cons
144
+ 
145
+ struct cmd_struct {
146
+ 	const char *cmd;
147
+-	int (*fn)(int, const char **, const char *);
148
++	int (*fn)(int, char **, const char *);
149
+ 	int option;
150
+ };
151
+ 
152
+-static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
153
++static int run_builtin(struct cmd_struct *p, int argc, char **argv)
154
+ {
155
+ 	int status, help;
156
+ 	struct stat st;
157
+@@ -359,6 +359,7 @@ static struct cmd_struct commands[] = {
158
+ 	{ "config", cmd_config, RUN_SETUP_GENTLY },
159
+ 	{ "count-objects", cmd_count_objects, RUN_SETUP },
160
+ 	{ "credential", cmd_credential, RUN_SETUP_GENTLY },
161
++	{ "daemon", cmd_daemon },
162
+ 	{ "describe", cmd_describe, RUN_SETUP },
163
+ 	{ "diff", cmd_diff },
164
+ 	{ "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
165
+@@ -377,6 +378,8 @@ static struct cmd_struct commands[] = {
166
+ 	{ "grep", cmd_grep, RUN_SETUP_GENTLY },
167
+ 	{ "hash-object", cmd_hash_object },
168
+ 	{ "help", cmd_help },
169
++	{ "http-backend", cmd_http_backend },
170
++	{ "imap-send", cmd_imap_send },
171
+ 	{ "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
172
+ 	{ "init", cmd_init_db },
173
+ 	{ "init-db", cmd_init_db },
174
+@@ -424,6 +427,7 @@ static struct cmd_struct commands[] = {
175
+ 	{ "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
176
+ 	{ "rm", cmd_rm, RUN_SETUP },
177
+ 	{ "send-pack", cmd_send_pack, RUN_SETUP },
178
++	{ "shell", cmd_shell },
179
+ 	{ "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
180
+ 	{ "show", cmd_show, RUN_SETUP },
181
+ 	{ "show-branch", cmd_show_branch, RUN_SETUP },
182
+@@ -440,6 +444,7 @@ static struct cmd_struct commands[] = {
183
+ 	{ "update-server-info", cmd_update_server_info, RUN_SETUP },
184
+ 	{ "upload-archive", cmd_upload_archive },
185
+ 	{ "upload-archive--writer", cmd_upload_archive_writer },
186
++	{ "upload-pack", cmd_upload_pack },
187
+ 	{ "var", cmd_var, RUN_SETUP_GENTLY },
188
+ 	{ "verify-pack", cmd_verify_pack },
189
+ 	{ "verify-tag", cmd_verify_tag, RUN_SETUP },
190
+--- a/http-backend.c
191
++++ b/http-backend.c
192
+@@ -563,7 +563,7 @@ static struct service_cmd {
193
+ 	{"POST", "/git-receive-pack$", service_rpc}
194
+ };
195
+ 
196
+-int main(int argc, char **argv)
197
++int cmd_http_backend(int argc, char **argv, const char *prefix)
198
+ {
199
+ 	char *method = getenv("REQUEST_METHOD");
200
+ 	char *dir;
201
+--- a/imap-send.c
202
++++ b/imap-send.c
203
+@@ -1362,7 +1362,7 @@ static int git_imap_config(const char *k
204
+ 	return 0;
205
+ }
206
+ 
207
+-int main(int argc, char **argv)
208
++int cmd_imap_send(int argc, char **argv, const char *prefix)
209
+ {
210
+ 	struct strbuf all_msgs = STRBUF_INIT;
211
+ 	struct strbuf msg = STRBUF_INIT;
212
+--- a/shell.c
213
++++ b/shell.c
214
+@@ -142,7 +142,7 @@ static struct commands {
215
+ 	{ NULL },
216
+ };
217
+ 
218
+-int main(int argc, char **argv)
219
++int cmd_shell(int argc, char **argv, const char *prefix)
220
+ {
221
+ 	char *prog;
222
+ 	const char **user_argv;
223
+--- a/upload-pack.c
224
++++ b/upload-pack.c
225
+@@ -790,7 +790,7 @@ static int upload_pack_config(const char
226
+ 	return parse_hide_refs_config(var, value, "uploadpack");
227
+ }
228
+ 
229
+-int main(int argc, char **argv)
230
++int cmd_upload_pack(int argc, char **argv, const char *prefix)
231
+ {
232
+ 	char *dir;
233
+ 	int i;

+ 12
- 0
net/git/patches/200-disable_fasthash.patch View File

@@ -0,0 +1,12 @@
1
+--- a/config.mak.uname
2
++++ b/config.mak.uname
3
+@@ -17,9 +17,6 @@ endif
4
+ # because maintaining the nesting to match is a pain.  If
5
+ # we had "elif" things would have been much nicer...
6
+ 
7
+-ifeq ($(uname_M),x86_64)
8
+-	XDL_FAST_HASH = YesPlease
9
+-endif
10
+ ifeq ($(uname_S),OSF1)
11
+ 	# Need this for u_short definitions et al
12
+ 	BASIC_CFLAGS += -D_OSF_SOURCE