Skip to content

Instantly share code, notes, and snippets.

@grepwood
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grepwood/c8cd6e01b84e32e7c5c8 to your computer and use it in GitHub Desktop.
Save grepwood/c8cd6e01b84e32e7c5c8 to your computer and use it in GitHub Desktop.
Stop living in 2008 and embrace C++11 - useful for people who still have Qt4
#!/bin/bash
function fix_qt4_ebuilds {
pushd /usr/portage/dev-qt
ELEMENT=(core dbus gui script svg)
JOB_PID=$$
for((COUNTER=0, ARRAY_SIZE=${#ELEMENT[*]}; COUNTER < ARRAY_SIZE; ++COUNTER)) do
CCURRENT_ELEMENT=${ELEMENT[COUNTER]}
EBUILD=`ls qt$CURRENT_ELEMENT/qt$CURRENT_ELEMENT-4*.ebuild | tail -n1`
if [ "`grep ^IUSE $EBUILD | grep c\+\+0x | wc -l`" -eq "0" ]; then
cat $EBUILD | sed 's/^IUSE=\"/IUSE=\"c\+\+0x\ /' > ebuild.$JOB_PID
mv ebuild.$JOB_PID $EBUILD
ebuild $EBUILD digest
else
echo "$EBUILD already contains c++0x"
fi
done
popd
}
function stop_being_silly {
pushd /usr/portage/profiles
JOB_PID=$$
sed 's/^qt5$//' base/use.mask > $JOB_PID
mv $JOB_PID base/use.mask
popd
}
emerge --sync -q
if command -v layman >/dev/null; then layman -Sq; fi
fix_qt4_ebuilds
stop_being_silly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment