fpc: Generate a default configuration file

The file provides a set of default paths and options, which help in
unit search paths (equivalent to C search paths) so that formulas won't
need to specify them when needed. All options and variables can be
overridden at any time on the command line.

Add an unused unit to the test section to check that the search path
is always correctly set.

Fix Homebrew/homebrew#45783.

Closes Homebrew/homebrew#46021.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Vittorio Giovara 2015-11-16 00:57:20 +01:00 committed by Mike McQuaid
parent 0cdcc64509
commit 52a8f9d0ae

View file

@ -28,11 +28,15 @@ class Fpc < Formula
# Prevent non-executable audit warning
rm_f Dir[bin/"*.rsj"]
# Generate a default fpc.cfg to set up unit search paths
system "#{bin}/fpcmkcfg", "-p", "-d", "basepath=#{lib}/fpc/#{version}", "-o", "#{prefix}/etc/fpc.cfg"
end
test do
hello = <<-EOS.undent
program Hello;
uses GL;
begin
writeln('Hello Homebrew')
end.