Commits

Ville Suoranta authored 2de34a7b979 Merge
Pull request #148: CAS-13857

Merge in CASA/casa-pkg from CAS-13857 to master * commit '1b671450056e93185d9cfa126d90dd58b234f531': Add Rocky to packaging variants Add EL8 version detection to make-app Add /opt/casa/03 prefix for openmpi on ML2014 Fix previous commit Remove VERSION file dependency in make-dmg Remove asdmstman references Remove libiconv update from Mac adjustments Add macos12 to packaging Revert "Add /opt/casa/0x to prefix path" Add /opt/casa/0x to prefix path Remove showtablelock from the template Remove the "find prefix" functionality and include openmpi only. Revert "Remove legacy build" Remove legacy build
No tags

packaging/scripts/make-app

Modified
182 182 ## fill in workspace references...
183 183 $app_dir = $distribution_directory;
184 184 print "Appdir: $app_dir\n";
185 185 fill_stubs( $app_dir, \&copy_file, "filling explicit stubs" );
186 186
187 187 ## scan for dependencies and discover prefix...
188 188 scan_application( $app_dir, "initial scan of application..." );
189 189
190 190 unless ( $quiet ) { print "\nfound load-time dependencies in ", scalar(keys %libraries_dirs)," directories...\n"; }
191 191
192 -@prefix = prefix( );
192 +@prefix = ("/usr/lib64/openmpi/","/opt/casa/03");
193 +#= prefix( );
193 194 die "could not find prefix path..." unless scalar(@prefix) > 0;
194 195 unless ( $quiet ) { print "using library paths " . join(' ',@prefix) . "\n" }
195 196
196 197 # now that we have the prefix, scan the application again and
197 198 # fill in the stubs that depend on the prefix...
198 199 fill_stubs( $app_dir, \&copy_file, "filling prefix relative stubs..." );
199 200
200 201 ###
201 202 ### check to see if more than one version of python is referenced...
202 203 ###
241 242 }
242 243 }
243 244
244 245 unless( $quiet ) { print "copying dependencies to $library_destination ...\n" }
245 246
246 247 foreach $libdir ( keys %libraries_dirs ) {
247 248 my $ref = $libraries_dirs{$libdir};
248 249 ###
249 250 ### throw away dependencies to obvious system areas...
250 251 ###
251 - next if m|^/System| || m|^/usr/lib|;
252 + next if m|^/System| || m|^/usr/lib/|;
252 253 ###
253 254 ### copy over each dependency...
254 255 ###
255 256 foreach $dep ( keys %$ref ) {
256 257 my $destfile = $dep;
257 258 ###
258 259 ### stored frameworks look like:
259 260 ###
260 261 ### QtUiTools.framework/Versions/4/QtUiTools QtXml.framework/Versions/4/QtXml
261 262 ### QtCore.framework/Versions/4/QtCore QtDBus.framework/Versions/4/QtDBus
281 282 }
282 283 }
283 284 }
284 285 } until ( scalar(@scan_copies) == 0 );
285 286
286 287 unless( $quiet ) { print "resolving links to outside of application directory...\n" }
287 288 resolve_external_links( "$distribution_directory" );
288 289
289 290 adjust_runtime_paths( "$distribution_directory" );
290 291
291 -adjust_version_file( "$distribution_directory", fetch_version() );
292 +#adjust_version_file( "$distribution_directory", fetch_version() );
292 293 osx_specific_adjustments( "$distribution_directory" );
293 294 linux_specific_adjustments( "$distribution_directory" );
294 295
295 296 if ($extract_symbols){
296 297 process_debug_symbols("$distribution_directory", $version,$workspace);
297 298 }
298 299
299 300 create_revstate( $workspace, ($osname eq 'darwin' ? "$distribution_directory/Contents/Resources/revstate" : "$distribution_directory/.revstate" ) );
300 301
301 302 print "application creation complete: $distribution_directory\n";
811 812 ### $bash$
812 813 ###
813 814 ### initial 'libqsvgicon.dylib' dependency causes 'libqsvgicon.dylib' to
814 815 ### show up as the directory... throw this away...
815 816 ###
816 817 next if $osname eq "darwin" && m|$libname\s+|;
817 818 next if $osname eq "linux" && m|not found$|;
818 819 next if $osname eq "linux" && m|statically linked|;
819 820 ### some special libraries have no corresponding path:
820 821 ### linux-vdso.so.1 => (0x00007fffd1cfa000)
822 + next if $osname eq "linux" && m|.*linux-vdso.so.*|;
821 823 next if $osname eq "linux" && m|\s+\S+\s+=>\s+\(0x\S+\)$|;
822 824 next if m|\s+(?:\S+ => )?(\S+)| && exists $exclude{libroot($1)};
823 825 if ( $match && m|$match| && m|\s+(?:\S+ => )(\S+)| ) { print "<match:depend> $file [$1]\n" }
824 826 if ( m|^\s+(?:\S+ => )?(\S+?/Frameworks)| ||
825 827 #m|^\s+(?:\S+ => )?(\S+?/mac/build/Release)| ||
826 828 ($osname eq "darwin" && m|^\s+(?:\S+ => )?(\S+?/breakpad/breakpad-distro/src/client/mac/build/Release)|) ||
827 829 m|^\s+(?:\S+ => )?($workspace/$arch)| ||
828 830 m|^\s+(?:\S+ => )?(\S*?/lib)/| ||
829 831 m|^\s+(?:\S+ => )?(\S*?/lib64)/| ||
830 832 m|^\s+(?:\S+ => )?(\S+)| ) {
1518 1520 return @substrings;
1519 1521 }
1520 1522
1521 1523 sub osx_specific_adjustments {
1522 1524
1523 1525 if ( $osname ne "darwin" ) { return }
1524 1526
1525 1527 my $appdir = shift( @_ );
1526 1528 my @libraries = ( );
1527 1529 my @executables = ( );
1530 +
1528 1531 my @libiconv_path = ( );
1529 1532 my %libiconv_refs = ( );
1530 1533 my $iconv_func = sub { my $file = $_;
1531 1534 my $type = resolve_file_type($file);
1532 1535 if ( m|^libiconv| ) {
1533 1536 @libiconv_path = ( $File::Find::dir, $file );
1534 1537 }
1535 1538 if ( $type eq 'exe' ||
1536 1539 $type eq 'lib' ||
1537 1540 $type eq 'ldso' ) {
1544 1547 close( INFO );
1545 1548 }
1546 1549 if ( $type eq 'lib' ) {
1547 1550 push( @libraries, "$File::Find::dir/$file" );
1548 1551 } elsif ( $type eq 'exe' ) {
1549 1552 push( @executables, "$File::Find::dir/$file" );
1550 1553 }
1551 1554 };
1552 1555 unless( $quiet ) { print "scanning application for libiconv references...\n" }
1553 1556 find( { wanted => $iconv_func }, $appdir );
1557 +=pod
1554 1558 unless( scalar( @libiconv_path ) == 2 ) { die "could not find libiconv within $appdir" }
1555 1559 my $oldiconv = $libiconv_path[1];
1556 1560 my $newiconv = $oldiconv;
1557 1561 $newiconv =~ s|libiconv|libcasa_iconv|;
1558 1562
1559 1563 unless( $quiet ) { print "\tupdating libiconv references...\n" }
1560 1564 foreach $lib ( keys %libiconv_refs ) {
1561 1565 my $oldname = $libiconv_refs{$lib};
1562 1566 my $newname = $oldname;
1563 1567 my $printed_label = '';
1566 1570 open( CHG, "install_name_tool -change \"$oldname\" \"$newname\" \"$lib\" 2>&1 |" );
1567 1571 foreach ( <CHG> ) {
1568 1572 unless ( $printed_label ) {
1569 1573 unless( $quiet ) { print "\t\t$lib\n" }
1570 1574 $printed_label='yes';
1571 1575 }
1572 1576 print "\t\t>\t$_";
1573 1577 }
1574 1578 close( CHG );
1575 1579 }
1576 -
1580 +=cut
1577 1581 unless( $quiet ) { print "\tadjusting names of all shared libraries...\n" }
1578 1582 my @python_libraries = ( );
1579 1583 foreach $lib ( @libraries ) {
1580 1584 if ( -l $lib && basename($lib) eq 'Python' ) {
1581 1585 push( @python_libraries, $lib );
1582 1586 }
1583 1587
1584 1588 if ( -l $lib ) { next } ### avoid renaming a library
1585 1589 ### based upon links which point to it
1586 1590 my $newname = basename($lib);
1623 1627 print " original reference $libref\n";
1624 1628 open( CHG, "install_name_tool -change \"$libref\" \"$relpath\" \"$e\" 2>&1 |" );
1625 1629 foreach ( <CHG> ) {
1626 1630 print "\t\t>\t$_";
1627 1631 }
1628 1632 close( CHG );
1629 1633 }
1630 1634 }
1631 1635 }
1632 1636 =cut
1637 +=pod
1633 1638 unless( $quiet ) { print "\trenaming $libiconv_path[1] to $newiconv\n" }
1634 1639 rename( "$libiconv_path[0]/$libiconv_path[1]", "$libiconv_path[0]/$newiconv" );
1635 1640 unless( $quiet ) { print "\tchanging id to \"$newiconv\"...\n" }
1636 1641 open( CHG, "install_name_tool -id \"$newiconv\" \"$libiconv_path[0]/$newiconv\" 2>&1 |" );
1637 1642 foreach ( <CHG> ) {
1638 1643 print "\t\t>\t$_";
1639 1644 }
1640 1645 close( CHG );
1641 1646
1642 1647 unless( $quiet ) { print "scanning application for asdmstman plugin...\n" }
1643 1648 my $orig_dir = getcwd( );
1644 1649 chdir( "$appdir/Contents/Plugins/casa" ) or die "could not change to the plugin directory ($appdir/Contents/Plugins/casa): $!";
1645 1650 my $target = '';
1646 1651 my $find_asdmstman = sub { if ( -f $_ && m|^libasdmstman.*\.dylib$| ) { $target = "$File::Find::dir/$_" } };
1647 1652 find( { wanted => $find_asdmstman }, "../.." );
1648 1653 unless( $target ) { die "failed to find asdmstman plugin" }
1649 1654 unless( $quiet ) { print "\tcreating symlink to $target in Plugins...\n" }
1650 1655 symlink( $target, "libasdmstman.dylib" );
1651 1656 chdir( $orig_dir );
1652 -
1657 +=cut
1653 1658 ##
1654 1659 ## set version in Info.plist
1655 1660 ##
1656 1661 $version = fetch_version( );
1657 1662 unless( $quiet ) { print "setting version number to $version in Info.plist...\n" }
1658 1663 if ( -f "$appdir/Contents/Info.plist" ) {
1659 1664 open( my $in, "< $appdir/Contents/Info.plist" );
1660 1665 my @contents = map { s|\@\@VERSION\@\@|$version|g; $_ } <$in>;
1661 1666 close($in);
1662 1667 open( my $out, "> $appdir/Contents/Info.plist" );
1663 1668 print $out @contents;
1664 1669 close($out);
1665 1670 }
1666 1671
1667 - osx_inject_pipeline( );
1672 + #osx_inject_pipeline( );
1668 1673
1669 1674 # libcasa_meas.dylib and libcasa_derivedmscal.dylib are a special case as
1670 1675 # they are only via casacore facilities and no other library depends on them.
1671 1676 # Including them in the template includes both the versioned and versioned
1672 1677 # library on Mac, but only the versionless files on Linux. Removing the versioned files
1673 1678 # on Mac for the sake of consistency
1674 - print "Removing versioned libcasa_meas.dylib and libcasa_derivedmscal.dylib\n";
1675 - unlink glob "$appdir/Contents/$arch/lib/libcasa_meas.*.dylib";
1676 - unlink glob "$appdir/Contents/$arch/lib/libcasa_derivedmscal.*.dylib";
1679 + #print "Removing versioned libcasa_meas.dylib and libcasa_derivedmscal.dylib\n";
1680 + #unlink glob "$appdir/Contents/$arch/lib/libcasa_meas.*.dylib";
1681 + #unlink glob "$appdir/Contents/$arch/lib/libcasa_derivedmscal.*.dylib";
1677 1682
1678 1683
1679 1684
1680 1685 }
1681 1686
1682 1687 sub osx_inject_pipeline {
1683 1688 print "Copying pipeline\n";
1684 1689 $pipelineDirPrefix="Pipeline";
1685 1690 # List files in the workspace
1686 1691 opendir (DIR, $workspace) or die $!;
1880 1885 close( $fh );
1881 1886 }
1882 1887
1883 1888 sub adjust_version_file {
1884 1889 ## this script is now used to create a viewer distribution too...
1885 1890 if ( $distro_name ne 'casa' ) { return }
1886 1891 my $appdir = shift(@_);
1887 1892 my $version = shift(@_);
1888 1893 unless ( $version ) { die "could not find casa revision" }
1889 1894 unless ( -d $appdir ) { die "app directory ($appdir) does not exist" }
1890 - unless ( -f "$version_file" ) { die "version file ($version_file) does not exist" }
1895 + #unless ( -f "$version_file" ) { die "version file ($version_file) does not exist" }
1891 1896 my @output = ( );
1892 1897 open( my $VER, "< $version_file" );
1893 1898 foreach ( <$VER> ) {
1894 1899 s|\$.*?\$|$version|;
1895 1900 push( @output, $_ );
1896 1901 }
1897 1902 close( $VER );
1898 1903 open( my $VER, "> $version_file" );
1899 1904 foreach $line ( @output ) {
1900 1905 print $VER "$line";
1993 1998 } elsif ( $rhver =~ m/^Scientific Linux SL release 6.*/ ) {
1994 1999 return "el6";
1995 2000 } elsif ( $rhver =~ m/^CentOS release 6.*/ ) {
1996 2001 return "el6";
1997 2002 } elsif ( $rhver =~ m/^Red Hat Enterprise.*release 7/ ) {
1998 2003 return "el7";
1999 2004 } elsif ( $rhver =~ m/^Scientific Linux SL release 7.*/ ) {
2000 2005 return "el7";
2001 2006 } elsif ( $rhver =~ m/^CentOS Linux release 7.*/ ) {
2002 2007 return "el7";
2008 + } elsif ( $rhver =~ m/^Red Hat Enterprise.*release 8.*/ ) {
2009 + return "el8";
2010 + } elsif ( $rhver =~ m/^Alma.*/ ) {
2011 + return "el8";
2012 + } elsif ( $rhver =~ m/^Rocky.*/ ) {
2013 + return "el8";
2003 2014 } elsif ( $rhver =~ m/^Red Hat Enterprise/ ) {
2004 2015 die "unknown enterprise version: $rhver";
2005 2016 } elsif ( $rhver =~ m/^Red Hat Linux release ([0-9.]+)/ ) {
2006 2017 die "we no longer support: $rhver";
2007 2018 } elsif ( $rhver =~ m/^Mandrake Linux/ ) {
2008 2019 die "we don't yet support mandrake";
2009 2020 } else {
2010 2021 die "cannot understand version string: $rhver";
2011 2022 }
2012 2023

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut