aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula_installer.rb
AgeCommit message (Collapse)Author
2012-07-04Introduce new formula specsJack Nagel
2012-06-27Simplify check_non_librariesAdam Vandenberg
2012-06-01Replace /usr/bin/ruby with full Framework pathMisty De Meo
Rationale: some users insist on replacing the /usr/bin/ruby symlink to point to another ruby on their system, which may break homebrew. Use the full Framework path instead, which is less likely to be tampered with. This also reorganizes the brew --config checks to reflect the different path. Fixes Homebrew/homebrew#12009. Closes Homebrew/homebrew#12333. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-05-26Do not warn about JNI libraries in libWill Ross
JNI libraries in OS X are suffixed with jnilib. Additionally, /usr/local/lib is a default search location for JNI libraries, so Homebrew shouldn't complain when it installs .jnilibs into lib. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-05-13FormulaInstaller: fold dirlist helper into check_m4Jack Nagel
Having in_aclocal_dirlist? defined as a method on FormulaInstaller is a little weird; since its just a return condition of check_m4, move the code there. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-05Honor build options and bottles when upgradingNicolas Despres
Fixes Homebrew/homebrew#11552. Closes Homebrew/homebrew#11777. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-16Fix Git installation warnings (again).Mike McQuaid
We have to install them to lib; anywhere else requires root access, a non-system perl or patching Git. Tried just moving them in 9597d5 but that breaks git-svn.
2012-04-16Fix Qt installation warnings.Mike McQuaid
PRL files are necessary in lib so whitelist them. Debian installs them too: http://packages.debian.org/squeeze/amd64/libqt4-dev/filelist
2012-04-11Don't warn about .o files in libAdam Vandenberg
2012-03-23Pass the tab to FormulaInstallerJack Nagel
Callers of FormulaInstaller now usually unlink the existing keg prior to running the installer. However, Tab.for_formula uses the LinkedKeg record to obtain the tab. Since we need the tab to persist install options across upgrades, we must start creating the Tab object before unlinking the old keg and passing it to the FormulaInstaller. Fixes Homebrew/homebrew#11086. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-18Use fetch for downloading bottles.Mike McQuaid
Fixes Homebrew/homebrew#10958.
2012-03-16Tell the user to tap (if req.) for tapped depsMax Howell
Also propagate dependency info through exception if possible so the error message is more useful.
2012-03-16Leave kegs keg-only if linking step failsMax Howell
Rationale: well, it should always have been like this! However now we are opening ourselves up to more-mixed installations of formula not maintained by us, it's important that
2012-03-15Abort installs if reps are installed but not linkedMax Howell
Except for keg-only reps of course. I suspect quite a few bug reports we receive are due to this sort of thing. Ideally we'd not do this check for deps, since they have already been checked. I fear some weird consequences. But this check *should* be done before unlinking the previously installed brew in the case of upgrades. And the ignore_deps flag is set after the initialiser. There are ways round this but the code would be less nice.
2012-03-10Use new Requirements code in HomebrewAdam Vandenberg
2012-03-10Move most bottle stuff to a bottles.rb file.Mike McQuaid
2012-03-10Support bottles for non-Lion OSX versions.Mike McQuaid
2012-03-07Allow dependencies to still installMax Howell
Oops bug.
2012-03-07Stop supporting `brew install --force'Max Howell
Rationale: it breaks stuff. You should not be able to install over something already installed *and* linked. brew now prompts you to unlink the existing linked keg first. I came to fix this because I discovered that `brew install foo` works without --force provided foo's formula version is different to that which is installed and linked. I'm not sure if this was intentionally broken, but it led to at least two tickets I found where people were getting crazy issues trying to install over the top of already installed previous versions. So I also fixed a whole category of other issues, mostly by moving error handling into FormulaInstaller. Now error's can be caught in Homebrew.install and handled on a formula-by-formula basis. I will next port this behaviour to upgrade.
2012-02-29Add support for Luarocks dependencies.Adam Vandenberg
2012-02-27Autoconf, Automake and LibtoolMax Howell
We need these now for Xcode-4.3/CLT4X installations. Also prevent m4 error in installer. And prevent brew doctor complaining if we're Xcode 4.3 or above. Closes Homebrew/homebrew#10349. Fixes Homebrew/homebrew#10423. Refs Homebrew/homebrew#9179.
2012-02-26audit: check sbin tooAdam Vandenberg
Apply the 'bin' audit to 'sbin' too, and also complain if subfolders are installed to either.
2012-02-25List offending jar files when installed to libAdam Vandenberg
2012-02-25Add more external dep optionsSecond Planet
* Chicken Scheme * Node.js * Rubinius Closes Homebrew/homebrew#8466. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-24Replace UI uses of 'folder' with 'directory'Jack Nagel
There are still methods and variables with the word "folder" in the name, but at least user-facing messages and warnings should use the correct terminology. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21Move this code into FormulaInstallerMax Howell
The correct location for it IMO. Also added warning for the user.
2012-02-20Complain about non-exes in bin and non-libs in libAdam Vandenberg
2012-02-10Don't return nil from Formula#linked_kegJack Nagel
Doing so was the result of a quick hack to fix the "deps installed as upgrades don't get linked" bug, but it was a mistake. Instead, always return the LinkedKegs entry as a Pathname object, and let callers be responsible for checking that it exists. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-09Split bottle logic.Mike McQuaid
Fixes Homebrew/homebrew#8805.
2012-01-25Add `devel` to the DSL, + stable and bottle blocksMisty De Meo
This commit adds a `devel` entry to the DSL, allowing formulae to specify an unstable branch. `devel` takes a block, which should contain standard `url` and `md5` fields (and `version`, if necessary). This must come after the standard DSL fields. This commit also migrates over all formulae currently using `devel` to the new syntax, as well as formulae which used `head` for non-VCS urls. The new syntax is also available for `stable` and `bottle`. `stable` is an option alongside the old syntax. `bottle` replaces the old syntax. Note that the @stable ivar in Formula has been renamed to @standard, and the @bottle ivar has been renamed to @bottle_url. Closes Homebrew/homebrew#9735. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-01-15Unlink old keg when upgrading dependenciesJack Nagel
Installing a formula via `brew install` may trigger upgrades of its dependencies if the dependencies are installed but outdated. However, we never unlinked the existing keg in FormulaInstaller#install_dependency which caused the link step to fail. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-01Omit check_m4 warning when appropriateFelix Buenemann
If the suggested modifications are already in place, just skip the warning. Closes Homebrew/homebrew#8624. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-12-26Generalize formula_installer dependency resolutionCharlie Sharpsteen
Use `Formula.factory dep.path` instead of `Formula.factory dep.name` so that non-standard dependencies specified as URLs or paths can be handled properly.
2011-12-20Omit empty caveatsAdam Vandenberg
2011-11-29Fix installation error from ARGV `--HEAD` filterMisty De Meo
The ARGV filtering would strip `--HEAD` from dependency installations, then proceed with trying to install the dependency from the latest version in the formula. This causes an error if the latest version is already installed, so check to see if formula is installed before performing the installation. Closes Homebrew/homebrew#8869. Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-11-27Re-work ARGV filtering to properly handle --HEADCharlie Sharpsteen
Previously, stripping arguments like `--HEAD` for dependencies failed because that flag affects the installation prefix encoded into formula objects. The previous implementation of `ARGV` filtering tried to contain all changes to a single method call before the `FormulaInstaller` forks. This update spreads things out a bit: - The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies` which strips flags like `--HEAD`, yields to a block, then restores the original contents of ARGV. - The `explicitly_requested?` test, which returns true or false depending on if a formula object is a member of `ARGV.formulae`, is now a method of `Formula` objects. - `FormulaInstaller` objects now execute the installation of dependencies inside an `ARGV.filter_for_dependencies` block if the dependency was `explicitly_requested?`. Fixes Homebrew/homebrew#8668. Closes Homebrew/homebrew#7724.
2011-11-23formula_installer.rb: Improve receipt checkCharlie Sharpsteen
Using `f.installed?` instead of `f.prefix.exist?` ensures something was created by the installation step before the install receipt is written.
2011-11-21formula_installer.rb: Hotfix for head installsCharlie Sharpsteen
For now, don't strip `--HEAD` from `ARGV` prior to forking for install. Currently this doesn't work because the formula object the installer is acting on has its `prefix` set while under the influence of `--HEAD`. So, the installer bails out when it sees that nothing is installed to `f.prefix`. This is a hotfix for issue Homebrew/homebrew#8668 to allow formulae to keep building. A proper fix should ensure that formula installers are operating on objects with appropriately set `prefix` values.
2011-11-16Don't write receipt for empty installsCharlie Sharpsteen
Fixes Homebrew/homebrew#8616.
2011-11-14Add --fresh option to brew installCharlie Sharpsteen
When invoked, this option will ensure brew doesn't re-use any options from previous installs of a formula.
2011-11-14Hotfix for filtered_args breaking brew upgradeCharlie Sharpsteen
The `filtered_args` method added to the `FormulaInstaller` makes a call `ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a `FormulaUnspecifiedError` instead of returning an empty list. This patch avoids the issue by checking `ARGV.named.empty?` before calling `ARGV.formulae`. Fixes Homebrew/homebrew#8576.
2011-11-13metadata: Use options from previous installsCharlie Sharpsteen
FormulaInstaller now loads the install recipt of a previous install and appends the `used_options` to ARGV before forking to build. This means `brew upgrade` will "remember" which options were invoked for the last install and re-use them. Fixes Homebrew/homebrew#5250.
2011-11-13metadata: Record installation optionsCharlie Sharpsteen
Adds a new class called `Tab` that acts as a recipt for install options. A `Tab` can be serialized to a JSON file for future reference.
2011-11-13formula_installer.rb: Pre-process ARGV before forkCharlie Sharpsteen
`ARVG` is now filtered before the formula installer forks a new process. This allows a chance to do things like strip out `--HEAD` flags for formulae that weren't explicitly passed as arguments but came in as dependencies. Fixes Homebrew/homebrew#7724.
2011-09-13formula_installer.rb: Call link before check_PATHCharlie Sharpsteen
Otherwise, for formula that making the very first install into `sbin`, the following line will fail with a critical error: bin = (HOMEBREW_PREFIX/bin.basename).realpath.to_s Because `sbin` will not exist until after `link` runs. This isn't very clean as it moves `check_PATH` away from the other checks in `caveats`, but I couldn't think of a better hotfix that did not require a bit of code shuffling and re-writing.
2011-09-01Fix stripping of keg-only reasons during installAdam Vandenberg
2011-08-25Only use the bottle if its version is up-to-dateMax Howell
Rationale: if you edit a formula to use a different source URL it should build that and not the pour the bottle. Obviously.
2011-08-24Leopard: Fix undefined method `count` for `Array`Charlie Sharpsteen
Leopard runs Ruby 1.8.6 while Snow Leopard runs 1.8.7 and `Array.count` was not introduced until 1.8.7. Using `Array.length` instead.
2011-08-24Rename install.rb to build.rb for clarity and great justiceMax Howell
It was just confusing, and since the `brew upgrade` refactor this makes more sense too. Shame it still downloads in there etc. but whatever. Homebrew 2 will fix!
2011-08-24Implement bottles againMax Howell
Bottles now pour purely, without doing all the other unnecessary stuff that happened before the `brew upgrade` code shuffle. Formula.pourable? removed since it was install-specific metadata and not related to the formula itself. Now all such logic is in the FormulaInstaller which is much cleaner. I also changed the bottle cache location to the normal directory and added a .bottle pre-extension. Thus you can see everything in one directory without messing about.