214 Commits

Author SHA1 Message Date
Markus Reiter
526299913f Remove usless comments. 2017-10-24 19:39:40 +02:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
JCount
66f1b17942 python_virtualenv_constants: update virtualenv to 15.1.0
This release adds support for Python 3.6, the current python3
version in homebrew/core.
2017-07-11 14:20:49 -04:00
Mike McQuaid
9f6762d958 language/node: general cleanup.
- Avoid using a temporary variable where not necessary
- Use fewer, better stubs in the tests to avoid warnings and better
  test the implemented functionality.
2017-07-07 15:11:41 +01:00
Christian Moritz
5e00c277ce partly revert log verbose npm pack output commit
to fix issues with shwoing npm debug output even on non-verbose install runs.
2017-06-30 00:55:34 +02:00
Christian Moritz
6baea2543a language/node: set cache config via argument
instead of writing a .npmrc file, which simplifies the code.
npm_cache_config is still preserved for backwarts compatiblility and
usage int he kibana@n formulas in core.
2017-06-29 20:29:25 +02:00
Christian Moritz
466fe9841a language/node: npm pack ignore prepublish scripts
This tells npm pack to don't run prepublish scripts at all.
I think this is the best default because:
* most modules don't have a prepublish script at all and aren't affected
  by this change
* most prepublish scripts are calling devDeps, which would fail in our
  case, because (dev)Deps aren't installed at npm pack time until #2820
  gets resolved
* we favor npm registry tarball for formula downloads, which are already
  prepublished, so we would in the best case needlessly run prepublish
  a second time and in the worst case it would fail (because a clean
  step is required before running prepublish a second time in a row)
* This change does the right thing for >99% of all the packages and
  would only affect packages with prepublish scripts downloaded from a
  non-npm registry tarball (like github tarballs) and with a prepublish
  script wich does no't require any devDep (unlike for cross platform)
2017-06-29 20:29:25 +02:00
Christian Moritz
fe39dbb78c language/node: log verbose npm pack output
This makes npm pack to log verbose debug output to the console to
simplify debugging npm pack failures.
Refs: https://github.com/Homebrew/brew/pull/2820#discussion_r123890729
Prevously Utils.popen_read swallowed all debug output.
2017-06-29 20:29:25 +02:00
Christian Moritz
495520a1f9 language/node: make packname detection more robust
This fixes some edge cases where verbose output from a prepublish script
could break our npm pack package name detection code by only using the
last line of the output printed by npm itself containing the desired
package name.
2017-06-29 20:29:25 +02:00
Christian Moritz
02113e2714 language/node: build native addons from source
By telling node-pre-gyp and prebuild to don't pull prebuild binaries and
instead build them from source. This still may not work for some custom
third party scripts for pulling prebuild binaries.
2017-06-29 20:29:25 +02:00
Christian Moritz
7d8124f339 language/node: set npm loglevel to max -ddd
to match the loglevel used in npm_debug.log (previous --verbose loglevel
would match -dd)
2017-06-29 20:29:25 +02:00
mansimarkaur
f8f239686d Added rescue FormulaUnavailableError to setup_npm_environment 2017-06-23 03:40:03 +05:30
Mike McQuaid
021cef4b2b Autocorrect Rubocop Style/SpecialGlobalVars. 2017-06-12 09:11:42 +01:00
Dominyk Tiller
b6d81359f0
language/node: adjustments for npm 5.0.x
Goes with: https://github.com/Homebrew/homebrew-core/pull/14085
2017-06-01 21:45:26 +01:00
Mike McQuaid
7a38bab333 Fixup all RuboCop warnings. 2017-05-29 18:43:18 +01:00
Mike McQuaid
ba3c46d24f More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused
elsewhere and removed. External APIs have had deprecation methods added.
Existing deprecations have been either upgraded to produce warnings or
no longer deprecated and the reasoning documented.
2017-04-22 16:28:07 +01:00
Tim D. Smith
47d57ca995 Immortalize virtualenvs better
virtualenvs remember the prefix of the python that created them and do
magic to load packages from them; help them remember a more durable
path.
2016-10-04 22:57:08 -07:00
ilovezfs
23a38e0ff6 virtualenv_install_with_resources: select correct python
`virtualenv_install_with_resources` will now attempt to guess the
desired Python based on the active build options and based on the
dependencies and requirements. When the situation is ambiguous (e.g.,
`depends_on :python3` and `build.with? "python"` is true) raise
`FormulaAmbiguousPythonError` unless `:using => "python"` or
`:using => "python3"` has been passed to resolve the ambiguity.

