From c609cbd63a1a815684f6909647a275c37bfccc38 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 19 Jan 2015 20:17:28 -0500 Subject: [PATCH] git: version 2.2.2. * Tested with HaikuPorter, works * No longer needs Python * Has fancy colorized terminal output --- dev-vcs/git/git-2.2.2.recipe | 222 +++++++++++++++++++++++++ dev-vcs/git/patches/git-2.2.2.patchset | 147 ++++++++++++++++ 2 files changed, 369 insertions(+) create mode 100644 dev-vcs/git/git-2.2.2.recipe create mode 100644 dev-vcs/git/patches/git-2.2.2.patchset diff --git a/dev-vcs/git/git-2.2.2.recipe b/dev-vcs/git/git-2.2.2.recipe new file mode 100644 index 000000000..bc3b7ef6c --- /dev/null +++ b/dev-vcs/git/git-2.2.2.recipe @@ -0,0 +1,222 @@ +SUMMARY="Fast, scalable, distributed revision control system" +DESCRIPTION="Git is a free and open source distributed version control system \ +designed to handle everything from small to very large projects with speed \ +and efficiency. + +Git is easy to learn and has a tiny footprint with lightning fast performance. \ +It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with \ +features like cheap local branching, convenient staging areas, and multiple \ +workflows." +HOMEPAGE="http://git-scm.com/" +LICENSE="GNU GPL v2" +COPYRIGHT="2005-2015 Git Authors (see git web site for list)" + +SRC_URI="https://www.kernel.org/pub/software/scm/git/git-$portVersion.tar.gz" +CHECKSUM_SHA256="e9e50d0d382183a9327d39334eb65db92852208e1438aab2a9bf8d06ef17b653" +PATCHES="git-$portVersion.patchset" + +SRC_URI_2="https://www.kernel.org/pub/software/scm/git/git-manpages-$portVersion.tar.gz" +CHECKSUM_SHA256_2="c9340fad1f521f3782abca4839d66bfee237f3e931856413561cf1b55fc9d550" + +SRC_URI_3="https://www.kernel.org/pub/software/scm/git/git-htmldocs-$portVersion.tar.gz" +CHECKSUM_SHA256_3="7f5eb11cf3dd5abb4705fb91f52c78ff4265b2e2eb15948cef311b3e04896d1c" + +REVISION="1" + +ARCHITECTURES="x86_gcc2 x86 x86_64" + +PROVIDES=" + git = $portVersion compat >= 2.2 + cmd:git = $portVersion compat >= 2.2 + cmd:git_receive_pack = $portVersion compat >= 2.2 + cmd:git_shell = $portVersion compat >= 2.2 + cmd:git_upload_archive = $portVersion compat >= 2.2 + cmd:git_upload_pack = $portVersion compat >= 2.2 + " +PROVIDES_arch=" + git_arch = $portVersion compat >= 2.2 + cmd:git_archimport = $portVersion compat >= 2.2 + " +PROVIDES_cvs=" + git_cvs = $portVersion compat >= 2.2 + cmd:git_cvsimport = $portVersion compat >= 2.2 + cmd:git_cvsserver = $portVersion compat >= 2.2 + " +PROVIDES_daemon=" + git_daemon = $portVersion compat >= 2.2 + cmd:git_daemon = $portVersion compat >= 2.2 + " +PROVIDES_email=" + git_email = $portVersion compat >= 2.2 + cmd:git_send_email = $portVersion compat >= 2.2 + " +PROVIDES_source=" + git_source = $portVersion compat >= 2.2 + " +PROVIDES_svn=" + git_svn = $portVersion compat >= 2.2 + cmd:git_svn = $portVersion compat >= 2.2 + " + +REQUIRES=" + haiku + cmd:man + cmd:nano + cmd:perl >= 5 + cmd:python + lib:libcurl + lib:libexpat + lib:libiconv + lib:libintl + lib:libpcre + lib:libssl + lib:libz + vendor_perl + " +REQUIRES_arch=" + haiku + git == $portVersion base + " +REQUIRES_cvs=" + haiku + git == $portVersion base + cmd:cvsps + " +REQUIRES_daemon=" + haiku + git == $portVersion base + " +REQUIRES_email=" + haiku + git == $portVersion base + " +REQUIRES_svn=" + haiku + git == $portVersion base + " + +BUILD_REQUIRES=" + cmd:man + cmd:nano + cmd:perl + devel:libcurl + devel:libexpat + devel:libiconv + devel:libintl + devel:libpcre + devel:libssl + devel:libz + " + +BUILD_PREREQUIRES=" + haiku_devel + cmd:find + cmd:gcc + cmd:gettext + cmd:ld + cmd:make + cmd:msgfmt + cmd:sed + cmd:tar + " + +USER_SETTINGS_FILES=" + settings/git directory + " + +makeGit() +{ + make prefix=$prefix \ + bindir_relative=$relativeBinDir \ + mandir=$manDir \ + infodir=$infoDir \ + gitexecdir=$libDir/git-core \ + sharedir=$dataDir \ + template_dir=$dataDir/git-core/templates \ + htmldir=$docDir \ + sysconfdir=$sysconfDir \ + PTHREAD_LIBS= \ + USE_LIBPCRE=YesPlease \ + NO_D_TYPE_IN_DIRENT=YesPlease \ + NO_MEMMEM=YesPlease \ + NO_MKSTEMPS=YesPlease \ + NEEDS_LIBICONV=YesPlease \ + NO_R_TO_GCC_LINKER=YesPlease \ + GNU_ROFF=YesPlease \ + PERL_PATH=$portPackageLinksDir/cmd~perl/bin/perl \ + NO_PYTHON=YesPlease \ + NO_TCLTK=YesPlease \ + OBJECT_CREATION_USES_RENAMES=YesPlease \ + NO_CROSS_DIRECTORY_HARDLINKS=YesPlease \ + NO_INSTALL_HARDLINKS=YesPlease \ + HAVE_DEV_TTY=YesPlease \ + DEFAULT_EDITOR=nano \ + BASIC_LDFLAGS="-lnetwork -lbsd" \ + "$@" +} + +BUILD() +{ + makeGit $jobArgs + makeGit strip +} + +INSTALL() +{ + makeGit install + + # copy manpages + mkdir -p $manDir + cp -rd $sourceDir2/* $manDir/ + + # copy html documentation + htmlDir=$docDir/html + mkdir -p $htmlDir + cp -rd $sourceDir3/*.html $htmlDir/ + rm $htmlDir/git-gui.html + + # replace copies of git binaries with symlinks + cd $binDir + for program in git*; do + ln -sfn "../lib/git-core/$program" "$program" + done + + packageEntries arch \ + documentation/packages/git/html/git-archimport.html \ + documentation/man/man1/git-archimport.1 \ + lib/git-core/git-archimport + + packageEntries cvs \ + bin/git-cvsserver \ + documentation/packages/git/html/git-cvsexportcommit.html \ + documentation/packages/git/html/git-cvsimport.html \ + documentation/packages/git/html/git-cvsserver.html \ + documentation/man/man1/git-cvsexportcommit.1 \ + documentation/man/man1/git-cvsimport.1 \ + documentation/man/man1/git-cvsserver.1 \ + documentation/man/man7/gitcvs-migration.7 \ + lib/git-core/git-cvsexportcommit \ + lib/git-core/git-cvsimport \ + lib/git-core/git-cvsserver + + packageEntries daemon \ + documentation/packages/git/html/git-credential-cache--daemon.html \ + documentation/packages/git/html/git-credential-cache.html \ + documentation/packages/git/html/git-daemon.html \ + documentation/man/man1/git-credential-cache--daemon.1 \ + documentation/man/man1/git-credential-cache.1 \ + documentation/man/man1/git-daemon.1 \ + lib/git-core/git-credential-cache--daemon \ + lib/git-core/git-credential-cache \ + lib/git-core/git-daemon + + packageEntries email \ + documentation/packages/git/html/git-send-email.html \ + documentation/man/man1/git-send-email.1 \ + lib/git-core/git-send-email + + packageEntries svn \ + documentation/packages/git/html/git-svn.html \ + documentation/man/man1/git-svn.1 \ + lib/git-core/git-svn +} diff --git a/dev-vcs/git/patches/git-2.2.2.patchset b/dev-vcs/git/patches/git-2.2.2.patchset new file mode 100644 index 000000000..820f58492 --- /dev/null +++ b/dev-vcs/git/patches/git-2.2.2.patchset @@ -0,0 +1,147 @@ +From ee8b7c8ecc7ea2cd35a3e1c298c7afaf8823e048 Mon Sep 17 00:00:00 2001 +From: Ingo Weinhold +Date: Tue, 13 Aug 2013 08:07:25 +0200 +Subject: [PATCH 1/5] git-web--browse.sh: use "open" on Haiku + +--- + git-web--browse.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/git-web--browse.sh b/git-web--browse.sh +index ae15253..1f6e306 100755 +--- a/git-web--browse.sh ++++ b/git-web--browse.sh +@@ -132,6 +132,10 @@ if test -z "$browser" ; then + if test -x /usr/bin/cygstart; then + browser_candidates="cygstart $browser_candidates" + fi ++ # /boot/system/haiku_loader indicates Haiku ++ if test -f /boot/system/haiku_loader; then ++ browser_candidates="open $browser_candidates" ++ fi + + for i in $browser_candidates; do + init_browser_path $i +-- +1.8.3.4 + + +From a7f24c225e8b75abf52d07f73625ea404503b475 Mon Sep 17 00:00:00 2001 +From: Ingo Weinhold +Date: Mon, 19 Jan 2015 15:37:16 -0500 +Subject: [PATCH 2/5] On Haiku use the user settings directory instead of HOME + +--- + path.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/path.c b/path.c +index e608993..ee5831c 100644 +--- a/path.c ++++ b/path.c +@@ -5,6 +5,11 @@ + #include "strbuf.h" + #include "string-list.h" + ++#ifdef __HAIKU__ ++# include ++# include ++#endif ++ + static int get_st_mode_bits(const char *path, int *mode) + { + struct stat st; +@@ -132,6 +137,19 @@ char *git_path(const char *fmt, ...) + + void home_config_paths(char **global, char **xdg, char *file) + { ++#ifdef __HAIKU__ ++ char settingsPath[B_PATH_NAME_LENGTH]; ++ ++ *xdg = NULL; ++ ++ if (global) { ++ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, true, settingsPath, ++ sizeof(settingsPath)) == B_OK) { ++ *global = mkpathdup("%s/git/%s", settingsPath, file); ++ } else ++ *global = NULL; ++ } ++#else + char *xdg_home = getenv("XDG_CONFIG_HOME"); + char *home = getenv("HOME"); + char *to_free = NULL; +@@ -156,6 +174,7 @@ void home_config_paths(char **global, char **xdg, char *file) + } + + free(to_free); ++#endif + } + + char *git_path_submodule(const char *path, const char *fmt, ...) +-- +1.8.3.4 + + +From b2890c33ea7dff56b4060394673d36746ad4e448 Mon Sep 17 00:00:00 2001 +From: Oliver Tappe +Date: Mon, 19 Jan 2015 15:50:09 -0500 +Subject: [PATCH 3/5] Ensure config-directory exists before using it. + +--- + config.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/config.c b/config.c +index 752e2e2..1e07f5c 100644 +--- a/config.c ++++ b/config.c +@@ -1934,6 +1934,7 @@ int git_config_set_multivar_in_file(const char *config_filename, + int ret; + struct lock_file *lock = NULL; + char *filename_buf = NULL; ++ char *config_dir = NULL; + + /* parse-key returns negative; flip the sign to feed exit(3) */ + ret = 0 - git_config_parse_key(key, &store.key, &store.baselen); +@@ -1945,6 +1946,12 @@ int git_config_set_multivar_in_file(const char *config_filename, + if (!config_filename) + config_filename = filename_buf = git_pathdup("config"); + ++ config_dir = xstrdup(config_filename); ++ * find_last_dir_sep(config_dir) = '\0'; ++ if (access(config_dir, F_OK) != 0) ++ mkdir(config_dir, 0755); ++ free(config_dir); ++ + /* + * The lock serves a purpose in addition to locking: the new + * contents of .git/config will be written into it. +-- +1.8.3.4 + + +From 089d55aa7d52ac66b9639b47b0be062851bfbda2 Mon Sep 17 00:00:00 2001 +From: Augustin Cavalier +Date: Mon, 19 Jan 2015 16:40:30 -0500 +Subject: [PATCH 4/5] Don't use __builtin_ctzll on GCC2. + +--- + ewah/ewok.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ewah/ewok.h b/ewah/ewok.h +index f6ad190..ca059c9 100644 +--- a/ewah/ewok.h ++++ b/ewah/ewok.h +@@ -47,7 +47,7 @@ static inline uint32_t ewah_bit_popcount64(uint64_t x) + return (x * 0x0101010101010101ULL) >> 56; + } + +-#ifdef __GNUC__ ++#if defined(__GNUC__) && __GNUC__ >= 3 + #define ewah_bit_ctz64(x) __builtin_ctzll(x) + #else + static inline int ewah_bit_ctz64(uint64_t x) +-- +1.8.3.4