From 58c2cc4c992615bfef81897b85299d5e0933f36f Mon Sep 17 00:00:00 2001 From: Santiago Rodriguez Date: Fri, 12 Jun 2015 04:56:18 +0200 Subject: [PATCH 1/3] compiz: remove recomendation to use non-free software Original helper from Ryan Houlgate Closes #1942 --- helpers/make-compiz | 100 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 helpers/make-compiz diff --git a/helpers/make-compiz b/helpers/make-compiz new file mode 100644 index 0000000..10390b6 --- /dev/null +++ b/helpers/make-compiz @@ -0,0 +1,100 @@ +#!/bin/sh +# +# Copyright (C) 2012 Ryan Houlgate +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +VERSION=1 + +. ./config + + +# Need to remove an 'option' in the XML file. +# It extends for five lines, so we will comment +# them out. +xmlFileName=workarounds/workarounds.xml.in +xmlStringToLookFor=fglrx_xgl_fix +xmlSkipLines=4 + +cat $xmlFileName | while read line; do + + if (echo $line|grep $xmlStringToLookFor>/dev/null); then + echo "" + else + echo "$line" + fi + +done > $xmlFileName.tmp +mv $xmlFileName.tmp $xmlFileName + +# The C++ code calls methods that appear to be based +# on the part of the XML file that we removed. +# There is a method that returns a boolean to +# indicate whether or not this feature should +# be exhibited. I've created a dummy method +# that always returns false for that. +# It's declared as "extern" in the "*.h" file. +# It's defined at the end of the "*.cpp" file. +# There is another call to a related method. +# I just comment out that call. +cppFileName=workarounds/src/workarounds.cpp +cppStringToLookFor=optionSetFglrxXglFixNotify +cppSkipLines=2 + + +cat $cppFileName | while read line; do + + if (echo $line|grep $cppStringToLookFor>/dev/null); then + echo "/**************** Removing recommendation to use non-free software" + echo "$line" + count=0 + + while [ "$count" -lt "$cppSkipLines" ] ; do + count=`expr $count + 1`; + read line + echo "$line" + done + + echo "****************/" + else + echo "$line" + fi + +done > $cppFileName.tmp +mv $cppFileName.tmp $cppFileName + + +# Create declaration of method in the *.h file +echo "extern bool optionGetFglrxXglFix();" >> workarounds/src/workarounds.h + +# Create definition of method in the *.cpp file +echo "// Providing dummy method to always return false due to the removal" >> workarounds/src/workarounds.cpp +echo "// of non-free software recommendation" >> workarounds/src/workarounds.cpp +echo "bool optionGetFglrxXglFix() { return false; }" >> workarounds/src/workarounds.cpp + +changelog "Remove recomendation to use fglrx (non-free software)" + +compile From deafb13d546ab9d60e6d7b5601a3b91a3fe39d24 Mon Sep 17 00:00:00 2001 From: Santiago Rodriguez Date: Fri, 12 Jun 2015 04:58:00 +0200 Subject: [PATCH 2/3] compiz: update paths to current locations --- helpers/make-compiz | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helpers/make-compiz b/helpers/make-compiz index 10390b6..d86fc34 100644 --- a/helpers/make-compiz +++ b/helpers/make-compiz @@ -25,7 +25,7 @@ VERSION=1 # Need to remove an 'option' in the XML file. # It extends for five lines, so we will comment # them out. -xmlFileName=workarounds/workarounds.xml.in +xmlFileName=plugins/workarounds/workarounds.xml.in xmlStringToLookFor=fglrx_xgl_fix xmlSkipLines=4 @@ -60,7 +60,7 @@ mv $xmlFileName.tmp $xmlFileName # It's defined at the end of the "*.cpp" file. # There is another call to a related method. # I just comment out that call. -cppFileName=workarounds/src/workarounds.cpp +cppFileName=plugins/workarounds/src/workarounds.cpp cppStringToLookFor=optionSetFglrxXglFixNotify cppSkipLines=2 @@ -88,12 +88,12 @@ mv $cppFileName.tmp $cppFileName # Create declaration of method in the *.h file -echo "extern bool optionGetFglrxXglFix();" >> workarounds/src/workarounds.h +echo "extern bool optionGetFglrxXglFix();" >> plugins/workarounds/src/workarounds.h # Create definition of method in the *.cpp file -echo "// Providing dummy method to always return false due to the removal" >> workarounds/src/workarounds.cpp -echo "// of non-free software recommendation" >> workarounds/src/workarounds.cpp -echo "bool optionGetFglrxXglFix() { return false; }" >> workarounds/src/workarounds.cpp +echo "// Providing dummy method to always return false due to the removal" >> plugins/workarounds/src/workarounds.cpp +echo "// of non-free software recommendation" >> plugins/workarounds/src/workarounds.cpp +echo "bool optionGetFglrxXglFix() { return false; }" >> plugins/workarounds/src/workarounds.cpp changelog "Remove recomendation to use fglrx (non-free software)" From 32a9a4d6bc210c17437c039f444e4f4a9d79cdd2 Mon Sep 17 00:00:00 2001 From: Santiago Rodriguez Date: Thu, 18 Jun 2015 15:58:55 +0200 Subject: [PATCH 3/3] compiz: change string manipulations and use sed --- helpers/make-compiz | 50 ++------------------------------------------- 1 file changed, 2 insertions(+), 48 deletions(-) diff --git a/helpers/make-compiz b/helpers/make-compiz index d86fc34..ea260ab 100644 --- a/helpers/make-compiz +++ b/helpers/make-compiz @@ -25,30 +25,8 @@ VERSION=1 # Need to remove an 'option' in the XML file. # It extends for five lines, so we will comment # them out. -xmlFileName=plugins/workarounds/workarounds.xml.in -xmlStringToLookFor=fglrx_xgl_fix -xmlSkipLines=4 -cat $xmlFileName | while read line; do - - if (echo $line|grep $xmlStringToLookFor>/dev/null); then - echo "" - else - echo "$line" - fi - -done > $xmlFileName.tmp -mv $xmlFileName.tmp $xmlFileName +sed -i '/fglrx_xgl_fix"/,/option/d' plugins/workarounds/workarounds.xml.in # The C++ code calls methods that appear to be based # on the part of the XML file that we removed. @@ -60,32 +38,8 @@ mv $xmlFileName.tmp $xmlFileName # It's defined at the end of the "*.cpp" file. # There is another call to a related method. # I just comment out that call. -cppFileName=plugins/workarounds/src/workarounds.cpp -cppStringToLookFor=optionSetFglrxXglFixNotify -cppSkipLines=2 - - -cat $cppFileName | while read line; do - - if (echo $line|grep $cppStringToLookFor>/dev/null); then - echo "/**************** Removing recommendation to use non-free software" - echo "$line" - count=0 - - while [ "$count" -lt "$cppSkipLines" ] ; do - count=`expr $count + 1`; - read line - echo "$line" - done - - echo "****************/" - else - echo "$line" - fi - -done > $cppFileName.tmp -mv $cppFileName.tmp $cppFileName +sed -i '/optionSetFglrxXglFixNotify/,/_1/ s:^://:' plugins/workarounds/src/workarounds.cpp # Create declaration of method in the *.h file echo "extern bool optionGetFglrxXglFix();" >> plugins/workarounds/src/workarounds.h