Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path relocation for Perl in the qtw installer templat #2

Open
MaxPerl opened this issue Jun 11, 2017 · 1 comment
Open

Path relocation for Perl in the qtw installer templat #2

MaxPerl opened this issue Jun 11, 2017 · 1 comment

Comments

@MaxPerl
Copy link
Owner

MaxPerl commented Jun 11, 2017

In the MINGW PKBUILD file for the perl mingw packages is done a path relocation after installation. The relevant lines are:

    # Path relocation. This is done by replacing hard-coded paths with relocate
    # patterns that will be resolved on package installation. The HTML
    # documentation is handled with a patch, the rest is handled below.

    local root_pattern
    local root_pattern_double
    local pkgdir_pattern
    local pkgdir_pattern_double

    root_pattern=$(cygpath -w /)
    root_pattern="${root_pattern%\\}"
    root_pattern="${root_pattern//\\/\\\\}"
    root_pattern_double="${root_pattern//\\\\/\\\\\\\\}"
    pkgdir_pattern=$(cygpath -w "${pkgdir}")
    pkgdir_pattern="${pkgdir_pattern//\\/\\\\}"
    pkgdir_pattern_double="${pkgdir_pattern//\\\\/\\\\\\\\}"

    msg2 "Creating relocate patterns for:"
    printf "     ${root_pattern}\n"
    printf "     ${root_pattern_double}\n"
    printf "     ${pkgdir_pattern}\n"
    printf "     ${pkgdir_pattern_double}\n"

    sed -i "s/${pkgdir_pattern}/@PERL_RELOCATE@/g"                lib/perl5/core_perl/.packlist
    sed -i "s/${pkgdir_pattern_double}/@PERL_RELOCATE_DOUBLE@/g"  lib/perl5/core_perl/CORE/config.h
    sed -i "s/${root_pattern}/@PERL_RELOCATE@/g"                  lib/perl5/core_perl/Config.pm
    sed -i "s/${root_pattern_double}/@PERL_RELOCATE_DOUBLE@/g"    lib/perl5/core_perl/Config.pm
    sed -i "s/${pkgdir_pattern_double}/@PERL_RELOCATE_DOUBLE@/g"  lib/perl5/core_perl/Config.pm
    sed -i "s/${root_pattern}/@PERL_RELOCATE@/g"                  lib/perl5/core_perl/Config_heavy.pl
    sed -i "s/${root_pattern_double}/@PERL_RELOCATE_DOUBLE@/g"    lib/perl5/core_perl/Config_heavy.pl
    sed -i "s/${pkgdir_pattern}/@PERL_RELOCATE@/g"                lib/perl5/core_perl/Config_heavy.pl

    for script in \
        c2ph corelist cpan enc2xs encguess exetype h2ph h2xs instmodsh json_pp libnetcfg perlbug  \
        perldoc perlglob perlivp perlthanks piconv pl2bat pl2pm pod2html pod2man pod2text pod2usage podchecker \
        podselect prove pstruct ptar ptardiff ptargrep runperl search shasum splain xsubpp zipdetails ; do
        sed -i "s/${pkgdir_pattern}/@PERL_RELOCATE@/g" bin/${script}
    done

At the moment I don't see that this is really necessary. Especially all perl modules are found without patching Config.PM etc.. But perhaps, if your application uses File::ShareDir or similar, this could make some troubles (even if I still havn't tested, whether this is really necessary!!!). So we should relocate perl after installing within the javascript file qt-ifw/packages/org.MyApp.root.base/installscript.js, too. This issue report is as a reminder, that I want to implement perl relocation in the next version...

@MaxPerl
Copy link
Owner Author

MaxPerl commented Jul 8, 2017

Good news: http://www.maximilianlika.de/static/caecilia/Caecilia-x86_64-0.08.exe was built with File::ShareDir. No problem here, especially path relocation was not necessary! So this issue seems not to be an issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant