sassc 2.0.1 → 2.1.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.gitmodules +1 -1
  4. data/.travis.yml +7 -3
  5. data/CHANGELOG.md +3 -0
  6. data/CODE_OF_CONDUCT.md +1 -1
  7. data/README.md +1 -1
  8. data/Rakefile +23 -8
  9. data/ext/extconf.rb +39 -0
  10. data/ext/libsass/.gitignore +1 -0
  11. data/ext/libsass/GNUmakefile.am +23 -39
  12. data/ext/libsass/Makefile +56 -91
  13. data/ext/libsass/Makefile.conf +16 -2
  14. data/ext/libsass/configure.ac +8 -12
  15. data/ext/libsass/include/sass/base.h +1 -0
  16. data/ext/libsass/include/sass/context.h +1 -1
  17. data/ext/libsass/src/GNUmakefile.am +1 -5
  18. data/ext/libsass/src/ast.cpp +747 -2010
  19. data/ext/libsass/src/ast.hpp +239 -2383
  20. data/ext/libsass/src/{to_c.cpp → ast2c.cpp} +22 -16
  21. data/ext/libsass/src/ast2c.hpp +39 -0
  22. data/ext/libsass/src/ast_def_macros.hpp +62 -10
  23. data/ext/libsass/src/ast_fwd_decl.cpp +1 -0
  24. data/ext/libsass/src/ast_fwd_decl.hpp +43 -165
  25. data/ext/libsass/src/ast_sel_cmp.cpp +909 -0
  26. data/ext/libsass/src/ast_sel_unify.cpp +280 -0
  27. data/ext/libsass/src/ast_selectors.cpp +1475 -0
  28. data/ext/libsass/src/ast_selectors.hpp +568 -0
  29. data/ext/libsass/src/ast_supports.cpp +130 -0
  30. data/ext/libsass/src/ast_supports.hpp +121 -0
  31. data/ext/libsass/src/ast_values.cpp +967 -0
  32. data/ext/libsass/src/ast_values.hpp +489 -0
  33. data/ext/libsass/src/backtrace.cpp +4 -0
  34. data/ext/libsass/src/base64vlq.cpp +3 -0
  35. data/ext/libsass/src/bind.cpp +18 -17
  36. data/ext/libsass/src/bind.hpp +3 -1
  37. data/ext/libsass/src/c2ast.cpp +64 -0
  38. data/ext/libsass/src/c2ast.hpp +14 -0
  39. data/ext/libsass/src/cencode.c +2 -2
  40. data/ext/libsass/src/check_nesting.cpp +52 -56
  41. data/ext/libsass/src/check_nesting.hpp +35 -34
  42. data/ext/libsass/src/color_maps.cpp +156 -153
  43. data/ext/libsass/src/color_maps.hpp +152 -152
  44. data/ext/libsass/src/constants.cpp +15 -0
  45. data/ext/libsass/src/constants.hpp +13 -0
  46. data/ext/libsass/src/context.cpp +24 -14
  47. data/ext/libsass/src/context.hpp +6 -6
  48. data/ext/libsass/src/cssize.cpp +69 -71
  49. data/ext/libsass/src/cssize.hpp +50 -50
  50. data/ext/libsass/src/debugger.hpp +117 -110
  51. data/ext/libsass/src/emitter.cpp +13 -12
  52. data/ext/libsass/src/emitter.hpp +13 -9
  53. data/ext/libsass/src/environment.cpp +15 -1
  54. data/ext/libsass/src/environment.hpp +6 -0
  55. data/ext/libsass/src/error_handling.cpp +36 -59
  56. data/ext/libsass/src/error_handling.hpp +29 -16
  57. data/ext/libsass/src/eval.cpp +302 -323
  58. data/ext/libsass/src/eval.hpp +64 -55
  59. data/ext/libsass/src/expand.cpp +94 -88
  60. data/ext/libsass/src/expand.hpp +33 -37
  61. data/ext/libsass/src/extend.cpp +38 -36
  62. data/ext/libsass/src/extend.hpp +15 -15
  63. data/ext/libsass/src/file.cpp +34 -2
  64. data/ext/libsass/src/fn_colors.cpp +594 -0
  65. data/ext/libsass/src/fn_colors.hpp +85 -0
  66. data/ext/libsass/src/fn_lists.cpp +284 -0
  67. data/ext/libsass/src/fn_lists.hpp +34 -0
  68. data/ext/libsass/src/fn_maps.cpp +94 -0
  69. data/ext/libsass/src/fn_maps.hpp +30 -0
  70. data/ext/libsass/src/fn_miscs.cpp +256 -0
  71. data/ext/libsass/src/fn_miscs.hpp +40 -0
  72. data/ext/libsass/src/fn_numbers.cpp +220 -0
  73. data/ext/libsass/src/fn_numbers.hpp +45 -0
  74. data/ext/libsass/src/fn_selectors.cpp +235 -0
  75. data/ext/libsass/src/fn_selectors.hpp +35 -0
  76. data/ext/libsass/src/fn_strings.cpp +254 -0
  77. data/ext/libsass/src/fn_strings.hpp +34 -0
  78. data/ext/libsass/src/fn_utils.cpp +156 -0
  79. data/ext/libsass/src/fn_utils.hpp +56 -0
  80. data/ext/libsass/src/inspect.cpp +101 -152
  81. data/ext/libsass/src/inspect.hpp +69 -73
  82. data/ext/libsass/src/json.cpp +2 -2
  83. data/ext/libsass/src/lexer.cpp +6 -3
  84. data/ext/libsass/src/listize.cpp +9 -11
  85. data/ext/libsass/src/listize.hpp +11 -7
  86. data/ext/libsass/src/memory/SharedPtr.cpp +2 -83
  87. data/ext/libsass/src/memory/SharedPtr.hpp +127 -143
  88. data/ext/libsass/src/node.cpp +13 -10
  89. data/ext/libsass/src/node.hpp +3 -3
  90. data/ext/libsass/src/operation.hpp +184 -144
  91. data/ext/libsass/src/operators.cpp +43 -17
  92. data/ext/libsass/src/operators.hpp +5 -5
  93. data/ext/libsass/src/output.cpp +21 -18
  94. data/ext/libsass/src/output.hpp +14 -21
  95. data/ext/libsass/src/parser.cpp +215 -183
  96. data/ext/libsass/src/parser.hpp +28 -24
  97. data/ext/libsass/src/plugins.cpp +5 -1
  98. data/ext/libsass/src/position.cpp +3 -0
  99. data/ext/libsass/src/prelexer.cpp +9 -3
  100. data/ext/libsass/src/prelexer.hpp +9 -9
  101. data/ext/libsass/src/remove_placeholders.cpp +14 -11
  102. data/ext/libsass/src/remove_placeholders.hpp +8 -9
  103. data/ext/libsass/src/sass.cpp +9 -3
  104. data/ext/libsass/src/sass.hpp +12 -9
  105. data/ext/libsass/src/sass2scss.cpp +45 -14
  106. data/ext/libsass/src/sass_context.cpp +18 -15
  107. data/ext/libsass/src/sass_functions.cpp +6 -3
  108. data/ext/libsass/src/sass_functions.hpp +1 -1
  109. data/ext/libsass/src/sass_util.cpp +3 -0
  110. data/ext/libsass/src/sass_values.cpp +21 -13
  111. data/ext/libsass/src/source_map.cpp +5 -2
  112. data/ext/libsass/src/source_map.hpp +2 -2
  113. data/ext/libsass/src/subset_map.cpp +4 -1
  114. data/ext/libsass/src/to_value.cpp +23 -21
  115. data/ext/libsass/src/to_value.hpp +18 -22
  116. data/ext/libsass/src/units.cpp +4 -0
  117. data/ext/libsass/src/units.hpp +1 -0
  118. data/ext/libsass/src/utf8/checked.h +12 -10
  119. data/ext/libsass/src/utf8/core.h +3 -0
  120. data/ext/libsass/src/utf8_string.cpp +3 -0
  121. data/ext/libsass/src/util.cpp +67 -75
  122. data/ext/libsass/src/util.hpp +64 -19
  123. data/ext/libsass/src/util_string.cpp +75 -0
  124. data/ext/libsass/src/util_string.hpp +19 -0
  125. data/ext/libsass/src/values.cpp +22 -13
  126. data/ext/libsass/src/values.hpp +2 -2
  127. data/ext/libsass/win/libsass.targets +30 -4
  128. data/ext/libsass/win/libsass.vcxproj.filters +82 -4
  129. data/lib/sassc.rb +24 -0
  130. data/lib/sassc/engine.rb +2 -2
  131. data/lib/sassc/native.rb +8 -1
  132. data/lib/sassc/version.rb +1 -1
  133. data/sassc.gemspec +19 -11
  134. data/test/engine_test.rb +26 -1
  135. data/test/native_test.rb +1 -1
  136. metadata +66 -72
  137. data/ext/Rakefile +0 -3
  138. data/ext/libsass/.github/CONTRIBUTING.md +0 -65
  139. data/ext/libsass/.github/ISSUE_TEMPLATE.md +0 -54
  140. data/ext/libsass/.travis.yml +0 -64
  141. data/ext/libsass/Readme.md +0 -104
  142. data/ext/libsass/SECURITY.md +0 -10
  143. data/ext/libsass/appveyor.yml +0 -91
  144. data/ext/libsass/docs/README.md +0 -20
  145. data/ext/libsass/docs/api-context-example.md +0 -45
  146. data/ext/libsass/docs/api-context-internal.md +0 -163
  147. data/ext/libsass/docs/api-context.md +0 -295
  148. data/ext/libsass/docs/api-doc.md +0 -215
  149. data/ext/libsass/docs/api-function-example.md +0 -67
  150. data/ext/libsass/docs/api-function-internal.md +0 -8
  151. data/ext/libsass/docs/api-function.md +0 -74
  152. data/ext/libsass/docs/api-importer-example.md +0 -112
  153. data/ext/libsass/docs/api-importer-internal.md +0 -20
  154. data/ext/libsass/docs/api-importer.md +0 -86
  155. data/ext/libsass/docs/api-value-example.md +0 -55
  156. data/ext/libsass/docs/api-value-internal.md +0 -76
  157. data/ext/libsass/docs/api-value.md +0 -154
  158. data/ext/libsass/docs/build-on-darwin.md +0 -27
  159. data/ext/libsass/docs/build-on-gentoo.md +0 -55
  160. data/ext/libsass/docs/build-on-windows.md +0 -139
  161. data/ext/libsass/docs/build-shared-library.md +0 -35
  162. data/ext/libsass/docs/build-with-autotools.md +0 -78
  163. data/ext/libsass/docs/build-with-makefiles.md +0 -68
  164. data/ext/libsass/docs/build-with-mingw.md +0 -107
  165. data/ext/libsass/docs/build-with-visual-studio.md +0 -90
  166. data/ext/libsass/docs/build.md +0 -97
  167. data/ext/libsass/docs/compatibility-plan.md +0 -48
  168. data/ext/libsass/docs/contributing.md +0 -17
  169. data/ext/libsass/docs/custom-functions-internal.md +0 -122
  170. data/ext/libsass/docs/dev-ast-memory.md +0 -223
  171. data/ext/libsass/docs/implementations.md +0 -56
  172. data/ext/libsass/docs/plugins.md +0 -47
  173. data/ext/libsass/docs/setup-environment.md +0 -68
  174. data/ext/libsass/docs/source-map-internals.md +0 -51
  175. data/ext/libsass/docs/trace.md +0 -26
  176. data/ext/libsass/docs/triage.md +0 -17
  177. data/ext/libsass/docs/unicode.md +0 -39
  178. data/ext/libsass/extconf.rb +0 -6
  179. data/ext/libsass/script/bootstrap +0 -13
  180. data/ext/libsass/script/branding +0 -10
  181. data/ext/libsass/script/ci-build-libsass +0 -134
  182. data/ext/libsass/script/ci-build-plugin +0 -62
  183. data/ext/libsass/script/ci-install-compiler +0 -6
  184. data/ext/libsass/script/ci-install-deps +0 -20
  185. data/ext/libsass/script/ci-report-coverage +0 -42
  186. data/ext/libsass/script/spec +0 -5
  187. data/ext/libsass/script/tap-driver +0 -652
  188. data/ext/libsass/script/tap-runner +0 -1
  189. data/ext/libsass/script/test-leaks.pl +0 -103
  190. data/ext/libsass/src/functions.cpp +0 -2234
  191. data/ext/libsass/src/functions.hpp +0 -198
  192. data/ext/libsass/src/to_c.hpp +0 -39
  193. data/ext/libsass/test/test_node.cpp +0 -94
  194. data/ext/libsass/test/test_paths.cpp +0 -28
  195. data/ext/libsass/test/test_selector_difference.cpp +0 -25
  196. data/ext/libsass/test/test_specificity.cpp +0 -25
  197. data/ext/libsass/test/test_subset_map.cpp +0 -472
  198. data/ext/libsass/test/test_superselector.cpp +0 -69
  199. data/ext/libsass/test/test_unification.cpp +0 -31
  200. data/lib/tasks/libsass.rb +0 -33
@@ -1,68 +0,0 @@
1
- ### Get the sources
2
- ```bash
3
- # using git is preferred
4
- git clone https://github.com/sass/libsass.git
5
- # only needed for sassc and/or testsuite
6
- git clone https://github.com/sass/sassc.git libsass/sassc
7
- git clone https://github.com/sass/sass-spec.git libsass/sass-spec
8
- ```
9
-
10
- ### Decide for static or shared library
11
-
12
- `libsass` can be built and linked as a `static` or as a `shared` library. The default is `static`. To change it you can set the `BUILD` environment variable:
13
-
14
- ```bash
15
- export BUILD="shared"
16
- ```
17
-
18
- Alternatively you can also define it directly when calling make:
19
-
20
- ```bash
21
- BUILD="shared" make ...
22
- ```
23
-
24
- ### Compile the library
25
- ```bash
26
- make -C libsass -j5
27
- ```
28
-
29
- ### Results can be found in
30
- ```bash
31
- $ ls libsass/lib
32
- libsass.a libsass.so
33
- ```
34
-
35
- ### Install onto the system
36
-
37
- We recommend to use [autotools to install](build-with-autotools.md) libsass onto the
38
- system, since that brings all the benefits of using libtools as the main install method.
39
- If you still want to install libsass via the makefile, you need to make sure that gnu
40
- `install` utility (or compatible) is installed on your system.
41
- ```bash
42
- yum install coreutils # RedHat Linux
43
- emerge -a coreutils # Gentoo Linux
44
- pkgin install coreutils # SmartOS
45
- ```
46
-
47
- You can set the install location by setting `PREFIX`
48
- ```bash
49
- PREFIX="/opt/local" make install
50
- ```
51
-
52
-
53
- ### Compling sassc
54
-
55
- ```bash
56
- # Let build know library location
57
- export SASS_LIBSASS_PATH="`pwd`/libsass"
58
- # Invokes the sassc makefile
59
- make -C libsass -j5 sassc
60
- ```
61
-
62
- ### Run the spec test-suite
63
-
64
- ```bash
65
- # needs ruby available
66
- # also gem install minitest
67
- make -C libsass -j5 test_build
68
- ```
@@ -1,107 +0,0 @@
1
- ## Building LibSass with MingGW (makefiles)
2
-
3
- First grab the latest [MinGW for windows][1] installer. Once it is installed, you can click on continue or open the Installation Manager via `bin\mingw-get.exe`.
4
-
5
- You need to have the following components installed:
6
- ![](https://cloud.githubusercontent.com/assets/282293/5525466/947bf396-89e6-11e4-841d-4aa916f14de1.png)
7
-
8
- Next we need to install [git for windows][2]. You probably want to check the option to add it to the global path, but you do not need to install the unix tools.
9
-
10
- If you want to run the spec test-suite you also need [ruby][3] and a few gems available. Grab the [latest installer][3] and make sure to add it the global path. Then install the missing gems:
11
-
12
- ```bash
13
- gem install minitest
14
- ```
15
-
16
- ### Mount the mingw root directory
17
-
18
- As mentioned in the [MinGW Getting Started](http://www.mingw.org/wiki/Getting_Started#toc5) guide, you should edit `C:\MinGW\msys\1.0\etc\fstab` to contain the following line:
19
-
20
- ```
21
- C:\MinGW /mingw
22
- ```
23
-
24
- ### Starting a "MingGW" console
25
-
26
- Create a batch file with this content:
27
- ```bat
28
- @echo off
29
- set PATH=C:\MinGW\bin;%PATH%
30
- REM only needed if not already available
31
- set PATH=%PROGRAMFILES%\git\bin;%PATH%
32
- REM C:\MinGW\msys\1.0\msys.bat
33
- cmd
34
- ```
35
-
36
- Execute it and make sure these commands can be called: `git`, `mingw32-make`, `rm` and `gcc`! Once this is all set, you should be ready to compile `libsass`!
37
-
38
- ### Get the sources
39
-
40
- ```bash
41
- # using git is preferred
42
- git clone https://github.com/sass/libsass.git
43
- # only needed for sassc and/or testsuite
44
- git clone https://github.com/sass/sassc.git libsass/sassc
45
- git clone https://github.com/sass/sass-spec.git libsass/sass-spec
46
- ```
47
-
48
- ### Decide for static or shared library
49
-
50
- `libsass` can be built and linked as a `static` or as a `shared` library. The default is `static`. To change it you can set the `BUILD` environment variable:
51
-
52
- ```bat
53
- set BUILD="shared"
54
- ```
55
-
56
- ### Compile the library
57
- ```bash
58
- mingw32-make -C libsass
59
- ```
60
-
61
- ### Results can be found in
62
- ```bash
63
- $ ls libsass/lib
64
- libsass.a libsass.dll libsass.so
65
- ```
66
-
67
- ### Run the spec test-suite
68
- ```bash
69
- mingw32-make -C libsass test_build
70
- ```
71
-
72
- ## Building via MingGW 64bit (makefiles)
73
- Building libass to dll on window 64bit.
74
-
75
- Download [MinGW64 for windows7 64bit](http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.2/threads-win32/seh/x86_64-4.9.2-release-win32-seh-rt_v3-rev0.7z/download) and unzip to "C:\mingw64".
76
-
77
- Create a batch file with this content:
78
-
79
- ```bat
80
- @echo off
81
- set PATH=C:\mingw64\bin;%PATH%
82
- set CC=gcc
83
- REM only needed if not already available
84
- set PATH=%PROGRAMFILES%\Git\bin;%PATH%
85
- REM C:\MinGW\msys\1.0\msys.bat
86
- cmd
87
- ```
88
-
89
- By default, mingw64 dll will depends on "​m​i​n​g​w​m​1​0​.​d​l​l​、​ ​l​i​b​g​c​c​_​s​_​d​w​2​-​1​.​d​l​l​", we can modify Makefile to fix this:(add "-static")
90
-
91
- ``` bash
92
- lib/libsass.dll: $(COBJECTS) $(OBJECTS) $(RCOBJECTS)
93
- $(MKDIR) lib
94
- $(CXX) -shared $(LDFLAGS) -o $@ $(COBJECTS) $(OBJECTS) $(RCOBJECTS) $(LDLIBS) -s -static -Wl,--subsystem,windows,--out-implib,lib/libsass.a
95
- ```
96
-
97
- Compile the library
98
-
99
- ```bash
100
- mingw32-make -C libsass
101
- ```
102
-
103
- By the way, if you are using java jna, [JNAerator](http://jnaerator.googlecode.com/) is a good tool.
104
-
105
- [1]: http://sourceforge.net/projects/mingw/files/latest/download?source=files
106
- [2]: https://msysgit.github.io/
107
- [3]: http://rubyinstaller.org/
@@ -1,90 +0,0 @@
1
- ## Building LibSass with Visual Studio
2
-
3
- ### Requirements:
4
-
5
- The minimum requirement to build LibSass with Visual Studio is "Visual Studio 2013 Express for Desktop".
6
-
7
- Additionally, it is recommended to have `git` installed and available in `PATH`, so to deduce the `libsass` version information. For instance, if GitHub for Windows (https://windows.github.com/) is installed, the `PATH` will have an entry resembling: `X:\Users\<YOUR_NAME>\AppData\Local\GitHub\PortableGit_<SOME_GUID>\cmd\` (where `X` is the drive letter of system drive). If `git` is not available, inquiring the LibSass version will result in `[NA]`.
8
-
9
- ### Build Steps:
10
-
11
- #### From Visual Studio:
12
-
13
- On opening the `win\libsass.sln` solution and build (Ctrl+Shift+B) to build `libsass.dll`.
14
-
15
- To Build LibSass as a static Library, it is recommended to set an environment variable `LIBSASS_STATIC_LIB` before launching the project:
16
-
17
- ```cmd
18
- cd path\to\libsass
19
- SET LIBSASS_STATIC_LIB=1
20
- ::
21
- :: or in PowerShell:
22
- :: $env:LIBSASS_STATIC_LIB=1
23
- ::
24
- win\libsass.sln
25
- ```
26
-
27
- Visual Studio will form the filtered source tree as shown below:
28
-
29
- ![image](https://cloud.githubusercontent.com/assets/3840695/9298985/aae9e072-44bf-11e5-89eb-e7995c098085.png)
30
-
31
- `Header Files` contains the .h and .hpp files, while `Source Files` covers `.c` and `.cpp`. The other used headers/sources will appear under `External Dependencies`.
32
-
33
- If there is a LibSass code file appearing under External Dependencies, it can be changed by altering the `win\libsass.vcxproj.filters` file or dragging in Solution Explorer.
34
-
35
- #### From Command Prompt:
36
-
37
- Notice that in the following commands:
38
-
39
- * If the platform is 32-bit Windows, replace `ProgramFiles(x86)` with `ProgramFiles`.
40
- * To build with Visual Studio 2015, replace `12.0` with `14.0` in the aforementioned command.
41
-
42
- Open a command prompt:
43
-
44
- To build dynamic/shared library (`libsass.dll`):
45
-
46
- ```cmd
47
- :: debug build:
48
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild" win\libsass.sln
49
-
50
- :: release build:
51
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild" win\libsass.sln ^
52
- /p:Configuration=Release
53
- ```
54
-
55
- To build static library (`libsass.lib`):
56
-
57
- ```cmd
58
- :: debug build:
59
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild" win\libsass.sln ^
60
- /p:LIBSASS_STATIC_LIB=1
61
-
62
- :: release build:
63
- "%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild" win\libsass.sln ^
64
- /p:LIBSASS_STATIC_LIB=1 /p:Configuration=Release
65
- ```
66
-
67
- #### From PowerShell:
68
-
69
- To build dynamic/shared library (`libsass.dll`):
70
-
71
- ```powershell
72
- # debug build:
73
- &"${env:ProgramFiles(x86)}\MSBuild\12.0\Bin\MSBuild" win\libsass.sln
74
-
75
- # release build:
76
- &"${env:ProgramFiles(x86)}\MSBuild\12.0\Bin\MSBuild" win\libsass.sln `
77
- /p:Configuration=Release
78
- ```
79
-
80
- To build static library (`libsass.lib`):
81
-
82
- ```powershell
83
- # build:
84
- &"${env:ProgramFiles(x86)}\MSBuild\12.0\Bin\MSBuild" win\libsass.sln `
85
- /p:LIBSASS_STATIC_LIB=1
86
-
87
- # release build:
88
- &"${env:ProgramFiles(x86)}\MSBuild\12.0\Bin\MSBuild" win\libsass.sln `
89
- /p:LIBSASS_STATIC_LIB=1 /p:Configuration=Release
90
- ```
@@ -1,97 +0,0 @@
1
- `libsass` is only a library and does not do much on its own. You need an implementation that you can use from the [command line][6]. Or some [bindings|Implementations][9] to use it within your favorite programming language. You should be able to get [`sassc`][6] running by following the instructions in this guide.
2
-
3
- Before starting, see [setup dev environment](setup-environment.md).
4
-
5
- Building on different Operating Systems
6
- --
7
-
8
- We try to keep the code as OS independent and standard compliant as possible. Reading files from the file-system has some OS depending code, but will ultimately fall back to a posix compatible implementation. We do use some `C++11` features, but are so far only committed to use `unordered_map`. This means you will need a pretty recent compiler on most systems (gcc 4.5 seems to be the minimum).
9
-
10
- ### Building on Linux (and other *nix flavors)
11
-
12
- Linux is the main target for `libsass` and we support two ways to build `libsass` here. The old plain makefiles should still work on most systems (including MinGW), while the autotools build is preferred if you want to create a [system library] (experimental).
13
-
14
- - [Building with makefiles][1]
15
- - [Building with autotools][2]
16
-
17
- ### Building on Windows (experimental)
18
-
19
- Windows build support was added very recently and should be considered experimental. Credits go to @darrenkopp and @am11 for their work on getting `libsass` and `sassc` to compile with visual studio!
20
-
21
- - [Building with MinGW][3]
22
- - [Building with Visual Studio][11]
23
-
24
- ### Building on Max OS X (untested)
25
-
26
- Works the same as on linux, but you can also install LibSass via `homebrew`.
27
-
28
- - [Building on Mac OS X][10]
29
-
30
- ### Building a system library (experimental)
31
-
32
- Since `libsass` is a library, it makes sense to install it as a shared library on your system. On linux this means creating a `.so` library via autotools. This should work pretty well already, but we are not yet committed to keep the ABI 100% stable. This should be the case once we increase the version number for the library to 1.0.0 or higher. On Windows you should be able get a `dll` by creating a shared build with MinGW. There is currently no target in the MSVC project files to do this.
33
-
34
- - [Building shared system library][4]
35
-
36
- Compiling with clang instead of gcc
37
- --
38
-
39
- To use clang you just need to set the appropriate environment variables:
40
-
41
- ```bash
42
- export CC=/usr/bin/clang
43
- export CXX=/usr/bin/clang++
44
- ```
45
-
46
- Running the spec test-suite
47
- --
48
-
49
- We constantly and automatically test `libsass` against the official [spec test-suite][5]. To do this we need to have a test-runner (which is written in ruby) and a command-line tool ([`sassc`][6]) to run the tests. Therefore we need to additionally compile `sassc`. To do this, the build files of all three projects need to work together. This may not have the same quality for all build flavors. You definitely need to have ruby (2.1?) installed (version 1.9 seems to cause problems at least on windows). You also need some gems installed:
50
-
51
- ```bash
52
- ruby -v
53
- gem install minitest
54
- # should be optional
55
- gem install minitap
56
- ```
57
-
58
- Including the LibSass version
59
- --
60
-
61
- There is a function in `libsass` to query the current version. This has to be defined at compile time. We use a C macro for this, which can be defined by calling `g++ -DLIBSASS_VERSION="\"x.y.z.\""`. The two quotes are necessary, since it needs to end up as a valid C string. Normally you do not need to do anything if you use the makefiles or autotools. They will try to fetch the version via git directly. If you only have the sources without the git repo, you can pass the version as an environment variable to `make` or `configure`:
62
-
63
- ```
64
- export LIBSASS_VERSION="x.y.z."
65
- ```
66
-
67
- Continuous Integration
68
- --
69
-
70
- We use two CI services to automatically test all commits against the latest [spec test-suite][5].
71
-
72
- - [LibSass on Travis-CI (linux)][7]
73
- [![Build Status](https://travis-ci.org/sass/libsass.png?branch=master)](https://travis-ci.org/sass/libsass)
74
- - [LibSass on AppVeyor (windows)][8]
75
- [![Build status](https://ci.appveyor.com/api/projects/status/github/sass/libsass?svg=true)](https://ci.appveyor.com/project/mgreter/libsass-513/branch/master)
76
-
77
- Why not using CMake?
78
- --
79
-
80
- There were some efforts to get `libsass` to compile with CMake, which should make it easier to create build files for linux and windows. Unfortunately this was not completed. But we are certainly open for PRs!
81
-
82
- Miscellaneous
83
- --
84
-
85
- - [Ebuilds for Gentoo Linux](build-on-gentoo.md)
86
-
87
- [1]: build-with-makefiles.md
88
- [2]: build-with-autotools.md
89
- [3]: build-with-mingw.md
90
- [4]: build-shared-library.md
91
- [5]: https://github.com/sass/sass-spec
92
- [6]: https://github.com/sass/sassc
93
- [7]: https://github.com/sass/libsass/blob/master/.travis.yml
94
- [8]: https://github.com/sass/libsass/blob/master/appveyor.yml
95
- [9]: implementations.md
96
- [10]: build-on-darwin.md
97
- [11]: build-with-visual-studio.md
@@ -1,48 +0,0 @@
1
- This document is to serve as a living, changing plan for getting LibSass caught up with Ruby Sass.
2
-
3
- _Note: an "s" preceeding a version number is specifying a Ruby Sass version. Without an s, it's a version of LibSass._
4
-
5
- # Goal
6
- **Our goal is to reach full s3.4 compatibility as soon as possible. LibSass version 3.4 will behave just like Ruby Sass 3.4**
7
-
8
- I highlight the goal, because there are some things that are *not* currently priorities. To be clear, they WILL be priorities, but they are not at the moment:
9
-
10
- * Performance Improvements
11
- * Extensibility
12
-
13
- The overriding goal is correctness.
14
-
15
- ## Verifying Correctness
16
- LibSass uses the spec for its testing. The spec was originally based off s3.2 tests. Many things have changed in Ruby Sass since then and some of the tests need to be updated and changed in order to get them to match both LibSass and Ruby Sass.
17
-
18
- Until this project is complete, the spec will be primarily a place to test LibSass. By the time LibSass reaches 3.4, it is our goal that sass-spec will be fully usable as an official testing source for ALL implementations of Sass.
19
-
20
- ## Version Naming
21
- Until LibSass reaches parity with Ruby Sass, we will be aggressively bumping versions, and LibSass 3.4 will be the peer to Ruby Sass 3.4 in every way.
22
-
23
- # Release Plan
24
-
25
- ## 3.0
26
- The goal of 3.0 is to introduce some of the most demanded features for LibSass. That is, we are focusing on issues and features that have kept adoption down. This is a mongrel release wrt which version of Sass it's targeting. It's often a mixture of 3.2 / 3.3 / 3.4 behaviours. This is not ideal, but it's favourable to not existing. Targeting 3.4 strictly during this release would mean we never actually release.
27
-
28
- # 3.1
29
- The goal of 3.1 is to update all the passing specs to agree with 3.4. This will not be a complete representation of s3.4 (aka, there will me missing features), but the goal is to change existing features and implemented features to match 3.4 behaviour.
30
-
31
- By the end of this, the sass-spec must pass against 3.4.
32
-
33
- Major issues:
34
- * Variable Scoping
35
- * Color Handling
36
- * Precision
37
-
38
- # 3.2
39
- This version will focus on edge case fixes. There are a LOT of edge cases in the _todo_ tests and this is the release where we hunt those down like dogs (not that we want to hurt dogs, it's just a figure of speech in English).
40
-
41
- # 3.3
42
- Dress rehearsal. When we are 99% sure that we've fixed the main issues keeping us from saying we are compliant in s3.4 behaviour.
43
-
44
- # 3.4
45
- Compass Compatibility. We need to be able to work with Compass and all the other libraries out there. At this point, we are calling LibSass "mature"
46
-
47
- # Beyond 3.4
48
- Obviously, there is matching Sass 3.5 behaviour. But, beyond that, we'll want to focus on performance, stability, and error handling. These can always be improved upon and are the life's work of an open source project. We'll have to work closely with Sass in the future.
@@ -1,17 +0,0 @@
1
- First of all, welcome! Thanks for even reading this page. If you're here, you're probably wondering what you can do to help make the LibSass project even more awesome. And, even having that feeling means you are awesome!
2
-
3
- ## I'm a programmer
4
-
5
- Awesome! We need your help. The best thing to do is go find issues that are tagged with both "bug" and "test written". We do spec driven development here and these issues have a test that's written already in the sass-spec project. Go find the test by going to sass-spec/spec/LibSass-todo-issues/issue_XXX/ where XXX is the issue number. Write the code, and compile, and then issue a pull request referencing the issue. We'll quickly verify it and get it merged in!
6
-
7
- To get your dev environment setup, check out our article on [Setup-Dev-Environment](setup-environment.md).
8
-
9
- ## I'm not a backend programmer
10
-
11
- COOL! We also need your help. Doing [Issue-Triage](triage.md) is a big deal and something we need constant help with. That means helping to verify issues, write tests for them, and make sure they are getting fixed. It's being part of the smiling face of the project.
12
-
13
- Also, we need help with the Sass-Spec project itself. Just people to organize, refactor, and understand the tests in there.
14
-
15
- ## I don't know what a computer is?
16
-
17
- Hmm.... well, it's the thing you are looking at right now. Ummm... check out training courses! Then, come back and join us!
@@ -1,122 +0,0 @@
1
- # Developer Documentation
2
-
3
- Custom functions are internally represented by `struct Sass_C_Function_Descriptor`.
4
-
5
- ## Sass_C_Function_Descriptor
6
-
7
- ```C
8
- struct Sass_C_Function_Descriptor {
9
- const char* signature;
10
- Sass_C_Function function;
11
- void* cookie;
12
- };
13
- ```
14
-
15
- - `signature`: The function declaration, like `foo($bar, $baz:1)`
16
- - `function`: Reference to the C function callback
17
- - `cookie`: any pointer you want to attach
18
-
19
- ### signature
20
-
21
- The signature defines how the function can be invoked. It also declares which arguments are required and which are optional. Required arguments will be enforced by LibSass and a Sass error is thrown in the event a call as missing an argument. Optional arguments only need to be present when you want to overwrite the default value.
22
-
23
- foo($bar, $baz: 2)
24
-
25
- In this example, `$bar` is required and will error if not passed. `$baz` is optional and the default value of it is 2. A call like `foo(10)` is therefore equal to `foo(10, 2)`, while `foo()` will produce an error.
26
-
27
- ### function
28
-
29
- The callback function needs to be of the following form:
30
-
31
- ```C
32
- union Sass_Value* call_sass_function(
33
- const union Sass_Value* s_args,
34
- void* cookie
35
- ) {
36
- return sass_clone_value(s_args);
37
- }
38
- ```
39
-
40
- ### cookie
41
-
42
- The cookie can hold any pointer you want. In the `perl-libsass` implementation it holds the structure with the reference of the actual registered callback into the perl interpreter. Before that call `perl-libsass` will convert all `Sass_Values` to corresponding perl data types (so they can be used natively inside the perl interpretor). The callback can also return a `Sass_Value`. In `perl-libsass` the actual function returns a perl value, which has to be converted before `libsass` can work with it again!
43
-
44
- ## Sass_Values
45
-
46
- ```C
47
- // allocate memory (copies passed strings)
48
- union Sass_Value* sass_make_null (void);
49
- union Sass_Value* sass_make_boolean (bool val);
50
- union Sass_Value* sass_make_string (const char* val);
51
- union Sass_Value* sass_make_qstring (const char* val);
52
- union Sass_Value* sass_make_number (double val, const char* unit);
53
- union Sass_Value* sass_make_color (double r, double g, double b, double a);
54
- union Sass_Value* sass_make_list (size_t len, enum Sass_Separator sep, bool is_bracketed);
55
- union Sass_Value* sass_make_map (size_t len);
56
- union Sass_Value* sass_make_error (const char* msg);
57
- union Sass_Value* sass_make_warning (const char* msg);
58
-
59
- // Make a deep cloned copy of the given sass value
60
- union Sass_Value* sass_clone_value (const union Sass_Value* val);
61
-
62
- // deallocate memory (incl. all copied memory)
63
- void sass_delete_value (const union Sass_Value* val);
64
- ```
65
-
66
- ## Example main.c
67
-
68
- ```C
69
- #include <stdio.h>
70
- #include <stdint.h>
71
- #include "sass/context.h"
72
-
73
- union Sass_Value* call_fn_foo(const union Sass_Value* s_args, void* cookie)
74
- {
75
- // we actually abuse the void* to store an "int"
76
- return sass_make_number((size_t)cookie, "px");
77
- }
78
-
79
- int main( int argc, const char* argv[] )
80
- {
81
-
82
- // get the input file from first argument or use default
83
- const char* input = argc > 1 ? argv[1] : "styles.scss";
84
-
85
- // create the file context and get all related structs
86
- struct Sass_File_Context* file_ctx = sass_make_file_context(input);
87
- struct Sass_Context* ctx = sass_file_context_get_context(file_ctx);
88
- struct Sass_Options* ctx_opt = sass_context_get_options(ctx);
89
-
90
- // allocate a custom function caller
91
- Sass_C_Function_Callback fn_foo =
92
- sass_make_function("foo()", call_fn_foo, (void*)42);
93
-
94
- // create list of all custom functions
95
- Sass_C_Function_List fn_list = sass_make_function_list(1);
96
- sass_function_set_list_entry(fn_list, 0, fn_foo);
97
- sass_option_set_c_functions(ctx_opt, fn_list);
98
-
99
- // context is set up, call the compile step now
100
- int status = sass_compile_file_context(file_ctx);
101
-
102
- // print the result or the error to the stdout
103
- if (status == 0) puts(sass_context_get_output_string(ctx));
104
- else puts(sass_context_get_error_message(ctx));
105
-
106
- // release allocated memory
107
- sass_delete_file_context(file_ctx);
108
-
109
- // exit status
110
- return status;
111
-
112
- }
113
- ```
114
-
115
- ## Compile main.c
116
-
117
- ```bash
118
- gcc -c main.c -o main.o
119
- gcc -o sample main.o -lsass
120
- echo "foo { margin: foo(); }" > foo.scss
121
- ./sample foo.scss => "foo { margin: 42px }"
122
- ```