Skip to content

Commit

Permalink
Drop bundled libgit2 (#463)
Browse files Browse the repository at this point in the history
* Drop the bundled libgit2 source code

* github-action: run on all branches

* Update build configuration script

* Remove unused 'src/Makevars_libgit2.in'

* Update cleanup script

* Remove outdated CONTRIBUTING.md

* Remove unused figure/git2r-design.png

* Update README

* Remove unused patches
  • Loading branch information
stewid authored Nov 29, 2023
1 parent be5145b commit a465c2d
Show file tree
Hide file tree
Showing 447 changed files with 190 additions and 176,441 deletions.
4 changes: 0 additions & 4 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
^LICENSE$
^aclocal\.m4$
^Makefile$
^README\.Rmd$
^figure$
^man-roxygen$
^patches$
^revdep$
^scripts$
^CONTRIBUTING.md$
^tools/README\.md$
^.*\.Rproj$
^\.Rproj\.user$
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
on: [push, pull_request]

name: R-CMD-check

Expand Down
205 changes: 0 additions & 205 deletions CONTRIBUTING.md

This file was deleted.

7 changes: 1 addition & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ Suggests:
Type: Package
Biarch: true
NeedsCompilation: yes
SystemRequirements: By default, git2r uses a system installation of
the libgit2 headers and library. However, if a system installation
is not available, builds and uses a bundled version of the libgit2
source. zlib headers and library. OpenSSL headers and library
(non-macOS). LibSSH2 (optional on non-Windows) to enable the SSH
transport.
SystemRequirements: libgit2 (>= 0.26)
Collate:
'blame.R'
'blob.R'
Expand Down
53 changes: 0 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,59 +113,6 @@ test_objects = $(wildcard tests/*.R)
valgrind:
$(foreach var,$(test_objects),R -d "valgrind --tool=memcheck --leak-check=full" --vanilla < $(var);)

# Sync git2r with changes in the libgit2 C-library
#
# 1) clone or pull libgit2 to parent directory from
# https://github.com/libgit/libgit.git
#
# 2) run 'make sync_libgit2'. It first removes files and then copy
# files from libgit2 directory. Next it runs an R script to build
# Makevars.in and Makevars.win based on source files. Finally it runs
# a patch command to change some lines in the source code to pass
# 'R CMD check git2r'
#
# 3) Build and check updated package 'make check'
sync_libgit2:
-rm -f src/libgit2/deps/http-parser/*
-rm -f src/libgit2/deps/xdiff/*
-rm -rf src/libgit2/include
-rm -rf src/libgit2/src
-cp -f ../libgit2/deps/http-parser/* src/libgit2/deps/http-parser
-cp -f ../libgit2/deps/xdiff/* src/libgit2/deps/xdiff
-cp -r ../libgit2/include/ src/libgit2/include
-rm -f src/libgit2/include/git2/inttypes.h
-rm -f src/libgit2/include/git2/stdint.h
-cp -r ../libgit2/src/ src/libgit2/src
-rm -rf src/libgit2/src/cli
-rm -f src/libgit2/deps/http-parser/CMakeLists.txt
-rm -f src/libgit2/deps/regex/CMakeLists.txt
-rm -f src/libgit2/deps/xdiff/CMakeLists.txt
-rm -f src/libgit2/src/README.md
-rm -f src/libgit2/src/CMakeLists.txt
-rm -f src/libgit2/src/libgit2/CMakeLists.txt
-rm -f src/libgit2/src/libgit2/experimental.h.in
-rm -f src/libgit2/src/libgit2/git2.rc
-rm -f src/libgit2/src/util/CMakeLists.txt
-rm -f src/libgit2/src/util/git2_features.h.in
-rm -f src/libgit2/src/stransport_stream.c
-rm -f src/libgit2/src/util/hash/builtin.c
-rm -f src/libgit2/src/util/hash/builtin.h
-rm -f src/libgit2/src/util/hash/common_crypto.c
-rm -f src/libgit2/src/util/hash/common_crypto.h
-rm -f src/libgit2/src/util/hash/sha1/generic.c
-rm -f src/libgit2/src/util/hash/sha1/generic.h
-rm -f src/libgit2/src/util/hash/mbedtls.c
-rm -f src/libgit2/src/util/hash/mbedtls.h
-rm -f src/libgit2/src/util/hash/win32.c
-rm -f src/libgit2/src/util/hash/win32.h
-rm -rf src/libgit2/src/util/hash/rfc6234
-rm -f src/libgit2/src/libgit2/transports/auth_negotiate.c
-rm -rf src/libgit2/src/util/win32
Rscript scripts/build_Makevars.R

Makevars:
Rscript scripts/build_Makevars.R

configure: configure.ac
autoconf ./configure.ac > ./configure
chmod +x ./configure
Expand Down
25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,11 @@ To install the development version of `git2r`, it's easiest to use the
devtools package:

```coffee
# install.packages("devtools")
library(devtools)
# install.packages("remotes")
library(remotes)
install_github("ropensci/git2r")
```

Another alternative is to use `git` and `make`

```coffee
$ git clone https://github.com/ropensci/git2r.git
$ cd git2r
$ make install
```

## Usage

### Repository
Expand Down Expand Up @@ -299,20 +291,9 @@ commit(repo, "Commit message")
#> Summary: Commit message
```

# Included software

- The C library [libgit2](https://github.com/libgit2/libgit2). See
`inst/AUTHORS` for the authors of libgit2.

- The libgit2 library has been modified, e.g. to use the R printing
and error routines, and to use `runif` instead of `rand`.

# License

The `git2r` package is licensed under the GPLv2. See these files for additional details:

- LICENSE - `git2r` package license (GPLv2)
- inst/COPYING - Copyright notices for additional included software
The `git2r` package is licensed under the GPLv2.

---

Expand Down
12 changes: 0 additions & 12 deletions cleanup
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
#!/bin/sh

rm -f config.*
rm -f confdefs.h
rm -f src/Makevars
rm -rf autom4te.cache
rm -f src/*.o
rm -f src/*.so
rm -f src/libmygit.a
rm -f src/libgit2/deps/http-parser/*.o
rm -f src/libgit2/deps/regex/*.o
rm -f src/libgit2/deps/xdiff/*.o
rm -f src/libgit2/src/libgit2/*.o
rm -f src/libgit2/src/libgit2/streams/*.o
rm -f src/libgit2/src/libgit2/transports/*.o
rm -f src/libgit2/src/util/*.o
rm -f src/libgit2/src/util/allocators/*.o
rm -f src/libgit2/src/util/hash/*.o
rm -f src/libgit2/src/util/unix/*.o
Loading

0 comments on commit a465c2d

Please sign in to comment.