Alexander,
       This is my current attempt at implementing the code to have
fink automatically append the appropriate flags to CPPFLAGS and
LDFLAGS if the package contained a BuildDepends on x11-dev. I am
currently stuck on how to construct a check for the presence of the
BuildDepends on x11-dev (which I have placed in the resolve_depends()
routine. I have confirmed this routine executes before the get_env()
routine so it will work once a proper test for the BuildDepends on
x11-dev is constructed.
               Jack

--- PkgVersion.pm.orig 2015-02-10 15:57:40.000000000 -0500
+++ PkgVersion.pm 2015-02-10 16:22:23.000000000 -0500
@@ -71,11 +71,14 @@
  $VERSION = 1.00;
  @ISA = qw(Exporter Fink::Base);
  @EXPORT = qw();
- @EXPORT_OK = qw(); # eg: qw($Var1 %Hashit &func3);
+ @EXPORT_OK = qw($BD_on_x11_dev); # eg: qw($Var1 %Hashit &func3);
  %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
 }
 our @EXPORT_OK;

+# Hold status of x11-dev BuildDepends
+our $BD_on_x11_dev = 0;
+
 our %perl_archname_cache;

 # Hold the trees of packages that we've built, so we can scan them
@@ -2645,6 +2648,13 @@
  $resolve_altspec->($self->pkglist_default("Build".$field, ""));
  }

+ if (lc($field) eq "builddepends") {
+ print "Checking for x11-dev\n";
+ if ($self->get_name() eq 'x11-dev') {
+ $BD_on_x11_dev = 1;
+ }
+ }
+
  # Add all regular dependencies to the list.
  if (lc($field) eq "depends") {
  # FIXME: Right now we completely ignore 'Conflicts' in the dep engine.
@@ -5062,6 +5072,20 @@
  "LDFLAGS"                  => "-L\%p/lib",
  );

+# if BuildDepends x11-dev is used append flags
+
+ print "Setting CPPFLAGS\n";
+ if ( $BD_on_x11_dev eq "1" ) {
+ my $osxversion = Fink::Services::get_kernel_vers();
+ if ( $osxversion < 12 ) {
+ $defaults{"CPPFLAGS"} = $defaults{"CPPFLAGS"} . " -I/usr/X11/lib";
+ $defaults{"LDFLAGS"} = $defaults{"LDFLAGS"} . " -L/usr/X11/lib";
+ } else {
+ $defaults{"CPPFLAGS"} = $defaults{"CPPFLAGS"} . " -I/opt/X11/lib";
+ $defaults{"LDFLAGS"} = $defaults{"LDFLAGS"} . " -L/opt/X11/lib";
+ }
+ }
+
 # for building 64bit libraries, we change LDFLAGS:

  if (exists $self->{_type_hash}->{"-64bit"}) {

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to