[153640] trunk/dports/perl/p5-text-bibtex

mcalhoun at macports.org mcalhoun at macports.org
Thu Oct 6 17:36:10 CEST 2016


Revision: 153640
          https://trac.macports.org/changeset/153640
Author:   mcalhoun at macports.org
Date:     2016-10-06 08:36:10 -0700 (Thu, 06 Oct 2016)
Log Message:
-----------
p5-text-bibtex: allow installer script to modify its own files as it intends

Modified Paths:
--------------
    trunk/dports/perl/p5-text-bibtex/Portfile

Added Paths:
-----------
    trunk/dports/perl/p5-text-bibtex/files/
    trunk/dports/perl/p5-text-bibtex/files/patch-permissions.diff

Modified: trunk/dports/perl/p5-text-bibtex/Portfile
===================================================================
--- trunk/dports/perl/p5-text-bibtex/Portfile	2016-10-06 14:21:59 UTC (rev 153639)
+++ trunk/dports/perl/p5-text-bibtex/Portfile	2016-10-06 15:36:10 UTC (rev 153640)
@@ -6,6 +6,7 @@
 
 perl5.branches      5.22 5.24
 perl5.setup         Text-BibTeX 0.77
+revision            1
 platforms           darwin
 maintainers         nomaintainer
 license             {Artistic-1 GPL}
@@ -29,4 +30,12 @@
                     port:p${perl5.major}-unicode-normalize
 
     perl5.use_module_build
+
+    # in inc/MyBuilder.pm, copy_if_modified is called on binaries and libraries
+    # the libraries and binaries are then modified (install names changed)
+    # copy_if_modified, however, sets all files as read only
+    #    see http://search.cpan.org/~leont/Module-Build-0.4220/lib/Module/Build/API.pod#copy_if_modified
+    #    see https://github.com/Perl-Toolchain-Gang/Module-Build/blob/master/lib/Module/Build/Base.pm#L5600
+    # patch temporarily makes the files writable before changing them
+    patchfiles-append patch-permissions.diff
 }

Added: trunk/dports/perl/p5-text-bibtex/files/patch-permissions.diff
===================================================================
--- trunk/dports/perl/p5-text-bibtex/files/patch-permissions.diff	                        (rev 0)
+++ trunk/dports/perl/p5-text-bibtex/files/patch-permissions.diff	2016-10-06 15:36:10 UTC (rev 153640)
@@ -0,0 +1,27 @@
+--- inc/MyBuilder.pm.orig	2016-09-20 09:41:51.000000000 -0700
++++ inc/MyBuilder.pm	2016-10-06 04:48:58.000000000 -0700
+@@ -33,15 +33,24 @@
+     	$libpath = catfile($libpath, "libbtparse$LIBEXT");
+ 
+     	# do it for binaries as well.
++	my $macports_patch_save_mode = (stat("./blib/usrlib/libbtparse.dylib"))[2] & 07777;
++	chmod( $macports_patch_save_mode | oct(200), "./blib/usrlib/libbtparse.dylib" );
+     	`install_name_tool -id "$libpath" ./blib/usrlib/libbtparse.dylib`;
++	chmod( $macports_patch_save_mode, "./blib/usrlib/libbtparse.dylib" );
+         # binries
+         my $libfile = "btparse/src/libbtparse$LIBEXT";
+         my $abs_path = abs_path($libfile);
+         foreach my $bin (@BINARIES) {
++	    my $macports_patch_save_mode = (stat("./blib/bin/$bin$EXEEXT"))[2] & 07777;
++	    chmod( $macports_patch_save_mode | oct(200), "./blib/bin/$bin$EXEEXT" );
+             `install_name_tool -change "$abs_path" "$libpath" ./blib/bin/$bin$EXEEXT`;
++	    chmod( $macports_patch_save_mode, "./blib/bin/$bin$EXEEXT" );
+         }
+         my $bundle = $self->notes("bundle");
++	my $macports_patch_save_mode = (stat($bundle))[2] & 07777;
++	chmod( $macports_patch_save_mode | oct(200), $bundle );
+         `install_name_tool -change "$abs_path" "$libpath" $bundle`;
++	chmod( $macports_patch_save_mode, $bundle );
+  	}
+ 
+     if ($^O =~ /cygwin/i) { # cygwin uses windows lib searching (PATH instead of LD_LIBRARY_PATH)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-changes/attachments/20161006/5b7eb5f6/attachment-0002.html>


More information about the macports-changes mailing list