In most cases, this will allow

```
    virtualenv_create(libexec, "python3")
    virtualenv_install_with_resources
```

to be changed to just

```
    virtualenv_install_with_resources
```
2016-10-02 18:08:56 -07:00
Markus Reiter
fe2d51e0b9 Fix Style/IfUnlessModifier. 2016-09-23 15:30:07 +02:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
ba85244413 language/python_virtualenv_constants: fix Rubocop warnings. 2016-09-10 10:40:08 +01:00
Mike McQuaid
16be0f105e language/python: fix Rubocop warnings. 2016-09-10 10:40:02 +01:00
Mike McQuaid
bde8d69d6e language/node: fix Rubocop warnings. 2016-09-10 10:39:59 +01:00
Mike McQuaid
78603a24f6 language/haskell: fix Rubocop warnings. 2016-09-10 10:38:47 +01:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00
Martin Afanasjew
b77a695b7a python: tweak script linking in virtualenv (#613)
* python: tweak script linking in virtualenv

Instead of making the formula author use a slightly awkward block like

  venv.link_scripts(bin) { venv.pip_install buildpath }

avoid exposing this implementation detail and offer the more familiar:

  venv.pip_install buildpath, :link_scripts => bin

* Add non-block form and use instead of recursion

* Update 'pip_install' documentation

* Remove obsolete 'link_scripts'

* Add test for 'pip_install' with linking scripts

Also drop no longer relevant (and broken) `link_scripts` test, that
served as a template for the new test.

* Restore compatibility with Ruby 1.8.7

* Replace option hash with 'pip_install_and_link'

* Avoid confusing 'Object#tap' and fix silly bug

* Avoid side effects in mock object parameter check

* Simplify argument check (no need for a block)
2016-08-02 13:37:15 -07:00
Tim D. Smith
a5a930c48b Allow virtualenvs to find Python bindings provided by deps (#608)
Allow virtualenvs to find Python bindings provided by deps

Closes #603.
2016-07-31 11:59:30 -07:00
Tim D. Smith
209d9e8a6e Refurbish args in virtualenv (#600)
Instead of adding additional lines to formula.rb:
  https://git.io/vKxxh
just turn on argument refurbishment for any formula that creates a
virtualenv.

cf Homebrew/ruby-macho#50, Homebrew/homebrew-core#1663
2016-07-29 08:45:26 -07:00
Tim D. Smith
2783adec4a Add helper class for Python virtualenvs 2016-07-26 21:34:06 -07:00
Vlad Shablinsky
3fb5d70a72
Unify Version.create usage
Substitue each Version.new and HeadVersion.new with Version.create
to unify Version and HeadVersion instantiation among core code.

Note that this does not relate to Mac::OS::Version class.
2016-07-16 20:39:13 +08:00
Dominyk Tiller
373d927e37
languages/go: die on empty arrays if HOMEBREW_DEVELOPER 2016-07-10 21:26:39 +01:00
Martin Afanasjew
4f2e31b3e3 language/python: fix bogus require
Including the extension is not an error, but we don't normally do this.
2016-07-09 11:58:43 +02:00
ilovezfs
7b2d1a5b08 Haskell::Cabal: fix overquoting of flags
Since `system` escapes its own spaces, cabal was interpreting
`--flags='webapp s3'` as `+'webapp +s3'` rather than `+webapp +s3`.

Closes #267.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-05-21 15:11:48 -07:00
Martin Afanasjew
8600b9edf1 Update Homebrew/homebrew references in comments
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Christian Moritz
bc98fd3788 Language::Node.npm_install_args: add helper method (#37)
* add Language::Node helper module

This adds a language module for Node module based formulas.
It contains the 2 public methods `std_npm_install_args(libexec)` and
`local_npm_install_args`:

* `std_npm_install_args` is intended to be used in formulas for
  standard node modules and returns `npm install` args for a global
  style module installation to libexec.
* `local_npm_install_args` is for formulas, in which the `npm install`
  step is only one of multiple parts of the installation process and
  returns `npm install` args for a default local installation in place.

Both methods have in common, that they are

* making sure that a working copy of npm and node-gyp from node's
  libexec is prepended to the PATH (to not rely of a user managed npm)
* seting the npm cache to HOMEBREW_CACHE/npm, which fixes issues caused
  by overriding $HOME resulting in long install times + high disk usage
  (see https://github.com/Homebrew/brew/pull/37#issuecomment-208840366)

* audit: update npm install check for Language::Node

* cleanup: remove npm_cache too

* doc: add Node-for-Formula-Authors.md
2016-04-27 17:08:44 +01:00
Misty De Meo
a7869783ad Haskell: cap cabal-install make jobs at 64
Fixes Homebrew/homebrew#49509.

Closes Homebrew/homebrew#49511.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-25 08:08:34 +00:00
ilovezfs
4c1e415bff haskell: fix empty flags build failures
Fixes a regression introduced by Homebrew/homebrew#47950 in 9e3ee3e causing build
failures with the error

  cabal: The file does not exist ''.

This will occur whenever the optional :flags key isn't in the options
hash passed to install_cabal_package.

Closes Homebrew/homebrew#49425.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-22 16:16:50 +00:00
Cedric Staub
cc3e2e8f0f git-annex: force-enable "webapp" flag
To address issue Homebrew/homebrew#47346 (git-annex-webapp missing), we explicitly
enable the "webapp" flag for git-annex. This should prevent git-annex
from being built without the webapp and make the build fail if there is
e.g. a dependency issue.

Closes Homebrew/homebrew#47950.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-02-22 01:32:42 +00:00
Baptiste Fontaine
bb37aa2824 go: warn about no-op stage_deps calls
Closes Homebrew/homebrew#49389.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-21 21:21:23 +01:00
ilovezfs
6a1a57423b Haskell#cabal_install more robust deps resolution
The default max-backjumps can be too low, especially since
Language::Haskell::Cabal doesn't guarantee an LTS config.

In particular, this fixes a git-annex build failure in Homebrew/homebrew#47950

Closes Homebrew/homebrew#49158.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-21 18:40:36 +00:00
Dominyk Tiller
d91caa2b92 languages/haskell: style nits 2016-01-03 19:08:11 +00:00
Dominyk Tiller
fff140cb9d language/haskell: wrap options in parens
Fixes:
language/haskell.rb:65: warning: `*' interpreted as argument prefix
2016-01-03 19:08:10 +00:00
Misty De Meo
21d70a2816 Haskell: call fails_with on correct object
Fixes Homebrew/homebrew#47533.
2015-12-30 15:51:57 -04:00
Miëtek Bak
68361be36c Improve Haskell language support
Removes the need to call setup_ghc_compilers in every Haskell language
formula, by automatically calling fails_with.

Adds a :home option to the cabal_sandbox method.  This option allows a
specific temporary HOME to be used instead of the current working
directory, and in turn allows a single Cabal package database to be reused
between multiple calls to this method.

Avoids updating the Cabal package database more than once if cabal_sandbox
is called multiple times.

Removes the need to call cabal_clean_lib whenever cabal_sandbox is called,
by automatically cleaning the lib directory.

Adds a :keep_lib option to the cabal_sandbox method.  This option allows
opting out of the automatic cleaning.

Ensures build products are always removed from the current working
directory.

Removes a workaround for versions of cabal-install older than 1.20.0.0.

Adds a cabal_sandbox_add_source method.

Adds a :using option to the install_cabal_package method.  This option
allows specifying the Haskell language tools that are required to install
a particular formula, and in turn allows formulae to be simplified by
replacing calls to multiple methods with a single call to this method.

Allows customizing the call to install_cabal_package by giving a block.

Removes empty method shells.

Closes Homebrew/homebrew#47293.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-25 21:05:28 +00:00
Mike McQuaid
b745546943 Overhaul, simplify and cleanup documentation.
Remove duplication, link to the API documentation more often,
tweak wording, add `@UniqMartin` as a maintainer, note `@jacknagel`'s
and `@adamv`'s significant past contributions to Homebrew, delete some
outdated or unneeded documentation, add some missing `Formula` API.
entries and simplify/improve `CONTRIBUTING.md`.

Closes Homebrew/homebrew#46179.

Closes Homebrew/homebrew#46618.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-07 13:37:49 +00:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Misty De Meo
0abe16673e Cabal: move fails_with to a class method
Fixes Homebrew/homebrew#39950.
2015-05-28 19:30:10 -07:00
Geoff Nixon
1600658fcc ghc: cleanup/decruft.
- Fix static GMP
- Remove --32-bit option (ghc 7.6 or newer is needed to build).
- Building with llvm-gcc and 7.6.3 works on Snow Leopard and Lion.

Closes Homebrew/homebrew#39134.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-05-13 11:27:55 +01:00
Xu Cheng
6dc9506edc java overridable_java_home_env
Closes Homebrew/homebrew#37622
2015-03-13 18:43:42 +08:00