Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext: Fix the build with system libgit2 1.9.0 #985

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/rugged/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def self.run_cmake(timeout, args)
major = minor = nil

File.readlines(File.join(LIBGIT2_DIR, "include", "git2", "version.h")).each do |line|
if !major && (matches = line.match(/^#define LIBGIT2_VER_MAJOR\s+([0-9]+)$/))
if !major && (matches = line.match(/^#define LIBGIT2_VERSION_MAJOR\s+([0-9]+)$/))
major = matches[1]
next
end

if !minor && (matches = line.match(/^#define LIBGIT2_VER_MINOR\s+([0-9]+)$/))
if !minor && (matches = line.match(/^#define LIBGIT2_VERSION_MINOR\s+([0-9]+)$/))
minor = matches[1]
next
end
Expand All @@ -85,9 +85,9 @@ def self.run_cmake(timeout, args)
end

try_compile(<<-SRC) or abort "libgit2 version is not compatible, expected ~> #{major}.#{minor}.0"
#include <git2/version.h>
#include <git2.h>

#if LIBGIT2_VER_MAJOR != #{major} || LIBGIT2_VER_MINOR != #{minor}
#if LIBGIT2_VERSION_MAJOR != #{major} || LIBGIT2_VERSION_MINOR != #{minor}
#error libgit2 version is not compatible
#endif
SRC
Expand Down