Git Product home page Git Product logo

Comments (2)

NickNick avatar NickNick commented on September 24, 2024

I made a find_lib function which, unsurprisingly, finds a lib. Still not sure where OSX looks, but in my case it found the specific lib in /usr/local/lib (since it was the only version I had).

Here's the how I use it, and the sub itself:

        } elsif(is_relative_path($dylib)) {
            my $found_it = find_lib($dylib);
            if($found_it){
                $dylib = $found_it;
            } else {
                warn "${spaces}Failed to find $dylib, update sub find_lib to find it!";
            }
        }

        my ($newpath, $newpath_relative) = copy_lib($dylib, $spaces);
sub find_lib {
    my ($lib) = @_;
    foreach(qw(/usr/local/lib)) {
        my $full_path = join "/", $_, $lib;
        if(-f $full_path){
            return $full_path;
        }
    }

    return 0;
}

from make_independent.

NickNick avatar NickNick commented on September 24, 2024

Our highly caffeinated monkeys found out it was the right sub at the wrong location. In exchange for 2 bananas they gave me a better place to call find_lib, namely in copy_lib. This way, the correct names are passed into fix_names, making sure it'll look next to the binary for the libraries.

sub copy_lib {
    my ($lib, $s) = @_;
    if(is_relative_path($lib)) {
        my $found_it = find_lib($lib);
        if($found_it){
            $lib = $found_it;
        } else {
            warn "${s}Failed to find $lib, update sub find_lib to find it (and then run me again!)";
        }
    }
    my $basename = basename($lib);
    my $newpath = "$libdir/$basename";
    my $int_path = "\@rpath/$basename";
    my $relative_path = "$basename";
    if(!-f $newpath) {
        print "${s}Copy $lib into app\n";
        unless($DRYRUN) {
            copy($lib, $newpath) or die "${s}Failed to copy: $!\n";
        }
    }

    return ($int_path, $relative_path);
}

Of course, this removes the need for the check if $dylib is a relative path in sub fix, so just remove that condition.

from make_independent.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.