Merge pull request #25883 from geekpi/translating

Translating
This commit is contained in:
geekpi 2022-06-01 08:21:46 +08:00 committed by GitHub
commit 46efe1ff1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 169 additions and 169 deletions

View File

@ -1,168 +0,0 @@
[#]: subject: "Compile GNOME Shell and Apps From Source [Beginners Guide]"
[#]: via: "https://www.debugpoint.com/2022/05/compile-gnome-source/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Compile GNOME Shell and Apps From Source [Beginners Guide]
======
Heres a quick guide for you on how to compile GNOME from its source, including the shell, mutter and some native apps.
Before you compile, you need to make sure certain things because the following compilation is directly from the master branch in GitLab, which contains some development packages.
In general, you can compile in any Linux distribution of your choice. But I would recommend using Fedora Rawhide which is the development branch of Fedora, for future releases.
Also, do not try this in a stable system. Because things may go wrong, you may end up with a broken system.
To summarize, you need the following to compile GNOME from the source.
* A test setup ([Virtual machine][1] or a test system)
* Fedora Rawhide Distro (recommended. [Download from here][2])
* Make sure your distro is up to date.
* And you are logged in to an X.Org session.
I would not recommend compiling in the Wayland session because you will run into problems.
### Compile GNOME from the Source
The GNOME desktop is a collection of packages based on their functions. The desktop component of a Linux distribution works under a window manager and shell.
So for GNOME, I will first compile mutter the window manager for GNOME Shell. And then followed by the compilation of GNOME Shell. Finally, I will compile some native apps.
I will use the meson build system for compilation. The meson is a beautiful build system which is fast and user friendly.
#### Compile Mutter
Open a terminal and install the required packages for GNOME Shell and mutter.
```
sudo dnf build-dep mutter gnome-shell
```
Create a demo directory in your home drive (or anywhere you want).
```
cd ~
```
```
mkdir demo
```
```
cd demo
```
Clone the mutter master branch from GitLab.
git clone https://gitlab.gnome.org/GNOME/mutter
Go to the cloning directory and use the below meson command to prepare the build files. By default, meson uses `/usr/local` for building files. However, you can also use prefix switch to redirect the output to a specific folder (shown below).
```
cd mutter
```
```
meson _build --prefix=/usr
```
![Compile Mutter for GNOME][3]
Install mutter in your system when the build is complete using the below command.
```
sudo ninja install -C _build
```
#### Compile GNOME Shell
The compilation of GNOME Shell and other packages are similar. First, clone the GNOME Shell master repository from GitLab, then build and install. You can follow the below commands in sequence.
There are two dependencies which you need for GNOME Shell. They are [asciidoc][4] and [sassc][5]. Install them before you build GNOME Shell.
```
sudo dnf install asciidoc
```
```
sudo dnf install sassc
```
After installing these dependencies, follow the below commands to build and install GNOME Shell. Make sure you go back to the `demo` folder (which I created in the first step) before running this command.
```
git clone https://gitlab.gnome.org/GNOME/gnome-shellcd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
### Running the GNOME Shell
After you finish compiling, you can try restarting the GNOME Shell to see the changes from the master branch.
Before you restart, as I mentioned earlier, make sure you are in the X.Org session. Press `ALT+F2` and type `r`. Then press enter. This command will restart GNOME Shell.
![Restart GNOME Shell (X11)][6]
And congratulations! You have successfully compiled GNOME Shell and Mutter.
Now, its time to compile some sample GNOME native applications.
### Compile GNOME Native Applications
The steps are the same for all sources of GNOME or any applications. You need to change the repo name. So, here are some sample commands to compile necessary GNOME native apps.
#### Files (Nautilus)
```
git clone https://gitlab.gnome.org/GNOME/nautilus/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
#### GNOME Software
```
git clone https://gitlab.gnome.org/GNOME/gnome-software/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
#### GNOME Control Center
```
git clone https://gitlab.gnome.org/GNOME/gnome-control-center/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
### FAQ
1. Using the above steps, you can compile any source branch. Not only GNOME.
2. The GitLab server is sometimes slow, and it may take a longer time to clone a repo. If the `git clone` fails, I would recommend you to try again.
### Closing Notes
I hope this little advanced tutorial helps you try out new GNOME features before they land in GNOME nightly OS. Since you compiled, you may also contribute to testing new GNOME features and report any bugs or problems on the GitLab Issues page for specific packages.
This article is the first instalment of the open-source app compilation series. Stay tuned for more compilation articles of more open-source apps.
Also, do let me know your comments, suggestions, or any error you faced using these instructions in the comment box.
Cheers.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2022/05/compile-gnome-source/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/virtual-machine
[2]: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Workstation/x86_64/iso/
[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Compile-Mutter-for-GNOME.jpg
[4]: https://asciidoc.org/
[5]: https://github.com/sass/sassc
[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Restart-GNOME-Shell-X11.jpg

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/5/compile-code-ldlibrarypath"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -0,0 +1,168 @@
[#]: subject: "Compile GNOME Shell and Apps From Source [Beginners Guide]"
[#]: via: "https://www.debugpoint.com/2022/05/compile-gnome-source/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
从源码编译 Gnome Shell 和应用(初学者指南)
======
这是你如何从其来源码编译 GNOME 的快速指南,包括 shellmutter 和一些原生应用。
在编译之前,你需要确保一些事情,因为以下编译直接来自 Gitlab 的主分支,其中包含一些开发包。
通常,你可以选择在任何 Linux 分发中编译。但是我建议使用 Fedora RawhideFedora 的开发分支,即未来版本)。
另外,请勿在稳定系统中尝试此操作。因为操作可能出错,所以你可能最终得到损坏的系统。
总而言之,你需要以下内容来从源码编译 Gnome。
* 测试设置([虚拟机][1]或测试系统)。
* Fedora Rawhide 发行版(推荐,[从此处下载][2])。
* 确保你的发行版是最新的。
* 你已登录 X.org 会话。
我不建议你在 Wayland 会话中进行编译,因为你会遇到问题。
### 从源码编译 Gnome
Gnome 桌面是基于其功能的软件包集合。Linux 发行版的桌面组件在窗口管理器和 shell 下工作。
因此,对于 Gnome我将首先编译 mutter Gnome Shell 的窗口管理。然后进行 Gnome Shell 的编译。最后,我将编译一些原生应用。
我将使用 meson 构建系统进行编译。meson 是一个美丽的构建系统,快速且用户友好。
#### 编译 Mutter
打开终端并安装需要的 GNOME Shell 和 mutter。
```
sudo dnf build-dep mutter gnome-shell
```
在主目录(或你想要的任何地方)中创建演示目录。
```
cd ~
```
```
mkdir demo
```
```
cd demo
```
从 Gitlab 克隆 mutter 的主分支。
git clone https://gitlab.gnome.org/GNOME/mutter
进入克隆目录,然后使用以下 meson 命令来准备构建文件。默认情况下Meson 使用 `/usr/local` 用于构建文件。但是,你也可以使用前缀开关将输出重定向到特定文件夹(如下所示)。
```
cd mutter
```
```
meson _build --prefix=/usr
```
![Compile Mutter for GNOME][3]
使用以下命令在构建完成时,将 mutter 安装在到系统中。
```
sudo ninja install -C _build
```
#### 编译 GNOME Shell
GNOME Shell 和其他软件包的编译方法类似。首先,从 GitLab 克隆 GNOME Shell 主仓库,然后进行编译和安装。你可以按照下面的命令依次进行。
在 GNOME Shell 中,你需要两个依赖项。它们是 [asciidoc][4] 和 [sassc][5] 。请在构建 GNOME Shell 之前安装它们。
```
sudo dnf install asciidoc
```
```
sudo dnf install sassc
```
安装完这些依赖项后,按照下面的命令来构建和安装 GNOME Shell。在运行这个命令之前请确保你回到 `demo` 文件夹(我在第一步创建的)。
```
git clone https://gitlab.gnome.org/GNOME/gnome-shellcd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
### 运行 GNOME Shell
编译完成后,你可以尝试重新启动 GNOME Shell 来查看主分支的变化。
在重启之前,正如我之前提到的,确保你处于 X.Org 会话中。按 `ALT+F2` 并输入 `r`。然后按回车键。这个命令将重启 GNOME Shell。
![Restart GNOME Shell (X11)][6]
恭喜你! 你已经成功地编译了 GNOME Shell 和 Mutter。
现在,是时候编译一些 GNOME 原生应用了。
### 编译 GNOME 原生应用
这些步骤对于 GNOME 或任何应用的所有源码都是一样的。你需要改变仓库的名字。因此,这里有一些编译必要的 GNOME 原生应用的命令示例。
#### FilesNautilus
```
git clone https://gitlab.gnome.org/GNOME/nautilus/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
#### GNOME 软件
```
git clone https://gitlab.gnome.org/GNOME/gnome-software/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
#### GNOME 控制中心
```
git clone https://gitlab.gnome.org/GNOME/gnome-control-center/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build
```
### FAQ
1. 使用上述步骤,你可以编译任何源码分支。不仅仅是 GNOME。
2. GitLab 服务器有时很慢,克隆一个仓库可能需要较长的时间。如果 `git clone` 失败,我建议你再试一次。
### 结束语
我希望这个小小的高级教程能够帮助你在 GNOME 每日构建系统出现之前尝试新的 GNOME 功能。既然你编译了,你也可以为测试新的 GNOME 功能做出贡献,并在 GitLab 问题页面上报告任何特定包的 bug 或问题。
这篇文章是开源应用编译系列的第一篇文章。请继续关注更多开源应用的编译文章。
另外,请让我在下面的评论栏中知道你的评论、建议,或者你在使用这些说明时遇到的任何错误。
干杯。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2022/05/compile-gnome-source/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/virtual-machine
[2]: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Workstation/x86_64/iso/
[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Compile-Mutter-for-GNOME.jpg
[4]: https://asciidoc.org/
[5]: https://github.com/sass/sassc
[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Restart-GNOME-Shell-X11.jpg