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

Expose config param to allow specific libsass commit for build #389

Closed
nschonni opened this issue Aug 17, 2014 · 5 comments
Closed

Expose config param to allow specific libsass commit for build #389

nschonni opened this issue Aug 17, 2014 · 5 comments

Comments

@nschonni
Copy link
Contributor

Although we ship prebuilt binaries, it may be beneficial to allow users to rebuild their own bindings to a specific version of libsass. The use case I'm seeing with this is for those that want the latest libsass, but not require us to re-release and prep for a non-tagged libsass release.

Maybe something like this in the package.config

{
...
  "libsass": "commitHash"
}

I lean towards a config value rather than a .node-sass.yml, although that would be a valid approach too.

@andrew thoughts?

@andrew
Copy link
Contributor

andrew commented Aug 17, 2014

I like the sound of that, I prefer the package.json config option myself.

@keithamus
Copy link
Member

+1 for package.json

@am11
Copy link
Contributor

am11 commented Feb 28, 2015

At present, if end-user wants to get the binary out of the desired libsass and given they have compiler GCC 4.6+ (or VC 2013+) and python v2.7 installed, they can:

1 - first install node-sass:

cd /tmp
npm install node-sass
cd node_modules/node-sass

# the following is to overcome the bug in v2.0.1, as pangyp (temporary fork of node-gyp
# supporting io.js) was mistakenly added as devDependency. This has been mitigated:
npm install pangyp

2 - then update upstream submodule:

cd src/libsass
git remote add libsass https://github.com/sass/libsass
git fetch libsass
git checkout <my-favourite-hash>
cd ../..

3 - rebuild binary:

node scripts/build --force
# force flag tells the script to ignore the presence of existing binary

Are we aiming to provision automating step 2 here; replacing <my-favourite-hash> with require('package').libsassHash (since libsass in now reserved for libsass version in our package.json)?

So user can do:

# pwd: node-sass root directory
nano package.json
# updated the value of libsassHash with desired hash, save and close editor, then
node scripts/build --force --update
# where --update would be the new flag which would tell the build script to: git checkout <hash>

@saper saper mentioned this issue Mar 13, 2015
8 tasks
saper added a commit to saper/node-sass that referenced this issue Mar 15, 2015
If PKGCONFIG is set to YES in the proces
environment, use pkg-config to locate
system libsass to be linked.

This way there is no need to checkout
a src/libsass submodule at all and
the library from the package management
system can be used.

Otherwise fallback to the bundled libsass.

By default, use the bundled library.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
If PKGCONFIG is set to YES in the proces
environment, use pkg-config to locate
system libsass to be linked.

This way there is no need to checkout
a src/libsass submodule at all and
the library from the package management
system can be used.

Otherwise fallback to the bundled libsass.

By default, use the bundled library.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=
LIBSASS_LDFLAGS=

Link libsass manually, by adding
compiler flags and linker flags
in LIBSASS_CFLAGS and LIBSASS_LDFLAGS,
respectively.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LDFLAGS=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=
LIBSASS_LDFLAGS=

Link libsass manually, by adding
compiler flags and linker flags
in LIBSASS_CFLAGS and LIBSASS_LDFLAGS,
respectively.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LDFLAGS=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=
LIBSASS_LDFLAGS=

Link libsass manually, by adding
compiler flags and linker flags
in LIBSASS_CFLAGS and LIBSASS_LDFLAGS,
respectively.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LDFLAGS=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=
LIBSASS_LDFLAGS=

Link libsass manually, by adding
compiler flags and linker flags
in LIBSASS_CFLAGS and LIBSASS_LDFLAGS,
respectively.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LDFLAGS=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=
LIBSASS_LDFLAGS=

Link libsass manually, by adding
compiler flags and linker flags
in LIBSASS_CFLAGS and LIBSASS_LDFLAGS,
respectively.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LDFLAGS=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=    compiler flags
LIBSASS_LDFLAGS=   linker flags
LIBSASS_LIBRARY=   library to link

Link libsass manually, by adding
compiler and linker flags.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LIBRARY=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 16, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=    compiler flags
LIBSASS_LDFLAGS=   linker flags
LIBSASS_LIBRARY=   library to link

Link libsass manually, by adding
compiler and linker flags.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LIBRARY=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744

Conflicts:
	scripts/build.js
saper added a commit to saper/node-sass that referenced this issue Mar 17, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=    compiler flags
LIBSASS_LDFLAGS=   linker flags
LIBSASS_LIBRARY=   library to link

Link libsass manually, by adding
compiler and linker flags.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LIBRARY=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744
saper added a commit to saper/node-sass that referenced this issue Mar 17, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=    compiler flags
LIBSASS_LDFLAGS=   linker flags
LIBSASS_LIBRARY=   library to link

Link libsass manually, by adding
compiler and linker flags.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LIBRARY=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744

Conflicts:
	scripts/build.js
saper added a commit to saper/node-sass that referenced this issue Mar 20, 2015
Use environment variables to control
how libsass is linked:

LIBSASS_EXT variable empty or unset

Build a bundled libsass source
(from src/libsass).
This is the default.

LIBSASS_EXT=auto

libsass is located using pkg-config
and linked dynamically

LIBSASS_EXT=yes
LIBSASS_CFLAGS=    compiler flags
LIBSASS_LDFLAGS=   linker flags
LIBSASS_LIBRARY=   library to link

Link libsass manually, by adding
compiler and linker flags.

For example this way libsass can
be linked in statically (on Unix):

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LIBRARY=/usr/local/lib/libsass.a

When using LIBSASS_EXT there is no need
to checkout the libsass source into src/libsass submodule
and the library from the package management
system can be used.

PR: sass#139
PR: sass#389
PR: sass#744

Conflicts:
	binding.gyp
	scripts/build.js
	src/sass_context_wrapper.h
@xzyfer
Copy link
Contributor

xzyfer commented Apr 28, 2015

I believe this use case has been addressed by the LIBSASS_EXT flag introduced in #763.

You can now supply the on disk location of the Libsass you wish to use with

LIBSASS_EXT=/path/to/libsass npm install node-sass

@saper
Copy link
Member

saper commented May 5, 2015

There are two ways you can specify the external library:

LIBSASS_EXT=auto

to detect library using pkg-config

or

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I<path to sass.h header>
LIBSASS_LDFLAGS=-L<path to libsass.so or libsass.a library>
LIBSASS_LIBRARY=-lsass

For example:

LIBSASS_EXT=yes
LIBSASS_CFLAGS=-I/usr/local/include
LIBSASS_LDFLAGS=-L/usr/local/lib
LIBSASS_LIBRARY=-lsass

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants