Re: header dependencies

2016-05-26 Thread Jerome BENOIT
Hi Nico:

On 26/05/16 19:06, Nico Schlömer wrote:
> Hi everyone,
> 
> Say a package installs only headers, and in one of those, a header of
> another -dev package is #included. How to depend on the package?

Have a look to the libmpfrc++-dev package.

Best wishes,
Jerome


> 
> Cheers, Nico

-- 
Jerome BENOIT | calculus+at-rezozer^dot*net
https://qa.debian.org/developer.php?login=calcu...@rezozer.net
AE28 AE15 710D FF1D 87E5  A762 3F92 19A6 7F36 C68B



Re: header dependencies

2016-05-26 Thread Gianfranco Costamagna
Hi,


>Say a package installs only headers, and in one of those, a header of another 
>-dev package is #included. How to depend on the package?


I would call it libfoo-dev (arch:all) and depend (runtime) on libbar-dev.

Feel free to steal from websocketpp, a source-only library I maintain.

https://sources.debian.net/src/websocketpp/0.7.0-5/debian/control/

Hope this helps,

G.



header dependencies

2016-05-26 Thread Nico Schlömer
Hi everyone,

Say a package installs only headers, and in one of those, a header of
another -dev package is #included. How to depend on the package?

Cheers,
Nico


Re: How to track header dependencies amongst -dev packages?

2015-08-28 Thread Ferenc Wagner
Ferenc Wagner wf...@niif.hu writes:

 I'm packaging software which consists of multiple libraries.  I put
 those libraries into various lib* binary packages with corresponding
 lib*-dev packages.  Some header files contained in the lib*-dev packages
 include others in other lib*-dev packages, thus package dependencies
 must be declared between them.  Is there any tool to help me with this,
 or should I create my own?  I imagine something like ${misc:Depends}...

I put something together which might (after recoding in a safe manner)
bu useful to others or be considered a horrible hack (which I'd like to
know of).  I invoke this script:

#!/bin/sh -e

cd debian

pkgs=$(grep-dctrl -sPackage -n -FSection libdevel control)

for p in $pkgs; do
includes=$includes -I $p/usr/include
done

for pkg in $pkgs; do
  {
printf 'header:Depends='
for header in $(find $pkg -name *.h); do
gcc -MM -MT '' -E $includes $header
done | sed s|^:||;s|^ *||;\|^$pkg/|d;s|/.*| (= \${binary:Version}),| 
| sort -u | tr '\n' ' '
printf '\n'
  } $pkg.substvars
done

from debian/rules like

override_dh_gencontrol:
debian/check_header_deps
dh_gencontrol

and use Depends: ${header:Depends} in the control file.  Works for me in
the single case I tested.

Do you think it's worth developing into some proper helper?
-- 
Regards,
Feri.



How to track header dependencies amongst -dev packages?

2015-08-03 Thread Ferenc Wagner
Hi,

I'm packaging software which consists of multiple libraries.  I put
those libraries into various lib* binary packages with corresponding
lib*-dev packages.  Some header files contained in the lib*-dev packages
include others in other lib*-dev packages, thus package dependencies
must be declared between them.  Is there any tool to help me with this,
or should I create my own?  I imagine something like ${misc:Depends}...
-- 
Thanks,
Feri.


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/87lhdsic5a@lant.ki.iif.hu



Re: How to determine header dependencies for -dev packages

1998-05-20 Thread Manoj Srivastava
Hi,
Shaleh == Shaleh  [EMAIL PROTECTED] writes:

Shaleh Is there an easy way to determine header dependencies?
Shaleh Anyone header could include many others.  Or do I have to
Shaleh open up each header and track down which package it is
Shaleh included in?

Well, one may script this -- there are scripts out there that
 can print a recursive tree of included dependencies (unfortunately,
 most scripts do not deal well with cpp conditionals); one just needs
 grab ths list of headers, and then do a dpkg -S on them. Not likely
 to be fast, but it'll work.

manoj

-- 
 Everyone's head is a cheap movie show. Jeff G. Bone
Manoj Srivastava  [EMAIL PROTECTED] http://www.datasync.com/%7Esrivasta/
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


Re: How to determine header dependencies for -dev packages

