Hello community, here is the log from the commit of package sassc for openSUSE:Factory checked in at 2018-03-19 23:32:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sassc (Old) and /work/SRC/openSUSE:Factory/.sassc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sassc" Mon Mar 19 23:32:45 2018 rev:4 rq:587173 version:3.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/sassc/sassc.changes 2017-11-08 15:14:14.281058207 +0100 +++ /work/SRC/openSUSE:Factory/.sassc.new/sassc.changes 2018-03-19 23:32:47.365450087 +0100 @@ -1,0 +2,99 @@ +Mon Mar 12 20:27:22 UTC 2018 - [email protected] + +- New upstream release 3.5.0: + + Features: + + * Implement trailing commas in parameters and arguments (#2070, @xzyfer) + * Implement deprecation warning for ID strings that look like colors (#2302, @xzyfer) + * Implement content-exists function (#2266, @xzyfer) + * Implement support for passing var() to CSS functions (#2244, @xzyfer) + * Implement first class functions (#2277 #2275, @xzyfer) + * Implement nesting guard to avoid "out of stack space" (#2438, @mgreter) + * Implement exponents for numbers (#2465, @mgreter) + * Implement long file path support for Windows (#2477, @mgreter) + * Implement case modifier for attribute selector (#2509, @mgreter) + * Implement warning for double parent selectors (#2522, @mgreter) + * Implement support for custom property syntax (#2076, @xzyfer) + * Implement support for custom-property feature flag (#2076, @xzyfer) + + Optimisations: + + * Performance improvements (#2339, @mgreter) + * Fix memory leak by removing previously unused code (#2505, @mgreter) + * Fix memory leak of custom functions signature (#2553, @mgreter) + + Community: + + * Add libsass-python to Readme (#2546, @asottile) + * Update link to go-libsass (#2340 #2410, @drewwells) + + Fixes: + + * Fix media query stack and eval issue (#2341, @mgreter) + * Fix Attribute Selector equal compare operator (#2347, @mgreter) + * Fix segfault for varargs with non-string keys (#2352, @mgreter) + * Fix Element Selector compare operators (#2347, @mgreter) + * Fix compiler issue with spec regression on NetBSD 6.1 (#2357, @mgreter) + * Fix some segfaults caused by the parser being too forgiving (#2367, @xzyfer) + * Fix segfault with invalid map keys (#2368, @xzyfer) + * Fix null pointer dereference in css_error (#2369, @xzyfer) + * Fix bug when parsing selector schemas (#2371, @xzyfer) + * Fix null pointer dereference when parsing selector schemas (#2371, @2372) + * Fix .editorconfig (#2380, @brucek) + * Fix compiler issue with spec regression on NetBSD 6.1 (#2357, @mgreter) + * Fix segfault when extending pseudo selectors failed (#2366, @mgreter) + * Fix parser for urls looking like ruleset selectors (#2376, @mgreter) + * Fix use of non-portable std::to_string (#2385, @mgreter) + * Fix use of non-portable strdup (#2459, @asottile) + * Fix unary slash expressions (#2349 #2384, @mgreter) + * Fix missing error for trailing comma in selector list (#2365, @mgreter) + * Fix selector and binominal look ahead (#2346, @mgreter) + * Fix hex escape handling in interpolation (#2320, @mgreter) + * Fix wrong parsing of calc functions as number units (#2382, @mgreter) + * Fix incorrect comment evaluation for compressed output (#2359, @mgreter) + * Fix parent selector handling in selector schema (#2358, @mgreter) + * Fix parameter vararg and keyword handling (#2394, @mgreter) + * Fix a few minor memory leaks (#2400, @mgreter) + * Fix issue with invalid error indicator (#2404, @mgreter) + * Fix selector parsing and url regression (#2429, @mgreter) + * Fix null ptr segv on invalid vararg (#2437, @mgreter) + * Fix segfault in selector extend edge-case (#2437, @mgreter) + * Fix segfault in selector extend edge-case (#2437, @mgreter) + * Fix segfault in selector append edge-case (#2437, @mgreter) + * Fix ref-counted value handling in if function (#2437, @mgreter) + * Fix segfault in at-root cssize edge-case (#2439, @mgreter) + * Fix file content malloc to avoid reading beyond buffer (#2440, @mgreter) + * Fix case-sensitive lookup to named color map (#2462, @asottile) + * Fix shebang for tap-driver (#2466, @naroga) + * Fix segfault in parser edge case (#2446, @mgreter) + * Fix memory corruption on error in parse_selector_schema (#2484, @mgreter) + * Fix autoconf path for sassc tester (#2492, @mgreter) + * Fix output of invisible @support blocks (#2488, @mgreter) + * Fix to_value for bracketed lists (#2467, @mgreter) + * Fix propagation of named rest arguments (#2480, @mgreter) + * Fix @extend of wrapped selectors (#2468, @mgreter) + * Fix wrapped pseudo selector handling (#2464 #2383, @mgreter) + * Fix minor issue with attribute selector unification (#2053, @mgreter) + * Fix issue when passing restargs to call (#2472, @mgreter) + * Fix compressing of colors in selectors (#2232, @mgreter) + * Fix missing error on selector with invalid quote mark (#2082, @mgreter) + * Fix travis-ci mac OSX builds (#2527, @mgreter) + * Fix endless loop comparing Selector_List to List (#2516 #2517, @mgreter) + * Fix SmartOS/Solaris build regression (#2519, @mgreter) + * Fix to connect parent selector only once (#2520, @mgreter) + * Fix whitespace issue for wrapped selectors (#2366, @mgreter) + * Fix missing error if cwd goes missing (#2513, @mgreter) + * Fix missing error when mixin ruleset in root has parent selector (#2482, @mgreter) + * Fix sourcemap crutch once again (#2312, @mgreter) + * Fix parser state column following static values (#2542, @mgreter) + * Fix error indicator not being Unicode aware (#2404, @mgreter) + * Fix error sourcemaps not being fully Unicode aware (#2319, @mgreter) + * Fix some compiler warnings (#2547, @mgreter) + * Fix math with multiple units (#2549, @mgreter) + * Fix css test for interpolated numbers (#2560, @mgreter) + * Fix null pointer access in nesting check (sass/sassc#222 sass/sassc#223, @mgreter) + * Fix @else possibly producing invalid output (#2569, @xzyfer) + * Fix parsing of @supports declarations (#2452, @xzyfer) + +------------------------------------------------------------------- Old: ---- sassc-3.4.5.tar.gz New: ---- sassc-3.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sassc.spec ++++++ --- /var/tmp/diff_new_pack.MDqGHP/_old 2018-03-19 23:32:48.517408531 +0100 +++ /var/tmp/diff_new_pack.MDqGHP/_new 2018-03-19 23:32:48.521408386 +0100 @@ -17,7 +17,7 @@ Name: sassc -Version: 3.4.5 +Version: 3.5.0 Release: 0 Summary: Libsass command line driver License: MIT ++++++ sassc-3.4.5.tar.gz -> sassc-3.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/.gitignore new/sassc-3.5.0/.gitignore --- old/sassc-3.4.5/.gitignore 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/.gitignore 2018-01-11 21:32:04.000000000 +0100 @@ -1,7 +1,8 @@ a.out .DS_Store -Makefile.in +GNUmakefile +GNUmakefile.in .deps/ /aclocal.m4 /autom4te.cache/ @@ -46,6 +47,15 @@ build/ config.h.in* lib/pkgconfig/ +libsass/ +script/ar-lib +script/compile +script/config.guess +script/config.sub +script/depcomp +script/install-sh +script/ltmain.sh +script/missing .sass-cache *.user *.db diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/.travis.yml new/sassc-3.5.0/.travis.yml --- old/sassc-3.4.5/.travis.yml 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/.travis.yml 2018-01-11 21:32:04.000000000 +0100 @@ -22,5 +22,5 @@ - ./script/ci-build-libsass after_success: - - ./bin/sassc -v - - ldd ./bin/sassc + - ./build/bin/sassc -v + - ldd ./build/bin/sassc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/GNUmakefile.am new/sassc-3.5.0/GNUmakefile.am --- old/sassc-3.4.5/GNUmakefile.am 1970-01-01 01:00:00.000000000 +0100 +++ new/sassc-3.5.0/GNUmakefile.am 2018-01-11 21:32:04.000000000 +0100 @@ -0,0 +1,45 @@ +ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -I script + +AM_COPT = -Wall -O2 +AM_COVLDFLAGS = + +if ENABLE_COVERAGE + AM_COPT = -O0 --coverage + AM_COVLDFLAGS += -lgcov +endif + +AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CFLAGS = $(AM_COPT) +AM_CXXFLAGS = $(AM_COPT) +AM_LDFLAGS = $(AM_COPT) $(AM_COVLDFLAGS) + +# only needed to support old source tree +# we have moved the files to src folder +AM_CPPFLAGS += -I$(top_srcdir) + +SOURCES = sassc.c +if COMPILER_IS_MINGW32 + SOURCES += res/libsass.rc + AM_CXXFLAGS += -std=gnu++0x + AM_LDFLAGS += -std=gnu++0x +else + AM_CXXFLAGS += -std=c++0x + AM_LDFLAGS += -std=c++0x +endif + +if ENABLE_COVERAGE + AM_CFLAGS += -O0 --coverage + AM_CXXFLAGS += -O0 --coverage + AM_LDFLAGS += -O0 --coverage -lgcov +else + AM_CFLAGS += -O2 + AM_CXXFLAGS += -O2 +endif + +bin_PROGRAMS = sassc +sassc_SOURCES = $(SOURCES) +sassc_LDFLAGS = $(AM_LDFLAGS) + +# Dummy C++ source to cause C++ linking. +# Otherwise the plain C linker is used +nodist_EXTRA_sassc_SOURCES = dummy.cxx \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/Makefile new/sassc-3.5.0/Makefile --- old/sassc-3.4.5/Makefile 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/Makefile 2018-01-11 21:32:04.000000000 +0100 @@ -180,9 +180,20 @@ SPEC_PATH = $(SASS_SPEC_PATH) all: sassc +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +%.o: %.rc + $(WINDRES) -i $< -o $@ + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c -o $@ $< + sassc: $(SASSC_EXE) +build: build-$(BUILD) +libsass: libsass-$(BUILD) -$(SASSC_EXE): libsass build-$(BUILD) +$(SASSC_EXE): libsass build $(DESTDIR)$(PREFIX)/: $(MKDIR) $(DESTDIR)$(PREFIX) @@ -193,20 +204,24 @@ $(DESTDIR)$(PREFIX)/bin/%: bin/% $(INSTALL) -D -v -m0755 "$<" "$@" -install: $(DESTDIR)$(PREFIX)/$(SASSC_EXE) +install: libsass-install-$(BUILD) \ + $(DESTDIR)$(PREFIX)/$(SASSC_EXE) build-static: $(RESOURCES) $(OBJECTS) $(LIB_STATIC) $(CC) $(LDFLAGS) -o $(SASSC_EXE) $^ $(LDLIBS) build-shared: $(RESOURCES) $(OBJECTS) $(LIB_SHARED) + $(CC) $(LDFLAGS) -o $(SASSC_EXE) $(RESOURCES) $(OBJECTS) \ + $(LDLIBS) -L$(SASS_LIBSASS_PATH)/lib -lsass + +build-shared-dev: $(RESOURCES) $(OBJECTS) $(LIB_SHARED) $(CC) $(LDFLAGS) -o $(SASSC_EXE) $^ $(LDLIBS) - $(CP) $(LIB_SHARED) bin/. + +build-static-dev: build-static $(LIB_STATIC): libsass-static $(LIB_SHARED): libsass-shared -libsass: libsass-$(BUILD) - libsass-static: ifdef SASS_LIBSASS_PATH $(MAKE) BUILD="static" -C $(SASS_LIBSASS_PATH) @@ -221,8 +236,21 @@ $(error SASS_LIBSASS_PATH must be defined) endif -%.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< +# nothing to do for static +libsass-install-static: libsass-static +ifdef SASS_LIBSASS_PATH + $(MAKE) BUILD="static" -C $(SASS_LIBSASS_PATH) install +else + $(error SASS_LIBSASS_PATH must be defined) +endif + +# install shared library +libsass-install-shared: libsass-shared +ifdef SASS_LIBSASS_PATH + $(MAKE) BUILD="shared" -C $(SASS_LIBSASS_PATH) install +else + $(error SASS_LIBSASS_PATH must be defined) +endif test: all $(MAKE) -C $(SASS_LIBSASS_PATH) version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/Makefile.am new/sassc-3.5.0/Makefile.am --- old/sassc-3.4.5/Makefile.am 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,45 +0,0 @@ -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -I script - -AM_COPT = -Wall -O2 -AM_COVLDFLAGS = - -if ENABLE_COVERAGE - AM_COPT = -O0 --coverage - AM_COVLDFLAGS += -lgcov -endif - -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = $(AM_COPT) -AM_CXXFLAGS = $(AM_COPT) -AM_LDFLAGS = $(AM_COPT) $(AM_COVLDFLAGS) - -# only needed to support old source tree -# we have moved the files to src folder -AM_CPPFLAGS += -I$(top_srcdir) - -SOURCES = sassc.c -if COMPILER_IS_MINGW32 - SOURCES += res/libsass.rc - AM_CXXFLAGS += -std=gnu++0x - AM_LDFLAGS += -std=gnu++0x -else - AM_CXXFLAGS += -std=c++0x - AM_LDFLAGS += -std=c++0x -endif - -if ENABLE_COVERAGE - AM_CFLAGS += -O0 --coverage - AM_CXXFLAGS += -O0 --coverage - AM_LDFLAGS += -O0 --coverage -lgcov -else - AM_CFLAGS += -O2 - AM_CXXFLAGS += -O2 -endif - -bin_PROGRAMS = sassc -sassc_SOURCES = $(SOURCES) -sassc_LDFLAGS = $(AM_LDFLAGS) - -# Dummy C++ source to cause C++ linking. -# Otherwise the plain C linker is used -nodist_EXTRA_sassc_SOURCES = dummy.cxx \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/appveyor.yml new/sassc-3.5.0/appveyor.yml --- old/sassc-3.4.5/appveyor.yml 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/appveyor.yml 2018-01-11 21:32:04.000000000 +0100 @@ -32,7 +32,7 @@ # Turn off the test script to speedup the CI builds, set it to on or remove the previous line when needed. artifacts: - path: bin + path: bin\sassc.exe deploy: provider: GitHub diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/configure.ac new/sassc-3.5.0/configure.ac --- old/sassc-3.4.5/configure.ac 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/configure.ac 2018-01-11 21:32:04.000000000 +0100 @@ -100,5 +100,5 @@ AC_MSG_NOTICE([Building sassc ($VERSION)]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([GNUmakefile]) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/docs/building/unix-instructions.md new/sassc-3.5.0/docs/building/unix-instructions.md --- old/sassc-3.4.5/docs/building/unix-instructions.md 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/docs/building/unix-instructions.md 2018-01-11 21:32:04.000000000 +0100 @@ -1,37 +1,188 @@ # Building On Unix -To build SassC, you must have either local copy of the LibSass source or it must be installed into your system. For development, please use the source version. +To build SassC, you must either have a local copy of the LibSass sources or +LibSass must already be installed in your system as a (shared) library with +development headers available (See [LibSass build instruction][1] for further +reference). LibSass and SassC can be built either via provided [Makefiles][3] +(preferred for local development) or via [autotools][2] (preferred for system +installs). -The executable will be in the bin folder. To run it, simply try something like +# Using the CI bootstrap script -```bash -./bin/sassc [input file] > output.css -``` - -# Step-by-step +This will need a git client available to fetch the dependencies. 1. Clone the SassC repo ```bash git clone https://github.com/sass/sassc.git ``` -1. cd into the SassC repo +2. Run CI bootstrap script and import env-variables + ```bash + . sassc/script/bootstrap + ``` + +3. Execute `make` to compile all sources + ```bash + make -C sassc -j4 + ``` + + Make sure you are using GNU make, on some + systems it may be called `gmake`. + +4. The binary should be created in the `bin` folder ```bash - cd ./sassc + ./sassc/bin/sassc [input file] > output.css ``` -1. Type 'script/bootstrap' to clone [`libsass`](https://github.com/sass/libsass) and [`sass-spec`](https://github.com/sass/sass-spec) into the parent directory - ```bash - script/bootstrap - ``` -Alternately, if you already have libsass cloned or installed, you can edit your `.bash_profile` to include libsass directory: +5. Optionally install the resulting binary ```bash - export SASS_LIBSASS_PATH=/Users/you/path/libsass + PREFIX="/usr" make -C sassc install ``` -1. Type 'make' - ```bash - make - ``` +# Environment variables for custom source locations + +In case you have already cloned LibSass or the spec tests +in any other location, you can set the following environment +variables. To make these locations permanent add them to +your `.profile` or `.bash_profile` in your home directory: + +```bash +SASS_LIBSASS_PATH=/Users/you/path/libsass +export SASS_LIBSASS_PATH +SASS_SPEC_SASS=/Users/you/favourite/sass-spec +export SASS_SPEC_SASS +``` + +# Manually building from git sources via github + +```bash +SASS_LIBSASS_PATH=`pwd`/libsass +git clone https://github.com/sass/sassc.git +git clone https://github.com/sass/libsass.git +make -C sassc -j4 +sassc/bin/sassc --version +``` + +# Manually building from tar sources via github + +Note: it is not really recommended to use archive +downloads from github, as the build will show "na" +as the compiled version, since the info will be +directly derived from the git version (until you +pass the information manually to the build call)! + +```bash +# select tagged versions +SASSC_VERSION="3.4.5" +LIBSASS_VERSION="3.4.5" +# download from github and unpack in one go +curl -L https://github.com/sass/sassc/archive/${SASSC_VERSION}.tar.gz | tar -xz; +curl -L https://github.com/sass/libsass/archive/${LIBSASS_VERSION}.tar.gz | tar -xz; +# set environment variable for sassc makefile +SASS_LIBSASS_PATH=`pwd`/libsass-${LIBSASS_VERSION} +# create version files for standalone build +echo $SASSC_VERSION > sassc-${SASSC_VERSION}/VERSION +echo $LIBSASS_VERSION > libsass-${LIBSASS_VERSION}/VERSION +# compile libsass and sassc binary +make -C sassc-${SASSC_VERSION} -j4 +# check version of resulting binary +sassc-${SASSC_VERSION}/bin/sassc --version +``` + +# Build via autoconfig (preferred for system installs) + +Please read [libsass autotools build instructions][2] first! +LibSass must be compiled first with corresponding settings! +Here we will compile and use LibSass as a shared library! + +## Get the sources + +```bash +# using git is preferred +git clone https://github.com/sass/libsass.git +git clone https://github.com/sass/sassc.git +``` + +## Prerequisites + +In order to run autotools you need a few tools installed on your system. + +```bash +apt-get install autotools-dev autoconf libtool # Alpine +yum install automake libtool # RedHat Linux +emerge -a automake libtool # Gentoo Linux +pkgin install automake libtool # SmartOS +``` + +## Compile LibSass + +### Create configure script + +```bash +cd libsass +autoreconf --force --install +cd .. +``` + +### Create custom makefiles + +```bash +cd libsass +./configure \ + --disable-tests \ + --enable-shared \ + --prefix=/usr +cd .. +``` + +### Build the library + +```bash +make -C libsass -j4 +``` + +### Install the library + +```bash +make -C libsass install +``` + +## Compile SassC + +### Create configure script + +```bash +cd sassc +autoreconf --force --install +cd .. +``` + +### Create custom makefiles + +```bash +cd sassc +./configure \ + --enable-shared \ + --prefix=/usr +cd .. +``` + +### Build the binary + +```bash +make -C sassc -j4 +``` + +### Install the binary + +The binary will be installed to the location given as `prefix` to `configure`. +This is standard behavior for autotools and not `sassc` specific. + +```bash +make -C sassc install +sassc --version +``` -1. Job done! +[1]: https://github.com/sass/libsass/blob/master/docs/build.md +[2]: https://github.com/sass/libsass/blob/master/docs/build-with-autotools.md +[3]: https://github.com/sass/libsass/blob/master/docs/build-with-makefiles.md diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/sassc.c new/sassc-3.5.0/sassc.c --- old/sassc-3.4.5/sassc.c 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/sassc.c 2018-01-11 21:32:04.000000000 +0100 @@ -50,6 +50,7 @@ } #else #include <unistd.h> +#include <sysexits.h> #endif int output(int error_status, const char* error_message, const char* output_string, const char* outfile) { @@ -96,7 +97,11 @@ if(source_string == NULL) { perror("Allocation failed"); - exit(1); + #ifdef _WIN32 + exit(ERROR_OUTOFMEMORY); + #else + exit(EX_OSERR); // system error (e.g., can't fork) + #endif } source_string[0] = '\0'; @@ -108,7 +113,11 @@ if(source_string == NULL) { perror("Reallocation failed"); free(old); - exit(2); + #ifdef _WIN32 + exit(ERROR_OUTOFMEMORY); + #else + exit(EX_OSERR); // system error (e.g., can't fork) + #endif } strcat(source_string, buffer); } @@ -116,7 +125,11 @@ if(ferror(stdin)) { free(source_string); perror("Error reading standard input"); - exit(2); + #ifdef _WIN32 + exit(ERROR_READ_FAULT); // + #else + exit(EX_IOERR); // input/output error + #endif } ctx = sass_make_data_context(source_string); @@ -199,7 +212,7 @@ printf(" --line-comments\n"); printf(" -I, --load-path PATH Set Sass import path.\n"); printf(" -P, --plugin-path PATH Set path to autoload plugins.\n"); - printf(" -m, --sourcemap Emit source map.\n"); + printf(" -m, --sourcemap[=TYPE] Emit source map (auto or inline).\n"); printf(" -M, --omit-map-comment Omits the source map url comment.\n"); printf(" -p, --precision Set the precision for numbers.\n"); printf(" -a, --sass Treat input as indented syntax.\n"); @@ -210,7 +223,12 @@ void invalid_usage(char* argv0) { fprintf(stderr, "See '%s -h'\n", argv0); - exit(EXIT_FAILURE); + #ifdef _WIN32 + exit(ERROR_BAD_ARGUMENTS); // One or more arguments are not correct. + #else + exit(EX_USAGE); // command line usage error + #endif + } int main(int argc, char** argv) { @@ -228,6 +246,7 @@ char *outfile = 0; int from_stdin = 0; + bool auto_source_map = false; bool generate_source_map = false; struct Sass_Options* options = sass_make_options(); sass_option_set_output_style(options, SASS_STYLE_NESTED); @@ -244,7 +263,7 @@ { "style", required_argument, 0, 't' }, { "line-numbers", no_argument, 0, 'l' }, { "line-comments", no_argument, 0, 'l' }, - { "sourcemap", no_argument, 0, 'm' }, + { "sourcemap", optional_argument, 0, 'm' }, { "omit-map-comment", no_argument, 0, 'M' }, { "precision", required_argument, 0, 'p' }, { "version", no_argument, 0, 'v' }, @@ -252,7 +271,7 @@ { "help", no_argument, 0, 'h' }, { NULL, 0, NULL, 0} }; - while ((c = getopt_long(argc, argv, "vhslmMap:t:I:P:", long_options, &long_index)) != -1) { + while ((c = getopt_long(argc, argv, "vhslm:Map:t:I:P:", long_options, &long_index)) != -1) { switch (c) { case 's': from_stdin = 1; @@ -283,6 +302,20 @@ sass_option_set_source_comments(options, true); break; case 'm': + if (optarg) { // optional argument + if (strcmp(optarg, "auto") == 0) { + auto_source_map = true; + } else if (strcmp(optarg, "inline") == 0) { + sass_option_set_source_map_embed(options, true); + } else { + fprintf(stderr, "Invalid argument for -m flag: '%s'. Allowed arguments are:", optarg); + fprintf(stderr, " %s", "auto inline"); + fprintf(stderr, "\n"); + invalid_usage(argv[0]); + } + } else { + auto_source_map = true; + } generate_source_map = true; break; case 'M': @@ -331,6 +364,8 @@ strcpy(source_map_file, outfile); strcat(source_map_file, extension); sass_option_set_source_map_file(options, source_map_file); + } else if (auto_source_map) { + sass_option_set_source_map_embed(options, true); } result = compile_file(options, argv[optind], outfile); } else { @@ -342,5 +377,9 @@ sass_delete_options(options); - return result; + #ifdef _WIN32 + return result ? ERROR_INVALID_DATA : 0; // The data is invalid. + #else + return result ? EX_DATAERR : 0; // data format error + #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/script/bootstrap new/sassc-3.5.0/script/bootstrap --- old/sassc-3.4.5/script/bootstrap 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/script/bootstrap 2018-01-11 21:32:04.000000000 +0100 @@ -1,26 +1,50 @@ -#!/bin/bash +#!/bin/sh -set -e +if [ -n "${TRAVIS_BUILD_DIR}" ]; then + set -e +fi -SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )" +if [ -z "$SASSC_PATH" ]; then + export SASSC_PATH=`pwd` +fi -if [ "x$SASS_LIBSASS_PATH" == "x" ]; then - export SASS_LIBSASS_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../libsass/ && pwd )" - echo "SASS_LIBSASS_PATH variable is missing missing, so using $SASS_LIBSASS_PATH" +if [ -f "$SASSC_PATH/sassc/sassc.c" ]; then + export SASSC_PATH=$SASSC_PATH/sassc +elif [ -f "$SASSC_PATH/../sassc.c" ]; then + export SASSC_PATH=$SASSC_PATH/.. fi + +if [ ! -f "$SASSC_PATH/sassc.c" ]; then + echo "SassC source directory not found" + echo "Consider setting it via SASSC_PATH" + echo "Or call this script from the root" + unset SASSC_PATH && exit 1 +fi + +if [ -z "$SASS_LIBSASS_PATH" ]; then + export SASS_LIBSASS_PATH="$SASSC_PATH/../libsass/" + echo "SASS_LIBSASS_PATH env-variable missing" + echo "Using default: $SASS_LIBSASS_PATH" +fi + if [ ! -d "$SASS_LIBSASS_PATH" ]; then git clone https://github.com/sass/libsass.git "$SASS_LIBSASS_PATH" else - echo "LibSass already exists, skiping Git Clone" + echo "LibSass source directory exists, skiping Git Clone" fi -if [ "x$SASS_SPEC_PATH" == "x" ]; then - export SASS_SPEC_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../sass-spec/ && pwd )" - echo "SASS_SPEC_PATH variable is missing, so using $SASS_SPEC_PATH" +if [ -z "$SASS_SPEC_PATH" ]; then + export SASS_SPEC_PATH="$SASSC_PATH/../sass-spec/" + echo "SASS_SPEC_PATH env-variable missing" + echo "Using default: $SASS_SPEC_PATH" fi if [ ! -d "$SASS_SPEC_PATH" ]; then git clone https://github.com/sass/sass-spec.git "$SASS_SPEC_PATH" else - echo "sass-spec already exists, skiping Git Clone" + echo "Sass-spec test directory exists, skiping Git Clone" +fi + +if [ -n "${TRAVIS_BUILD_DIR}" ]; then + set +e fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sassc-3.4.5/script/ci-build-libsass new/sassc-3.5.0/script/ci-build-libsass --- old/sassc-3.4.5/script/ci-build-libsass 2017-03-05 20:36:58.000000000 +0100 +++ new/sassc-3.5.0/script/ci-build-libsass 2018-01-11 21:32:04.000000000 +0100 @@ -1,88 +1,87 @@ -#!/bin/bash +#!/bin/sh -set -e - -# script/bootstrap - -# export this path right here (was in script/spec before) -export SASS_SASSC_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )" +if [ -n "${TRAVIS_BUILD_DIR}" ]; then + set -e +fi # use some defaults if not running under travis ci -if [ "x$TRAVIS_BUILD_DIR" == "x" ]; then export TRAVIS_BUILD_DIR=$(pwd)/build; fi -if [ "x$SASS_LIBSASS_PATH" == "x" ]; then export SASS_LIBSASS_PATH=$(pwd)/..; fi -if [ "x$SASS_SPEC_PATH" == "x" ]; then export SASS_SPEC_PATH=$(pwd)/sass-spec; fi +: ${SASS_LIBSASS_PATH:?SASS_LIBSASS_PATH should point to libsass sources} +: ${BUILD:?Please configure BUILD as either "shared" or "static"} +: ${AUTOTOOLS:?Need to know wheter to use AUTOTOOLS - set it to "yes" or "no"} + +. ./script/bootstrap +: ${PREFIX:=${TRAVIS_BUILD_DIR-$(pwd)}/build} + +SASS_SASSC_PATH="${PREFIX}" +export SASS_SASSC_PATH +export SASS_LIBSASS_PATH + +export EXTRA_CFLAGS +export EXTRA_CXXFLAGS +export EXTRA_LDFLAGS + +travis_fold() { + if [ -n "${TRAVIS_BUILD_DIR}" ]; then + printf "travis_fold:$1:$2\r" + fi +} -if [ "x$COVERAGE" == "xyes" ]; then +if [ "${COVERAGE}" = "yes" ]; then COVERAGE_OPT="--enable-coverage" - export EXTRA_CFLAGS="--coverage" - export EXTRA_CXXFLAGS="--coverage" - export EXTRA_LDFLAGS="--coverage" + EXTRA_CFLAGS="--coverage" + EXTRA_CXXFLAGS="--coverage" + EXTRA_LDFLAGS="--coverage" else COVERAGE_OPT="--disable-coverage" fi -if [ "x$BUILD" == "xstatic" ]; then - SHARED_OPT="--disable-shared --enable-static" - MAKE_TARGET="static" -else - # Makefile of sassc wants to link to static - SHARED_OPT="--enable-shared --enable-static" - MAKE_TARGET="shared" -fi - -if [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then +uname_s="$(uname -s)" +if [ "${uname_s%%-.*}" = "MINGW32_NT" ]; then MAKE_OPTS="$MAKE_OPTS -j1 V=1" else MAKE_OPTS="$MAKE_OPTS -j5 V=1" fi +SINGLE_MAKE_OPS="$MAKE_OPTS -j1 V1" -if [ "x$PREFIX" == "x" ]; then - if [ "x$TRAVIS_BUILD_DIR" == "x" ]; then - PREFIX=$SASS_LIBSASS_PATH/build +if [ "${AUTOTOOLS}" = "yes" ]; then + + if [ "${BUILD}" = "static" ]; then + SHARED_OPT="--disable-shared --enable-static" else - PREFIX=$TRAVIS_BUILD_DIR + # Makefile of sassc wants to link to static + SHARED_OPT="--enable-shared --enable-static" fi -fi -if [ "x$AUTOTOOLS" == "xyes" ]; then - - pushd $SASS_LIBSASS_PATH - - echo -en 'travis_fold:start:libsass\r' - autoreconf --force --install + travis_fold start libsass + (cd ${SASS_LIBSASS_PATH} && + autoreconf --force --install && ./configure --disable-tests $COVERAGE_OPT \ --disable-silent-rules \ - --prefix=$PREFIX \ - ${SHARED_OPT} - - # always rebuild - make $MAKE_OPTS clean - - # install the library - make $MAKE_OPTS install + --prefix=${PREFIX} \ + ${SHARED_OPT} && + ${MAKE:=make} $MAKE_OPTS clean && + ${MAKE} $MAKE_OPTS all && + ${MAKE} install ) || exit 2 + travis_fold end libsass - echo -en 'travis_fold:end:libsass\r' - popd - - echo -en 'travis_fold:start:configure\r' - autoreconf --force --install + travis_fold start configure + autoreconf --force --install && ./configure \ - --with-libsass="$PREFIX" \ + --with-libsass="${PREFIX}" \ --disable-silent-rules \ --prefix=$PREFIX \ $COVERAGE_OPT \ - ${SHARED_OPT} - echo -en 'travis_fold:end:configure\r' - + ${SHARED_OPT} || exit 3 + travis_fold end configure fi -# always rebuild -make $MAKE_OPTS clean -# does what $BUILD says -make $MAKE_OPTS all -make $MAKE_OPTS install +# Don't try "all" and "install" in parallel +${MAKE:=make} $MAKE_OPTS clean && +${MAKE} $SINGLE_MAKE_OPTS BUILD=${BUILD} PREFIX=${PREFIX} all install && +echo successfully compiled sassc && +echo AUTOTOOLS=$AUTOTOOLS COVERAGE=$COVERAGE BUILD=$BUILD && +/usr/bin/env LD_LIBRARY_PATH="${SASS_LIBSASS_PATH}/lib" $PREFIX/bin/sassc -v -echo successfully compiled sassc -echo AUTOTOOLS=$AUTOTOOLS COVERAGE=$COVERAGE BUILD=$BUILD - -LD_LIBRARY_PATH="$PREFIX/lib" $PREFIX/bin/sassc -v +if [ -n "${TRAVIS_BUILD_DIR}" ]; then + set +e +fi
