@@ -49,6 +49,7 @@ my $skip_manifest = env_option 'PSASS_SKIP_MANIFEST', 0;
49
49
my $skip_version = env_option ' PSASS_SKIP_VERSION' , 0;
50
50
my $update_deps = env_option ' PSASS_UPDATE_DEPS' , 0;
51
51
my $checkout_deps = env_option ' PSASS_CHECKOUT_DEPS' , 0;
52
+ my $patch_gcc44 = env_option ' PSASS_PATCH_GCC44' , 0;
52
53
my $skip_git = env_option ' PSASS_SKIP_GIT' , 0;
53
54
54
55
# arrays for various switches
@@ -80,6 +81,7 @@ sub help
80
81
print " --checkout-deps Checkout submodules at linked commit (needs git repo)\n " ;
81
82
print " --get-versions Show versions of all perl package (.pm) files\n " ;
82
83
print " --set-versions Set versions of all perl package (.pm) files\n " ;
84
+ print " --patch-gcc44 Patch libsass for gcc44 compatibility\n " ;
83
85
print " --skip-git Do not try to use anything git related\n " ;
84
86
print " \n " ;
85
87
print " You may use environment variables to set any option\n " ;
@@ -161,6 +163,7 @@ GetOptions(
161
163
' --library!' => \$install_library ,
162
164
' --compiler:s' => \$compiler ,
163
165
' --profiling!' => \$profiling ,
166
+ ' --patch-gcc44' => \$patch_gcc44 ,
164
167
' --skip-git!' => \$skip_git ,
165
168
' --skip-version!' => \$skip_version ,
166
169
' --skip-manifest!' => \$skip_manifest ,
@@ -311,6 +314,24 @@ if ($install_sassc) {
311
314
}
312
315
}
313
316
317
+ # ###############################################################################
318
+ # patch sources
319
+ # ###############################################################################
320
+
321
+ if ($patch_gcc44 ) {
322
+ my $cwd = Cwd::getcwd;
323
+ chdir (" libsass" ) or die " pushd: $! " ;
324
+ print " Patching libsass source for gcc compatibility\n " ;
325
+ foreach my $patch (sort glob (" ../patches/*.patch" )) {
326
+ print " applying $patch \n " ;
327
+ # system "git", "am", "--abort";
328
+ system " git" , " am" , " --3way" , " --keep-cr" ,
329
+ " --ignore-space-change" , " --quiet" , $patch ;
330
+ }
331
+ system " perl" , " script/replace-range-for-loops.pl" ;
332
+ chdir ($cwd ) or die " popd: $! " ;
333
+ }
334
+
314
335
# ###############################################################################
315
336
# compiler configurations
316
337
# ###############################################################################
0 commit comments