Chackal sjc (Talk | contribs) (→Create a user account for KDE4 development) |
|||
| (27 intermediate revisions by 9 users not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
| − | {{ | + | {{TutorialBrowser_(pt_BR)| |
| − | series= | + | series=Primeiros passos| |
| − | name=Compilando | + | name=Compilando o KDE4 a partir do código fonte| |
| − | pre=[[../../Sources/Anonymous_SVN| | + | pre=[[../../Sources/Anonymous_SVN (pt_BR)|Guia rápido de SVN anônimo]]| |
| − | next=[[../../Set_up_KDE_4_for_development| | + | next=[[../../Set_up_KDE_4_for_development|Configurando o KDE4 para desenvolvimento]]| |
| − | reading=[[../kdesvn-build|kdesvn-build: The KDE From Subversion Build Tool]]<br>[[../../Increased_Productivity_in_KDE4_with_Scripts| | + | reading=[[../kdesvn-build|kdesvn-build: The KDE From Subversion Build Tool]]<br>[[../../Increased_Productivity_in_KDE4_with_Scripts|Aumentando a produtividade no KDE 4 com Scripts]]<br>[[Development/Tutorials/CMake|Introdução ao CMake]]<br>[[../KDE4/FreeBSD|Notas sobre FreeBSD]]<br>[[../KDE4/Mac OS X|Instruções para Mac OS X]]<br>[[../KDE4/Windows|Instruções para MS Windows]]| |
}} | }} | ||
| − | == | + | == Resumo == |
| − | Esse tutorial mostra uma maneira de instalar o KDE pelo trunk rodando em sistemas | + | Esse tutorial mostra uma maneira de instalar o KDE pelo trunk rodando em sistemas Linux/BSD. Você pode também ajudar a traduzir tutoriais para [[Getting_Started/Build/KDE4/FreeBSD|FreeBSD]], [http://www.kdelibs.com/ Windows], [[Getting_Started/Build/KDE4/Mac OS X|Mac OS X]] e [http://solaris.kde.org/ Solaris]. Durante todo o tutorial o bash shell é usado. |
| − | {{warning|Existe um grande risco de falhas '''nas Segundas-Feiras''' quando a maioria das kdelibs são commited(atualizadas). Acesse o [http://developer.kde.org/~dirk/dashboard/ Dashboard] para reportar quebras inesperadas. Você é encorajado à corrigir as falhas e erros. | + | {{warning (pt_BR)|Existe um grande risco de falhas '''nas Segundas-Feiras''' quando a maioria das kdelibs são commited(atualizadas). Acesse o [http://developer.kde.org/~dirk/dashboard/ Dashboard] para reportar quebras inesperadas. Você é encorajado à corrigir as falhas e erros. |
| + | }} | ||
| + | |||
| + | == Criando a conta de usuário para o desenvolvimento do KDE 4 == | ||
| + | |||
| + | {{Note (pt_BR)| | ||
| + | Algumas pessoas gostam de ter uma conta de usuário separada para o KDE4 (Antes de que um bug apague arquivos por engano), e as instruções abaixo foram escritas com esse propósito. | ||
| + | |||
| + | Entretando é muito mais eficiente por ter tudo em uma conta de usuário, veja [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts|Aumentando a produtividade no KDE4 com Scripts(inglês)]] | ||
| + | para mais detalhes. | ||
| + | |||
| + | Você pode continuar seguindo as instruções abaixo, mas não coloque as váriaveis de ambiente no seu <tt>.bashrc</tt>, coloque elas em um arquivo separado que você faça uso quando for para o ambiente de desenvolvimento do KDE 4. | ||
| + | }} | ||
| + | |||
| + | === Opção 1: Linha de Comando === | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | useradd -m kde-devel | ||
| + | passwd kde-devel | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === Opção 2: Usando o KControl === | ||
| + | |||
| + | Ao invés dos comandos acima, você pode usar o módulo User no KDE Control Center se você já tem o KDE3 instalado. | ||
| + | |||
| + | === Configurando o Ambiente === | ||
| + | |||
| + | Copie o {{path|~/.bashrc}} do seu usuário normal par o novo usuário kde-devel. Depois, copie e cole o conteúdo do [[Getting Started/Increased Productivity in KDE4 with Scripts/.bashrc|exemplo .bashrc]] dentro do {{path|~kde-devel/.bashrc}}. Tenha certeza de comentar a linha <tt>alias make=makeobj</tt> se você não tem o comando <tt>[[Getting Started/Build/KDE4#Required Software|makeobj]]</tt>. Provavelmente você quer modificar os paths para ter certeza que não irá incluir os kde3 paths. Também se você quer usar o KDevelop para desenvolver aplicativos para o KDE 4 você precisa passar a flag ''-GKDevelop3'' ao comando ''cmake'' (para fazer o CMake gerar arquivos de projetos KDevelop, isso irá ajudar a recompilar no futuro, veja [[Getting_Started/Build/KDE4_(pt_BR)#Configurando_o_Ambiente|isso]]). | ||
| + | Para fazer isso, você precisa abrir um novo bash ou executar | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | source ~/.bashrc | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | Isso irá dar acesso aos comandos tais como <tt>cmakekde</tt> que é usado no tutorial para forçar o cominho dos binários do Qt, KDE e CMake. | ||
| + | |||
| + | Para mais informações, por favor leia o tutorial [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts|Aumentando a produtividade no KDE4 com Scripts(inglês)]]. | ||
| + | |||
| + | === Mudando Para o Novo Usuário === | ||
| + | Mude para o usuário kde-devel: (Não se esqueça do hífen) | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | ssh -X kde-devel@localhost | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | {{Note (pt_BR)| | ||
| + | Se o ssh falhar, veja o [[Getting_Started/Set_up_KDE_4_for_development#Launching_KDE_4_apps|Launching KDE 4 apps]] na sessão [[Getting_Started/Set_up_KDE_4_for_development|KDE4 development guide]]. | ||
}} | }} | ||
| Line 34: | Line 76: | ||
=== Ark Linux === | === Ark Linux === | ||
| − | No Ark Linux, as | + | No Ark Linux, as dependências que você precisa são instaladas pelo comando: |
| − | < | + | <syntaxhighlight lang="bash"> |
apt-get install devel-core libxml-devel libxslt-devel bzip2-devel \ | apt-get install devel-core libxml-devel libxslt-devel bzip2-devel \ | ||
clucene-core-devel librdf-devel shared-mime-info xorg-Mesa-libGL-devel \ | clucene-core-devel librdf-devel shared-mime-info xorg-Mesa-libGL-devel \ | ||
subversion boost-devel doxygen giflib-devel dbus-devel openssl-devel \ | subversion boost-devel doxygen giflib-devel dbus-devel openssl-devel \ | ||
alsa-lib-devel kdesdk-scripts qt4-devel | alsa-lib-devel kdesdk-scripts qt4-devel | ||
| − | </ | + | </syntaxhighlight> |
Se você preferir uma interface gráfica, selecione os pacotes listados acima na ferramenta "Install Software" no Mission Control. | Se você preferir uma interface gráfica, selecione os pacotes listados acima na ferramenta "Install Software" no Mission Control. | ||
| Line 50: | Line 92: | ||
No Arch Linux você precisa instalar os seguintes pacotes: | No Arch Linux você precisa instalar os seguintes pacotes: | ||
| − | < | + | <syntaxhighlight lang="bash"> |
pacman -Sy subversion bzip2 libxslt libxml2 \ | pacman -Sy subversion bzip2 libxslt libxml2 \ | ||
shared-mime-info mesa boost dbus openssl \ | shared-mime-info mesa boost dbus openssl \ | ||
pkgconfig xine-lib | pkgconfig xine-lib | ||
| − | </ | + | </syntaxhighlight> |
| − | Se quiser, você instalar o qt4 a partir do repositório do Arch Linux com o comando: | + | Se quiser, você pode instalar o qt4 a partir do repositório do Arch Linux com o comando: |
| − | < | + | <syntaxhighlight lang="bash"> |
pacman -Sy qt4 | pacman -Sy qt4 | ||
| − | </ | + | </syntaxhighlight> |
Para as bibliotecas clucene você precisa do [http://aur.archlinux.org/packages.php?do_Details=1&ID=5968&O=0&L=0&C=0&K=clucene&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd PKGBUILD] pelo AUR. | Para as bibliotecas clucene você precisa do [http://aur.archlinux.org/packages.php?do_Details=1&ID=5968&O=0&L=0&C=0&K=clucene&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd PKGBUILD] pelo AUR. | ||
| Line 67: | Line 109: | ||
Alguns pacotes são requisitos para a compilação do KDE4 no Fedora 7 ou superior: | Alguns pacotes são requisitos para a compilação do KDE4 no Fedora 7 ou superior: | ||
| − | < | + | <syntaxhighlight lang="bash"> |
yum install clucene-core-devel libxml-devel libxslt-devel \ | yum install clucene-core-devel libxml-devel libxslt-devel \ | ||
dbus-devel boost-devel bzip2-devel openssl-devel alsa-lib-devel \ | dbus-devel boost-devel bzip2-devel openssl-devel alsa-lib-devel \ | ||
| Line 81: | Line 123: | ||
lcms-devel libtiff-devel sqlite-devel libxkbfile-devel \ | lcms-devel libtiff-devel sqlite-devel libxkbfile-devel \ | ||
imlib2-devel patch | imlib2-devel patch | ||
| − | </ | + | </syntaxhighlight> |
Esta instalação inclui o D-Bus e CMake -- você pode pular os passos 5 e 6. | Esta instalação inclui o D-Bus e CMake -- você pode pular os passos 5 e 6. | ||
| Line 89: | Line 131: | ||
Para compilar: | Para compilar: | ||
| − | %build | + | <syntaxhighlight lang="bash">%build |
mkdir -p %{_target_platform} | mkdir -p %{_target_platform} | ||
| Line 99: | Line 141: | ||
popd | popd | ||
| − | make %{?_smp_mflags} -C %{_target_platform} | + | make %{?_smp_mflags} -C %{_target_platform}</syntaxhighlight> |
Eu tive melhores resultados criando uma rpm do kdesupport, significa que você não precisa instalar o soprano e strigi rpms. YMMV | Eu tive melhores resultados criando uma rpm do kdesupport, significa que você não precisa instalar o soprano e strigi rpms. YMMV | ||
| Line 105: | Line 147: | ||
=== Kubuntu e Debian === | === Kubuntu e Debian === | ||
| − | No Kubuntu 7.04 (Feisty) e Debian (Testing/Unstable) as | + | No Kubuntu 7.04 (Feisty) e Debian (Testing/Unstable) as dependências que você precisa instalar são: |
| − | < | + | <syntaxhighlight lang="text"> |
sudo aptitude install build-essential cdbs debhelper cmake \ | sudo aptitude install build-essential cdbs debhelper cmake \ | ||
libxml2-dev libxslt1-dev libbz2-dev libclucene-dev librdf-dev \ | libxml2-dev libxslt1-dev libbz2-dev libclucene-dev librdf-dev \ | ||
| Line 118: | Line 160: | ||
libsmbclient-dev libxcb1-dev libcaptury-dev libxcomposite-dev \ | libsmbclient-dev libxcb1-dev libcaptury-dev libxcomposite-dev \ | ||
libxdamage-dev libusb-dev libgpgme11-dev libldap2-dev | libxdamage-dev libusb-dev libgpgme11-dev libldap2-dev | ||
| − | </ | + | </syntaxhighlight> |
No Kubuntu 7.10 (Gutsy) e Debian unstable você deve adicionar: | No Kubuntu 7.10 (Gutsy) e Debian unstable você deve adicionar: | ||
| − | < | + | <syntaxhighlight lang="text"> |
sudo aptitude install dbus-x11 libqt4-dev libqca2-dev libeigen-dev \ | sudo aptitude install dbus-x11 libqt4-dev libqca2-dev libeigen-dev \ | ||
libstreamanalyzer-dev libsoprano-dev libstrigiqtdbusclient-dev \ | libstreamanalyzer-dev libsoprano-dev libstrigiqtdbusclient-dev \ | ||
libxklavier11-dev libxml2-utils libdbus-1-dev libxslt1-dev cmake libbz2-dev \ | libxklavier11-dev libxml2-utils libdbus-1-dev libxslt1-dev cmake libbz2-dev \ | ||
libungif4-dev libgpgme11-dev libboost-dev libxine-dev | libungif4-dev libgpgme11-dev libboost-dev libxine-dev | ||
| − | </ | + | </syntaxhighlight> |
Para uma completa e funcional documentação da API você também precisa: | Para uma completa e funcional documentação da API você também precisa: | ||
| − | < | + | <syntaxhighlight lang="text"> |
sudo aptitude install graphviz | sudo aptitude install graphviz | ||
| − | </ | + | </syntaxhighlight> |
| − | Não | + | Não há necessidade de compilar o qt ou kdesupport no kubuntu gutsy. Todos os pacotes requeridos já estão inclusos na instalação acima. Para configurar o kde4 user e etc será explicado na próxima sessão, mas passe por cima das sessões de compilação do qt, hal e kdesupport. |
| − | {{Note| | + | {{Note (pt_BR)| |
Se você tiver erros na compilação do KDE4 | Se você tiver erros na compilação do KDE4 | ||
Beta4 ou acima no Kubuntu 7.10, como: | Beta4 ou acima no Kubuntu 7.10, como: | ||
| Line 151: | Line 193: | ||
=== openSUSE === | === openSUSE === | ||
| − | No openSUSE 10.2 e mais | + | No openSUSE 10.2 e versões mais novas, você pode instalar os pacotes usando [http://en.opensuse.org/Zypper Zypper]: |
| − | < | + | <syntaxhighlight lang="bash"> |
sudo zypper install <package-name> | sudo zypper install <package-name> | ||
| − | </ | + | </syntaxhighlight> |
| − | Em | + | Em versões mais antigas do SUSE, você pode usar o YaST: |
| − | < | + | <syntaxhighlight lang="bash"> |
su | su | ||
yast -i <packagename> | yast -i <packagename> | ||
| − | </ | + | </syntaxhighlight> |
'''Pacotes Requeridos''' | '''Pacotes Requeridos''' | ||
| − | Os pacotes que você precisa | + | Os pacotes que você precisa instalar são: |
| − | < | + | <syntaxhighlight lang="text"> |
xorg-x11-devel | xorg-x11-devel | ||
libxml2-devel | libxml2-devel | ||
| Line 181: | Line 223: | ||
gcc | gcc | ||
gcc-c++ | gcc-c++ | ||
| − | gmp-devel ( | + | gmp-devel (needed to build kdesupport) |
| − | + | xine-devel | |
| − | + | libgpgme-devel (needed to build kdepimlibs) | |
| − | </ | + | </syntaxhighlight> |
'''Pacotes Opcionais''' | '''Pacotes Opcionais''' | ||
| Line 192: | Line 234: | ||
Para openSUSE 10.2 ou mais novo, faça: | Para openSUSE 10.2 ou mais novo, faça: | ||
| − | < | + | <syntaxhighlight lang="text"> |
sudo zypper service-add http://software.opensuse.org/download/KDE:/KDE4/openSUSE_10.2 KDE4-102 | sudo zypper service-add http://software.opensuse.org/download/KDE:/KDE4/openSUSE_10.2 KDE4-102 | ||
| − | </ | + | </syntaxhighlight> |
Para versões mais velhas do SUSE Linux faça: | Para versões mais velhas do SUSE Linux faça: | ||
| − | < | + | <syntaxhighlight lang="text"> |
su | su | ||
installation_sources -a http://software.opensuse.org/download/KDE:/KDE4/[SUA VERSÃO SUSE LINUX] | installation_sources -a http://software.opensuse.org/download/KDE:/KDE4/[SUA VERSÃO SUSE LINUX] | ||
| − | </ | + | </syntaxhighlight> |
Agora instale os seguintes pacotes: | Agora instale os seguintes pacotes: | ||
| − | < | + | <syntaxhighlight lang="text"> |
cmake | cmake | ||
dbus-1-devel | dbus-1-devel | ||
| Line 212: | Line 254: | ||
strigi | strigi | ||
strigi-ui | strigi-ui | ||
| − | </ | + | </syntaxhighlight> |
Existem mais pacotes que precisam ser instalados para satisfazer o config-check, como libusb-devel, bison etc., então dê uma olhada nas notificações de configuração e instale de acordo. Por favor lembre de pular qualquer instrução que seja referencia do kdesupport abaixo. Comece a compilar pelo kdelibs. | Existem mais pacotes que precisam ser instalados para satisfazer o config-check, como libusb-devel, bison etc., então dê uma olhada nas notificações de configuração e instale de acordo. Por favor lembre de pular qualquer instrução que seja referencia do kdesupport abaixo. Comece a compilar pelo kdelibs. | ||
E para uma completa e funcional documentação da API você vai precisar também: | E para uma completa e funcional documentação da API você vai precisar também: | ||
| − | < | + | <syntaxhighlight lang="text"> |
graphviz | graphviz | ||
| − | </ | + | </syntaxhighlight> |
Os pacotes binários do CMake para openSUSE estão disponiveis no repositório do KDE:KDE4 pelo [http://software.opensuse.org/download/devel:/tools:/building/ openSUSE build service]. | Os pacotes binários do CMake para openSUSE estão disponiveis no repositório do KDE:KDE4 pelo [http://software.opensuse.org/download/devel:/tools:/building/ openSUSE build service]. | ||
| Line 225: | Line 267: | ||
=== Gentoo === | === Gentoo === | ||
| − | ==== Instalando | + | ==== Instalando manualmente ==== |
Você pode usar stable ebuilds só lembrando o seu sync portage antes de começar. | Você pode usar stable ebuilds só lembrando o seu sync portage antes de começar. | ||
| Line 235: | Line 277: | ||
Precisamos habilitar os seguintes keywords no ebuilds. | Precisamos habilitar os seguintes keywords no ebuilds. | ||
| − | < | + | <syntaxhighlight lang="bash"> |
echo 'dev-util/cmake' >> /etc/portage/package.keywords | echo 'dev-util/cmake' >> /etc/portage/package.keywords | ||
echo 'dev-cpp/clucene' >> /etc/portage/package.keywords | echo 'dev-cpp/clucene' >> /etc/portage/package.keywords | ||
| − | </ | + | </syntaxhighlight> |
Tenha certeza que você setou a flah USE para o redland, se não o epomuk não irá funcionar. | Tenha certeza que você setou a flah USE para o redland, se não o epomuk não irá funcionar. | ||
| − | < | + | <syntaxhighlight lang="bash"> |
echo 'dev-libs/redland berkdb' >> /etc/portage/package.use | echo 'dev-libs/redland berkdb' >> /etc/portage/package.use | ||
echo 'x11-libs/qt accessibility' >> /etc/portage/package.use | echo 'x11-libs/qt accessibility' >> /etc/portage/package.use | ||
| − | </ | + | </syntaxhighlight> |
| − | Esses são os pacotes que você vai precisar | + | Esses são os pacotes que você vai precisar. Eu inclui a opção update para que você não precise reusar o emarge para pacotes já instalados. |
| − | < | + | <syntaxhighlight lang="bash"> |
emerge -avu 'sys-devel/gcc' \ | emerge -avu 'sys-devel/gcc' \ | ||
'dev-util/subversion' \ | 'dev-util/subversion' \ | ||
| Line 271: | Line 313: | ||
'sys-apps/hal' \ | 'sys-apps/hal' \ | ||
'x11-libs/qt' | 'x11-libs/qt' | ||
| − | </ | + | </syntaxhighlight> |
Você também vai precisar usar o emerge para o 'kde-base/kdesdk' ou kde-base/kdesdk-scripts'. | Você também vai precisar usar o emerge para o 'kde-base/kdesdk' ou kde-base/kdesdk-scripts'. | ||
| Line 281: | Line 323: | ||
Você pode instalar os pacotes KDE4 diretamente por: | Você pode instalar os pacotes KDE4 diretamente por: | ||
| − | < | + | <syntaxhighlight lang="bash"> |
emerge -a <packagename> | emerge -a <packagename> | ||
| − | </ | + | </syntaxhighlight> |
Para isso você precisa [http://gentoo-wiki.com/TIP_Overlays#Layman instalar layman] e depois colocar no "kde" overlay (que contém a experimental KDE ebuilds): | Para isso você precisa [http://gentoo-wiki.com/TIP_Overlays#Layman instalar layman] e depois colocar no "kde" overlay (que contém a experimental KDE ebuilds): | ||
| − | < | + | <syntaxhighlight lang="bash"> |
layman -a kde | layman -a kde | ||
| − | </ | + | </syntaxhighlight> |
Depois disso você precisa ajudar alguns USE-flags para o KDE4 e avisar o portage para usar o testing KDE 4 ebuilds ao invez do stable KDE 3. | Depois disso você precisa ajudar alguns USE-flags para o KDE4 e avisar o portage para usar o testing KDE 4 ebuilds ao invez do stable KDE 3. | ||
| Line 298: | Line 340: | ||
No Mandriva as dependências necessárias para compilar o KDE4 são: | No Mandriva as dependências necessárias para compilar o KDE4 são: | ||
| − | < | + | <syntaxhighlight lang="bash"> |
urpmi gcc-c++ cmake libxml2-devel libbzip2_1-devel \ | urpmi gcc-c++ cmake libxml2-devel libbzip2_1-devel \ | ||
libclucene0-devel liblrdf2-devel libmesagl1-devel \ | libclucene0-devel liblrdf2-devel libmesagl1-devel \ | ||
subversion doxygen libdbus-1_3-devel libopenssl0.9.8-devel \ | subversion doxygen libdbus-1_3-devel libopenssl0.9.8-devel \ | ||
libalsa2-devel libgpgme-devel libboost1-devel libxine-devel | libalsa2-devel libgpgme-devel libboost1-devel libxine-devel | ||
| − | </ | + | </syntaxhighlight> |
Se você está rodando em um processador 64-bit você deve substituir o começo dos nomes dos pacotes de "lib..." para "lib64...". | Se você está rodando em um processador 64-bit você deve substituir o começo dos nomes dos pacotes de "lib..." para "lib64...". | ||
| Line 311: | Line 353: | ||
Isso inclui as instalação do CMake, DBus - você pode pular os passos 5 e 6. | Isso inclui as instalação do CMake, DBus - você pode pular os passos 5 e 6. | ||
| − | |||
| − | |||
| − | |||
| − | + | == O Shell Para Desenvolvimento == | |
| − | + | ||
| − | + | Em alguns sistemas um novo usuário é configurado por padrão para usar o {{path|/bin/sh}}. Se esse não é o caso do seu sistema, você pode pular essa sessão. Usando {{path|/bin/sh}} pode ser bastante inconveniente para trabalhar e talvez você queria mudar isso para {{path|/bin/bash}} ou outro shell. | |
| − | }} | + | No Ark Linux, Fedora e Slackware, você pode pular esse passo - {{path|/bin/sh}} é {{path|bash}}. |
| − | === Opção 1: | + | === Opção 1: Como o usuário kde-devel === |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | Se você não tem acesso ao root e seu sistema suporta a mudança do seu próprio shell com o aplicativo <tt>chsh</tt>, então você pode tentar mudar seu shell para {{path|/bin/bash}} assim: | |
| − | + | <syntaxhighlight lang="bash"> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | < | + | |
chsh -s /bin/bash kde-devel | chsh -s /bin/bash kde-devel | ||
| − | </ | + | </syntaxhighlight> |
| − | === Option 2: | + | === Option 2: Como o usuário root === |
| − | + | Se seu sistema vem com a aplicação <tt>usermod</tt> você pode rodar o seguinte comando como root: <tt>usermod -s /bin/bash kde-devel</tt>. | |
| − | + | Outra opção é de usar a aplicação <tt>vipw</tt> como root para editar com segurança seu {{path|/etc/passwd}}. Ache o 'kde-devel' no arquivo. Mude '{{path|/bin/sh}}' no final da linha para '{{path|/bin/bash}}', salve as mudanças e saia. | |
| − | + | O novo shell vai startar automaticamente quando você entrar como o usuário kde-devel. | |
== D-Bus == | == D-Bus == | ||
| − | QtDBus | + | O QtDBus e KDE são conhecidos por trabalhar com versões 0.62, também com 0.92 e superiores, do D-Bus. As versões 0.60 e 0.61 podem funcionar também mas não foram testadas. Nós recomendamos usar a versão post-1.0 release (pelo menos a 0.94), então atualize se você não o fez. |
| − | + | Você pode pular essa parte se você já tem uma versão recente do D-Bus ou se não quer atualizar. Provavelmente você não quer compilar os bindings ao menos que você irá ter que compilar o HAL (ver abaixo). | |
| − | + | Antes de continuar com os passos, tenha certeza que os cabeçalhos do X11 e as bibliotecas estão habilitadas. O script configure roda na linha 5, a seguinte instrução deverá aparecer para confirmar: | |
Building X11 code: yes | Building X11 code: yes | ||
| − | === | + | === A Receita === |
| − | {{tip| | + | {{tip (pt_BR)|Tenha certeza que você configurou o ambiente corretamente como feito [[Getting_Started/Build/KDE4_%28pt_BR%29#Configurando_o_Ambiente|acima]]. Isso é necessário para as funções <tt>cs</tt> e <tt>cb</tt> funcionarem.}} |
| − | cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' | + | cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' é uma função bash, clique aqui para saber mais(inglês)]] |
wget http://dbus.freedesktop.org/releases/dbus/dbus-1.0.2.tar.gz | wget http://dbus.freedesktop.org/releases/dbus/dbus-1.0.2.tar.gz | ||
tar -xvzf dbus-1.0.2.tar.gz | tar -xvzf dbus-1.0.2.tar.gz | ||
| Line 395: | Line 396: | ||
sudo dbus-uuidgen --ensure | sudo dbus-uuidgen --ensure | ||
| − | cs # | + | cs # ver acima |
wget http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.74.tar.gz | wget http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.74.tar.gz | ||
tar -xvzf dbus-glib-0.74.tar.gz | tar -xvzf dbus-glib-0.74.tar.gz | ||
| Line 402: | Line 403: | ||
make | make | ||
sudo make install | sudo make install | ||
| − | + | cd | |
sudo chown -R kde-devel:kde-devel * | sudo chown -R kde-devel:kde-devel * | ||
| − | === | + | === O que está acontecendo === |
| − | + | Depois de mudar para o diretório do código fonte(linha 1), o código fonte do D-Bus é baixado pelo freedesktop.org (linha 2) e descompactado (linha 3). Depois entra no diretório criado para o D-Bus (linha 4), as configurações de compilação são criadas pelo script {{path|configure}} (linha 5). Depois da compilação (linha 6) e instalação (linha 7) do D-Bus, nós usamos a ferramenta <tt>dbus-uuidgen</tt> para instalar o arquivo de identificação da maquina (machine identification file) que permite o bus começar automaticamente quando a sessão do desktop começar (linha 8). | |
| − | Note | + | Note que você precisa de permissão de escrita no {{path|/var}} para os dois últimos passos. Se seu sistema não tem acesso ao comando sudo, você pode usar o comando <tt>su</tt>, ex. <tt>su -c "make install"</tt>. |
| − | + | Os passos para compilar os bindings do glib são similares aos acima. | |
| − | + | Então quando esses dois pacotes estão compilados e instalados, nós precisamos arrumar o dono do arquivo pois ao usar 'sudo make install' o root que fica como dono do arquivo e dos diretórios no ~kde-devel/kde. | |
== CMake == | == CMake == | ||
| − | + | Pule essa parte se você têm o [http://cmake.org/ CMake] >=2.4.5 instalado. | |
| − | + | Você pode baixar os pacotes binários diretamente do [http://www.cmake.org/HTML/Download.html CMake site]. Existem também pacotes específicos para diversas distribuições. | |
| − | === | + | === A Receita === |
<!--'cs' and 'cb' are NOT typos!--> | <!--'cs' and 'cb' are NOT typos!--> | ||
| − | cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' | + | cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' é uma função bash, clique aqui para saber mais(inglês) ]] |
wget http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz | wget http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz | ||
tar -zxf cmake-2.4.6.tar.gz | tar -zxf cmake-2.4.6.tar.gz | ||
| Line 430: | Line 431: | ||
sudo make install | sudo make install | ||
| − | === | + | === O que está acontecendo === |
| − | + | Primeiro, vamos ao diretório do código fonte (linha 1), baixamos o código fonte do CMake (linha 2) e os descompactamos (linha 3). Criamos um diretório para compilar o CMake (linha 4) e entramos nele (linha 5). Rodamos o script de bootstrap do CMake para configurar a compilação (linha 6), depois compilamos (linha 7) e instalamos (linha 8) usando o usuário root. | |
| − | + | Se seu sistema não tem acesso ao comando <tt>sudo</tt>, então você pode usar o <tt>su -c "make install"</tt>. | |
== Qt == | == Qt == | ||
| − | + | Agora precisamos instalar o Qt4 que está no repositório do KDE. KDE é garantido com qualquer Qt 4.3. Qt 4.2 e antigos não são suportados e não irá funcionar. Você deve usar a cópia do Qt no server Subversion do KDE. (nota: algumas distribuições, tais como Debian e openSUSE, dão um suporte ao Qt com patches do KDE svn, então você pode usar o método pré-compilado da sua distro, porque eles irão funcionar normalmente). KDE tenta garantir que o código é compativel com o Qt 4.3.0, mas você pode pegar alguns bugfixes adicionais usando o qt-copy (entretanto, sua distribuição já deve cuidar desses bugfixes, então na maioria das vezes a distro já disponibiliza uma versão com atualizações suficientes). Para maior referência sobre distribuições, acesse as sessões acima. | |
| − | + | Por enquanto a compatibilidade com o Qt3 é obrigatória, porfavor <b>evite</b> usar a opção "-no-qt3support" quando for compilar o Q4. | |
| − | === | + | === A Receita === |
| − | cd # Note: qt-copy | + | cd # Note: qt-copy fica em $HOME/qt-copy. Veja $QTDIR em [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|<font color=red>.bashrc</font>]] |
svn checkout svn://anonsvn.kde.org/home/kde/trunk/qt-copy | svn checkout svn://anonsvn.kde.org/home/kde/trunk/qt-copy | ||
cd qt-copy | cd qt-copy | ||
| Line 449: | Line 450: | ||
make -j2 | make -j2 | ||
| − | # | + | # se não instalamos, só limpa os arquivos obj para |
| − | # | + | # limpar memória no disco |
if [ $QTDIR = `pwd` ]; then \ | if [ $QTDIR = `pwd` ]; then \ | ||
find . -name '*.o' -delete ; \ | find . -name '*.o' -delete ; \ | ||
else make install; fi; | else make install; fi; | ||
| − | === | + | === O que está acontecendo === |
| − | + | Nós mudamos de volta para o diretório home do usuário <tt>kde-devel</tt> (linha 1) e fizemos o download do código usando o subversion (svn) pelo repositório do KDE (linha 2). Depois acessamos o diretório {{path|qt-copy}} (linha 3), rodamos o script que manipula os patches que vem com o <tt>qt-copy</tt> (linha 4). | |
| − | + | Uma vez que os patches foi feito, nós rodamos o script <tt>configure</tt> para configurar a instalação (linha 5-6). Os comandos de linha usados são explicados no arquivo {{path|qt-copy/README.qt-copy}}. Finalmente, nós compilamos os requerimentos minimos para o KDE (linha 7) e instalamos (linha 10) o Qt. Se o diretório de instalação for o mesmo do diretório corrente (line 8), então só limpamos um pouco de espaço (linha 9). Se você quiser todos os exemplos e aplicações demo, você pode compilar individualmente ou simplismente dar um <tt>make</tt> no diretório {{path|qt-copy}}. | |
| − | Note | + | Note que a instalação não requer root já que o Qt é instalado localmente no {{path|$QTDIR}}. Mas, a instalação só é necessário se o {{path|$QTDIR}} for diferente do {{path|$HOME/qt-copy}}, que não é o caso se você seguiu todas as instruções corretamente. |
| − | === | + | === Solução de problemas === |
| − | + | Se você teve "error: X11/Xlib.h: No such file or directory", instale o devel package do <tt>xorg</tt> (o nome varia bastante da distribuição, por exemplo é <tt>xorg-dev</tt> nos sistemas baseados em Ubunto como o Kubuntu). | |
| − | + | Se você teve um erro de no passo de configuração (linha 5-6), cheque o valor da variável <tt>$QMAKESPEC</tt>. Algumas distribuições setam essa variável apontado diretamente pro diretório Qt do sitema. Se <tt>unset QMAKESPEC</tt> resolver seu problema, então provavelmente você quer adicionar no seu script <tt>~/.bashrc</tt>. | |
| − | + | Se você teve um erro ".pch/debug-shared/QtCore", isso é porque o Qt-4.3 habilita cabeçalhos pré-compilados para o gcc suportar isso, mas por alguma rasão isso não funcionou para você. Se você usar distcc, configure o qt com -no-pch. Se você usa o icecream, atualize para a útlima versão do svn trunk. | |
| − | + | Tente rodar qualquer programa Qt, como o {{program|assistant}}. '''Nota:''' Você talvez precise rodar <tt>xhost +local:kde-devel</tt> com seu usuário normal do kde3 para rodar essa aplicação. Se der erro no QSpanData::adjustSpanMethods, então seu problema é o style. Tente remover {{path|lib/kde4/plugins/styles/kstyle-oxygen.so}} e {{path|lib/kde4/plugins/styles/oxygen.so}} se eles existirem no prefixo de instalação do KDE. | |
== HAL == | == HAL == | ||
| − | {{tip| | + | {{tip (pt_BR)|Você pode usar qdbusviewer para ver se tem org.freedesktop.hal. Se não tem, vai precisar da versão mais nova do hal. Mas se tiver o org.freedesktop.hal, Então provavelmente não precisa, e não ''quer'', use seu próprio HAL.}} |
| − | + | Se seu sistema requer a versão mais recente do HAL, Há uma boa chance de você precisar fazer outros coisas, algumas das quais pode não estar aqui. No entanto, isto deve ser requerido somente para velhas distribuições. | |
== kdesupport == | == kdesupport == | ||
| − | {{warning|Don't forget to read the [[Getting_Started/Build/KDE4#Setting_up_the_environment|Setting Up The Environment]] section first.}} | + | {{warning (pt_BR)|Don't forget to read the [[Getting_Started/Build/KDE4#Setting_up_the_environment|Setting Up The Environment]] section first.}} |
There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs. | There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs. | ||
| Line 487: | Line 488: | ||
Please remember that if you use openSUSE, you can install the needed packages from the KDE:KDE4 buildservice repository and do not have to bother with fiddling the details below. Skip to the kdelibs section. | Please remember that if you use openSUSE, you can install the needed packages from the KDE:KDE4 buildservice repository and do not have to bother with fiddling the details below. Skip to the kdelibs section. | ||
| − | === | + | === A Receita === |
<!--'cs' and 'cb' are NOT typos!--> | <!--'cs' and 'cb' are NOT typos!--> | ||
cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | ||
| Line 494: | Line 495: | ||
cmakekde | cmakekde | ||
| − | === | + | === O que está acontecendo === |
We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new {{path|~/kde/src/kdesupport}} directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed. | We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new {{path|~/kde/src/kdesupport}} directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed. | ||
| − | === | + | === Solução de problemas === |
If you get | If you get | ||
cmakekde: command not found | cmakekde: command not found | ||
| Line 537: | Line 538: | ||
We can now move on to building KDE's base libraries. | We can now move on to building KDE's base libraries. | ||
| − | === | + | === A Receita === |
cd | cd | ||
cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | cs # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | ||
| Line 545: | Line 546: | ||
cmakekde | cmakekde | ||
| − | === | + | === O que está acontecendo === |
We change to the base source directory (line 1) then make and go into the KDE directory (line 2). We download the sources for kdelibs using subversion (line 3), go into the new {{path|~/kde/src/KDE/kdelibs}} directory (line 4), and commence the build (line 5). This will leave us in the <tt>kdelibs</tt> build directory after the build is completed. | We change to the base source directory (line 1) then make and go into the KDE directory (line 2). We download the sources for kdelibs using subversion (line 3), go into the new {{path|~/kde/src/KDE/kdelibs}} directory (line 4), and commence the build (line 5). This will leave us in the <tt>kdelibs</tt> build directory after the build is completed. | ||
| − | {{tip|There might be missing dependencies on your system! They are easily overlooked in the output of <tt>cmakekde</tt>. | + | {{tip (pt_BR)|There might be missing dependencies on your system! They are easily overlooked in the output of <tt>cmakekde</tt>. |
You might want to do a <tt>cmake $KDE_SRC/KDE/MODULE_NAME</tt> prior to compiling any kde modules (like kdelibs, kdepimlibs etc.)}} | You might want to do a <tt>cmake $KDE_SRC/KDE/MODULE_NAME</tt> prior to compiling any kde modules (like kdelibs, kdepimlibs etc.)}} | ||
| Line 554: | Line 555: | ||
There are additional CMake modules in {{path|kdelibs/cmake/modules/}} that are necessary for building KDE4 applications. These will be installed for you when kdelibs itself is installed. | There are additional CMake modules in {{path|kdelibs/cmake/modules/}} that are necessary for building KDE4 applications. These will be installed for you when kdelibs itself is installed. | ||
| − | === | + | === Solução de problemas === |
If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/KDE4#Required_Software|Required Software]] section above is installed and works. Other possible hints include: | If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/KDE4#Required_Software|Required Software]] section above is installed and works. Other possible hints include: | ||
* If the <tt>cmakekde</tt> command fails stating that CMake requires an out of source build directory, remove {{path|~/kde/src/KDE/kdelibs/CMakeCache.txt}}, and try again. | * If the <tt>cmakekde</tt> command fails stating that CMake requires an out of source build directory, remove {{path|~/kde/src/KDE/kdelibs/CMakeCache.txt}}, and try again. | ||
| Line 573: | Line 574: | ||
* Here you need the libungif library, otherwise you will get an error message like "<tt>Could NOT find GIF</tt>". | * Here you need the libungif library, otherwise you will get an error message like "<tt>Could NOT find GIF</tt>". | ||
* Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run). | * Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run). | ||
| − | * if you get < | + | * if you get <syntaxhighlight lang="text">CMake Error: KDE Requires Qt to be built with SSL support |
| − | </ | + | </syntaxhighlight>, install openssl-devel, remove CMakeCache.txt and re-compile QT. |
| − | * if you get < | + | * if you get <syntaxhighlight lang="text">kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'</syntaxhighlight> it means you compiled QT without QT3 support(no, linking to a true QT3 install won't work) |
== kdepimlibs == | == kdepimlibs == | ||
After <tt>kdelibs</tt>, but before ''kdebase'', you need to build and install ''kdepimlibs''. | After <tt>kdelibs</tt>, but before ''kdebase'', you need to build and install ''kdepimlibs''. | ||
| − | === | + | === A Receita === |
<!--'cs' and 'cb' are NOT typos!--> | <!--'cs' and 'cb' are NOT typos!--> | ||
cs KDE # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | cs KDE # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | ||
| Line 587: | Line 588: | ||
cmakekde | cmakekde | ||
| − | === | + | === O que está acontecendo === |
We go into the KDE source directory (line 1), download the source code for kdepimlibs using subversion (line 2) and then go into the new {{path|~/kde/src/KDE/kdepimlibs}} directory (line 3). We then commence the build (line 4). This will leave us in the <tt>kdepimlibs</tt> build directory after the build is completed. | We go into the KDE source directory (line 1), download the source code for kdepimlibs using subversion (line 2) and then go into the new {{path|~/kde/src/KDE/kdepimlibs}} directory (line 3). We then commence the build (line 4). This will leave us in the <tt>kdepimlibs</tt> build directory after the build is completed. | ||
| − | === | + | === Solução de problemas === |
| − | + | Se você tem problemas compilando kdepimlibs: | |
* the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/(en)/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install. | * the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/(en)/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install. | ||
== kdebase == | == kdebase == | ||
| − | kdebase | + | kdebase é dividido em três partes: |
* '''apps''' | * '''apps''' | ||
:This contains applications like Dolphin or KWrite. | :This contains applications like Dolphin or KWrite. | ||
| Line 603: | Line 604: | ||
:This contains things specific to the KDE desktop, like Plasma or the window manager. Most stuff here depends on X11. You only need it if you want to build a full KDE desktop. | :This contains things specific to the KDE desktop, like Plasma or the window manager. Most stuff here depends on X11. You only need it if you want to build a full KDE desktop. | ||
| − | You can build all of kdebase at once, which is described in the recipe below. If you only want to build kdebase-runtime, which is the only requirement, you can replace < | + | You can build all of kdebase at once, which is described in the recipe below. If you only want to build kdebase-runtime, which is the only requirement, you can replace <syntaxhighlight lang="bash">cd kdebase</syntaxhighlight> with <syntaxhighlight lang="bash">cd kdebase/runtime</syntaxhighlight> in the recipe below. |
| − | === | + | === A Receita === |
<!--'cs' and 'cb' are NOT typos!--> | <!--'cs' and 'cb' are NOT typos!--> | ||
cs KDE # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | cs KDE # [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc|'cs' is a bash function, click here to learn more]] | ||
| Line 612: | Line 613: | ||
cmakekde | cmakekde | ||
| − | === | + | === Solução de problemas === |
If you have troubles compiling kdebase: | If you have troubles compiling kdebase: | ||
* Make sure you have the <tt>libxss headers</tt> installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers) | * Make sure you have the <tt>libxss headers</tt> installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers) | ||
| − | * <tt>which | + | * <tt>which meinproc4</tt> has to deliver {{path|/home/kde-devel/kde/bin/meinproc4}} |
* if cmakekde can not find the path of kdepimlibs, edit the file {{path|$KDE_BUILD/KDE/kdebase/CMakeCache.txt}} and manually set <tt>KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs</tt> | * if cmakekde can not find the path of kdepimlibs, edit the file {{path|$KDE_BUILD/KDE/kdebase/CMakeCache.txt}} and manually set <tt>KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs</tt> | ||
* if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of <tt>Xtst</tt>. On some systems, this is packaged separately from <tt>xext</tt> and called <tt>x11proto-xext-dev</tt> or <tt>libxtst-dev</tt>. You may also need to remove the CMakeCache.txt file in the build dir after installing the package. | * if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of <tt>Xtst</tt>. On some systems, this is packaged separately from <tt>xext</tt> and called <tt>x11proto-xext-dev</tt> or <tt>libxtst-dev</tt>. You may also need to remove the CMakeCache.txt file in the build dir after installing the package. | ||
| Line 629: | Line 630: | ||
* If you get the message "kdebase/workspace/kcontrol/kxkb/x11helper.cpp:131: error: ‘KGlobal’ has not been declared", you might need to install libxklavier development packages. | * If you get the message "kdebase/workspace/kcontrol/kxkb/x11helper.cpp:131: error: ‘KGlobal’ has not been declared", you might need to install libxklavier development packages. | ||
| − | == | + | == Executando programas KDE 4 == |
| − | + | Você pode agora executar programas KDE 5 (exemplo, kwrite) digitando: | |
ssh -X kde-devel@localhost | ssh -X kde-devel@localhost | ||
kwrite | kwrite | ||
| − | === | + | === Solução de problemas === |
| − | * | + | * Se você obter |
KUniqueApplication: Cannot find the D-Bus session server | KUniqueApplication: Cannot find the D-Bus session server | ||
check if you can access the display, e.g. type | check if you can access the display, e.g. type | ||
| Line 643: | Line 644: | ||
and see if a clock appears on the screen. | and see if a clock appears on the screen. | ||
| − | * | + | * Se você obter algo como |
Error: standard icon theme "oxygen" not found! | Error: standard icon theme "oxygen" not found! | ||
| Line 650: | Line 651: | ||
You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase. | You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase. | ||
| − | == | + | == Gerando a documentação API local == |
Although the API documentation for KDE is available online at [http://api.kde.org api.kde.org], it is sometimes useful to have it on your own disk, for example when you want to use [[Getting_Started/Set_up_KDE_4_for_development#KDevelop|KDevelop]] for browsing the documentation or when you are not able to be online all the time. | Although the API documentation for KDE is available online at [http://api.kde.org api.kde.org], it is sometimes useful to have it on your own disk, for example when you want to use [[Getting_Started/Set_up_KDE_4_for_development#KDevelop|KDevelop]] for browsing the documentation or when you are not able to be online all the time. | ||
| Line 668: | Line 669: | ||
Another, even easier method involves downloading this [[Doxyfile]] to your local system. Then simply change directory to where you want to create the documentation and run | Another, even easier method involves downloading this [[Doxyfile]] to your local system. Then simply change directory to where you want to create the documentation and run | ||
| − | < | + | <syntaxhighlight lang="bash"> |
% doxygen /path/to/Doxyfile | % doxygen /path/to/Doxyfile | ||
| − | </ | + | </syntaxhighlight> |
Then review the file {{path|doxygen.log}} to see the doxygen errors and warnings. You'll find the actual documentation in the {{path|apidocs}} subdirectory. | Then review the file {{path|doxygen.log}} to see the doxygen errors and warnings. You'll find the actual documentation in the {{path|apidocs}} subdirectory. | ||
| − | == | + | == Mantendo-se atualizado == |
In order to keep the kde4 installation up to date, each of the modules installed should be updated periodically. As Monday is the day for big changes in kdelibs, Tuesday may be the best day to do this. For each module checked out, run <tt>svn up</tt> and <tt>make</tt>. | In order to keep the kde4 installation up to date, each of the modules installed should be updated periodically. As Monday is the day for big changes in kdelibs, Tuesday may be the best day to do this. For each module checked out, run <tt>svn up</tt> and <tt>make</tt>. | ||
For example: | For example: | ||
| − | < | + | <syntaxhighlight lang="bash"> |
cs kdesupport # cs is not a typo | cs kdesupport # cs is not a typo | ||
svn up | svn up | ||
cb # cb is not a typo | cb # cb is not a typo | ||
make -j2 VERBOSE=1 && make install | make -j2 VERBOSE=1 && make install | ||
| − | </ | + | </syntaxhighlight> |
| − | == | + | == Instalando um subconjunto de um módulo == |
Many modules in KDE contain a large number of programs which could take a long time to download and compile. In cases where you want to work only on a particular program or programs in a module, it is possible to download and compile particular folders. In some cases, certain folders are required for any build of the module. This is determined in the CMakeLists.txt file of the module. For example the [http://websvn.kde.org/trunk/KDE/kdegames/CMakeLists.txt?view=markup kdegames CMakeLists.txt file] lists: | Many modules in KDE contain a large number of programs which could take a long time to download and compile. In cases where you want to work only on a particular program or programs in a module, it is possible to download and compile particular folders. In some cases, certain folders are required for any build of the module. This is determined in the CMakeLists.txt file of the module. For example the [http://websvn.kde.org/trunk/KDE/kdegames/CMakeLists.txt?view=markup kdegames CMakeLists.txt file] lists: | ||
| − | < | + | <syntaxhighlight lang="text"> |
add_subdirectory(libkdegames) | add_subdirectory(libkdegames) | ||
add_subdirectory(libkmahjongg) | add_subdirectory(libkmahjongg) | ||
| Line 696: | Line 697: | ||
macro_optional_add_subdirectory(lskat) | macro_optional_add_subdirectory(lskat) | ||
macro_optional_add_subdirectory(katomic) | macro_optional_add_subdirectory(katomic) | ||
| − | </ | + | </syntaxhighlight> |
So, the libkdegames and libkmahjongg directories are required to build any of kdegames. The cmake directory will also usually be required. All the other directories (doc, katomic etc) are optional. They will be built if present on your machine. In this example, we build kmahjongg and kbattleship: | So, the libkdegames and libkmahjongg directories are required to build any of kdegames. The cmake directory will also usually be required. All the other directories (doc, katomic etc) are optional. They will be built if present on your machine. In this example, we build kmahjongg and kbattleship: | ||
| − | < | + | <syntaxhighlight lang="bash"> |
cs KDE | cs KDE | ||
svn co -N kdegames # The -N switch performs a non-recursive checkout | svn co -N kdegames # The -N switch performs a non-recursive checkout | ||
| Line 710: | Line 711: | ||
svn up kmahjongg | svn up kmahjongg | ||
cmakekde | cmakekde | ||
| − | </ | + | </syntaxhighlight> |
| − | == | + | == Solução de problemas gerais == |
What can happen over time, after some <tt>svn up</tt> commands, is that some of the tools used in the KDE build chain change their output format. For example, <tt>kcfg</tt> files are read by <tt>kconfig_compiler</tt> to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files: | What can happen over time, after some <tt>svn up</tt> commands, is that some of the tools used in the KDE build chain change their output format. For example, <tt>kcfg</tt> files are read by <tt>kconfig_compiler</tt> to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files: | ||
| Line 718: | Line 719: | ||
The same applies to <tt>ui</tt> files as produced by Qt designer. | The same applies to <tt>ui</tt> files as produced by Qt designer. | ||
| − | === | + | === Sessões bloqueadas === |
When installing KDE 4 as a user, one will not be able to unlock a locked session. To work around this issue you can either: | When installing KDE 4 as a user, one will not be able to unlock a locked session. To work around this issue you can either: | ||
su | su | ||
| Line 725: | Line 726: | ||
chmod 755 $KDEDIR/lib/kde4/libexec/kcheckpass | chmod 755 $KDEDIR/lib/kde4/libexec/kcheckpass | ||
| − | == | + | == Sucesso! == |
You are now ready to start building other svn modules in the same fashion as you built kdebase, running and testing KDE4 or writing your own patches and applications. | You are now ready to start building other svn modules in the same fashion as you built kdebase, running and testing KDE4 or writing your own patches and applications. | ||
| Série de Tutoriais | Primeiros passos |
| Pré-requisitos | Guia rápido de SVN anônimo |
| Qual é o próximo | Configurando o KDE4 para desenvolvimento |
| Leitura adicional | kdesvn-build: The KDE From Subversion Build Tool Aumentando a produtividade no KDE 4 com Scripts Introdução ao CMake Notas sobre FreeBSD Instruções para Mac OS X Instruções para MS Windows |
Esse tutorial mostra uma maneira de instalar o KDE pelo trunk rodando em sistemas Linux/BSD. Você pode também ajudar a traduzir tutoriais para FreeBSD, Windows, Mac OS X e Solaris. Durante todo o tutorial o bash shell é usado.
| Existe um grande risco de falhas nas Segundas-Feiras quando a maioria das kdelibs são commited(atualizadas). Acesse o Dashboard para reportar quebras inesperadas. Você é encorajado à corrigir as falhas e erros. |
|---|
| Aviso |
|
Algumas pessoas gostam de ter uma conta de usuário separada para o KDE4 (Antes de que um bug apague arquivos por engano), e as instruções abaixo foram escritas com esse propósito. Entretando é muito mais eficiente por ter tudo em uma conta de usuário, veja Aumentando a produtividade no KDE4 com Scripts(inglês) para mais detalhes. Você pode continuar seguindo as instruções abaixo, mas não coloque as váriaveis de ambiente no seu .bashrc, coloque elas em um arquivo separado que você faça uso quando for para o ambiente de desenvolvimento do KDE 4. |
|---|
| Nota |
useradd -m kde-devel passwd kde-devel
Ao invés dos comandos acima, você pode usar o módulo User no KDE Control Center se você já tem o KDE3 instalado.
Copie o ~/.bashrc do seu usuário normal par o novo usuário kde-devel. Depois, copie e cole o conteúdo do exemplo .bashrc dentro do ~kde-devel/.bashrc. Tenha certeza de comentar a linha alias make=makeobj se você não tem o comando makeobj. Provavelmente você quer modificar os paths para ter certeza que não irá incluir os kde3 paths. Também se você quer usar o KDevelop para desenvolver aplicativos para o KDE 4 você precisa passar a flag -GKDevelop3 ao comando cmake (para fazer o CMake gerar arquivos de projetos KDevelop, isso irá ajudar a recompilar no futuro, veja isso). Para fazer isso, você precisa abrir um novo bash ou executar
source ~/.bashrc
Isso irá dar acesso aos comandos tais como cmakekde que é usado no tutorial para forçar o cominho dos binários do Qt, KDE e CMake.
Para mais informações, por favor leia o tutorial Aumentando a produtividade no KDE4 com Scripts(inglês).
Mude para o usuário kde-devel: (Não se esqueça do hífen)
ssh -X kde-devel@localhost
Os seguintes softwares precisam ser instalados antes de seguir com o tutorial:
No Ark Linux, as dependências que você precisa são instaladas pelo comando:
apt-get install devel-core libxml-devel libxslt-devel bzip2-devel \
clucene-core-devel librdf-devel shared-mime-info xorg-Mesa-libGL-devel \
subversion boost-devel doxygen giflib-devel dbus-devel openssl-devel \
alsa-lib-devel kdesdk-scripts qt4-develSe você preferir uma interface gráfica, selecione os pacotes listados acima na ferramenta "Install Software" no Mission Control.
Isso inclui a instalação do CMake, DBus e Qt - você pode pular os passos 5, 6 e 7.
No Arch Linux você precisa instalar os seguintes pacotes:
pacman -Sy subversion bzip2 libxslt libxml2 \ shared-mime-info mesa boost dbus openssl \ pkgconfig xine-lib
Se quiser, você pode instalar o qt4 a partir do repositório do Arch Linux com o comando:
pacman -Sy qt4Para as bibliotecas clucene você precisa do PKGBUILD pelo AUR.
Alguns pacotes são requisitos para a compilação do KDE4 no Fedora 7 ou superior:
yum install clucene-core-devel libxml-devel libxslt-devel \ dbus-devel boost-devel bzip2-devel openssl-devel alsa-lib-devel \ redland-devel rasqal-devel raptor-devel hspell-devel aspell-devel \ cups-devel xine-lib-devel avahi-devel gamin-devel OpenEXR-devel \ enchant-devel jasper-devel ilmbase-devel pcre-devel gpgme-devel \ libxklavier-devel glib-devel libusb-devel libsmbclient-devel \ libxcb-devel NetworkManager-devel lm_sensors-devel libraw1394-devel \ bluez-libs-devel gcc-c++ libXext-devel cmake subversion giflib-devel \ libpng-devel libXdamage-devel libXcomposite-devel libXrender-devel \ fontconfig-devel libXft-devel libXcursor-devel libXfixes-devel \ ruby-devel libXScrnSaver-devel libkdcraw-devel exiv2-devel \ lcms-devel libtiff-devel sqlite-devel libxkbfile-devel \ imlib2-devel patch
Esta instalação inclui o D-Bus e CMake -- você pode pular os passos 5 e 6.
DCH-10/15/07: Note - Pode ser mais simples usar RPMs. Note que vocÊ pode editar as variáveis em /etc/rpm/macros.kde4 (que são providas pelo Rawhide kde-filesystem).
Para compilar:
%build mkdir -p %{_target_platform} pushd %{_target_platform} %{cmake_kde4} .. popd make %{?_smp_mflags} -C %{_target_platform}
Eu tive melhores resultados criando uma rpm do kdesupport, significa que você não precisa instalar o soprano e strigi rpms. YMMV
No Kubuntu 7.04 (Feisty) e Debian (Testing/Unstable) as dependências que você precisa instalar são:
sudo aptitude install build-essential cdbs debhelper cmake \ libxml2-dev libxslt1-dev libbz2-dev libclucene-dev librdf-dev \ shared-mime-info libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev \ libxext-dev libjpeg-dev libpng12-dev subversion libsm-dev libxinerama-dev \ libxrender-dev libfontconfig-dev libboost-dev libxcursor-dev doxygen \ libungif4-dev libdbus-1-dev libssl-dev libgpgme11-dev \ libasound2-dev kdesdk-scripts libpth-dev libjasper-dev \ ssh libxine-dev libqimageblitz-dev libqimageblitz4 libglib2.0-dev \ libxkbfile-dev libenchant-dev libbluetooth-dev network-manager-dev \ libsmbclient-dev libxcb1-dev libcaptury-dev libxcomposite-dev \ libxdamage-dev libusb-dev libgpgme11-dev libldap2-dev
No Kubuntu 7.10 (Gutsy) e Debian unstable você deve adicionar:
sudo aptitude install dbus-x11 libqt4-dev libqca2-dev libeigen-dev \ libstreamanalyzer-dev libsoprano-dev libstrigiqtdbusclient-dev \ libxklavier11-dev libxml2-utils libdbus-1-dev libxslt1-dev cmake libbz2-dev \ libungif4-dev libgpgme11-dev libboost-dev libxine-dev
Para uma completa e funcional documentação da API você também precisa:
sudo aptitude install graphviz
Não há necessidade de compilar o qt ou kdesupport no kubuntu gutsy. Todos os pacotes requeridos já estão inclusos na instalação acima. Para configurar o kde4 user e etc será explicado na próxima sessão, mas passe por cima das sessões de compilação do qt, hal e kdesupport.
|
Se você tiver erros na compilação do KDE4 Beta4 ou acima no Kubuntu 7.10, como: Soprano version is too low strigi xxx.h not found... Talvez você precise dar um checkout na parte do código fonte do kdesupport no SVN server do KDE4. Isso será mostrado quando você chegar na parte da compilação do kdesupport. |
|---|
| Nota |
No openSUSE 10.2 e versões mais novas, você pode instalar os pacotes usando Zypper:
sudo zypper install <package-name>
Em versões mais antigas do SUSE, você pode usar o YaST:
su yast -i <packagename>
Pacotes Requeridos
Os pacotes que você precisa instalar são:
xorg-x11-devel libxml2-devel kdesdk3 clucene-core-devel boost-devel libjpeg-devel liblrdf-devel libpng-devel libxslt-devel libredland-devel Mesa-devel giflib-devel subversion gcc gcc-c++ gmp-devel (needed to build kdesupport) xine-devel libgpgme-devel (needed to build kdepimlibs)
Pacotes Opcionais
Você pode pular a parte de instalação do manual e a do kdesupport e suas dependências ( Qt 4.3, CMake 2.4.6, DBus, Hal, clucene-core, Strigi, Soprano e outras dependências do Nepomuk) por adicionar o repositório KDE:KDE4 do openSUSE Build Service para suas instalações.
Para openSUSE 10.2 ou mais novo, faça:
sudo zypper service-add http://software.opensuse.org/download/KDE:/KDE4/openSUSE_10.2 KDE4-102
Para versões mais velhas do SUSE Linux faça:
su installation_sources -a http://software.opensuse.org/download/KDE:/KDE4/[SUA VERSÃO SUSE LINUX]
Agora instale os seguintes pacotes:
cmake dbus-1-devel libqt4-devel libqca2-devel libsoprano-devel libqimageblitz-devel strigi strigi-ui
Existem mais pacotes que precisam ser instalados para satisfazer o config-check, como libusb-devel, bison etc., então dê uma olhada nas notificações de configuração e instale de acordo. Por favor lembre de pular qualquer instrução que seja referencia do kdesupport abaixo. Comece a compilar pelo kdelibs.
E para uma completa e funcional documentação da API você vai precisar também:
graphviz
Os pacotes binários do CMake para openSUSE estão disponiveis no repositório do KDE:KDE4 pelo openSUSE build service.
Você pode usar stable ebuilds só lembrando o seu sync portage antes de começar.
Lembrete: Todos os comandos são executados como root.
Requerimento:
Precisamos habilitar os seguintes keywords no ebuilds.
echo 'dev-util/cmake' >> /etc/portage/package.keywords echo 'dev-cpp/clucene' >> /etc/portage/package.keywords
Tenha certeza que você setou a flah USE para o redland, se não o epomuk não irá funcionar.
echo 'dev-libs/redland berkdb' >> /etc/portage/package.use echo 'x11-libs/qt accessibility' >> /etc/portage/package.use
Esses são os pacotes que você vai precisar. Eu inclui a opção update para que você não precise reusar o emarge para pacotes já instalados.
emerge -avu 'sys-devel/gcc' \ 'dev-util/subversion' \ 'dev-util/pkgconfig' \ 'x11-base/xorg-x11' \ 'virtual/glut' \ 'media-libs/mesa' \ 'media-libs/jpeg' \ 'media-libs/libpng' \ 'media-libs/giflib' \ 'dev-cpp/clucene' \ 'dev-util/cppunit' \ 'media-libs/liblrdf' \ 'dev-libs/libxml2' \ 'dev-libs/libxslt' \ 'x11-misc/shared-mime-info' \ 'dev-libs/boost' \ 'dev-util/cmake' \ 'dev-libs/redland' \ 'sys-apps/dbus' \ 'sys-apps/hal' \ 'x11-libs/qt'
Você também vai precisar usar o emerge para o 'kde-base/kdesdk' ou kde-base/kdesdk-scripts'.
Se você "emergou" o DBUS, CMAKE, QT ou HAL você pode pular as seguintes sessões. Boa sorte!
Você pode instalar os pacotes KDE4 diretamente por:
emerge -a <packagename>
Para isso você precisa instalar layman e depois colocar no "kde" overlay (que contém a experimental KDE ebuilds):
layman -a kdeDepois disso você precisa ajudar alguns USE-flags para o KDE4 e avisar o portage para usar o testing KDE 4 ebuilds ao invez do stable KDE 3.
Assim o portage irá fazer todo trabalho de dependência para você.
Informações detalhadas de como compilar o KDE4 no Gentoo via portage pode ser encontrada no KDE overlay wiki. E também é discutida nesse tópico KDE 4 monolithic ebuilds.
No Mandriva as dependências necessárias para compilar o KDE4 são:
urpmi gcc-c++ cmake libxml2-devel libbzip2_1-devel \
libclucene0-devel liblrdf2-devel libmesagl1-devel \
subversion doxygen libdbus-1_3-devel libopenssl0.9.8-devel \
libalsa2-devel libgpgme-devel libboost1-devel libxine-develSe você está rodando em um processador 64-bit você deve substituir o começo dos nomes dos pacotes de "lib..." para "lib64...".
Se você prefere uma interfaçe gráfica(GUI), selecione os pacotes listados acima na ferramenta "Install Software" no Mandriva Linux Control Center.
Isso inclui as instalação do CMake, DBus - você pode pular os passos 5 e 6.
Em alguns sistemas um novo usuário é configurado por padrão para usar o /bin/sh. Se esse não é o caso do seu sistema, você pode pular essa sessão. Usando /bin/sh pode ser bastante inconveniente para trabalhar e talvez você queria mudar isso para /bin/bash ou outro shell. No Ark Linux, Fedora e Slackware, você pode pular esse passo - /bin/sh é bash.
Se você não tem acesso ao root e seu sistema suporta a mudança do seu próprio shell com o aplicativo chsh, então você pode tentar mudar seu shell para /bin/bash assim:
chsh -s /bin/bash kde-devel
Se seu sistema vem com a aplicação usermod você pode rodar o seguinte comando como root: usermod -s /bin/bash kde-devel.
Outra opção é de usar a aplicação vipw como root para editar com segurança seu /etc/passwd. Ache o 'kde-devel' no arquivo. Mude '/bin/sh' no final da linha para '/bin/bash', salve as mudanças e saia.
O novo shell vai startar automaticamente quando você entrar como o usuário kde-devel.
O QtDBus e KDE são conhecidos por trabalhar com versões 0.62, também com 0.92 e superiores, do D-Bus. As versões 0.60 e 0.61 podem funcionar também mas não foram testadas. Nós recomendamos usar a versão post-1.0 release (pelo menos a 0.94), então atualize se você não o fez.
Você pode pular essa parte se você já tem uma versão recente do D-Bus ou se não quer atualizar. Provavelmente você não quer compilar os bindings ao menos que você irá ter que compilar o HAL (ver abaixo).
Antes de continuar com os passos, tenha certeza que os cabeçalhos do X11 e as bibliotecas estão habilitadas. O script configure roda na linha 5, a seguinte instrução deverá aparecer para confirmar:
Building X11 code: yes
| Tenha certeza que você configurou o ambiente corretamente como feito acima. Isso é necessário para as funções cs e cb funcionarem. |
|---|
| Dica |
cs # 'cs' é uma função bash, clique aqui para saber mais(inglês) wget http://dbus.freedesktop.org/releases/dbus/dbus-1.0.2.tar.gz tar -xvzf dbus-1.0.2.tar.gz cd dbus-1.0.2/ ./configure --prefix=$DBUSDIR --localstatedir=/var make sudo make install sudo dbus-uuidgen --ensure
cs # ver acima wget http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.74.tar.gz tar -xvzf dbus-glib-0.74.tar.gz cd dbus-glib-0.74/ ./configure --prefix=$DBUSDIR make sudo make install cd sudo chown -R kde-devel:kde-devel *
Depois de mudar para o diretório do código fonte(linha 1), o código fonte do D-Bus é baixado pelo freedesktop.org (linha 2) e descompactado (linha 3). Depois entra no diretório criado para o D-Bus (linha 4), as configurações de compilação são criadas pelo script configure (linha 5). Depois da compilação (linha 6) e instalação (linha 7) do D-Bus, nós usamos a ferramenta dbus-uuidgen para instalar o arquivo de identificação da maquina (machine identification file) que permite o bus começar automaticamente quando a sessão do desktop começar (linha 8).
Note que você precisa de permissão de escrita no /var para os dois últimos passos. Se seu sistema não tem acesso ao comando sudo, você pode usar o comando su, ex. su -c "make install".
Os passos para compilar os bindings do glib são similares aos acima.
Então quando esses dois pacotes estão compilados e instalados, nós precisamos arrumar o dono do arquivo pois ao usar 'sudo make install' o root que fica como dono do arquivo e dos diretórios no ~kde-devel/kde.
Pule essa parte se você têm o CMake >=2.4.5 instalado. Você pode baixar os pacotes binários diretamente do CMake site. Existem também pacotes específicos para diversas distribuições.
cs # 'cs' é uma função bash, clique aqui para saber mais(inglês) wget http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz tar -zxf cmake-2.4.6.tar.gz mkdir cmake-build cd cmake-build ../cmake-2.4.6/bootstrap make sudo make install
Primeiro, vamos ao diretório do código fonte (linha 1), baixamos o código fonte do CMake (linha 2) e os descompactamos (linha 3). Criamos um diretório para compilar o CMake (linha 4) e entramos nele (linha 5). Rodamos o script de bootstrap do CMake para configurar a compilação (linha 6), depois compilamos (linha 7) e instalamos (linha 8) usando o usuário root.
Se seu sistema não tem acesso ao comando sudo, então você pode usar o su -c "make install".
Agora precisamos instalar o Qt4 que está no repositório do KDE. KDE é garantido com qualquer Qt 4.3. Qt 4.2 e antigos não são suportados e não irá funcionar. Você deve usar a cópia do Qt no server Subversion do KDE. (nota: algumas distribuições, tais como Debian e openSUSE, dão um suporte ao Qt com patches do KDE svn, então você pode usar o método pré-compilado da sua distro, porque eles irão funcionar normalmente). KDE tenta garantir que o código é compativel com o Qt 4.3.0, mas você pode pegar alguns bugfixes adicionais usando o qt-copy (entretanto, sua distribuição já deve cuidar desses bugfixes, então na maioria das vezes a distro já disponibiliza uma versão com atualizações suficientes). Para maior referência sobre distribuições, acesse as sessões acima.
Por enquanto a compatibilidade com o Qt3 é obrigatória, porfavor evite usar a opção "-no-qt3support" quando for compilar o Q4.
cd # Note: qt-copy fica em $HOME/qt-copy. Veja $QTDIR em .bashrc svn checkout svn://anonsvn.kde.org/home/kde/trunk/qt-copy cd qt-copy ./apply_patches ./configure -qt-gif -no-exceptions -debug -fast \ -prefix $QTDIR -nomake examples -nomake demos make -j2
# se não instalamos, só limpa os arquivos obj para # limpar memória no disco if [ $QTDIR = `pwd` ]; then \ find . -name '*.o' -delete ; \ else make install; fi;
Nós mudamos de volta para o diretório home do usuário kde-devel (linha 1) e fizemos o download do código usando o subversion (svn) pelo repositório do KDE (linha 2). Depois acessamos o diretório qt-copy (linha 3), rodamos o script que manipula os patches que vem com o qt-copy (linha 4).
Uma vez que os patches foi feito, nós rodamos o script configure para configurar a instalação (linha 5-6). Os comandos de linha usados são explicados no arquivo qt-copy/README.qt-copy. Finalmente, nós compilamos os requerimentos minimos para o KDE (linha 7) e instalamos (linha 10) o Qt. Se o diretório de instalação for o mesmo do diretório corrente (line 8), então só limpamos um pouco de espaço (linha 9). Se você quiser todos os exemplos e aplicações demo, você pode compilar individualmente ou simplismente dar um make no diretório qt-copy.
Note que a instalação não requer root já que o Qt é instalado localmente no $QTDIR. Mas, a instalação só é necessário se o $QTDIR for diferente do $HOME/qt-copy, que não é o caso se você seguiu todas as instruções corretamente.
Se você teve "error: X11/Xlib.h: No such file or directory", instale o devel package do xorg (o nome varia bastante da distribuição, por exemplo é xorg-dev nos sistemas baseados em Ubunto como o Kubuntu).
Se você teve um erro de no passo de configuração (linha 5-6), cheque o valor da variável $QMAKESPEC. Algumas distribuições setam essa variável apontado diretamente pro diretório Qt do sitema. Se unset QMAKESPEC resolver seu problema, então provavelmente você quer adicionar no seu script ~/.bashrc.
Se você teve um erro ".pch/debug-shared/QtCore", isso é porque o Qt-4.3 habilita cabeçalhos pré-compilados para o gcc suportar isso, mas por alguma rasão isso não funcionou para você. Se você usar distcc, configure o qt com -no-pch. Se você usa o icecream, atualize para a útlima versão do svn trunk.
Tente rodar qualquer programa Qt, como o assistant. Nota: Você talvez precise rodar xhost +local:kde-devel com seu usuário normal do kde3 para rodar essa aplicação. Se der erro no QSpanData::adjustSpanMethods, então seu problema é o style. Tente remover lib/kde4/plugins/styles/kstyle-oxygen.so e lib/kde4/plugins/styles/oxygen.so se eles existirem no prefixo de instalação do KDE.
| Você pode usar qdbusviewer para ver se tem org.freedesktop.hal. Se não tem, vai precisar da versão mais nova do hal. Mas se tiver o org.freedesktop.hal, Então provavelmente não precisa, e não quer, use seu próprio HAL. |
|---|
| Dica |
Se seu sistema requer a versão mais recente do HAL, Há uma boa chance de você precisar fazer outros coisas, algumas das quais pode não estar aqui. No entanto, isto deve ser requerido somente para velhas distribuições.
There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs.
Strigi itself has a few dependencies as well: you will need the libraries and headers for libz, libbz2, openssl (libcrypto or libssl), libclucene (>=0.9.16a but watch out: version 0.9.17 does not work), and either libxml2 or libexpat.
Please remember that if you use openSUSE, you can install the needed packages from the KDE:KDE4 buildservice repository and do not have to bother with fiddling the details below. Skip to the kdelibs section.
cs # 'cs' is a bash function, click here to learn more svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/ cd kdesupport cmakekde
We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new ~/kde/src/kdesupport directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed.
If you get
cmakekde: command not found
then you have to go manually into the kdesupport directory in ~ and execute the command cmakekde. if this still doesn't work, then something is wrong with your bashrc.
If you get
CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: LIBXML2_INCLUDE_DIR (ADVANCED)
you should install the development package for libxml2.
If you get
CMake Error: Could NOT find REDLAND
then you need librdf from the Redland. If your distribution does not provide the librdf package, you can download the source there: http://download.librdf.org/source/ and build it. (Gentoo users: The ebuild for librdf is named dev-libs/redland)
If you get
Fetching external item into 'kdesupport/admin' Error validating server certificate for 'https://...'
If you get
FILE cannot create directory: /usr/lib[64]/qt4/plugins/crypto. Maybe need administrative privileges. make: *** [install] Error 255
take a second look in the .bashrc file described above, are paths correct? ($QTDIR and $PATH are used to get the QT installation path) Alternatively, you may see this error if you decided to use a distribution installed version of qt4 and skipped the Qt install above. Either install qt-copy as describe above, or "sudo make install". If you use "sudo make install", make sure that you change the ownership back to your user for some of the ~/kde subdirectories that were effected by using sudo (ie. "sudo chown -R kde-devel:kde-devel ~/kde").
If you get a message related to
target libQtTest.so not found
you may need to recompile qt-copy. This time you should take out
-nomake demos -nomake examples
from the configure command, so that Qt generates library QtTest.
We can now move on to building KDE's base libraries.
cd cs # 'cs' is a bash function, click here to learn more mkdir KDE && cd KDE svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs cd kdelibs cmakekde
We change to the base source directory (line 1) then make and go into the KDE directory (line 2). We download the sources for kdelibs using subversion (line 3), go into the new ~/kde/src/KDE/kdelibs directory (line 4), and commence the build (line 5). This will leave us in the kdelibs build directory after the build is completed.
| There might be missing dependencies on your system! They are easily overlooked in the output of cmakekde. You might want to do a cmake $KDE_SRC/KDE/MODULE_NAME prior to compiling any kde modules (like kdelibs, kdepimlibs etc.) |
|---|
| Dica |
There are additional CMake modules in kdelibs/cmake/modules/ that are necessary for building KDE4 applications. These will be installed for you when kdelibs itself is installed.
If you have problems compiling kdelibs, first make sure the software in the Required Software section above is installed and works. Other possible hints include:
If cmakekde still gives the same error then try this
cd cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \ -DCMAKE_BUILD_TYPE=debugfull \ -DKDE4_BUILD_TESTS=ON \ ~/kde/src/KDE/kdelibs make make install
update-alternatives --config qmake
CMake Error: KDE Requires Qt to be built with SSL support
kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'
After kdelibs, but before kdebase, you need to build and install kdepimlibs.
cs KDE # 'cs' is a bash function, click here to learn more svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepimlibs cd kdepimlibs cmakekde
We go into the KDE source directory (line 1), download the source code for kdepimlibs using subversion (line 2) and then go into the new ~/kde/src/KDE/kdepimlibs directory (line 3). We then commence the build (line 4). This will leave us in the kdepimlibs build directory after the build is completed.
Se você tem problemas compilando kdepimlibs:
kdebase é dividido em três partes:
cd kdebasecd kdebase/runtime
cs KDE # 'cs' is a bash function, click here to learn more svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebase cd kdebase cmakekde
If you have troubles compiling kdebase:
Você pode agora executar programas KDE 5 (exemplo, kwrite) digitando:
ssh -X kde-devel@localhost kwrite
KUniqueApplication: Cannot find the D-Bus session server
check if you can access the display, e.g. type
xclock
and see if a clock appears on the screen.
Error: standard icon theme "oxygen" not found! ASSERT: "!isEmpty()" in file /home/kde-devel/qt-copy/include/QtCore/../../src/corelib/tools/qlist.h, line 245 Aborted (core dumped)
You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase.
Although the API documentation for KDE is available online at api.kde.org, it is sometimes useful to have it on your own disk, for example when you want to use KDevelop for browsing the documentation or when you are not able to be online all the time.
Be aware that generating the API documentation can take several hours and takes almost half a gigabyte of diskspace. The generation is handled by a script in kdelibs/doc/api, you need doxygen to be able to run it.
To build the API documentation for kdelibs, type the following:
cs KDE/kdelibs # 'cs' is a bash function, click here to learn more $KDE_SRC/KDE/kdelibs/doc/api/doxygen.sh \ --doxdatadir=$KDE_SRC/KDE/kdelibs/doc/common .
Repeat for other modules as desired.
cd <module home> $KDE_SRC/KDE/kdelibs/doc/api/doxygen.sh \ --doxdatadir=$KDE_SRC/KDE/kdelibs/doc/common .
Another, even easier method involves downloading this Doxyfile to your local system. Then simply change directory to where you want to create the documentation and run
% doxygen /path/to/Doxyfile
Then review the file doxygen.log to see the doxygen errors and warnings. You'll find the actual documentation in the apidocs subdirectory.
In order to keep the kde4 installation up to date, each of the modules installed should be updated periodically. As Monday is the day for big changes in kdelibs, Tuesday may be the best day to do this. For each module checked out, run svn up and make.
For example:
cs kdesupport # cs is not a typo svn up cb # cb is not a typo make -j2 VERBOSE=1 && make install
Many modules in KDE contain a large number of programs which could take a long time to download and compile. In cases where you want to work only on a particular program or programs in a module, it is possible to download and compile particular folders. In some cases, certain folders are required for any build of the module. This is determined in the CMakeLists.txt file of the module. For example the kdegames CMakeLists.txt file lists:
add_subdirectory(libkdegames) add_subdirectory(libkmahjongg) macro_optional_add_subdirectory(doc) macro_optional_add_subdirectory(lskat) macro_optional_add_subdirectory(katomic)
So, the libkdegames and libkmahjongg directories are required to build any of kdegames. The cmake directory will also usually be required. All the other directories (doc, katomic etc) are optional. They will be built if present on your machine. In this example, we build kmahjongg and kbattleship:
cs KDE svn co -N kdegames # The -N switch performs a non-recursive checkout cd kdegames svn up libkdegames # Get required directories svn up libkmahjongg svn up cmake svn up kbattleship # Get optional directories svn up kmahjongg cmakekde
What can happen over time, after some svn up commands, is that some of the tools used in the KDE build chain change their output format. For example, kcfg files are read by kconfig_compiler to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files:
find $KDE_SRC/KDE/kdebase -name "*.kcfg" | xargs touch
The same applies to ui files as produced by Qt designer.
When installing KDE 4 as a user, one will not be able to unlock a locked session. To work around this issue you can either:
su chown root.root $KDEDIR/lib/kde4/libexec/kcheckpass
or
chmod 755 $KDEDIR/lib/kde4/libexec/kcheckpass
You are now ready to start building other svn modules in the same fashion as you built kdebase, running and testing KDE4 or writing your own patches and applications.
See the Set up KDE 4 for development tutorial for how to start KDE 4 applications and how to use KDevelop to work on them.