archlinux-pkgbuilds – Arch Linux PKGBUILDs

I maintain a set of PKGBUILDs for the Arch Linux distro in a public GitHub repository: archlinux-pkgbuilds. Many of these are modified versions from the official Arch package repositories or from AUR packages, however some are not found in either. The modifications for existing packages are usually small fixes for issues building with the existing version or to build configured with different CMake variables.

Many of the packages are GIS applications, including

Some of the PKGBUILDs have not been built in several years. I will periodically update this list with recently built packages that are not available in the official repos or AUR.

Change process’s priority in Windows

The simplest means to do this is by simply opening Task Manager in Windows and navigating to the Details pane. Right-click on a process in the list, then select Set priority from the menu.

Alternatively, similar to the Linux renice command, the priority can also be set via command-line in Windows using

wmic process where name="devenv.exe" CALL setpriority "high priority"

The aforementioned methods will not persist upon system restart. Permanently setting the default priority of a process can be achieved using a registry script. This file can contain as many entries as desired. In this example below, I set the default process priority of devenv.exe and sqlservr.exe to High 00000003:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

error launching Qt6 applications: Cannot mix incompatible Qt library (6.5.2) with this library (6.5.3)

> qt6ct
Cannot mix incompatible Qt library (6.5.2) with this library (6.5.3)
[1]    26923 IOT instruction (core dumped)  qt6ct

In order to determine the problematic library, use the strace command:

