1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Description: remove reading version of libgit2 from the embedded copy
since it has been stripped out
hard code the major and minor versions of expected libgit2 version
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2024-10-31
--- a/ext/rugged/extconf.rb
+++ b/ext/rugged/extconf.rb
@@ -61,28 +61,14 @@
end
CWD = File.expand_path(File.dirname(__FILE__))
-LIBGIT2_DIR = File.join(CWD, '..', '..', 'vendor', 'libgit2')
if arg_config("--use-system-libraries", !!ENV['RUGGED_USE_SYSTEM_LIBRARIES'])
puts "Building Rugged using system libraries.\n"
dir_config('git2').any? or pkg_config('libgit2')
- 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]+)$/))
- major = matches[1]
- next
- end
-
- if !minor && (matches = line.match(/^#define LIBGIT2_VER_MINOR\s+([0-9]+)$/))
- minor = matches[1]
- next
- end
-
- break if major && minor
- end
+ major = 1
+ minor = 8
try_compile(<<-SRC) or abort "libgit2 version is not compatible, expected ~> #{major}.#{minor}.0"
#include <git2/version.h>
|