]> git.pld-linux.org Git - projects/cleanbuild.git/blob - findbr
new perl @INC fix
[projects/cleanbuild.git] / findbr
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use IPC::Open2;
6 use Cwd;
7 use constant DOCKER => -e '/.dockerenv';
8
9 my $pwd = getcwd();
10 # how to run poldek
11 my @ignore = qw(vserver-packages python-devel-src);
12 my @poldek;
13 if (DOCKER) {
14         push(@poldek, qw[poldek]);
15 } else {
16         push(@poldek, qw[sudo poldek -n th-x86_64-ready],
17                 "--cachedir=$pwd/poldekcache",
18                 "--conf=$pwd/poldekconf/poldek.conf",
19         );
20 }
21 push(@poldek, (
22         "--skip-installed",
23         "-O", "ignore=" . (join " ", @ignore)
24 ));
25
26 # if multiple packages provide some funcionality those will be selected:
27 my %preferred = (
28         "automake" => +1,
29         "autoconf" => +1,
30         "pkgconfig" => +1,
31
32         "python" => +1,
33         "python-modules" => +1,
34         "python-setuptools" => +1,
35
36         "perl-modules" => +1,
37         "perl-Encode" => +2,
38
39         "zlib-devel" => +1,
40         "libstdc++-devel" => +1,
41         "libusb-compat-devel" => +1,
42         "libjpeg-devel" => +1,
43         "libpng-devel" => +1,
44         "libsamplerate-devel" => +1,
45         "pulseaudio-devel" => +1,
46         "xorg-lib-libXrandr-devel" => +1,
47         "sqlite-devel" => +1,
48
49         "ice-devel" => -1,
50 );
51
52 # translate package name to provides name
53 my %translate = (
54         "gcc-c++" => "libstdc++-devel",
55         "rarian-compat" => "scrollkeeper",
56         "Mesa-libGL" => "OpenGL",
57         "Mesa-libGL-devel" => "OpenGL-devel",
58         "Mesa-libGLU-devel" => "OpenGL-GLU-devel",
59 );
60
61 my @skip = qw(hostname git svn svnversion mt gawk);
62 my %skip;
63 @skip{ @skip } = (1) x scalar @skip;
64
65 # for m4 in *.m4; do R=$(rpm -qf $m4); R=${R%-*-*}; \
66 #   awk -vr=$R '/^\s*(AC_DEFUN|AU_ALIAS)/ { gsub(/\].*/,""); gsub(/.*\[/,""); print r " " $0}' $m4; \
67 # done | sort | awk '{print "\t\"" $2 "\" => \"" $1 "\","}'
68 my %ac2br = do (DOCKER ? './cleanbuild/findbr-ac2br' : './findbr-ac2br');
69
70 my %cmake2br = (
71         "findkde4:44" => "kde4-kdelibs",
72         "findmsgfmt" => "gettext-tools",
73         "findpythoninterp" => "python",
74 );
75
76 BEGIN {
77         $SIG{__WARN__} = sub
78         {
79                 local $_ = shift;
80                 chomp;
81                 print STDERR "\033[31;1m" . $_ . "\033[0m\n"
82         };
83 }
84
85 my $builddir = shift @ARGV;
86 my @lines = <ARGV>;
87
88 my $reason;
89
90 my %out;
91 sub add_br
92 {
93         my $pkg = shift;
94         my $msg = shift || $reason;
95         if ( ref $pkg ) {
96                 foreach my $p ( @$pkg ) {
97                         add_br( $p, $msg );
98                 }
99                 return;
100         }
101
102         $msg =~ s/\n/ # /sg;
103
104         $pkg = $translate{ $pkg } || $pkg;
105
106         return if exists $out{ $pkg };
107         $out{ $pkg } = $msg;
108         print STDERR "\033[33;1madding: $pkg => $msg\033[0m\n";
109 }
110
111 sub poldek_cmd
112 {
113         my $cmd = shift;
114
115         warn "Poldek: $cmd\n";
116
117         my @cmd = (@poldek, "--shcmd=".$cmd);
118         open my $fh, '-|', @cmd or die "$!: @cmd";
119         my @read = <$fh>;
120         close $fh or die $!;
121
122         return wantarray ? @read : \@read;
123 }
124
125 my $check_ac = 0;
126 my $check_config_log = undef;
127
128 my %checked_files;
129 sub poldek_file
130 {
131         my @files;
132         foreach ( @_ ) {
133                 next if $checked_files{ $_ };
134                 $checked_files{ $_ } = 1;
135                 push @files, $_;
136         }
137         return unless @files;
138
139         my $search = join "; ", map "search -f $_", @files;
140         warn "Reason: $reason\n";
141         my @read = poldek_cmd( $search );
142
143         local $_;
144         my @found;
145         while ( $_ = shift @read ) {
146                 if ( /(\d+) package\(s\) found:$/ ) {
147                         foreach my $i ( 1..$1 ) {
148                                 $_ = shift @read;
149                                 chomp;
150                                 $_ =~ /^(.*)-.*?-.*?$/;
151                                 push @found, $1;
152                         }
153                 }
154         }
155
156         return unless @found;
157
158         my $found = $found[0];
159         if ( @found > 1 ) {
160                 my $i = 0.0;
161                 my %pts = map { ( $_ => ( ($i += 0.001) + ( $preferred{ $_ } || 0 ) ) ) }
162                         reverse @found;
163                 my @pref = sort { $pts{$b} <=> $pts{$a} } @found;
164                 my $pref = join ", ", map "$_ => $pts{$_}", @pref;
165                 warn "Multiple found: $pref\n";
166                 $found = $pref[0];
167         }
168
169         $found = $translate{ $found } if $translate{ $found };
170
171         add_br( $found );
172 }
173
174 my $pkglist;
175 sub get_pkglist
176 {
177         my %pkglist;
178         my $read = poldek_cmd( "ls" );
179         foreach ( @$read ) {
180                 chomp;
181                 next unless /(\S+)-.*?-.*?\.[a-z0-9_]+$/;
182                 my $pkg = $1;
183                 $pkglist{ lc $pkg } = $pkg;
184         }
185         $pkglist = \%pkglist;
186 }
187
188 sub guess_package
189 {
190         my $origname = shift;
191         get_pkglist() unless $pkglist;
192         return unless defined $origname;
193         my $name = lc $origname;
194         my @try = (
195                 "lib$name-devel",
196                 "$name-devel",
197                 "$name",
198                 "lib$name-.*-devel",
199                 "$name-.*-devel",
200                 ".*-lib$name-devel",
201                 ".*-$name-devel",
202                 ".*-lib$name-.*-devel",
203                 ".*-$name-.*-devel",
204         );
205         my @select;
206         for my $k ( keys %$pkglist ) {
207                 if ( $k =~ /$name/ ) {
208                         push @select, $k;
209                 }
210         }
211         @select = sort @select;
212
213         foreach my $try ( @try ) {
214                 foreach my $pkg ( @select ) {
215                         if ( $pkg =~ /^$try$/ ) {
216                                 warn "guessed: $origname => $pkglist->{ $pkg }\n";
217                                 return $pkglist->{ $pkg };
218                         }
219                 }
220         }
221         warn "$origname not guessed\n";
222         return undef;
223 }
224
225 start_check:
226
227 my %checked;
228 my $cmake_get_call = 0;
229 my $cmake_pkg_list = 0;
230 my $py_ver = undef;
231 while ( $_ = shift @lines ) {
232         chomp;
233         #next if $checked{ $_ };
234         #$checked{ $_ } = 1;
235
236         # try to extract current python version from setup.py run
237         if (m{^copying .+ -> build-(\d+)/lib/}) {
238                 $py_ver = $1;
239                 warn "py_ver set to '$py_ver'\n";
240         }
241
242         $reason = $_;
243         if ( /^\S+: (\S+): (?:Command )?not found$/ or /.*configure\[\d+\]: (\S+): not found$/
244                         or m{which: no (\S+) in \(.*/bin.*\)}
245                         or m{\S+: (\S+): command not found$}
246                         or m{(?:/usr/bin/)?env: (\S+): No such file or directory}
247                         or m{flock: (\S+): No such file or directory}
248                         or m{Can't exec "(\S+)": No such file or directory} ) {
249                 my $exec = $1;
250                 $exec = $1 if $exec =~ m{^"(.*)"$};
251                 next if $skip{ $exec };
252                 warn "Looking for executable $exec\n";
253                 if ( $exec =~ m#^/# ) {
254                         poldek_file( $exec );
255                 }
256                 poldek_file( "/usr/bin/$exec", "/bin/$exec" );
257         }
258
259         if ( /\S+\.[ch](?:pp|xx|c)?:\d+:\d+: error: (\S+): No such file or directory$/ or
260                 /\S+\.[ch](?:pp|xx|c)?:\d+:\d+: fatal error: (\S+): No such file or directory$/ or
261                 /Can't find the '(\S+\.h)'? header/
262         ) {
263                 my $h = $1;
264                 warn "Looking for C(++) header $h\n";
265                 poldek_file( "/usr/include*/$h" );
266         }
267
268         if (m{^ImportError: No module named (\S+)$}
269                 or m{^ERROR: Cannot find .+: No module named (\S+)$}
270                 or m{^ERROR: Failed to import the ".+" module: No module named (\S+)$}
271                 or m{^distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse\('([^'>=]+).*'\)}
272                 or                           m{^error: Could not find suitable distribution for Requirement.parse\('([^'>=]+).*'\)}
273                 or m{^Couldn't find index page for '(\S+)'}
274                 ) {
275                 my $mod = $1;
276                 $mod =~ s#\.#/#g;
277                 warn "Looking for Python$py_ver module $mod\n";
278                 poldek_file(
279                                 "/usr/share/python$py_ver*/site-packages/$mod/__init__.py*",
280                                 "/usr/share/python$py_ver*/$mod/__init__.py*",
281                                 "/usr/share/python$py_ver*/site-packages/$mod.py*",
282                                 "/usr/share/python$py_ver*/$mod.py*",
283                                 "/usr/lib*/python$py_ver*/site-packages/$mod/__init__.py*",
284                                 "/usr/lib*/python$py_ver*/$mod/__init__.py*",
285                                 "/usr/lib*/python$py_ver*/site-packages/$mod.py*",
286                                 "/usr/lib*/python$py_ver*/$mod.py*",
287                                 "/usr/lib*/python$py_ver*/site-packages/_$mod.so",
288                                 "/usr/lib*/python$py_ver*/_$mod.so",
289                                 "/usr/lib*/python$py_ver*/site-packages/$mod.so",
290                                 "/usr/lib*/python$py_ver*/$mod.so",
291                 );
292         }
293
294         if (
295                 m{^-- Could NOT find Sphinx \(missing:  SPHINX_EXECUTABLE\)}
296         ) {
297                 add_br("sphinx-pdg");
298                 next;
299         }
300
301         if (
302                 m{^You need to install the (\S+) module} or
303                 m{\*\*\*Error\*\*\*: You must have (\S+) >= (\S+) installed}
304         ) {
305                 add_br($1);
306                 next;
307         }
308
309         if (
310                 m{^cannot load such file -- (\S+)} or
311                 m{in `require': cannot load such file -- (\S+) \(LoadError\)}
312         ) {
313                 my $mod = $1;
314                 warn "Looking for ruby module $mod\n";
315                 poldek_file(
316                         "/usr/share/ruby/*/$mod.rb",
317                         "/usr/share/ruby/vendor_ruby/*/$mod.rb",
318                         "/usr/lib64/ruby/vendor_ruby/*/$mod.so",
319                 );
320         }
321
322         if ( /configure(?:\.in|\.ac)?:\d+: error: possibly undefined macro: (\S+)/
323                         or m{configure(?:\.in|\.ac)?:\d+: error: m4 macro `(\S+)' is not defined}
324                         or m{warning: macro `(\S+)' not found in library} ) {
325                 my $macro = $1;
326                 warn "Looking for autotools macro $macro\n";
327                 if ( my $br = $ac2br{ $macro } ) {
328                         add_br( $br );
329                         next;
330                 } else {
331                         $check_ac = 1;
332                 }
333         }
334         if ( /^No package '(\S+)' found$/ or
335                         /Package (\S+) was not found in the pkg-config search path/
336                                 or m{None of the required '(\S+?)(?:[<>=].*)?' found}
337                                 or m{--\s+package '(\S+?)(?:[<>=].*)?' not found}
338                                 or m{ERROR: cannot find a valid pkg-config package for \['(\S+?)(?:[<>=].*)?'\]}
339                 ) {
340                 my $pkg = $1;
341                 warn "Looking for package $pkg\n";
342                 poldek_file( "/usr/lib*/pkgconfig/$pkg.pc", "/usr/share/pkgconfig/$pkg.pc" );
343         }
344
345         if (/^ocamlfind: Package `(\S+)' not found - required by/
346                 or m{Camlp4: Uncaught exception: DynLoader.Error \("(\S+)", "file not found in path"\)}
347                 ) {
348                 my $pkg = $1;
349                 warn "Looking for ocaml package $pkg\n";
350                 poldek_file( "/usr/lib*/ocaml/*/$pkg.a", "/usr/lib*/ocaml/*/$pkg");
351         }
352
353         if ( m{^cp: cannot stat `(/.*)': No such file or directory$} ) {
354                 my $f = $1;
355                 warn "Looking for file $f\n";
356                 poldek_file( $f );
357         }
358
359         if ( m{ERROR: Could not find KDE4 (kde4-config)}) {
360                 my $f = "/usr/bin/$1";
361                 warn "Looking for file $f\n";
362                 poldek_file( $f );
363         }
364
365         if (m{Ragel State Machine Compiler not found}) {
366                 add_br( "ragel" );
367                 next;
368         }
369
370         if (m{ERROR: CMake is required to build}) {
371                 add_br("cmake");
372                 next;
373         }
374
375         # lucky guessing
376         if (m{'yum install (\S+)'}) {
377                 add_br($1);
378                 next;
379         }
380
381         if ( m{^find-lang.sh: Error: international files not found for '}
382                         or m{ gettext tools not found}
383                         ) {
384                 add_br( "gettext-tools" );
385                 next;
386         }
387
388         if ( m{ pkg-config .*not .*found}
389                 or m{^checking for pkg-config\.\.\. no}
390                 or m{^pkg-config unavailable, build terminated}
391                 or m{^\*\*\*Error\*\*\*: You must have pkg-config >= .* installed}
392                 or m{^-- Could NOT find PkgConfig \(missing:  PKG_CONFIG_EXECUTABLE\)}
393                 or m{exec: "pkg-config": executable file not found in \$PATH}
394         ) {
395                 add_br( "pkgconfig" );
396                 next;
397         }
398
399         if ( m{Can't locate (.*?\.pm) in \@INC} ) {
400                 my $mod = $1;
401                 warn "Looking for perl module $mod\n";
402                 poldek_file( "/usr/lib*/perl*/$mod", "/usr/share/perl*/$mod" );
403         }
404
405         if (
406                 m{^(?:/usr/bin/ld: )?cannot find -l(.*?)$}
407         ) {
408                 my $lib = $1;
409                 warn "Looking for library $lib\n";
410                 poldek_file( "/usr/lib64/lib$lib.so", "/usr/lib/lib$lib.so",
411                         "/usr/lib*/lib$lib.so" );
412         }
413
414         # full path to ldd files
415         if (
416                 m{^WARNING; can.*t resolve .* dependency: (.*?)$}
417         ) {
418                 my $lib = $1;
419                 warn "Looking for library '$lib'\n";
420                 poldek_file( "/usr/lib64/$lib", "/usr/lib/$lib", "/lib64/$lib", "/lib/$lib");
421         }
422
423         if ( m{^error: Couldn't exec (/\S+): No such file or directory$}
424                         or m{^Can't open perl script "(/\S+)": No such file or directory$}
425                         or m{unable to open (/\S+) \(No such file or directory\)$}
426                         or m{GConf-CRITICAL \*\*: No such file `(/.\S+?)'$}
427                         or m{make.*: \*\*\* No rule to make target `(/\S+)'}
428                         or m{g(?:cc|\+\+): (/\S+): No such file or directory$}
429                         or m{env: (/\S+): No such file or directory$}
430                         ) {
431                 my $file = $1;
432                 warn "Looking for file $file\n";
433                 poldek_file( $file );
434         }
435
436         if ( m{^ValueError: Couldn't find include '(.*\.gir)'} ) {
437                 my $file = $1;
438                 warn "Looking for gir file $file\n";
439                 poldek_file( "/usr/share/gir-1.0/" . $file );
440         }
441
442         if ( m{^error: Package `(\S+)' not found in specified Vala API directories or GObject-Introspection GIR directories}
443         ) {
444                 my $file = $1;
445                 warn "Looking for gir file $file\n";
446                 poldek_file( "/usr/share/vala/vapi/$file.vapi");
447         }
448
449         if ( m{failed.*http://www\.oasis-open\.org/docbook/xml/([\d\.]+/\S+\.dtd)} ) {
450                 my $dtd = $1;
451                 warn "Looking for docbook file $dtd\n";
452                 poldek_file( "/usr/share/sgml/docbook/xml-dtd-$dtd" );
453         }
454         if ( m{http://docbook.sourceforge.net/release/xsl/current/(\S+\.xsl)} ) {
455                 my $db = $1;
456                 next if m{^\s*(/usr/bin/)?xsltproc };
457                 warn "Looking for docbook file $db\n";
458                 poldek_file( "/usr/share/sgml/*/$db" );
459         }
460         if (m{Could not find HTML docbook.xsl}) {
461                 add_br("docbook-style-xsl");
462         }
463
464         if ( m{LaTeX Error: File `(\S+)' not found} ) {
465                 my $tex = $1;
466                 warn "Looking for tex file $tex\n";
467                 poldek_file( "/usr/share/tex*/$tex" );
468         }
469         if ( m{mv: cannot move `\S+' to `(/var/lib/texmf.*?)':} ) {
470                 my $tex = $1;
471                 warn "Looking for tex file $tex\n";
472                 poldek_file( $tex );
473         }
474
475         if ( m{configure: error: C\+\+ preprocessor "/lib/cpp" fails sanity check} ) {
476                 add_br( "gcc-c++", "try: %undefine\t__cxx" );
477         }
478         if ( m{configure: error: C\+\+ compiler cannot create executables} ) {
479                 add_br( "libstdc++-devel", "maybe try: %undefine\t__cxx" );
480         }
481         if ( m{configure: error: XML::Parser perl module is required for intltool} ) {
482                 add_br( "perl-XML-Parser" );
483         }
484         if ( m{iconv: conversion from `\S+' is not supported} ) {
485                 add_br( "iconv" );
486         }
487
488         if (m{rst2man \(python-docutils\) is required to build man pages}) {
489                 add_br("docutils");
490         }
491
492         if ( m{ (\S+) does not appear in AM_CONDITIONAL$} ) {
493                 my $macro = $1;
494                 warn "Looking for autotools macro $macro\n";
495                 if ( my $br = $ac2br{ $macro } ) {
496                         add_br( $br );
497                         next;
498                 } else {
499                         $check_ac = 1;
500                 }
501         }
502
503         if ( m{configure\[\d+\]: syntax error: }
504                         or m{\./configure\[\d+\]: \S+_\S+: not found}
505                         or m{./configure\[\d+\]: .*unexpected}
506                         or m{does not appear in AM_CONDITIONAL$}
507                         ) {
508                 warn "Need to check configure source: $reason\n";
509                 $check_ac = 1;
510         }
511         if ( m{^configure: error:} ) {
512                 $check_config_log = 1 unless defined $check_config_log;
513         }
514
515         if ( m{^CMake (?:Error|Warning) at (?:\S+/)?(\S+?)\.cmake:(\d+) } ) {
516                 my ( $module, $line ) = ( lc $1, $2 );
517                 my $br;
518                 if ( $module eq "findqt4" ) {
519                         my $l = $lines[0];
520                         chomp $l;
521                         if ( $l =~ /qmake/ ) {
522                                 add_br( "qt4-qmake", $l );
523                         } elsif ( $l =~ /rcc/ ) {
524                                 add_br( "qt4-build", $l );
525                         } elsif ( $l =~ /Could NOT find (Qt\S+) header/ ) {
526                                 add_br( "$1-devel", $l );
527                         } else {
528                                 warn "unrecognized Qt requirement: $l\n";
529                         }
530                 } elsif ( $module eq "cmakedeterminecxxcompiler" ) {
531                         add_br( "libstdc++-devel",
532                                 '"try: -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER="%{__cc}"' );
533                 } elsif ( $br = $cmake2br{ $module . ":" . $line } ) {
534                         add_br( $br );
535                 } elsif ( $br = $cmake2br{ $module } ) {
536                         add_br( $br );
537                 } elsif ( $br = guess_package( $module =~ /find(.+)/ ) ) {
538                         add_br( $br );
539                 } else {
540                         $cmake_get_call = 1;
541                         warn "Unrecognized cmake error: $reason\n";
542                 }
543         }
544         if ( m{^\s*ERROR: (?:\S+/)?(\S+?\.cmake) not found} ) {
545                 my $cmake = $1;
546                 warn "Looking for cmake file: $cmake\n";
547                 poldek_file( "/usr/*/cmake/*/$cmake" )
548         }
549         if ( $cmake_get_call ) {
550                 if ( m{^\s*/\S+/(\S+)\.cmake:(\d+) } ) {
551                         my ( $module, $line ) = ( lc $1, $2 );
552                         my $br;
553                         if ( $br = $cmake2br{ $module . ":" . $line } ) {
554                                 add_br( $br );
555                                 $cmake_get_call = 0;
556                         } elsif ( $br = $cmake2br{ $module } ) {
557                                 add_br( $br );
558                                 $cmake_get_call = 0;
559                         } elsif ( $br = guess_package( $module =~ /find(.+)/ ) ) {
560                                 add_br( $br );
561                                 $cmake_get_call = 0;
562                         }
563                 } elsif (m{Can not use "(.+)" module which has not yet been found}
564                         or m{Could not find a package configuration file provided by "(.+)"}) {
565                         my $cmake = $1;
566
567                         warn "Looking for cmake file: $cmake\n";
568                         poldek_file(
569                                 "/usr/*/cmake/*/$cmake.cmake",
570                                 "/usr/*/cmake/*/${cmake}Config.cmake",
571                                 "/usr/*/cmake/*/${cmake}-config.cmake",
572                         );
573                         $cmake_get_call = 0;
574                 }
575         }
576         if ( m{^-- WARNING: you are using the obsolete 'PKGCONFIG' macro} ) {
577                 add_br( "pkgconfig" );
578         }
579         if ( m{QT_(QT\S+)_LIBRARY \(ADVANCED\)}
580                         or m{X11_(\S+)_LIB \(ADVANCED\)}
581                         or m{Qt (\S+) library not found} ) {
582                 my $find = $1;
583                 my $pkg = guess_package( $find );
584                 if ( $pkg ) {
585                         add_br( $pkg );
586                 } else {
587                         warn "Cannot quess qt package: $find\n";
588                 }
589         }
590
591         if ( m{Unable to find a javac compiler;$} ) {
592                 add_br( "jdk" );
593         }
594         if ( m{Could not find (\S+) Java extension for this JVM$} ) {
595                 my $jar = $1;
596                 warn "Looking for jar file: $jar\n";
597                 poldek_file( "/usr/share/java/$jar.jar", "*/$jar.jar" )
598         }
599
600
601         if ( m{^-- The following OPTIONAL packages could NOT be located on your system} ) {
602                 $cmake_pkg_list = 1;
603         }
604         if ( $cmake_pkg_list ) {
605                 if ( /\s+\* (\S+) / ) {
606                         my $find = $1;
607                         my $pkg = guess_package( $find );
608                         if ( $pkg ) {
609                                 add_br( $pkg );
610                         } else {
611                                 warn "Cannot quess optional package: $find\n";
612                         }
613                 } elsif ( /^\s*$/ ) {
614                         $cmake_pkg_list = 0;
615                 }
616         }
617
618         # CMake Error at CMakeLists.txt:86 (find_package):
619         #  By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
620         #  project has asked CMake to find a package configuration file provided by
621         #  "Qt5LinguistTools", but CMake did not find one.
622         #
623         #  Could not find a package configuration file provided by "Qt5LinguistTools"
624         #  with any of the following names:
625         #
626         #    Qt5LinguistToolsConfig.cmake
627         #    qt5linguisttools-config.cmake
628         #
629         #  Add the installation prefix of "Qt5LinguistTools" to CMAKE_PREFIX_PATH or
630         #  set "Qt5LinguistTools_DIR" to a directory containing one of the above
631         #  files.  If "Qt5LinguistTools" provides a separate development package or
632         #  SDK, be sure it has been installed.
633         # ---
634         #CMake Warning at /usr/lib64/cmake/Qt5Core/Qt5CoreMacros.cmake:273 (find_package):
635         #  Could not find a package configuration file provided by "Qt5Network" with
636         #  any of the following names:
637         #
638         #    Qt5NetworkConfig.cmake
639         #    qt5network-config.cmake
640         #
641         #  Add the installation prefix of "Qt5Network" to CMAKE_PREFIX_PATH or set
642         #  "Qt5Network_DIR" to a directory containing one of the above files.  If
643         #  "Qt5Network" provides a separate development package or SDK, be sure it has
644         #  been installed.
645         #   Can not use "Network" module which has not yet been found.
646
647         if (m{By not providing "Find(.+)\.cmake" in CMAKE_MODULE_PATH}
648                 or m{Could not find a package configuration file provided by "(.+)"
649                 }) {
650                 my $cmake = $1;
651                 my $lcmake = lc $cmake;
652
653                 warn "Looking for cmake file: $cmake\n";
654                 poldek_file(
655                         "/usr/*/cmake/*/$cmake.cmake",
656                         "/usr/*/cmake/*/${cmake}Config.cmake",
657                         "/usr/*/cmake/*/${cmake}-config.cmake",
658                         "/usr/*/cmake/*/${lcmake}Config.cmake",
659                         "/usr/*/cmake/*/${lcmake}-config.cmake",
660                 )
661         }
662
663         if ( m{^configure:\d+: checking for (?:"(\S+)"|(\S+))$} ) {
664                 my $exec = $1 || $2;
665                 if ( @lines and $lines[0] =~ m{^configure:\d+: result: no$} ) {
666                         next if $skip{ $exec };
667                         warn "Looking for executable $exec\n";
668                         poldek_file( $exec ) if $exec =~ m#^/#;
669                         poldek_file( "/usr/bin/$exec", "/bin/$exec" );
670                 }
671         }
672
673
674         if (
675                 m{Could not find (\S+)}
676         ) {
677                 my $exec = $1;
678                 poldek_file("/usr/bin/$exec", "/bin/$exec" );
679         }
680 }
681
682
683
684 sub wanted
685 {
686         return unless /^configure(\.(?:ac|in|in\.in))?$/;
687         return unless -r;
688
689         warn "$File::Find::name\n";
690         open F_IN, "<", $_;
691         my $file = $_;
692         while ( <F_IN> ) {
693                 chomp;
694                 if ( m{^\s*([A-Za-z0-9_]+)\s*(\(.*)?$} ) {
695                         my $def = $1;
696                         if ( my $br = $ac2br{ $def } ) {
697                                 add_br( $br, "$file: $_" );
698                         } elsif ( $def !~ /^A[CM]_/ and $def =~ /^_?[A-Z]+_[A-Z_0-9a-z]+$/ ) {
699                                 #warn "Possible macro unrecognized: $def [[[$_]]]\n";
700                         }
701                 }
702         }
703         close F_IN;
704 }
705
706 use File::Find;
707 if ( $check_ac ) {
708         find( \&wanted, $builddir );
709 }
710
711 sub wanted2
712 {
713         return unless /^config\.log$/;
714         return unless -r;
715
716         warn "$File::Find::name\n";
717         open F_IN, "<", $_;
718         push @lines, <F_IN>;
719         close F_IN;
720 }
721
722 if ( $check_config_log ) {
723         $check_config_log = 0;
724         find( \&wanted2, $builddir );
725         goto start_check if @lines;
726 }
727
728 foreach my $pkg ( sort keys %out ) {
729         print "$pkg -- $out{$pkg}\n";
730 }
731 # vim: ts=4 sw=4
This page took 0.129703 seconds and 3 git commands to generate.