Currently the only way to install the LESS library via composer is running the composer directly on the module's folder. Most of the projects who uses composer on D7 orchestrates it via composer_mananger module.

http://cgit.drupalcode.org/less/tree/includes/less.libraries.inc#n188

It should have a way to determinate a different location for the libraries.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gabrielmachadosantos created an issue. See original summary.

gabrielmachadosantos’s picture

I've created a patch to allow other modules to add more libraries' paths to the LESS library.

Inside _less_libraries_determine_location() functions:

// Allow other modules update the libraries location.
drupal_alter('less_libraries_determine_location', $locations, $library);




You can easily create the example hook below on your custom module:

/**
 * Implements hook_less_libraries_determine_location_alter().
 */
function hook_less_libraries_determine_location_alter(&$locations, $library) {
  if ('less.php' == $library['name']) {
    $locations[] = variable_get('composer_manager_vendor_dir') . '/oyejorge/less.php';
  }
}




Patch applied:

~/Dropbox/projects/less (7.x-4.x) git apply -v ~/less-support_composer_manager-2847108-1.patch
Checking patch includes/less.libraries.inc...
Applied patch includes/less.libraries.inc cleanly.