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 for further reference). LibSass and SassC can be built either via provided Makefiles (preferred for local development) or via autotools (preferred for system installs).
This will need a git client available to fetch the dependencies.
-
Clone the SassC repo
git clone https://github.com/sass/sassc.git
-
Run CI bootstrap script and import env-variables
. sassc/script/bootstrap
-
Execute
make
to compile all sourcesmake -C sassc -j4
Make sure you are using GNU make, on some systems it may be called
gmake
. -
The binary should be created in the
bin
folder./sassc/bin/sassc [input file] > output.css
-
Optionally install the resulting binary
PREFIX="/usr" make -C sassc install
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:
SASS_LIBSASS_PATH=/Users/you/path/libsass
export SASS_LIBSASS_PATH
SASS_SPEC_SASS=/Users/you/favourite/sass-spec
export SASS_SPEC_SASS
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
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)!
# 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
Please read libsass autotools build instructions first!
LibSass must be compiled first with corresponding settings!
Here we will compile and use LibSass as a shared library!
# using git is preferred
git clone https://github.com/sass/libsass.git
git clone https://github.com/sass/sassc.git
In order to run autotools you need a few tools installed on your system.
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
cd libsass
autoreconf --force --install
cd ..
cd libsass
./configure \
--disable-tests \
--enable-shared \
--prefix=/usr
cd ..
make -C libsass -j4
make -C libsass install
cd sassc
autoreconf --force --install
cd ..
cd sassc
./configure \
--prefix=/usr
cd ..
make -C sassc -j4
The binary will be installed to the location given as prefix
to configure
.
This is standard behavior for autotools and not sassc
specific.
make -C sassc install
sassc --version