Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37836286
en ru br
Репозитории ALT

Группа :: Разработка/Ruby
Пакет: gem-libyajl2

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: fix-extconf-rb.patch
Скачать


--- ext/libyajl2/extconf.rb.orig	2021-04-07 03:32:11.000000000 +0000
+++ ext/libyajl2/extconf.rb	2021-10-11 17:10:04.925000000 +0000
@@ -3,20 +3,6 @@ require "rbconfig"
 require "fileutils"
 require "shellwords"
 
-if ENV["USE_SYSTEM_LIBYAJL2"]
-  File.open("Makefile", "w+") do |f|
-    f.write <<EOF
-# dummy Makefile when we're not really installing
-all:
-\ttrue
-
-install:
-\ttrue
-EOF
-  end
-  exit(0)
-end
-
 module Libyajl2Build
   class BuildError < StandardError; end
 
@@ -24,6 +10,10 @@ module Libyajl2Build
 
   PREFIX = File.expand_path("../../../lib/libyajl2/vendored-libyajl2", __FILE__).freeze
 
+  def self.using_system_libraries?
+    ARGV.include?('--use-system-libraries') || !!ENV['USE_SYSTEM_LIBYAJL2']
+  end
+
   def self.windows?
     !!(RUBY_PLATFORM =~ /mswin|mingw|cygwin|windows/)
   end
@@ -58,8 +48,23 @@ module Libyajl2Build
     $CFLAGS << " -DNDEBUG"
   end
 
+  def self.make_use_system_makefile
+    File.open("Makefile", "w+") do |f|
+      f.write <<-EOF
+# dummy Makefile when we're not really installing
+all:
+\ttrue
+
+install:
+\ttrue
+      EOF
+    end
+  end
+
   def self.makemakefiles
-    if RUBY_PLATFORM == "java"
+    if using_system_libraries?
+      make_use_system_makefile
+    elsif RUBY_PLATFORM == "java"
       File.open("Makefile", "w+") do |f|
         f.write <<EOF
 CC = gcc
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin