Skip to content

Commit 3c3344f

Browse files
committed
Update libsass to master + other fixes
Updates libsass to master to incorporate fixes for: 1. The :not selector. Fixes #91. sass/libsass#2697 2. Default precision changed to 10. sass/libsass#2716 3. Now builds with `cc` instead of hard-coding `gcc`. sass/libsass#2707 4. Building on Linux and Solaris. sass/libsass#2720 Also: 1. Adds Windows RubyInstaller compilation support via `rake-compiler`. Fixes #18. 2. Fixes `load_paths` separator on Windows. Fixes #93. 3. Changes the location of `libsass.so` from `ext/` to `lib/`. Fixes #95.
1 parent e7da015 commit 3c3344f

File tree

13 files changed

+69
-56
lines changed

13 files changed

+69
-56
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
*.so
1313
*.o
1414
*.a
15+
*.gem
1516
mkmf.log
1617
vendor/bundle

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "ext/libsass"]
22
path = ext/libsass
3-
url = git://github.com/sass/libsass.git
3+
url = https://github.com/sass/libsass.git

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This gem combines the speed of `libsass`, the [Sass C implementation](https://gi
66

77
### libsass Version
88

9-
[3.5.2](https://github.com/sass/libsass/releases/tag/3.5.2)
9+
[d225a09a](https://github.com/sass/libsass/commit/d225a09a152050d569c077f97bb944c8dc819d6f)
1010

1111
## Installation
1212

Rakefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ rescue LoadError
44
puts 'Cannot load bundler/gem_tasks'
55
end
66

7-
require 'tasks/libsass'
8-
97
task default: :test
108

9+
require 'rake/extensiontask'
10+
Rake::ExtensionTask.new do |ext|
11+
ext.name = 'libsass'
12+
ext.ext_dir = 'ext'
13+
ext.lib_dir = 'lib/sassc'
14+
end
15+
1116
desc "Run all tests"
12-
task test: 'libsass:compile' do
17+
task test: 'compile:libsass' do
1318
$LOAD_PATH.unshift('lib', 'test')
1419
Dir.glob('./test/**/*_test.rb') { |f| require f }
1520
end

ext/Rakefile

Lines changed: 0 additions & 3 deletions
This file was deleted.

ext/extconf.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# frozen_string_literal: true
2+
3+
gem_root = File.expand_path('..', __dir__)
4+
libsass_dir = File.join(gem_root, 'ext', 'libsass')
5+
6+
if !File.directory?(libsass_dir) ||
7+
# '.', '..', and possibly '.git' from a failed checkout:
8+
Dir.entries(libsass_dir).size <= 3
9+
Dir.chdir(gem_root) { system('git submodule update --init') } or
10+
fail 'Could not fetch libsass'
11+
end
12+
13+
File.write 'Makefile', <<-MAKEFILE
14+
ifndef DESTDIR
15+
LIBSASS_OUT = #{gem_root}/lib/sassc/libsass.so
16+
else
17+
LIBSASS_OUT = $(DESTDIR)$(PREFIX)/libsass.so
18+
endif
19+
20+
SUB_DIR := #{libsass_dir}
21+
SUB_TARGET := lib/libsass.so
22+
23+
libsass.so:#{' clean' if ENV['CLEAN']}
24+
$(MAKE) -C '$(SUB_DIR)' lib/libsass.so
25+
cp '$(SUB_DIR)/lib/libsass.so' libsass.so
26+
strip libsass.so
27+
28+
install: libsass.so
29+
cp libsass.so '$(LIBSASS_OUT)'
30+
31+
clean:
32+
$(MAKE) -C '$(SUB_DIR)' clean
33+
rm -f '$(LIBSASS_OUT)' libsass.so
34+
35+
.PHONY: clean install
36+
MAKEFILE

ext/libsass

Submodule libsass updated 158 files

lib/sassc/engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def output_style
133133

134134
def load_paths
135135
paths = (@options[:load_paths] || []) + SassC.load_paths
136-
paths.join(":") if paths.any?
136+
paths.join(File::PATH_SEPARATOR) unless paths.empty?
137137
end
138138
end
139139
end

lib/sassc/native.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Native
88

99
spec = Gem.loaded_specs["sassc"]
1010
gem_root = spec.gem_dir
11-
ffi_lib "#{gem_root}/ext/libsass/lib/libsass.so"
11+
ffi_lib "#{gem_root}/lib/sassc/libsass.so"
1212

1313
require_relative "native/sass_value"
1414

lib/tasks/libsass.rb

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)