--- 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)
