Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 8004d10

Browse files
authored
* Bump [email protected] See https://github.com/sass/libsass/releases/tag/3.5.3 * Workaround sass-spec A patch landed in sass-spec that is not compatible with 3.5.
1 parent 3ab7a16 commit 8004d10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+19561
-146
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "node-sass",
33
"version": "4.8.3",
4-
"libsass": "3.5.2",
4+
"libsass": "3.5.3",
55
"description": "Wrapper around libsass",
66
"license": "MIT",
77
"bugs": "https://github.com/sass/node-sass/issues",
@@ -83,7 +83,7 @@
8383
"object-merge": "^2.5.1",
8484
"read-yaml": "^1.0.0",
8585
"rimraf": "^2.5.2",
86-
"sass-spec": "^3.5.1",
86+
"sass-spec": "3.5.1",
8787
"unique-temp-dir": "^1.0.0"
8888
}
8989
}

src/libsass/GNUmakefile.am

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,63 +25,49 @@ else
2525
AM_CXXFLAGS += -std=c++0x
2626
endif
2727

28+
TEST_EXTENSIONS = .rb
29+
2830
if ENABLE_TESTS
2931

30-
noinst_PROGRAMS = tester
32+
SASS_SASSC_PATH ?= $(top_srcdir)/sassc
33+
SASS_SPEC_PATH ?= $(top_srcdir)/sass-spec
3134

35+
noinst_PROGRAMS = tester
3236
tester_LDADD = src/libsass.la
33-
tester_SOURCES = $(SASS_SASSC_PATH)/sassc.c
34-
tester_VERSION ?= `cd "$(SASS_SASSC_PATH)" && ./version.sh`
35-
tester_CFLAGS = $(AM_CFLAGS) -DSASSC_VERSION="\"$(tester_VERSION)\""
36-
tester_CXXFLAGS = $(AM_CXXFLAGS) -DSASSC_VERSION="\"$(tester_VERSION)\""
3737
tester_LDFLAGS = $(AM_LDFLAGS)
38+
nodist_tester_SOURCES = $(SASS_SASSC_PATH)/sassc.c
39+
SASS_SASSC_VERSION ?= `cd "$(SASS_SASSC_PATH)" && ./version.sh`
40+
tester_CFLAGS = $(AM_CFLAGS) -DSASSC_VERSION="\"$(SASS_SASSC_VERSION)\""
41+
tester_CXXFLAGS = $(AM_CXXFLAGS) -DSASSC_VERSION="\"$(SASS_SASSC_VERSION)\""
3842

3943
if ENABLE_COVERAGE
4044
nodist_EXTRA_tester_SOURCES = non-existent-file-to-force-CXX-linking.cxx
4145
endif
4246

43-
SASS_SASSC_PATH ?= $(top_srcdir)/sassc
44-
SASS_SPEC_PATH ?= $(top_srcdir)/sass-spec
45-
46-
TESTS = \
47-
$(SASS_SPEC_PATH)/spec/basic \
48-
$(SASS_SPEC_PATH)/spec/css \
49-
$(SASS_SPEC_PATH)/spec/extend-tests \
50-
$(SASS_SPEC_PATH)/spec/extends \
51-
$(SASS_SPEC_PATH)/spec/libsass \
52-
$(SASS_SPEC_PATH)/spec/libsass-closed-issues \
53-
$(SASS_SPEC_PATH)/spec/maps \
54-
$(SASS_SPEC_PATH)/spec/misc \
55-
$(SASS_SPEC_PATH)/spec/regressions \
56-
$(SASS_SPEC_PATH)/spec/scss \
57-
$(SASS_SPEC_PATH)/spec/scss-tests \
58-
$(SASS_SPEC_PATH)/spec/types
47+
TESTS = $(SASS_SPEC_PATH)/sass-spec.rb
48+
RB_LOG_COMPILER = ./script/tap-runner
49+
AM_RB_LOG_FLAGS = $(RUBY)
5950

6051
SASS_TEST_FLAGS = -V 3.5 --impl libsass
61-
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) ./script/tap-driver
62-
AM_LOG_FLAGS = -c ./tester $(LOG_FLAGS)
63-
if USE_TAP
64-
AM_LOG_FLAGS += -t
65-
SASS_TEST_FLAGS += -t | tapout
66-
LOG_COMPILER = ./script/tap-runner $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
67-
else
68-
LOG_COMPILER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
69-
endif
52+
SASS_TEST_FLAGS += -r $(SASS_SPEC_PATH)
53+
SASS_TEST_FLAGS += -c $(top_srcdir)/tester$(EXEEXT)
54+
AM_TESTS_ENVIRONMENT = TEST_FLAGS='$(SASS_TEST_FLAGS)'
7055

7156
SASS_TESTER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
72-
SASS_TESTER += -c $(top_srcdir)/tester$(EXEEXT)
7357

7458
test:
75-
$(SASS_TESTER) $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
59+
$(SASS_TESTER) $(SASS_TEST_FLAGS)
7660

7761
test_build:
78-
$(SASS_TESTER) $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
62+
$(SASS_TESTER) $(SASS_TEST_FLAGS)
7963

8064
test_full:
81-
$(SASS_TESTER) --run-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
65+
$(SASS_TESTER) --run-todo $(SASS_TEST_FLAGS)
8266

8367
test_probe:
84-
$(SASS_TESTER) --probe-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)
68+
$(SASS_TESTER) --probe-todo $(SASS_TEST_FLAGS)
69+
70+
.PHONY: test test_build test_full test_probe
8571

8672
endif
8773

src/libsass/Readme.md

Lines changed: 13 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,20 @@
1-
LibSass - Sass compiler written in C++
2-
======================================
1+
Welcome to the LibSass documentation!
32

4-
Currently maintained by Marcel Greter ([@mgreter]) and Michael Mifsud ([@xzyfer])
5-
Originally created by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin])
3+
## First Off
4+
LibSass is just a library. To run the code locally (i.e. to compile your stylesheets), you need an implementer. SassC (get it?) is an implementer written in C. There are a number of other implementations of LibSass - for example Node. We encourage you to write your own port - the whole point of LibSass is that we want to bring Sass to many other languages, not just Ruby!
65

