-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from glebm/ext-lib
Update libsass to v3.6.0 and fixes various issues (windows, cross-compilation, binary gems)
- Loading branch information
Showing
13 changed files
with
92 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ | |
*.so | ||
*.o | ||
*.a | ||
*.gem | ||
mkmf.log | ||
vendor/bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "ext/libsass"] | ||
path = ext/libsass | ||
url = git://github.com/sass/libsass.git | ||
url = https://github.com/sass/libsass.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,30 @@ | ||
begin | ||
require 'bundler/gem_tasks' | ||
rescue LoadError | ||
puts 'Cannot load bundler/gem_tasks' | ||
end | ||
|
||
require 'tasks/libsass' | ||
require 'bundler/gem_tasks' | ||
|
||
task default: :test | ||
|
||
require 'rake/extensiontask' | ||
gem_spec = Gem::Specification.load("sassc.gemspec") | ||
Rake::ExtensionTask.new('libsass', gem_spec) do |ext| | ||
ext.name = 'libsass' | ||
ext.ext_dir = 'ext' | ||
ext.lib_dir = 'lib/sassc' | ||
ext.cross_compile = true | ||
ext.cross_platform = %w[x86-mingw32 x64-mingw32 x86-linux x86_64-linux] | ||
ext.cross_compiling do |spec| | ||
spec.files.reject! { |path| File.fnmatch?('ext/*', path) } | ||
end | ||
end | ||
|
||
desc 'Compile all native gems via rake-compiler-dock (Docker)' | ||
task 'gem:native' do | ||
require 'rake_compiler_dock' | ||
RakeCompilerDock.sh "bundle && gem i rake --no-document && "\ | ||
"rake cross native gem MAKE='nice make -j`nproc`' "\ | ||
"RUBY_CC_VERSION=2.6.0:2.5.0:2.4.0:2.3.0" | ||
end | ||
|
||
desc "Run all tests" | ||
task test: 'libsass:compile' do | ||
task test: 'compile:libsass' do | ||
$LOAD_PATH.unshift('lib', 'test') | ||
Dir.glob('./test/**/*_test.rb') { |f| require f } | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
gem_root = File.expand_path('..', __dir__) | ||
libsass_dir = File.join(gem_root, 'ext', 'libsass') | ||
|
||
if !File.directory?(libsass_dir) || | ||
# '.', '..', and possibly '.git' from a failed checkout: | ||
Dir.entries(libsass_dir).size <= 3 | ||
Dir.chdir(gem_root) { system('git submodule update --init') } or | ||
fail 'Could not fetch libsass' | ||
end | ||
|
||
File.write 'Makefile', <<-MAKEFILE | ||
ifndef DESTDIR | ||
LIBSASS_OUT = #{gem_root}/lib/sassc/libsass.so | ||
else | ||
LIBSASS_OUT = $(DESTDIR)$(PREFIX)/libsass.so | ||
endif | ||
SUB_DIR := #{libsass_dir} | ||
SUB_TARGET := lib/libsass.so | ||
libsass.so:#{' clean' if ENV['CLEAN']} | ||
$(MAKE) -C '$(SUB_DIR)' lib/libsass.so | ||
cp '$(SUB_DIR)/lib/libsass.so' libsass.so | ||
strip libsass.so | ||
install: libsass.so | ||
cp libsass.so '$(LIBSASS_OUT)' | ||
clean: | ||
$(MAKE) -C '$(SUB_DIR)' clean | ||
rm -f '$(LIBSASS_OUT)' libsass.so | ||
.PHONY: clean install | ||
MAKEFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters