Detect Cycle When Analyzing Dependencies

Detect Cycle When Analyzing Dependencies The dependencies of a package can be viewed as a directed graph. It does not have to be a tree, as sub-dependencies can be shared. However, it is important to ensure that there are no circular dependencies. Circular dependencies can cause dynamic library builds to fail, and in the worst case, there are cyclic references in your project. Introducing memory leak in reference counting based garbage collectors. ...

December 1, 2021

Cross Compile to PinePhone with Clang

Cross Compile to PinePhone with Clang Click Here for GCC Part one Click Here for GCC Part three Advantages of Clang If you have read the previous posts about cross-compiling with gcc, you know that we need to install the cross-compiler first. This is not that difficult, but it has a few pitfalls. In particular, the one provided by ArchLinux by default does not work in our use case. The good thing about clang is that clang is inherently a cross-compiler. It lowers C/C++ source code into LLVM IR, which is platform independent. And LLVM then lower the IR further into platform-dependent machine code. One less tool to install, one less tool to maintain. ...

November 22, 2021

I spent two days building KDE from source, so you can do it faster

I spent two days building KDE from source, so you can do it faster or: How I Learned to Stop Worrying and Love Ubuntu kdesrc-build From KDE documentations: kdesrc-build is a script to help the KDE community install KDE software from its Git and Subversion source repositories, and continue to update that software afterwards. If you are a developer, your distribution may not have the latest dependencies. Even though you can theoretically build them from source, it is difficult to find out every dependencies and keep them up to date. kdesrc-build can manage the dependencies for you, build the dependencies and install them somewhere so that they don’t conflict with system libraries. ...

November 14, 2021

PolKit Explained

Polkit explained What is PolKit PolKit is a standard authorization method for Linux. It usually consists of PolKit daemon, PolKit session agent and the helper program shipped by applications that use PolKit. As a user, you don’t really interact with PolKit itself, usually you interact with PolKit session agent. Like KDE’s PolKit agent: You can consider it as sudo of the GUI. But it works completely different than sudo. I spent two days trying to figure out what PolKit is, how it works, and how to use it to write a GUI tool that requires root privileges but can’t be run as root itself. ...

November 7, 2021

What I'm doing recently

What I’m doing recently Formats & Language KCM So one thing I’ve been doing past four months is the porting of Formats KCM, but now the scope is no longer restricted in only porting. Alone the process, first the old KCM design isn’t that mobile friendly so I did a re-design. And then Nate pointed out that the Formats KCM is in conflicted with Language KCM, which leads to the merging of Language and Formats KCM. Also the post I made eariler about locales in Linux, that also needs to be addressed. It’s still some work to be done, namely locale generation and relevent package installation via PackageKit. I really want to get this merged before Plasma 5.24, the soft freeze of which happens at 30/12/2021. The MR in question is https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1147 ...

November 1, 2021

Linux Application Ecosystem Salon 2021 Changsha

Linux Application Ecosystem Salon 2021 Changsha This weekend I traveled to Changsha for the Linux Application Ecosystem Salon 2021 Changsha, which is held by Ubuntu Kylin in the campus of Central South University. The journey itself is uneventful. I’ve never been to any offline Linux events before, I wanted to go to FOSDEM, but then the COVID hit. So anyway, it’s a first time for me. You can view the full news in Ubuntu Kylin’s post ...

October 24, 2021

Linux Locales

Linux Locales Locale is often ignored aspects of a system. Especially if you’re America. For most systems, locale is chosen on installation. But for distributions like ArchLinux, you do need to config locale yourself. Now there’re two ways to config set locale. One way is described on ArchLinux Wiki, edit /etc/locale.gen to enable the locale and use locale-gen to generates it. Finally set $LANG to the locale you want. The second way is to use DE, take KDE for example. You can set locale in system settings under languages or formats. And unlike locale-gen, it doesn’t need root permission. Surprisingly, it actually work! I always set time format in formats to British while keep other America. The time format on system panel did changed to British after that. However, after rebooting, some terminal applications will complain about invalid locales. Mosh even refuses to work! I just set $LC_ALL to C in situations like this. But there must be something wrong about it. ...

October 17, 2021

Cross Compile to PinePhone Part Four

Cross Compile to PinePhone Part Four Click Here for Part one Click Here for Part two Click Here for Part three Now we’ve got ourselve a handy script for cross compiling, I think it’s time to introduce other means of cross compiliing and why I not using existing methods. Pmbootstrap pmbootstrap is the central tool to develop and install postmarketOS. It works using Alpine chroots to avoid installing software on the host’s machine. ...

October 1, 2021

Cross Compile to PinePhone Part Three

Cross Compile to PinePhone Part Three Click Here for Part one Click Here for Part two On last part, we managed to generate package by hand. While it works, having a script to do everything for us is even better. So I’ve wrote a small python script to automate the process. ppbuild ppbuild: https://invent.kde.org/hanyoung/ppbuild ppbuild is a small script for cross compile common Plasma Mobile apps. It expects you’ve already set up the binfmt. If you haven’t, refer to part one. ...

September 25, 2021

Cross Compile to PinePhone Part Two

Cross Compile to PinePhone Part Two Click Here for Part one Click Here for Part three So on part one, we managed to compile kalk with emulator, and generated ArchLinux package to install on our PinePhone. However, emulator is slow, and compiling with emulator isn’t cross compile. Today, we’ll be using real cross compiler to build kalk package. Setup the Toolchain and SDK To be able to cross compile, we need cross compiler and target platform’s libraries. On ArchLinux, there is aarch64-linux-gnu-gcc. But it’s sysroot option is bugged so we won’t use the cross compiler from pacman this time. Instead, we’ll grab the toolchain from ArchLinux arm. The link is here. Since PinePhone is armv8, download the armv8 pre-built crosstool-ng toolchain. To keep everything nice and tidy, we store the toolchain in dedicated directory. I’m using ~/Develop/CrossCompile. ...

September 20, 2021