opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: c327597866a81a2ff08948a78c2fee1c2db9b76c
Parent: 29e0ea38cd4cb6815656e1f33c5d58d305bac851
Author: Randy Palamar
Date:   Fri,  6 Oct 2023 08:09:27 -0600

add libs/libgit2

this is mostly for stagit.

current limitations:
* no support for http/ssh actions.
  * ssh can maybe be enabled with openssh
  * http can be enabled with libressl but it would be better to
    port to bearssl
* it would be better to use libxdiff from devel/git but local version
  renamed a bunch of symbols

Diffstat:
M.gitmodules | 3+++
Mpkg/devel/git/gen.lua | 2++
Mpkg/libs/gen.lua | 1+
Apkg/libs/libgit2/README.md | 10++++++++++
Apkg/libs/libgit2/gen.lua | 318+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/libs/libgit2/git2_features.h | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/libs/libgit2/src | 1+
Apkg/libs/libgit2/ver | 2++
8 files changed, 405 insertions(+), 0 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -31,6 +31,9 @@ path = pkg/libs/bearssl/src url = https://www.bearssl.org/git/BearSSL ignore = all +[submodule "pkg/libs/libgit2/src"] + path = pkg/libs/libgit2/src + url = https://github.com/libgit2/libgit2.git [submodule "pkg/libs/libpng/src"] path = pkg/libs/libpng/src url = https://github.com/glennrp/libpng.git diff --git a/pkg/devel/git/gen.lua b/pkg/devel/git/gen.lua @@ -499,4 +499,6 @@ dir('share/git-core/templates/hooks', '755') man(expand({'man/', lines('man.txt')})) +pkg.hdrs = copy('$outdir/include', '$srcdir/xdiff', { 'xdiff.h' }) + fetch('local') diff --git a/pkg/libs/gen.lua b/pkg/libs/gen.lua @@ -1,4 +1,5 @@ subgen('bearssl') +subgen('libgit2') subgen('libpng') subgen('libtermkey') subgen('libtls-bearssl') diff --git a/pkg/libs/libgit2/README.md b/pkg/libs/libgit2/README.md @@ -0,0 +1,10 @@ +# libgit2 + +## git2_features.h +Generated with: +``` +cmake \ + -DREGEX_BACKEND=pcre + -DUSE_HTTP_PARSER=builtin + -DUSE_HTTPS=no +``` diff --git a/pkg/libs/libgit2/gen.lua b/pkg/libs/libgit2/gen.lua @@ -0,0 +1,318 @@ +cflags({ + '-I $dir', + '-I $outdir/include', + '-I $srcdir/deps/http-parser', + '-I $srcdir/deps/xdiff', + '-I $srcdir/src/libgit2', + '-I $srcdir/src/util', + '-isystem $builddir/pkg/libs/pcre/include', + '-isystem $builddir/pkg/libs/zlib/include', +}) + +pkg.deps = { + 'pkg/libs/pcre/headers', + 'pkg/libs/zlib/headers', +} + +lib('libdeps.a', [[deps/( + http-parser/http_parser.c + xdiff/( + xdiffi.c + xemit.c + xhistogram.c + xmerge.c + xpatience.c + xprepare.c + xutils.c + ) +)]]) + +lib('libutil.a', [[ + src/util/( + allocators/( + failalloc.c + stdalloc.c + ) + alloc.c + date.c + filebuf.c + fs_path.c + futils.c + hash.c + hash/( + builtin.c + collisiondetect.c + rfc6234/sha224-256.c + sha1dc/( + sha1.c + ubc_check.c + ) + ) + net.c + pool.c + posix.c + pqueue.c + rand.c + regexp.c + runtime.c + sortedcache.c + str.c + strmap.c + thread.c + tsort.c + unix/( + map.c + realpath.c + ) + utf8.c + util.c + varint.c + vector.c + wildmatch.c + zstream.c + ) +]]) + +lib('libgit2.a', [[ + src/libgit2/( + annotated_commit.c + apply.c + attr.c + attr_file.c + attrcache.c + blame.c + blame_git.c + blob.c + branch.c + buf.c + cache.c + checkout.c + cherrypick.c + clone.c + commit.c + commit_graph.c + commit_list.c + config.c + config_cache.c + config_entries.c + config_file.c + config_mem.c + config_parse.c + config_snapshot.c + crlf.c + delta.c + describe.c + diff.c + diff_driver.c + diff_file.c + diff_generate.c + diff_parse.c + diff_print.c + diff_stats.c + diff_tform.c + diff_xdiff.c + email.c + errors.c + fetch.c + fetchhead.c + filter.c + grafts.c + graph.c + hashsig.c + ident.c + idxmap.c + ignore.c + index.c + indexer.c + iterator.c + libgit2.c + mailmap.c + merge.c + merge_driver.c + merge_file.c + message.c + midx.c + mwindow.c + notes.c + object.c + object_api.c + odb.c + odb_loose.c + odb_mempack.c + odb_pack.c + offmap.c + oid.c + oidarray.c + oidmap.c + pack-objects.c + pack.c + parse.c + patch.c + patch_generate.c + patch_parse.c + path.c + pathspec.c + proxy.c + push.c + reader.c + rebase.c + refdb.c + refdb_fs.c + reflog.c + refs.c + refspec.c + remote.c + repository.c + reset.c + revert.c + revparse.c + revwalk.c + signature.c + stash.c + status.c + strarray.c + streams/( + mbedtls.c + openssl.c + registry.c + schannel.c + socket.c + stransport.c + tls.c + ) + submodule.c + sysdir.c + tag.c + threadstate.c + trace.c + trailer.c + transaction.c + transport.c + transports/( + auth.c + auth_ntlmclient.c + auth_sspi.c + credential.c + credential_helpers.c + git.c + http.c + httpclient.c + local.c + smart.c + smart_pkt.c + smart_protocol.c + ssh.c + ) + tree-cache.c + tree.c + worktree.c + ) + libdeps.a + libutil.a + $builddir/pkg/libs/pcre/libpcre.a + $builddir/pkg/libs/zlib/libz.a +]]) + + -- <cd src/include; find . -type f +pkg.hdrs = { + copy('$outdir/include', '$srcdir/include', { 'git2.h' }), + copy('$outdir/include/git2', '$srcdir/include/git2', { + 'annotated_commit.h', + 'apply.h', + 'attr.h', + 'blame.h', + 'blob.h', + 'branch.h', + 'buffer.h', + 'cert.h', + 'checkout.h', + 'cherrypick.h', + 'clone.h', + 'commit.h', + 'common.h', + 'config.h', + 'cred_helpers.h', + 'credential.h', + 'credential_helpers.h', + 'deprecated.h', + 'describe.h', + 'diff.h', + 'email.h', + 'errors.h', + 'experimental.h', + 'filter.h', + 'global.h', + 'graph.h', + 'ignore.h', + 'index.h', + 'indexer.h', + 'mailmap.h', + 'merge.h', + 'message.h', + 'net.h', + 'notes.h', + 'object.h', + 'odb.h', + 'odb_backend.h', + 'oid.h', + 'oidarray.h', + 'pack.h', + 'patch.h', + 'pathspec.h', + 'proxy.h', + 'rebase.h', + 'refdb.h', + 'reflog.h', + 'refs.h', + 'refspec.h', + 'remote.h', + 'repository.h', + 'reset.h', + 'revert.h', + 'revparse.h', + 'revwalk.h', + 'signature.h', + 'stash.h', + 'status.h', + 'stdint.h', + 'strarray.h', + 'submodule.h', + 'tag.h', + 'trace.h', + 'transaction.h', + 'transport.h', + 'tree.h', + 'types.h', + 'version.h', + 'worktree.h', + }), + copy('$outdir/include/git2/sys', '$srcdir/include/git2/sys', { + 'alloc.h', + 'commit.h', + 'commit_graph.h', + 'config.h', + 'cred.h', + 'credential.h', + 'diff.h', + 'email.h', + 'filter.h', + 'hashsig.h', + 'index.h', + 'mempack.h', + 'merge.h', + 'midx.h', + 'odb_backend.h', + 'openssl.h', + 'path.h', + 'refdb_backend.h', + 'reflog.h', + 'refs.h', + 'remote.h', + 'repository.h', + 'stream.h', + 'transport.h', + }) +} +pkg.hdrs.install = true + +fetch('git') diff --git a/pkg/libs/libgit2/git2_features.h b/pkg/libs/libgit2/git2_features.h @@ -0,0 +1,68 @@ +#ifndef INCLUDE_features_h__ +#define INCLUDE_features_h__ + +/* #undef GIT_DEBUG_POOL */ +/* #undef GIT_DEBUG_STRICT_ALLOC */ +/* #undef GIT_DEBUG_STRICT_OPEN */ + +#define GIT_THREADS 1 +/* #undef GIT_WIN32_LEAKCHECK */ + +#define GIT_ARCH_64 1 +/* #undef GIT_ARCH_32 */ + +/* #undef GIT_USE_ICONV */ +#define GIT_USE_NSEC 1 +#define GIT_USE_STAT_MTIM 1 +/* #undef GIT_USE_STAT_MTIMESPEC */ +/* #undef GIT_USE_STAT_MTIME_NSEC */ +#define GIT_USE_FUTIMENS 1 + +/* #undef GIT_REGEX_REGCOMP_L */ +/* #undef GIT_REGEX_REGCOMP */ +#define GIT_REGEX_PCRE +/* #undef GIT_REGEX_PCRE2 */ +/* #undef GIT_REGEX_BUILTIN */ + +/* #undef GIT_QSORT_BSD */ +#define GIT_QSORT_GNU +/* #undef GIT_QSORT_C11 */ +/* #undef GIT_QSORT_MSC */ + +/* #undef GIT_SSH */ +/* #undef GIT_SSH_MEMORY_CREDENTIALS */ + +/* #undef GIT_NTLM */ +/* #undef GIT_GSSAPI */ +/* #undef GIT_GSSFRAMEWORK */ + +/* #undef GIT_WINHTTP */ +/* #undef GIT_HTTPS */ +/* #undef GIT_OPENSSL */ +/* #undef GIT_OPENSSL_DYNAMIC */ +/* #undef GIT_SECURE_TRANSPORT */ +/* #undef GIT_MBEDTLS */ +/* #undef GIT_SCHANNEL */ + +#define GIT_SHA1_COLLISIONDETECT 1 +/* #undef GIT_SHA1_WIN32 */ +/* #undef GIT_SHA1_COMMON_CRYPTO */ +/* #undef GIT_SHA1_OPENSSL */ +/* #undef GIT_SHA1_OPENSSL_DYNAMIC */ +/* #undef GIT_SHA1_MBEDTLS */ + +#define GIT_SHA256_BUILTIN 1 +/* #undef GIT_SHA256_WIN32 */ +/* #undef GIT_SHA256_COMMON_CRYPTO */ +/* #undef GIT_SHA256_OPENSSL */ +/* #undef GIT_SHA256_OPENSSL_DYNAMIC */ +/* #undef GIT_SHA256_MBEDTLS */ + +#define GIT_RAND_GETENTROPY 1 +#define GIT_RAND_GETLOADAVG 1 + +#define GIT_IO_POLL 1 +/* #undef GIT_IO_WSAPOLL */ +#define GIT_IO_SELECT 1 + +#endif diff --git a/pkg/libs/libgit2/src b/pkg/libs/libgit2/src @@ -0,0 +1 @@ +Subproject commit a2bde63741977ca0f4ef7db2f609df320be67a08 diff --git a/pkg/libs/libgit2/ver b/pkg/libs/libgit2/ver @@ -0,0 +1 @@ +1.7.1 r0 +\ No newline at end of file