> sudo strace qt6ct
mmap(NULL, 24912, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x7f90a0382000
mmap(0x7f90a0385000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x3000) = 0x7f90a0385000
mmap(0x7f90a0386000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x4000) = 0x7f90a0386000
mmap(0x7f90a0387000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x4000) = 0x7f90a0387000
close(9)                                = 0
mprotect(0x7f90a0387000, 4096, PROT_READ) = 0
statx(AT_FDCWD, "/root/.config/qt6ct/qt6ct.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=855, ...}) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2852, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so.avx2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so.avx2", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so", O_RDONLY|O_CLOEXEC) = 9
read(9, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(9, "", {st_mode=S_IFREG|0755, st_size=236056, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 234272, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x7f909bc9a000
mmap(0x7f909bca5000, 155648, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0xb000) = 0x7f909bca5000
mmap(0x7f909bccb000, 24576, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x31000) = 0x7f909bccb000
mmap(0x7f909bcd1000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x37000) = 0x7f909bcd1000
close(9)                                = 0
mprotect(0x7f909bcd1000, 8192, PROT_READ) = 0
openat(AT_FDCWD, "/dev/tty", O_RDONLY|O_CLOEXEC) = 9
close(9)                                = 0
write(2, "Cannot mix incompatible Qt libra"..., 69Cannot mix incompatible Qt library (6.5.2) with this library (6.5.3)

After finding the problematic library, use pacman -Qo to find the package providing this file:

> pacman -Qo /usr/lib/qt6/plugins/styles/libqt6gtk2-style.so      
/usr/lib/qt6/plugins/styles/libqt6gtk2-style.so is owned by qt6gtk2-git 0.2.r5.g441f266-1

After rebuilding qt6gtk2, qt6ct launches successfully.

Linux, Plank Dock & Desktop Entries: Add an open ‘New Window’ action

Plank is a popular application launcher dock in Linux. By default, most application desktop entries do not provide any additional actions. Say we want to add an open ‘new window’ action to our desktop entry for pkgbrowser:

/usr/share/applications/pkgbrowser.desktop

Our desktop entry file looks as follows:

[Desktop Entry]
Name=PkgBrowser
GenericName=Package Browser
Comment=A utility for browsing pacman databases and the AUR
Exec=pkgbrowser
Terminal=false
Type=Application
Icon=pkgbrowser
StartupNotify=false
Categories=Qt;System;

Simply add the following to the end of the file. Of course, if your desktop entry already has a defined Actions property, you’ll want to add this new-window to it.

Actions=new-window;

[Desktop Action new-window]
Name=New Window
Exec=pkgbrowser

Now, right-clicking the desktop entry will appear as follows:

By default, any desktop entries that come from packages for your Linux distro will be overwritten during a package update. To prevent this from happening, you can made the file read-only using chattr:

sudo chattr +i /usr/share/applications/pkgbrowser.desktop

cmake: /usr/include/c++/10.1.0/type_traits(1396): “error: type name is not allowed” or “error: identifier “__is_same_as” is undefined”

If the gcc version being used is incompatible with cuda version, there will be errors such as:

[ 68%] Building NVCC (Device) object src/nvtt/CMakeFiles/cuda_compile_1.dir/cuda/cuda_compile_1_generated_CompressKernel.cu.o
/usr/include/c++/10.1.0/type_traits(1396): error: type name is not allowed

/usr/include/c++/10.1.0/type_traits(1396): error: type name is not allowed

/usr/include/c++/10.1.0/type_traits(1396): error: identifier "__is_same_as" is undefined

3 errors detected in the compilation of "/home/nick/Code/Git/github.com/nvidia-texture-tools/src/nvtt/cuda/CompressKernel.cu".
CMake Error at cuda_compile_1_generated_CompressKernel.cu.o.Release.cmake:280 (message):
  Error generating file
  /home/nick/Code/Git/github.com/nvidia-texture-tools/cmake-build-release/src/nvtt/CMakeFiles/cuda_compile_1.dir/cuda/./cuda_compile_1_generated_CompressKernel.cu.o


make[2]: *** [src/nvtt/CMakeFiles/nvtt.dir/build.make:85: src/nvtt/CMakeFiles/cuda_compile_1.dir/cuda/cuda_compile_1_generated_CompressKernel.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:721: src/nvtt/CMakeFiles/nvtt.dir/all] Error 2
make: *** [Makefile:183: all] Error 2

See discussion on GitHub: CUDA Build error on Arch Linux and CUDA Compilers – nvcc compatibility chart.

This can be resolved by using an earlier version of GCC which is compatible with the CUDA version. In my example setting the following CMake variable resolved the issue:

	-DCUDA_HOST_COMPILER=/usr/bin/gcc-9

cmake: undefined reference to std::__cxx11::basic_string

The default version of gcc in the Arch Linux repositories is now gcc10:

➜  ~ pacman -Qo /usr/bin/c++
/usr/bin/c++ is owned by gcc 10.1.0-2

This can result in errors during linking while building packages, such as:

[ 75%] Linking CXX executable ../../../../../bin/sst_conn_tool
/usr/bin/ld: ../../../../../lib/libadios2_core.so.2.6.0: undefined reference to `int adios2::format::DataManSerializer::GetData<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&)'
/usr/bin/ld: ../../../../../lib/libadios2_core.so.2.6.0: undefined reference to `int adios2::format::DataManSerializer::GetData<float>(float*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&)'

This issue can be resolved by compiling with an earlier version of gcc:

➜  ~ pacman -Qo /usr/bin/g++-9
/usr/bin/g++-9 is owned by gcc9 9.3.0-3

Setting these CMake variables will result in using the gcc9 version of gcc, g++, gcc-ar, and gcc-ranlib:

        -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 \
        -DCMAKE_CXX_COMPILER_AR=/usr/bin/gcc-ar-9 \
        -DCMAKE_CXX_COMPILER_RANLIB=/usr/bin/gcc-ranlib-9 \
        -DCMAKE_C_COMPILER=/usr/bin/gcc-9 \
        -DCMAKE_C_COMPILER_AR=/usr/bin/gcc-ar-9 \
        -DCMAKE_C_COMPILER_RANLIB=/usr/bin/gcc-ranlib-9 \

Setting Energy Saver Preferences on macOS Mojave/High Sierra

System preferences can be set on macOS using the defaults command. For example, say I wish set the Prevent sleep setting that can be set through the System Preferences interface, but instead via command line.
macOS - System Preferences - Energy Saver - Prevent sleep - disabled

If your settings match those in the screenshot above, running defaults read /Library/Preferences/com.apple.PowerManagement.plist in the terminal should output

{
    "AC Power" =     {
        "Automatic Restart On Power Loss" = 1;
        DarkWakeBackgroundTasks = 1;
        "Disk Sleep Timer" = 180;
        "Display Sleep Timer" = 5;
        "Display Sleep Uses Dim" = 1;
        GPUSwitch = 2;
        "System Sleep Timer" = 15;
        "Wake On LAN" = 1;
    };
    "Battery Power" =     {
        "Automatic Restart On Power Loss" = 1;
        DarkWakeBackgroundTasks = 0;
        "Disk Sleep Timer" = 180;
        "Display Sleep Timer" = 5;
        "Display Sleep Uses Dim" = 1;
        GPUSwitch = 2;
        ReduceBrightness = 1;
        "System Sleep Timer" = 10;
        "Wake On LAN" = 1;
    };
    SystemPowerSettings =     {
        DestroyFVKeyOnStandby = 0;
        "Update DarkWakeBG Setting" = 1;
    };
}

To set System Sleep Timer to 0, run /usr/libexec/PlistBuddy -c "Set 'AC Power':'System Sleep Timer' 0" /Library/Preferences/com.apple.PowerManagement.plist. Now running the original defaults read command will output

{
    "AC Power" =     {
        "Automatic Restart On Power Loss" = 1;
        DarkWakeBackgroundTasks = 1;
        "Disk Sleep Timer" = 180;
        "Display Sleep Timer" = 5;
        "Display Sleep Uses Dim" = 1;
        GPUSwitch = 2;
        "System Sleep Timer" = 0;
        "Wake On LAN" = 1;
    };
    "Battery Power" =     {
        "Automatic Restart On Power Loss" = 1;
        DarkWakeBackgroundTasks = 0;
        "Disk Sleep Timer" = 180;
        "Display Sleep Timer" = 5;
        "Display Sleep Uses Dim" = 1;
        GPUSwitch = 2;
        ReduceBrightness = 1;
        "System Sleep Timer" = 10;
        "Wake On LAN" = 1;
    };
    SystemPowerSettings =     {
        DestroyFVKeyOnStandby = 0;
        "Update DarkWakeBG Setting" = 1;
    };
}

Now opening the System Preferences will reveal the updated value.
macOS - System Preferences - Energy Saver - Prevent sleep - enabled