1039 Commits

Author SHA1 Message Date
John Zeringue
a600262f68 formula: output recommended/optional deps in JSON.
Fixes Homebrew/homebrew#47914 by distinguishing between required, optional, and
recommended dependencies when using `brew info --json=v1`. This is done
by adding the `optional_dependencies` and `recommended_dependencies`
fields to the JSON output.

A good example of this fix is `brew info --json=v1 dtrx`.

Closes Homebrew/homebrew#48196.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-18 08:45:58 +00:00
Xu Cheng
6c8c56a689 build: store source modified time in tabfile 2016-01-15 16:26:04 +08:00
ilovezfs
07e849e7f4 Fix built_as_bottle in Formula's to_hash
This was caused by a "race" between two commits.
bash-3.2$ git log -n1 --format=%ai 3344229
2012-08-15 22:08:40 -0500
bash-3.2$ git log -n1 --format=%ci 3344229
2012-09-17 20:01:37 -0500
bash-3.2$ git log -n1 --format=%ai 8837423
2012-08-25 11:31:57 -0700
bash-3.2$ git log -n1 --format=%ci 8837423
2012-08-25 11:52:37 -0700

"built_bottle" was renamed "built_as_bottle" in 8837423 after the date
3344229 was authored but before the date it was committed to master, and
unfortunately in the interim 3344229 hadn't been updated to reflect the
name change.

This commit changes the Formula class's to_hash method to use
tab.built_as_bottle not tab.built_bottle, which doesn't exist. At this
time, there is no way that to_hash could have known that
tab.built_bottle is bogus. Perhaps this could be made safer in the
future, so that non-existent methods cause an error here rather than
just silently returning null.

Closes Homebrew/homebrew#47912

Closes Homebrew/homebrew#47916.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-12 17:41:31 +08:00
Dominyk Tiller
a508f9f94b Revert "formula: pass sdk_path in std_cmake_args"
This reverts commit 5896555e5352b5e4f16f583ea444942cd1fc56bd.

It caused header-location issue on dual-developer-tool systems for certain
formulae. Will need looking at again, but we'll probably have to try and
do this a different way.

Closes Homebrew/homebrew#47668.
2016-01-05 17:29:48 +00:00
Mateusz Lenik
47afde940a formula: fix undefined method error
Fixes: Homebrew/homebrew#47673.
Closes Homebrew/homebrew#47672.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-04 16:16:53 +01:00
Baptiste Fontaine
9bdd6619e2 cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-04 13:17:21 +01:00
Dominyk Tiller
2af64920fa formula: pass sdk_path in std_cmake_args 2015-12-29 13:27:23 +00:00
Baptiste Fontaine
169b8fc039 Revert "minor perf improvements"
This reverts commit 16a2a8274a7808e63a6c78475e12a7c0ef5812ef.
2015-12-26 23:00:38 +01:00
Baptiste Fontaine
48681c3f3a minor perf improvements
Closes Homebrew/homebrew#47224.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-26 22:58:26 +01:00
Alex Wang
d09698f19f Add -DNDEBUG to std_cmake_args
CMake has -DNDEBUG and -O3 as its default flags for Release builds.
Homebrew clears out the default CMake flags, which is fine for
optimization because Homebrew passes its own optimization flag(s).
-DNDEBUG wasn't added back in, though.

This ensures -DNDEBUG is passed to CMake release builds by default,
instead of individual formulas having to add it explicitly.

This also removes explicit additions of -DNDEBUG from the formulae that
had them -- gflags, llvm, and taglib.

Closes Homebrew/homebrew#47378.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-26 21:50:51 +00:00
Xu Cheng
0f84b976ba move CoreFormulaRepository into separate file
For users whose local brew is at around 2015-06-11 to 2015-08-06,
running `brew update` will emit following error:

  Error: uninitialized constant Formulary::CoreFormulaRepository

This is caused by the same bug described in Homebrew/homebrew#42553.

This commit workarounds this issue and restores `brew update` compatibility
for users mentioned above.

Also cleanup legacy `require "cmd/tap"`.
2015-12-19 22:05:30 +08:00
Xu Cheng
5debd5b132 Formula#tap: returns tap object 2015-12-09 16:56:59 +08:00
Xu Cheng
871ec75524 Formula: use CoreFormulaRepository, avoid duplicated logic 2015-12-09 16:56:59 +08: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
Xu Cheng
48950f2cc0 centralize the logic of handling homebrew- in Tap.fetch
Closes Homebrew/homebrew#46537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-03 13:46:59 +08:00
Xu Cheng
0686ebfcc0 formula: use installed_prefixes/installed_kegs
Closes Homebrew/homebrew#46463.
2015-11-29 20:24:30 +08:00
Xu Cheng
6273d464ee add Formula#installed_prefixes and Formula#installed_kegs 2015-11-29 20:24:30 +08:00
Mike McQuaid
4a457d191d formula: fix reference to self. 2015-11-27 20:43:13 +00:00
Andrew Thorburn
4c3a6c6022 formula: add missing require.
Closes Homebrew/homebrew#46433.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-27 18:48:38 +00:00
Mike McQuaid
6054666fa6 formula: refactor outdated handling, add to hash. 2015-11-27 16:52:54 +00:00
Baptiste Fontaine
24a1eeceb3 Common build environment methods moved in build_environment.rb
Closes Homebrew/homebrew#45966.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-11-17 00:17:22 +01:00
Xu Cheng
02d7abe2ec add Formula#pinned_version 2015-11-16 20:59:12 +08:00
Xu Cheng
0d74967ceb Formula.racks: exclude empty rack
Fixes https://github.com/Homebrew/homebrew-bundle/issues/121

Closes Homebrew/homebrew#45879.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-11 19:37:05 +08:00
Tim D. Smith
55063f0ec7 set up Python sys.path from install HOME
Necessary to allow system Python to find Python modules installed by Homebrew.

Closes Homebrew/homebrew#45076. Fixes Homebrew/homebrew#43919. Probably fixes Homebrew/homebrew#44813.
2015-11-08 11:58:28 -08:00
Alex Dunn
e891699342 formula.rb: define elisp and opt_elisp
Closes Homebrew/homebrew#45567.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2015-11-01 17:34:28 -08:00
Xu Cheng
ff9fdc078f add Formula#bottle_defined? 2015-11-01 08:22:18 -08:00
Dominyk Tiller
674a350e6c formula: update bottle criteria explanation 2015-10-24 00:25:46 +01:00
Xu Cheng
b5032ad2cb Formula: add bottle disable DSL 2015-10-19 21:41:36 +08:00
Baptiste Fontaine
f3035333fb FormulaValidationError: include full_name
Closes Homebrew/homebrew#44946.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-14 16:21:42 +02:00
Xu Cheng
3d585d6e3f add Formula#aliases
Fixes Homebrew/homebrew#44331.

Closes Homebrew/homebrew#44709.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-14 17:26:41 +08:00
Xu Cheng
98633e03c6 add alias_table and alias_reverse_table for core and tap 2015-10-14 17:26:41 +08:00
Xu Cheng
65488903f9 add Formula.core_alias_files 2015-10-14 17:26:41 +08:00
Xu Cheng
ee332c4550 handle TapFormulaWithOldnameAmbiguityError
Closes Homebrew/homebrew#44705.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-08 16:02:33 +08:00
Robin Neatherway
0fee65bf12 link_overwrite if the owning keg no longer exists 2015-10-07 17:20:09 +08:00
Xu Cheng
3b520cf195 cache taps
There are plenty of IO operations inside Tap object, and it will be more
when implementing formula alias reverse look up(e.g. list all of alias
names for a formula). So let's cache them.

Some benchmark:

$ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null
Before: 6.40s user 2.42s system 96% cpu 9.134 total
After: 4.75s user 0.77s system 97% cpu 5.637 total

Closes Homebrew/homebrew#44377.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-30 16:25:30 +08:00
Xu Cheng
c3813230c1 Formula#system: fix log output for travis 2015-09-24 16:44:39 +08:00
Xu Cheng
8c9f0120ca Formula#system: print dot for travis 2015-09-23 21:46:44 +08:00
Mike McQuaid
9aecb1be2b formula: increase fail log lines, allow config.
The default is almost never useful. 15 seems like a good medium as it'll
not fill a 80x24 default but provides a bit more context. Also allow it
to be overriden for developers and `test-bot`.
2015-09-23 21:46:43 +08:00
Xu Cheng
e21bb27c2e Formula: add alias_full_names 2015-09-13 17:23:17 +08:00
Xu Cheng
1e344c9672 Formula#core_names: use core_files 2015-09-13 17:05:27 +08:00
Xu Cheng
034b19cea7 uniq before sort
http://blog.askit.org/post/18152870794/performance-of-sortuniq-vs-uniqsort
2015-09-13 16:58:06 +08:00
Xu Cheng
2df6ad1bed Formula#to_hash: add bottle info
Closes Homebrew/homebrew#43848.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-13 12:59:13 +08:00
Xu Cheng
81bd5c40d0 Formula: add tap alias
Closes Homebrew/homebrew#43851.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-13 12:58:00 +08:00
Alex Dunn
818c65542d remove Formula#file_modified?
It's been more trouble than it's worth.

Fixes Homebrew/homebrew#43607.
Closes Homebrew/homebrew#43049.

Closes Homebrew/homebrew#43615.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-06 13:13:59 +01:00
Xu Cheng
faa6334774 Formula#file_modified?: use Utils.git_available? 2015-09-02 15:24:52 +08:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01:00
Xu Cheng
1df6e5d331 Formula#file_modfiled?: remove unnecessary git dir check
It's already covered by `$?.exitstatus == 0` in below.
2015-08-25 17:32:39 +08:00
Dominyk Tiller
b808eed08f formula: use which over locate 2015-08-25 04:18:46 +01:00
Misty De Meo
98bb638f29 Formula#file_modified?: fix for Xcodes without git
Fixes Homebrew/homebrew#43206.
2015-08-24 20:10:53 -07:00
Xu Cheng
09c810c7f4 add link_overwrite DSL
Sometimes we accidentally install files outside prefix. After we fix that,
users will get nasty link conflict error. So we create a whitelist here to
allow overwriting certain files. e.g.
  link_overwrite "bin/foo", "lib/bar"
  link_overwrite "share/man/man1/baz-*"

During FormulaInstaller#link, the whitelist conflict files will be
backup into HOMEBREW_CACHE/Backup
2015-08-23 21:43:03 +08:00