1998-05-20 Thread James LewisMoss
 On 19 May 1998 22:13:11 -0500, Manoj Srivastava [EMAIL PROTECTED] said:

 Manoj Hi,
  Shaleh == Shaleh [EMAIL PROTECTED] writes:

 Shaleh Is there an easy way to determine header dependencies?
 Shaleh Anyone header could include many others.  Or do I have to
 Shaleh open up each header and track down which package it is
 Shaleh included in?

 Manoj Well, one may script this -- there are scripts out
 Manoj there that
 Manoj  can print a recursive tree of included dependencies
 Manoj  (unfortunately, most scripts do not deal well with cpp
 Manoj  conditionals); one just needs grab ths list of headers, and
 Manoj  then do a dpkg -S on them. Not likely to be fast, but it'll
 Manoj  work.

(taking from Manoj's suggestion) How about:

#! /usr/bin/perl -w

use strict;

my @headers = list of headers; @ maybe `find . -name '*.h' -print`

my $tmp_file = some secure method of getting a temp file;

open(TMP_FILE, $tmp_file);
foreach (@headers) {
  print TMP_FILE #include $_\n; #maybe should be $_ instead
}
print TMP_FILE main(){}
close(TMP_FILE);

my $deps = `gcc -I. -M $tmp_file`; # need the approriate -I directives
   # here.  At least -I.

my @deps = split(/\s+/, $deps); # this may not work.  Maybe need a m
# on the regexp

my @all_deps;

foreach (@deps) {
  if(-f $_) {
my $one_dep = `dpkg -S $_`;
$one_dep =~ s/:.*//;
# and it'd probably be faster to do something like (but not the
# best of ideas)
# my $one_dep = `grep -l $_ /var/lib/dpkg/info/*.list`;
# $one_dep =~ s{/var/lib/dpkg/info}{};
  }
  push(@all_deps, $one_dep) if $one_dep !~ m/dpkg.*not found/;
  # since dpkg doesn't return an error code like it should here (IMO
  # of course) this check is a little annoying.  Should just be
  # $? == 0 
}

print @all_deps;

exit 0;

--
All of the above is off the top of my head and mostly untested, but it
should be close to working.

Unfortunately there is another cute problem:

Many packages use a config.h file to determine which things get
included.  Assuming you are doing this at the same time (with the same 
config.h file) as when you compiled the library, then it should work
OK, but that is important.

Also, really, libraries should be linked with the appropriate
libraries they depend on (which really tells you which dependancies
they have since it is a rare header file that doesn't refer to
functions in a library).

Dres
-- 
@James LewisMoss [EMAIL PROTECTED] |  Blessed Be!
@http://www.dimensional.com/~dres   |  Linux is kewl!
@Argue for your limitations and sure enough, they're yours. Bach


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


Re: How to determine header dependencies for -dev packages

1998-05-20 Thread Fabrizio Polacco
On Tue, May 19, 1998 at 10:13:11PM -0500, Manoj Srivastava wrote:
 Hi,
 Shaleh == Shaleh  [EMAIL PROTECTED] writes:
 
 Shaleh Is there an easy way to determine header dependencies?
 Shaleh Anyone header could include many others.  Or do I have to
 Shaleh open up each header and track down which package it is
 Shaleh included in?
 
   Well, one may script this -- there are scripts out there that
  can print a recursive tree of included dependencies (unfortunately,
  most scripts do not deal well with cpp conditionals); one just needs
  grab ths list of headers, and then do a dpkg -S on them. Not likely
  to be fast, but it'll work.

You don't need to go deeper that one level (assume that the package installing
the external include file has correct dependencies) and you need to do that
only for the include files that the -dev package installs, not for all the
include files used to compile the library (as they would be needed for
source-depends only).

An utility dpkg-incldeps would be very handy, indeed.

fab
-- 
| [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED]
| 6F7267F5 fingerprint 57 16 C4 ED C9 86 40 7B 1A 69 A1 66 EC FB D2 5E
 support the open-source initiative! http://www.opensource.org/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


Re: How to determine header dependencies for -dev packages

1998-05-20 Thread Sverker Wiberg
Shaleh [EMAIL PROTECTED] wrote:

 Is there an easy way to determine header dependencies?  Anyone header
 could include many others.  Or do I have to open up each header and
 track down which package it is included in?

Here's a piece of plumbing I put together in five minutes:

   bash$ gcc -E frobozz.c | grep ^#  | cut -d\  -f3 | sort | uniq

It only shows you the collapsed dependencies, not the tree-structure
you might want. Also, you should also add in whatever defines (the -D
flag) you usually have.

/Sverker


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


Re: How to determine header dependencies for -dev packages

1998-05-20 Thread Elie Rosenblum
And thus spake Sverker Wiberg, on Wed, May 20, 1998 at 02:53:39PM +0200:
 Shaleh [EMAIL PROTECTED] wrote:
 
  Is there an easy way to determine header dependencies?  Anyone header
  could include many others.  Or do I have to open up each header and
  track down which package it is included in?
 
 Here's a piece of plumbing I put together in five minutes:
 
