Changeset View
Changeset View
Standalone View
Standalone View
disable_archs.sh
- This file was added.
| Property | Old Value | New Value |
|---|---|---|
| File Mode | null | 100755 |
| # This script tries to mimic what Fedora does in eclipse.spec, that is to disable the | |||||
| # compilation of unneeded platforms and architectures, to save build time. In order to | |||||
| # follow Solus' standards, this script won't butcher source files directly in packge.yml | |||||
| # but it will have to be run manually to generate a proper .patch file that, | |||||
| # in turn, will have to be MANUALLY REVIEWED. | |||||
| disable_module() { | |||||
| # $1: module name | |||||
| # $2: pom.xml directory (without filename at its end) | |||||
| sed -i -e "\#<module>$1</module>#d" "$2/pom.xml" | |||||
| } | |||||
| remove_plugin_by_id(){ | |||||
| # $1: plugin id | |||||
| # $2: file path | |||||
| perl -i -pe "BEGIN{undef \$/;} s/<plugin[[:space:]]*id=\"$1\"[^<]*//smg" "$2" | |||||
| } | |||||
| remove_plugin_by_os(){ | |||||
| # $1: plugin os | |||||
| # $2: file path | |||||
| perl -i -pe "BEGIN{undef \$/;} s/<plugin[[:space:]]*"` | |||||
| `"id=\"[[:graph:]]*\"[[:space:]]*os=\"$1\"[^<]*//smg" \ | |||||
| "$2" | |||||
| } | |||||
| remove_plugin_by_arch(){ | |||||
| # $1: plugin arch | |||||
| # $2: file path | |||||
| perl -i -pe "BEGIN{undef \$/;} s/<plugin[[:space:]]*"` | |||||
| `"id=\"[[:graph:]]*\"[[:space:]]*os=\"[[:graph:]]*\"[[:space:]]*"` | |||||
| `"ws=\"[[:graph:]]*\"[[:space:]]*arch=\"$1\"[^<]*//smg" \ | |||||
| "$2" | |||||
| } | |||||
| replace_environments() { | |||||
| # $1 pom.xml directory (without filename at its end) | |||||
| # This is a simple multiple-line replacer | |||||
| tycho_env="<environments><environment><os>linux<\/os><ws>gtk<\/ws><arch>x86_64<\/arch><\/environment><\/environments>" | |||||
| perl -i -pe "BEGIN{undef \$/;} s/<environments>.*<\/environments>/$tycho_env/smg" "$1/pom.xml" | |||||
| } | |||||
| replace_environments eclipse-platform-parent | |||||
| replace_environments eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests | |||||
| replace_environments eclipse.platform.ui/bundles/org.eclipse.e4.ui.swt.gtk | |||||
| for b in $(ls eclipse.platform.swt.binaries/bundles | grep -P -e 'org.eclipse.swt\.(?!gtk\.linux.x86_64$)'); do | |||||
| module=$(grep ">bundles/$b<" eclipse.platform.swt.binaries/pom.xml || :) | |||||
| if [ -n "$module" ]; then | |||||
| disable_module "bundles/$b" eclipse.platform.swt.binaries | |||||
| # Add $b among the excluded modules (use perl to append line before '</excludes>') | |||||
| perl -plne "print \"<plugin id='$b'/>\" if(/<\/excludes>/);" -i eclipse.platform.ui/features/org.eclipse.e4.rcp/pom.xml | |||||
| fi | |||||
| done | |||||
| for b in $(ls rt.equinox.framework/bundles | grep -P -e 'org.eclipse.equinox.launcher\.(?!gtk\.linux.x86_64$)'); do | |||||
| module=$(grep ">bundles/$b<" rt.equinox.framework/pom.xml || :) | |||||
| if [ -n "$module" ]; then | |||||
| disable_module "bundles/$b" rt.equinox.framework | |||||
| remove_plugin_by_id "$b" rt.equinox.framework/features/org.eclipse.equinox.executable.feature/feature.xml | |||||
| fi | |||||
| done | |||||
| for b in $((cd rt.equinox.bundles/bundles && ls -d *{macosx,win32,linux}*) | grep -P -e 'org.eclipse.equinox.security\.(?!linux\.x86_64$)'); do | |||||
| disable_module "bundles/$b" rt.equinox.bundles | |||||
| remove_plugin_by_id "$b" rt.equinox.p2/features/org.eclipse.equinox.p2.core.feature/feature.xml | |||||
| done | |||||
| for b in $(ls eclipse.platform.team/bundles/org.eclipse.core.net/fragments/ | grep -P -e 'org.eclipse.core.net\.(?!linux.x86_64$)'); do | |||||
| disable_module "bundles/org.eclipse.core.net/fragments/$b" eclipse.platform.team | |||||
| done | |||||
| for b in $(ls eclipse.platform.resources/bundles/ | grep -P -e 'org.eclipse.core.filesystem\.(?!linux\.x86_64$)'); do | |||||
| module=$(grep ">bundles/$b<" eclipse.platform.resources/pom.xml || :) | |||||
| if [ -n "$module" ]; then | |||||
| disable_module "bundles/$b" eclipse.platform.resources | |||||
| remove_plugin_by_id "$b" eclipse.platform.resources/tests/org.eclipse.core.tests.filesystem.feature/feature.xml | |||||
| fi | |||||
| done | |||||
| disable_module 'org.eclipse.jdt.launching.macosx' eclipse.jdt.debug | |||||
| disable_module 'org.eclipse.jdt.launching.ui.macosx' eclipse.jdt.debug | |||||
| disable_module 'bundles/org.eclipse.compare.win32' eclipse.platform.team | |||||
| disable_module 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa' eclipse.platform.ui/bundles | |||||
| disable_module 'org.eclipse.ui.cocoa' eclipse.platform.ui/bundles | |||||
| disable_module 'org.eclipse.ui.win32' eclipse.platform.ui/bundles | |||||
| disable_module 'bundles/org.eclipse.core.resources.win32.x86' eclipse.platform.resources | |||||
| disable_module 'bundles/org.eclipse.core.resources.win32.x86_64' eclipse.platform.resources | |||||
| disable_module 'examples/org.eclipse.swt.examples.ole.win32' eclipse.platform.swt | |||||
| for f in eclipse.jdt/org.eclipse.jdt-feature/feature.xml \ | |||||
| eclipse.platform.ui/features/org.eclipse.e4.rcp/feature.xml \ | |||||
| eclipse.platform.releng/features/org.eclipse.rcp/feature.xml \ | |||||
| eclipse.platform.releng/features/org.eclipse.platform-feature/feature.xml; do | |||||
| remove_plugin_by_os 'macosx' $f | |||||
| remove_plugin_by_os 'win32' $f | |||||
| for arch in x86 arm aarch64 ppc64 ppc64le s390x; do | |||||
| remove_plugin_by_arch "$arch" $f | |||||
| done | |||||
| done | |||||
| # Not in Fedora (because it disables the equinox module directly) | |||||
| remove_plugin_by_id 'org.eclipse.swt.cocoa.macosx.x86_64' rt.equinox.p2/bundles/org.eclipse.equinox.p2.tests.reconciler.product/reconciler.product | |||||
| remove_plugin_by_id 'org.eclipse.swt.gtk.linux.x86' rt.equinox.p2/bundles/org.eclipse.equinox.p2.tests.reconciler.product/reconciler.product | |||||
| remove_plugin_by_id 'org.eclipse.swt.win32.win32.x86' rt.equinox.p2/bundles/org.eclipse.equinox.p2.tests.reconciler.product/reconciler.product | |||||
| remove_plugin_by_id 'org.eclipse.swt.win32.win32.x86_64' rt.equinox.p2/bundles/org.eclipse.equinox.p2.tests.reconciler.product/reconciler.product | |||||
| git diff --submodule=diff > disable-unneeded-platforms.patch | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.