7-
[![Unix CI](https://travis-ci.org/sass/libsass.svg?branch=master)](https://travis-ci.org/sass/libsass "Travis CI")
8-
[![Windows CI](https://ci.appveyor.com/api/projects/status/github/sass/libsass?svg=true)](https://ci.appveyor.com/project/sass/libsass/branch/master "Appveyor CI")
9-
[![Coverage Status](https://img.shields.io/coveralls/sass/libsass.svg)](https://coveralls.io/r/sass/libsass?branch=feature%2Ftest-travis-ci-3 "Code coverage of spec tests")
10-
[![Percentage of issues still open](http://isitmaintained.com/badge/open/sass/libsass.svg)](http://isitmaintained.com/project/sass/libsass "Percentage of issues still open")
11-
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/sass/libsass.svg)](http://isitmaintained.com/project/sass/libsass "Average time to resolve an issue")
12-
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=283068)](https://www.bountysource.com/trackers/283068-libsass?utm_source=283068&utm_medium=shield&utm_campaign=TRACKER_BADGE "Bountysource")
13-
[![Join us](https://libsass-slack.herokuapp.com/badge.svg)](https://libsass-slack.herokuapp.com/ "Slack communication channels")
6+
We're working hard on moving to full parity with Ruby Sass... learn more at the [The-LibSass-Compatibility-Plan](compatibility-plan.md)!
147

8+
### Implementing LibSass
159

16-
[LibSass](https://github.com/sass/libsass "LibSass GitHub Project") is just a library!
17-
If you want to use LibSass to compile Sass, you need an implementer. Some
18-
implementations are only bindings into other programming languages. But most also
19-
ship with a command line interface (CLI) you can use directly. There is also
20-
[SassC](https://github.com/sass/sassc), which is the official lightweight
21-
CLI tool built by the same people as LibSass.
10+
If you're interested in implementing LibSass in your own project see the [API Documentation](api-doc.md) which now includes implementing
11+
your own [Sass functions](api-function.md). You may wish to [look at other implementations](implementations.md) for your language of choice.
12+
Or make your own!
2213

23-
### Excerpt of "sanctioned" implementations:
14+
### Contributing to LibSass
2415

25-
- https://github.com/sass/node-sass (Node.js)
26-
- https://github.com/sass/perl-libsass (Perl)
27-
- https://github.com/sass/libsass-python (Python)
28-
- https://github.com/wellington/go-libsass (Go)
29-
- https://github.com/sass/sassc-ruby (Ruby)
30-
- https://github.com/sass/libsass-net (C#)
31-
- https://github.com/medialize/sass.js (JS)
32-
- https://github.com/bit3/jsass (Java)
16+
| Issue Tracker | Issue Triage | Community Guidelines |
17+
|-------------------|----------------------------------|-----------------------------|
18+
| We're always needing help, so check out our issue tracker, help some people out, and read our article on [Contributing](contributing.md)! It's got all the details on what to do! | To help understand the process of triaging bugs, have a look at our [Issue-Triage](triage.md) document. | Oh, and don't forget we always follow [[Sass Community Guidelines|http://sass-lang.com/community-guidelines]]. Be nice and everyone else will be nice too! |
3319

34-
This list does not say anything about the quality of either the listed or not listed [implementations](docs/implementations.md)!
35-
The authors of the listed projects above are just known to work regularly together with LibSass developers.
36-
37-
About
38-
-----
39-
40-
LibSass is a C++ port of the original Ruby Sass CSS compiler with a [C API](docs/api-doc.md).
41-
We coded LibSass with portability and efficiency in mind. You can expect LibSass to be a lot
42-
faster than Ruby Sass and on par or faster than the best alternative CSS compilers around.
43-
44-
Developing
45-
----------
46-
47-
As noted above, the LibSass repository does not contain any binaries or other way to execute
48-
LibSass. Therefore, you need an implementer to develop LibSass. Easiest is to start with
49-
the official [SassC](http://github.com/sass/sassc) CLI wrapper. It is *guaranteed* to compile
50-
with the latest code in LibSass master, since it is also used in the CI process. There is no
51-
limitation here, as you may use any other LibSass implementer to test your LibSass branch!
52-
53-
Testing
54-
-------
55-
56-
Since LibSass is a pure library, tests are run through the [Sass-Spec](https://github.com/sass/sass-spec)
57-
project using the [SassC](http://github.com/sass/sassc) CLI wrapper. To run the tests against LibSass while
58-
developing, you can run `./script/spec`. This will clone SassC and Sass-Spec under the project folder and
59-
then run the Sass-Spec test suite. You may want to update the clones to ensure you have the latest version.
60-
Note that the scripts in the `./script` folder are mainly intended for our CI needs.
61-
62-
Building
63-
--------
64-
65-
To build LibSass you need GCC 4.6+ or Clang/LLVM. If your OS is older, you may need to upgrade
66-
them first (or install clang as an alternative). On Windows, you need MinGW with GCC 4.6+ or VS 2013
67-
Update 4+. It is also possible to build LibSass with Clang/LLVM on Windows with various build chains
68-
and/or command line interpreters.
69-
70-
See the [build docs for further instructions](docs/build.md)!
71-
72-
Compatibility
73-
-------------
74-
75-
Current LibSass 3.4 should be compatible with Sass 3.4. Please refer to the [sass compatibility
76-
page](http://sass-compatibility.github.io/) for a more detailed comparison. But note that there
77-
are still a few incomplete edges which we are aware of. Otherwise LibSass has reached a good level
78-
of stability, thanks to our ever growing [Sass-Spec test suite](https://github.com/sass/sass-spec).
79-
80-
About Sass
81-
----------
82-
83-
Sass is a CSS pre-processor language to add on exciting, new, awesome features to CSS. Sass was
84-
the first language of its kind and by far the most mature and up to date codebase.
85-
86-
Sass was originally conceived of by the co-creator of this library, Hampton Catlin ([@hcatlin]).
87-
Most of the language has been the result of years of work by Natalie Weizenbaum ([@nex3]) and
88-
Chris Eppstein ([@chriseppstein]).
89-
90-
For more information about Sass itself, please visit http://sass-lang.com
91-
92-
Initial development of LibSass by Aaron Leung and Hampton Catlin was supported by [Moovweb](http://www.moovweb.com).
93-
94-
Licensing
95-
---------
96-
97-
Our [MIT license](LICENSE) is designed to be as simple and liberal as possible.
98-
99-
[@hcatlin]: https://github.com/hcatlin
100-
[@akhleung]: https://github.com/akhleung
101-
[@chriseppstein]: https://github.com/chriseppstein
102-
[@nex3]: https://github.com/nex3
103-
[@mgreter]: https://github.com/mgreter
104-
[@xzyfer]: https://github.com/xzyfer
20+
Please refer to the steps on [Building LibSass](build.md)

src/libsass/api-context-example.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Example main.c
2+
3+
```C
4+
#include <stdio.h>
5+
#include "sass/context.h"
6+
7+
int main( int argc, const char* argv[] )
8+
{
9+
10+
// get the input file from first argument or use default
11+
const char* input = argc > 1 ? argv[1] : "styles.scss";
12+
13+
// create the file context and get all related structs
14+
struct Sass_File_Context* file_ctx = sass_make_file_context(input);
15+
struct Sass_Context* ctx = sass_file_context_get_context(file_ctx);
16+
struct Sass_Options* ctx_opt = sass_context_get_options(ctx);
17+
18+
// configure some options ...
19+
sass_option_set_precision(ctx_opt, 10);
20+
21+
// context is set up, call the compile step now
22+
int status = sass_compile_file_context(file_ctx);
23+
24+
// print the result or the error to the stdout
25+
if (status == 0) puts(sass_context_get_output_string(ctx));
26+
else puts(sass_context_get_error_message(ctx));
27+
28+
// release allocated memory
29+
sass_delete_file_context(file_ctx);
30+
31+
// exit status
32+
return status;
33+
34+
}
35+
```
36+
37+
### Compile main.c
38+
39+
```bash
40+
gcc -c main.c -o main.o
41+
gcc -o sample main.o -lsass
42+
echo "foo { margin: 21px * 2; }" > foo.scss
43+
./sample foo.scss => "foo { margin: 42px }"
44+
```
45+

0 commit comments

Comments
 (0)