bash$ gcc -E frobozz.c | grep ^#  | cut -d\  -f3 | sort | uniq
 
 It only shows you the collapsed dependencies, not the tree-structure
 you might want. Also, you should also add in whatever defines (the -D
 flag) you usually have.

Any real reason not to use gcc -M to generate this same thing?

-- 
Elie Rosenblum erosenbl at nyx.netThat is not dead which can eternal lie,
 fnord at cosanostra.net   And with strange aeons even death may die.
Developer / Mercenary / System Administrator - _The Necromicon_


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


Re: How to determine header dependencies for -dev packages

1998-05-20 Thread Sverker Wiberg
Elie Rosenblum [EMAIL PROTECTED] wrote:

 Any real reason not to use gcc -M to generate this same thing?

Sorry, no --- I just misunderstood the GCC man page.

/Sverker


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


Re: How to determine header dependencies for -dev packages

1998-05-20 Thread Matthias Klose
Sverker Wiberg writes:
 Shaleh [EMAIL PROTECTED] wrote:
 
  Is there an easy way to determine header dependencies?  Anyone header
  could include many others.  Or do I have to open up each header and
  track down which package it is included in?
 
 Here's a piece of plumbing I put together in five minutes:
 
bash$ gcc -E frobozz.c | grep ^#  | cut -d\  -f3 | sort | uniq
 
 It only shows you the collapsed dependencies, not the tree-structure
 you might want. Also, you should also add in whatever defines (the -D
 flag) you usually have.

What about gcc -E -H ? It prints the headers that get included.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


Re: How to determine header dependencies for -dev packages

1998-05-20 Thread Manoj Srivastava
Hi,

Well then. Here is  a include tree builder, which handles
 duplicates recursively.

manoj

__
#!/usr/bin/perl -w

# Usage: inctree [options] [files]

# Configuration parameters.

$CPP = 'cc -E';
# $CPP = cc -P;
# $CPP = /lib/cpp;

$shiftwidth = 4;

# Process switches.

while ($ARGV[0] =~ /^-/) {
$_ = shift;
if (/^-D(.*)/) {
$defines .=  -D . ($1 ? $1 : shift);
}
elsif (/^-I(.*)/) {
$includes .=  -I . ($1 ? $1 : shift);
}
elsif (/^-m(.*)/) {
push(@pats, $1 ? $1 : shift);
}
elsif (/^-l/) {
$lines++;
}
else {
die Unrecognized switch: $_\n;
}
}

# Build a subroutine to scan for any specified patterns.

if (@pats) {
$sub = sub pats {\n;
foreach $pat (@pats) {
$sub .= print ' ',\$_ if m$pat;\n;
}
$sub .= }\n;
eval $sub;
++$pats;
}

# Now process each file on the command line.

foreach $file (@ARGV) {
open(CPP,$CPP $defines $includes $file|)
|| die Can't run cpp: $!\n;
$line = 2;

while (CPP) {
++$line;
pats if $pats;  # Avoid expensive call if we can.
next unless /^#/;
next unless /^# \d/;
($junk,$newline,$filename) = split;
$filename =~ s///g;

# Now figure out if it's a push, a pop, or neither.

if ($stack[$#stack] eq $filename) { # Same file.
$line = $newline-1;
next;
}

if ($stack[$#stack-1] eq $filename) {   # Leaving file.
$indent -= $shiftwidth;
$line = pop(@lines)-1;
pop(@stack);
}
else {  # New file.
printf %6d  , $line-2 if $lines;
push(@lines,$line);
$line = $newline;
print \t x ($indent / 8), ' ' x ($indent % 8),
$filename;
print   DUPLICATE if $seen{$filename}++;
print \n;
$indent += $shiftwidth;
push(@stack,$filename);
}
}
close CPP;
$indent = 0;
%seen = ();
print \n\n;
$line = 0;
}

-- 
 ... One sip of this will bathe the drooping spirits in delights
 beyond dreams of bliss. --anonymous
Manoj Srivastava  [EMAIL PROTECTED] http://www.datasync.com/%7Esrivasta/
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


How to determine header dependencies for -dev packages

1998-05-19 Thread Shaleh
Is there an easy way to determine header dependencies?  Anyone header
could include many others.  Or do I have to open up each header and
track down which package it is included in?

-- 
---
How can you see, when your mind is not open?
How can you think, when your eyes are closed?
- Jason Bonham Band, Ordinary Black and White
---


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]