Date: Wed, 13 Jan 2021 22:23:16 +0000 (UTC) From: Joseph Mingrone <jrm@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r561516 - in head/devel: . libegit2 libegit2/files Message-ID: <202101132223.10DMNGjj040791@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jrm Date: Wed Jan 13 22:23:16 2021 New Revision: 561516 URL: https://svnweb.freebsd.org/changeset/ports/561516 Log: New port, devel/libegit2: Emacs bindings for libgit2 PR: 251147 Submitted by: Yasuhiro Kimura <yasu@utahime.org> (maintainer) Added: head/devel/libegit2/ head/devel/libegit2/Makefile (contents, props changed) head/devel/libegit2/distinfo (contents, props changed) head/devel/libegit2/files/ head/devel/libegit2/files/patch-libgit.el (contents, props changed) head/devel/libegit2/files/patch-use-system-libgit2 (contents, props changed) head/devel/libegit2/pkg-descr (contents, props changed) head/devel/libegit2/pkg-plist (contents, props changed) Modified: head/devel/Makefile (contents, props changed) Modified: head/devel/Makefile ============================================================================== --- head/devel/Makefile Wed Jan 13 22:23:10 2021 (r561515) +++ head/devel/Makefile Wed Jan 13 22:23:16 2021 (r561516) @@ -1157,6 +1157,7 @@ SUBDIR += libdwarf SUBDIR += libe SUBDIR += libedit + SUBDIR += libegit2 SUBDIR += libeio SUBDIR += libelf SUBDIR += libepoll-shim Added: head/devel/libegit2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libegit2/Makefile Wed Jan 13 22:23:16 2021 (r561516) @@ -0,0 +1,48 @@ +# $FreeBSD$ + +PORTNAME= libegit2 +DISTVERSION= g20200515 +CATEGORIES= devel elisp +PKGNAMESUFFIX= ${EMACS_PKGNAMESUFFIX} + +MAINTAINER= yasu@utahime.org +COMMENT= Emacs bindings for libgit2 + +LICENSE= GPLv3+ +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libgit2.so:devel/libgit2 + +USES= cmake:noninja emacs pkgconfig +USE_GITHUB= yes +GH_ACCOUNT= magit +GH_TAGNAME= 0ef8b13 +USE_LDCONFIG= yes + +CMAKE_ON= USE_SYSTEM_LIBGIT2 + +PORTDOCS= README.md + +OPTIONS_DEFINE= DOCS + +post-patch: + ${REINPLACE_CMD} \ + 's,%%LIBEGIT2_INSTALL_DIR%%,${PREFIX}/${EMACS_VERSION_SITE_LISPDIR},' \ + ${WRKSRC}/libgit.el + +post-build: + (cd ${WRKSRC} \ + && ${EMACS_CMD} -Q -batch -L . -f batch-byte-compile libgit.el) + +do-install: + @${MKDIR} ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/../.build/libegit2.so \ + ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR} + ${INSTALL_DATA} ${WRKSRC}/libgit.el ${WRKSRC}/libgit.elc \ + ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR} + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} + +.include <bsd.port.mk> Added: head/devel/libegit2/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libegit2/distinfo Wed Jan 13 22:23:16 2021 (r561516) @@ -0,0 +1,3 @@ +TIMESTAMP = 1610571142 +SHA256 (magit-libegit2-g20200515-0ef8b13_GH0.tar.gz) = d746fd8120948ac1d2a3c12f25a65a2720ca8bdd7a794c9b2bc120ff95ed0ce9 +SIZE (magit-libegit2-g20200515-0ef8b13_GH0.tar.gz) = 131990 Added: head/devel/libegit2/files/patch-libgit.el ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libegit2/files/patch-libgit.el Wed Jan 13 22:23:16 2021 (r561516) @@ -0,0 +1,11 @@ +--- libgit.el.orig 2020-05-15 17:59:08 UTC ++++ libgit.el +@@ -41,7 +41,7 @@ + "Directory where the libegit2 dynamic module file should be built.") + + (defvar libgit--module-file +- (expand-file-name (concat "libegit2" module-file-suffix) libgit--build-dir) ++ (expand-file-name (concat "libegit2" module-file-suffix) "/usr/local/share/emacs/27.1/site-lisp") + "Path to the libegit2 dynamic module file.") + + (defun libgit--configure () Added: head/devel/libegit2/files/patch-use-system-libgit2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libegit2/files/patch-use-system-libgit2 Wed Jan 13 22:23:16 2021 (r561516) @@ -0,0 +1,78 @@ +From de3c48d72ec7064e7f0522877fe759c729df0c50 Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer <maxim.cournoyer@gmail.com> +Date: Wed, 25 Mar 2020 11:32:18 -0400 +Subject: [PATCH] Allow using a system provided libgit2 library + +Setting the USE_SYSTEM_LIBGIT2 Make or CMake variable (through the +BUILD_OPTIONS variable) to any value enables using the system library. +The default behavior of using a bundled copy of libgit2 is unchanged. +--- CMakeLists.txt.orig 2020-05-15 17:59:08 UTC ++++ CMakeLists.txt +@@ -7,9 +7,14 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "shared" FORCE) + set(BUILD_CLAR OFF CACHE BOOL "clar" FORCE) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DEGIT_DEBUG") + +-add_subdirectory(libgit2) ++if(USE_SYSTEM_LIBGIT2) ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(git2 REQUIRED IMPORTED_TARGET libgit2) ++else() ++ add_subdirectory(libgit2) ++ find_library(git2 libgit2.a) ++endif() + +-find_library(git2 libgit2.a) + add_subdirectory(src) + + enable_testing() + CMakeLists.txt | 9 +++++++-- + Makefile | 11 +++++++++++ + src/CMakeLists.txt | 9 +++++++-- + 3 files changed, 25 insertions(+), 4 deletions(-) + +--- Makefile.orig 2020-05-15 17:59:08 UTC ++++ Makefile +@@ -13,6 +13,13 @@ ifeq ($(UNAME),MSYS) + BUILD_OPTIONS+= -G "MSYS Makefiles" + endif + ++# If the variable USE_SYSTEM_LIBGIT2 is set to *any* value, use the ++# system provided libgit2 library. ++USE_SYSTEM_LIBGIT2? := \ ++ $(if $(or $(USE_SYSTEM_LIBGIT2),\ ++ $(findstring USE_SYSTEM_LIBGIT2,$(BUILD_OPTIONS))),\ ++ true) ++ + ifeq "$(TRAVIS)" "true" + ## Makefile for Travis ################################################### + # +@@ -87,7 +94,11 @@ submodule-update: + @git submodule update + + libgit2: ++ifeq ($(USE_SYSTEM_LIBGIT2?),) + @git submodule update --init ++else ++ @echo "Using the system provided libgit2 library" ++endif + + CLEAN = $(ELCS) $(PKG)-autoloads.el build + +--- src/CMakeLists.txt.orig 2020-05-15 17:59:08 UTC ++++ src/CMakeLists.txt +@@ -13,8 +13,13 @@ if(WIN32) + set_target_properties(egit2 PROPERTIES PREFIX lib) + endif(WIN32) + +-target_link_libraries(egit2 git2) +-target_include_directories(egit2 SYSTEM PRIVATE "${libgit2_SOURCE_DIR}/include") ++if(USE_SYSTEM_LIBGIT2) ++ target_link_libraries(egit2 PRIVATE PkgConfig::git2) ++else() ++ target_link_libraries(egit2 git2) ++ target_include_directories( ++ egit2 SYSTEM PRIVATE "${libgit2_SOURCE_DIR}/include") ++endif() + + if(CMAKE_COMPILER_IS_GNUCC) + target_compile_options(egit2 PRIVATE -Wall -Wextra) Added: head/devel/libegit2/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libegit2/pkg-descr Wed Jan 13 22:23:16 2021 (r561516) @@ -0,0 +1,4 @@ +This is an experimental module for libgit2 bindings to Emacs, intended +to boost the performance of Magit (https://magit.vc/). + +WWW: https://github.com/magit/libegit2 Added: head/devel/libegit2/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libegit2/pkg-plist Wed Jan 13 22:23:16 2021 (r561516) @@ -0,0 +1,3 @@ +%%EMACS_VERSION_SITE_LISPDIR%%/libegit2.so +%%EMACS_VERSION_SITE_LISPDIR%%/libgit.el +%%EMACS_VERSION_SITE_LISPDIR%%/libgit.elc
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101132223.10DMNGjj040791>