![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Way Too Much Ubuntu
![]() Join Date: Apr 2005
Location: Stockholm, Sweden
Beans: 326
Kubuntu 7.10 Gutsy Gibbon
|
This howto is for ppl who want to recompile ubuntu packages and keep the ubuntu settings(so that it is more stable) PLUS add some of your own compiling flags(maybe for your cpu type).
Make sure you have the deb-src lines uncommented in /etc/sources.list. Make a directory where you will do your work. This way you can easily see what has been downloaded and easy remove it later. Code:
mkdir recompileUbuntuPackages cd recompileUbuntuPackages
How to revert back to the original <package-name> Code:
sudo apt-get install --reinstall <package-name> KDEProblems with this method The above howto will not work on all packages since it depends on how they were packaged. If the package doesn't take the systems CFLAGS into account the it won't change a thing. Also packages using qmake won't work. To provide you with a solution to the first problem I will give you this script which I myself use. It solves the above problem by scanning the directoy and replacing occurances of -O2 with $CFLAG (not pretty but it works). Code:
#!/bin/bash
if [ -n "$1" ]
then
echo ":: fetching necessary packages for build"
apt-get build-dep "$@"
echo ":: fetching source"
apt-get source "$@"
fi
ourflags=$CFLAGS
echo :: using $ourflags
for directory in `ls -Al | awk '/^d/ {print $8}'`;
do
echo :: entering directory $directory ...
cd $directory
sed -e 's/-O2/'"${ourflags}"'/g' -i `ls -Al | awk '/^-/ {print $8}'`
cd debian
sed -e 's/-O2/'"${ourflags}"'/g' -i `ls -Al | awk '/^-/ {print $8}'`
cd ..
dpkg-buildpackage -rfakeroot -uc -b
echo :: leaving directory $directory ...
cd ..
done
Make it executable. Code:
sudo chmod +x ./recompile Or just do a sudo ./recompile. This will assume you already have the source and it will only build. Note...use this within a new directory otherwise it will span thrue your other directories and files. Please note that this is not a discussion about if or not other packages should be available. This is for those who like to have fun with their computer and change it to their own taste. This provides a safe way to do that since reverting back is so easy. Last edited by GoldBuggie; December 20th, 2005 at 09:29 AM.. |
|
|
|
|
|
#2 |
|
5 Cups of Ubuntu
![]() Join Date: Dec 2005
Beans: 15
|
Re: HOWTO: Recompile packages for your system
Hello, nice howto but...
ich have done it as described, but when iam compiling a package, it does not use my specified cflags at all... look here: g++ -c -pipe -I/usr/include/mysql -I/usr/include/freetype2 -I/usr/include/postgresql -I/usr/include/postgresql/8.0 -fno-exceptions -Wall -W -g -D_REENTRANT -fPIC -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT -DQT_THREAD_SUPPORT -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -DQT_NAS_SUPPORT -DQT_DLOPEN_OPENGL -DQT_NO_IMAGEIO_MNG -DQT_BUILTIN_GIF_READER=1 -DQT_NO_STYLE_MAC -DQT_NO_STYLE_AQUA -DQT_NO_STYLE_CDE -DQT_NO_STYLE_MOTIFPLUS -DQT_NO_STYLE_INTERLACE -DQT_NO_STYLE_PLATINUM -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_SGI -DQT_NO_STYLE_COMPACT -DQT_NO_STYLE_POCKETPC -DQT_NO_STYLE_WINDOWS -DQT_NO_STYLE_MOTIF -I/home/jan/Work/qt-x11-free-3.3.4/mkspecs/linux-g++ -I. -I/usr/include/freetype2 -I3rdparty/opentype -I../include -I/usr/X11R6/include -I.moc/debug-shared-mt/ -o .obj/debug-shared-mt/qbitmap.o kernel/qbitmap.cpp ...but my flags are: CFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden" CXXFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden" so, what can i do? |
|
|
|
|
|
#3 |
|
Python Enthusiast
![]() |
Re: HOWTO: Recompile packages for your system
XXFLAGS and CFLAGS? They remind me of my previous Gentoo installation. I didn't know it could be done in Ubuntu.
Thanks for the guide |
|
|
|
|
|
#4 |
|
Way Too Much Ubuntu
![]() Join Date: Apr 2005
Location: Markham, Ontario
Beans: 233
Ubuntu 9.10 Karmic Koala
|
Re: HOWTO: Recompile packages for your system
Nice guide
|
|
|
|
|
|
#5 |
|
Way Too Much Ubuntu
![]() Join Date: Apr 2005
Location: Stockholm, Sweden
Beans: 326
Kubuntu 7.10 Gutsy Gibbon
|
Re: HOWTO: Recompile packages for your system
Updated the howto to include a 3.1 section which first downloads the package then you can look at the files etc maybe change something then start the compile and build of .deb.
funkyou Well I've not come across a package that does not include those options. Would be wrong if they aren't included I think. Anyhow...the flag options should be in the configure file. Do a Code:
cat ./configure | grep FLAGS Which package are you building...maybe I can take a look. Must run now..I'm almost late for a appointment. |
|
|
|
|
|
#6 |
|
5 Cups of Ubuntu
![]() Join Date: Dec 2005
Beans: 15
|
Re: HOWTO: Recompile packages for your system
Hello,
at first, thank you for your help and support, its very appreciated. I tried to rebuild libqt3-mt and libqt3-mt-dev. this are my cflags and cxxflags: jan@agentj:~$ echo $CFLAGS -mtune=athlon-xp -O2 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden jan@agentj:~$ echo $CXXFLAGS -mtune=athlon-xp -O2 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden jan@agentj:~$ The first way (before your section 3.1) does not work on my machine, as gcc does not use my flags. So i tried it the other way, first downloading the sources with apt, and then modifying the whole thing. Well, when i search through the configure script, i find many build options with the name cflags... so i tried something different... i looked through the qt-source-folder and found this file ~/Work/qt-x11-free-3.3.4/mkspecs/linux-g++/qmake.conf in which one can place the flags for the compiler on linux/gcc... i have modified the following line to: QMAKE_CFLAGS = -mtune=athlon-xp -O2 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden I think this should work, but when i try to use the command from section 3.1 of your howto, i get this error message: jan@agentj:~/Work$ sudo dpkg-buildpackage -rfakeroot -uc -b Password: dpkg-parsechangelog: error: cannot open debian/changelog to find format: Datei oder Verzeichnis nicht gefunden dpkg-buildpackage: unable to determine source package is I tried this in both my work-folder and in the qt-folder itself, but its not working. it claims to not find the debian changelog... |
|
|
|
|
|
#7 |
|
Way Too Much Ubuntu
![]() Join Date: Apr 2005
Location: Stockholm, Sweden
Beans: 326
Kubuntu 7.10 Gutsy Gibbon
|
Re: HOWTO: Recompile packages for your system
the sudo dpkg-buildpackage -rfakeroot -uc -b command should be run in the same folder as you did the apt-get source. Have you installed fakeroot? sudo apt-get install fakeroot. As for not recoqnizing the cflags option that is just strange to my ears. I even compiled the libqt3-mt package and it worked as a charm. hmmmm...*must think*
but doing it the search important files and chang is also an option. But it can just be to much sometimes so using the flags option is an easy way out. Last edited by GoldBuggie; December 13th, 2005 at 12:01 AM.. |
|
|
|
|
|
#8 |
|
Way Too Much Ubuntu
![]() Join Date: Apr 2005
Location: Stockholm, Sweden
Beans: 326
Kubuntu 7.10 Gutsy Gibbon
|
Re: HOWTO: Recompile packages for your system
Ok added a line about QMAKE_C(XX)FLAGS in the KDE section but I haven't made any tests yet. Will do tomorrow!
But thanks funkyou for pointing it out. I looked thrue the package and noticed that some things are compiled using regular made makefiles and those include CFLAGS etc but since trolltech wants to make things their way(using qmake instead of make) you will have to use the above or change qmake.conf. |
|
|
|
|
|
#9 |
|
5 Cups of Ubuntu
![]() Join Date: Dec 2005
Beans: 15
|
Re: HOWTO: Recompile packages for your system
Tried it again, but no succes...
Didn't had the fakeroot package installed, but when i now try to invoke the sudo dpkg-buildpackage -rfakeroot -uc -b command at the work-folder (where i downloaded the packages), it gives me the same error message as posted below: jan@agentj:~/Work$ sudo dpkg-buildpackage -rfakeroot -uc -b Password: dpkg-parsechangelog: error: cannot open debian/changelog to find format: Datei oder Verzeichnis nicht gefunden dpkg-buildpackage: unable to determine source package is |
|
|
|
|
|
#10 |
|
Way Too Much Ubuntu
![]() Join Date: Apr 2005
Location: Stockholm, Sweden
Beans: 326
Kubuntu 7.10 Gutsy Gibbon
|
Re: HOWTO: Recompile packages for your system
I think you are missing some package. Don't know which it is but I have the following installed
ii automake1.4 1.4-p6-9 A tool for generating GNU Standards-complian ii automake1.6 1.6.3-12 A tool for generating GNU Standards-complian ii automake1.7 1.7.9-7 A tool for generating GNU Standards-complian ii automake1.8 1.8.5-3 A tool for generating GNU Standards-complian ii automake1.9 1.9.5-1 A tool for generating GNU Standards-complian ii dpkg 1.13.10ubuntu4 Package maintenance system for Debian ii dpkg-dev 1.13.10ubuntu4 Package building tools for Debian ii make 3.80-9 The GNU version of the "make" utility I think it might have something to do with automake. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|