mirror of
https://github.com/Snigdha-OS/snigdhaos-devdocs.git
synced 2025-09-20 11:54:56 +02:00
Compare commits
3 Commits
2c136e8733
...
4f614a1d76
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4f614a1d76 | ||
![]() |
735edcc37a | ||
![]() |
1d1cdd02ea |
@@ -139,7 +139,6 @@ Here are some useful tips when working with PKGBUILDs:
|
||||
A helpful cheat sheet for PKGBUILDs that includes examples of various PKGBUILD fields and usage.
|
||||
|
||||
|
||||
|
||||
### **Conclusion**
|
||||
|
||||
PKGBUILDs are an essential part of working with Snigdha OS and other Arch-based systems. They provide a powerful way to automate the process of building, customizing, and installing software from source code. By understanding how PKGBUILDs work, you can take full control over your software installations, making them more tailored to your specific needs. Additionally, PKGBUILDs ensure consistency, reproducibility, and security in the software build process, making them an indispensable tool for developers and advanced users. Whether you’re writing your own PKGBUILD or modifying an existing one, mastering this tool is key to fully utilizing the power of Snigdha OS and Arch-based systems.
|
170
docs/snigdhaos-pkgbuilds/02-example-pkgbuild.md
Normal file
170
docs/snigdhaos-pkgbuilds/02-example-pkgbuild.md
Normal file
@@ -0,0 +1,170 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Example
|
||||
|
||||
A **PKGBUILD** script is a simple shell script used by Arch-based Linux distributions (such as Snigdha OS) to define how a package is built from source and installed onto the system. Below is an example of a basic **PKGBUILD** script with explanations for each part.
|
||||
|
||||
### **Example of a Simple PKGBUILD Script:**
|
||||
|
||||
```bash
|
||||
# Maintainer: Your Name <youremail@example.com>
|
||||
pkgname=mysoftware
|
||||
pkgver=1.0
|
||||
pkgrel=1
|
||||
pkgdesc="A simple software example"
|
||||
arch=('x86_64')
|
||||
url="https://example.com/mysoftware"
|
||||
license=('GPL')
|
||||
depends=('glibc')
|
||||
source=("https://example.com/mysoftware-${pkgver}.tar.gz")
|
||||
sha256sums=('abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890')
|
||||
|
||||
build() {
|
||||
cd "$srcdir/mysoftware-${pkgver}"
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/mysoftware-${pkgver}"
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### **Explanation of the PKGBUILD Components**
|
||||
|
||||
1. **pkgname**:
|
||||
This is the name of the package you're creating. In this example, it’s set to `mysoftware`. When the package is installed, it will be referred to by this name in the system.
|
||||
|
||||
```bash
|
||||
pkgname=mysoftware
|
||||
```
|
||||
|
||||
2. **pkgver**:
|
||||
This is the version of the software you're packaging. For example, here we use `pkgver=1.0`, which refers to the first version of the software.
|
||||
|
||||
```bash
|
||||
pkgver=1.0
|
||||
```
|
||||
|
||||
3. **pkgrel**:
|
||||
This is the release number of the package. If you make changes to the PKGBUILD but don't change the software version (e.g., a patch or configuration change), you would increment this number. For this example, it's set to `pkgrel=1`.
|
||||
|
||||
```bash
|
||||
pkgrel=1
|
||||
```
|
||||
|
||||
4. **pkgdesc**:
|
||||
A short description of what the software does. In this case, we use `"A simple software example"`, but you should provide a meaningful description relevant to the software.
|
||||
|
||||
```bash
|
||||
pkgdesc="A simple software example"
|
||||
```
|
||||
|
||||
5. **arch**:
|
||||
This field specifies which architectures the package is compatible with. For most modern systems, you’ll typically see `arch=('x86_64')`, which supports 64-bit systems. Other options might include `i686` for 32-bit systems.
|
||||
|
||||
```bash
|
||||
arch=('x86_64')
|
||||
```
|
||||
|
||||
6. **url**:
|
||||
This is the website of the software. It provides users with more information about the software, updates, and support. In the example, we use `"https://example.com/mysoftware"`, but you should replace this with the actual URL of the project.
|
||||
|
||||
```bash
|
||||
url="https://example.com/mysoftware"
|
||||
```
|
||||
|
||||
7. **license**:
|
||||
The license under which the software is distributed. In this case, we use the `GPL` license. You can check the software's documentation to confirm which license applies.
|
||||
|
||||
```bash
|
||||
license=('GPL')
|
||||
```
|
||||
|
||||
8. **depends**:
|
||||
This field specifies any dependencies required by the software in order to run. For example, this software depends on `glibc` (the GNU C Library). These dependencies must be installed for the software to run correctly.
|
||||
|
||||
```bash
|
||||
depends=('glibc')
|
||||
```
|
||||
|
||||
9. **source**:
|
||||
The `source` array defines where to download the source code for the package. In this example, it points to a tarball (`tar.gz`) containing the source code of `mysoftware` at version `1.0`. The source code will be fetched from this URL when you run the `makepkg` command.
|
||||
|
||||
```bash
|
||||
source=("https://example.com/mysoftware-${pkgver}.tar.gz")
|
||||
```
|
||||
|
||||
10. **sha256sums**:
|
||||
This is a checksum (SHA256) used to verify the integrity of the downloaded source file. This ensures that the source code has not been tampered with. You can generate this checksum using the `sha256sum` command.
|
||||
|
||||
```bash
|
||||
sha256sums=('abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890')
|
||||
```
|
||||
|
||||
|
||||
|
||||
### **Build and Package Functions**
|
||||
|
||||
The `PKGBUILD` defines two functions: `build()` and `package()`. These functions contain the steps to compile and install the software.
|
||||
|
||||
1. **build()**:
|
||||
This function is responsible for compiling the software. Here, it does the following:
|
||||
- Changes the directory to the source code folder (`cd "$srcdir/mysoftware-${pkgver}"`).
|
||||
- Runs the `./configure` command, which prepares the build system, setting the installation prefix (`--prefix=/usr` to install to `/usr/bin`, `/usr/lib`, etc.).
|
||||
- Runs `make` to compile the source code.
|
||||
|
||||
```bash
|
||||
build() {
|
||||
cd "$srcdir/mysoftware-${pkgver}"
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
}
|
||||
```
|
||||
|
||||
2. **package()**:
|
||||
After the software is compiled, the `package()` function installs it into a staging directory (referred to as `$pkgdir`). This step essentially places the compiled software into the appropriate directories (`/usr/bin`, `/usr/lib`, etc.). It uses the `DESTDIR="$pkgdir"` option to specify the installation destination.
|
||||
|
||||
```bash
|
||||
package() {
|
||||
cd "$srcdir/mysoftware-${pkgver}"
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### **Building and Installing the Package**
|
||||
|
||||
Once you've created the PKGBUILD file, follow these steps to build and install the software:
|
||||
|
||||
1. **Run makepkg**:
|
||||
In the same directory where the PKGBUILD is located, run the following command to build the package.
|
||||
|
||||
```bash
|
||||
makepkg
|
||||
```
|
||||
|
||||
This will:
|
||||
- Download the source code from the URL defined in the `source` array.
|
||||
- Verify the integrity of the source code using the checksum.
|
||||
- Compile the software as per the `build()` function.
|
||||
- Package the compiled software into a `.pkg.tar.zst` file.
|
||||
|
||||
2. **Install the package**:
|
||||
After the package is built, use `pacman` to install the package locally. Replace `mysoftware-1.0-1.pkg.tar.zst` with the actual filename generated by `makepkg`.
|
||||
|
||||
```bash
|
||||
sudo pacman -U mysoftware-1.0-1.pkg.tar.zst
|
||||
```
|
||||
|
||||
|
||||
|
||||
### **Conclusion**
|
||||
|
||||
This example demonstrates the basic structure and components of a PKGBUILD file. By understanding and modifying these fields, you can create your own PKGBUILDs for custom software or modify existing ones to suit your needs. PKGBUILDs provide a powerful way to automate the process of building, installing, and distributing software on Arch-based systems like Snigdha OS.
|
88
docs/snigdhaos-pkgbuilds/03-snigdhaos-lynxfetch.md
Normal file
88
docs/snigdhaos-pkgbuilds/03-snigdhaos-lynxfetch.md
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# Lynxfetch - Snigdha OS
|
||||
|
||||
**snigdhaos-lynxfetch** is a package found in the SnigdhaOS PKGBUILD repository. It is a simple and lightweight terminal-based utility designed to fetch and display system information in a visually appealing format. The name **Lynxfetch** suggests that it might have been inspired by the popular system information tool `neofetch`, but with a focus on a minimalist approach, making it a good fit for SnigdhaOS, which values efficiency and simplicity.
|
||||
|
||||
### Key Features of snigdhaos-lynxfetch:
|
||||
|
||||
1. **System Information Display:**
|
||||
Just like other system fetch tools, `lynxfetch` is used to display essential information about the system in a clean, readable format. The type of information typically shown includes:
|
||||
- **System Information:** Includes details about the operating system, kernel version, and architecture.
|
||||
- **CPU Details:** Information about the processor type, cores, and usage.
|
||||
- **Memory Usage:** Provides the current memory (RAM) usage, which helps users monitor system resources.
|
||||
- **Disk Space:** Displays available disk space on mounted partitions.
|
||||
- **Uptime:** Shows how long the system has been running since the last boot.
|
||||
|
||||
2. **Minimalist Design:**
|
||||
`lynxfetch` is designed to be minimal, meaning it will not overwhelm users with unnecessary details. It aims to present the most important system information in a way that is visually appealing yet simple, making it perfect for users who prefer a clean and lightweight tool.
|
||||
|
||||
3. **Customization:**
|
||||
Even though `lynxfetch` is minimalist, it often allows some level of customization in terms of text colors, formatting, or output structure. This ensures that users can adapt it to their personal preferences, whether they want a bit more flair or a more utilitarian view.
|
||||
|
||||
4. **Integration with SnigdhaOS:**
|
||||
Since `snigdhaos-lynxfetch` is tailored for SnigdhaOS, it is configured to work seamlessly with the system. It is designed to follow the aesthetic and functionality philosophy of SnigdhaOS, making sure it integrates perfectly with the rest of the system tools.
|
||||
|
||||
5. **Terminal Usage:**
|
||||
Like other fetch tools, `lynxfetch` is meant to be run in the terminal. It’s a great tool for users who love to monitor system information directly from their command-line interface (CLI) without having to open resource-heavy GUI applications.
|
||||
|
||||
6. **Lightweight:**
|
||||
`lynxfetch` is designed to be efficient and use minimal resources. This makes it a great choice for users of lightweight desktop environments or those looking to keep their system running fast and smooth without sacrificing useful information.
|
||||
|
||||
### Example Output:
|
||||
When you run `lynxfetch` in the terminal, the output might look something like this (format can vary based on user preferences):
|
||||
|
||||
```
|
||||
WK0OO0X whoami@MacGnome
|
||||
WKOxk0XWNXkxN ---------------
|
||||
WXOxk0N kk OS: Snigdha OS x86_64
|
||||
WKkxOXW NxO Host:
|
||||
NX0ddk00OOOOkkkkkkkkk0 Kernel: Linux 6.6.70-1-lts
|
||||
WKkxO0dOXXNNNNWWW WXKK Uptime: 1 day, 3 hours, 56 mins
|
||||
NxkN kxW XOxxdN Packages: 837 (pacman)
|
||||
KoX WkxX WkxK Xd0 Shell: bash 5.2.37
|
||||
WxkW XkkX kkW NkxX Display (CMN153B): 1920x1080 @ 60 Hz in 15" [B]
|
||||
W0dK XxOWkkW XxkN DE: GNOME 47.2
|
||||
NkxX XoKWkxK Kd0 WM: Mutter (Wayland)
|
||||
XkkN WOdN NkxX NxO WM Theme: Sweet-Dark
|
||||
OxNKxOW XdO kk Theme: Sweet-Dark [GTK2/3/4]
|
||||
kdk0W XoK WXkxN Icons: candy-icons [GTK2/3/4]
|
||||
WNNXKXXXXKKKK000OOdxkk0X Font: Monaco (11pt) [GTK2/3/4]
|
||||
KdOO000KKKKXXXXX0xx0W Cursor: Adwaita (24px)
|
||||
XoK N0kx0N Terminal: GNOME Terminal 3.54.2
|
||||
Nd0 NKOxOKW Terminal Font: Monaco (12pt)
|
||||
Nkk0K0kxOKN CPU: 12th Gen Intel(R) Core(TM) i3-1215U (8) @z
|
||||
WXXXN GPU: Intel UHD Graphics @ 1.10 GHz [Integrated]
|
||||
Memory: 5.35 GiB / 7.44 GiB (72%)
|
||||
Swap: 74.25 MiB / 3.72 GiB (2%)
|
||||
Disk (/): 11.86 GiB / 475.94 GiB (2%) - btrfs
|
||||
Local IP (wlan0): 192.168.1.69/24
|
||||
Battery (Primary): 89% [Discharging]
|
||||
Locale: en_US.UTF-8
|
||||
```
|
||||
|
||||
This simple output displays the key information about the system in a clear and concise manner, with a minimal visual design.
|
||||
|
||||
### How to Use snigdhaos-lynxfetch:
|
||||
Once installed, using `lynxfetch` is straightforward. Open a terminal and type:
|
||||
```
|
||||
lynxfetch
|
||||
```
|
||||
|
||||
The system information will be displayed in the terminal window, allowing you to quickly check the status of your system’s resources.
|
||||
|
||||
### Installation:
|
||||
Since `snigdhaos-lynxfetch` is available through the SnigdhaOS PKGBUILD repository, you can install it via the package manager (`pacman` or `makepkg`). To install `lynxfetch`, you would typically follow these steps:
|
||||
1. Clone the repository containing the PKGBUILD for `snigdhaos-lynxfetch`.
|
||||
2. Navigate to the directory where the PKGBUILD is located.
|
||||
3. Run the following command to build and install the package:
|
||||
```
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
This will download the source, compile the package, and install it on your system.
|
||||
|
||||
### Conclusion:
|
||||
**snigdhaos-lynxfetch** is a lightweight and minimalist tool that provides a simple yet effective way to view essential system information in the terminal. It is designed with SnigdhaOS users in mind and integrates seamlessly with the system’s aesthetic and performance goals. Perfect for users who appreciate efficiency, `lynxfetch` is an excellent choice for anyone who wants quick access to system information without the overhead of heavier GUI-based utilities.
|
60
docs/snigdhaos-pkgbuilds/04-snigdhaos-asiant-fonts.md
Normal file
60
docs/snigdhaos-pkgbuilds/04-snigdhaos-asiant-fonts.md
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
# Asian Fonts
|
||||
|
||||
**snigdhaos-asian-fonts** is a package found in the SnigdhaOS PKGBUILD repository, aimed at providing essential Asian language font support for SnigdhaOS users. As SnigdhaOS seeks to be a globally accessible operating system, **snigdhaos-asian-fonts** ensures that users who require Asian fonts for proper display of text in languages such as Chinese, Japanese, Korean, and other scripts have access to the necessary font sets.
|
||||
|
||||
### Key Features of snigdhaos-asian-fonts:
|
||||
|
||||
1. **Asian Language Support:**
|
||||
The main purpose of **snigdhaos-asian-fonts** is to install a variety of fonts that support Asian scripts. This includes fonts for languages like:
|
||||
- **Chinese**: Simplified and Traditional Chinese characters.
|
||||
- **Japanese**: Kana and Kanji characters.
|
||||
- **Korean**: Hangul characters.
|
||||
- Other regional scripts as needed.
|
||||
|
||||
2. **Wide Range of Fonts:**
|
||||
The package includes a collection of popular and well-maintained Asian fonts, which are commonly used for proper rendering of text across various applications. These fonts are typically selected for their readability and compatibility with most software environments on Linux-based systems.
|
||||
|
||||
3. **Fonts for Different Purposes:**
|
||||
The fonts included in the **snigdhaos-asian-fonts** package can cater to various needs, whether for:
|
||||
- **User Interface (UI) Rendering**: Fonts suitable for graphical user interfaces, such as desktop environments and window managers.
|
||||
- **Document Editing**: Fonts optimized for displaying text in documents, whether for office suites or plain-text editors.
|
||||
- **Web Browsing**: Fonts that are commonly used for displaying content on websites written in Asian languages.
|
||||
- **Terminal Usage**: Monospaced fonts that are suitable for use in terminal emulators when working with Asian text.
|
||||
|
||||
4. **Improved System Compatibility:**
|
||||
By installing **snigdhaos-asian-fonts**, users can ensure that their SnigdhaOS system fully supports the display of Asian characters in all software, from system menus to applications and websites. Without these fonts, some applications or websites may fail to render text correctly, displaying unreadable boxes or missing characters.
|
||||
|
||||
5. **Integration with SnigdhaOS:**
|
||||
The fonts provided by this package are carefully selected to integrate well with SnigdhaOS's design and performance standards. SnigdhaOS is an Arch-based distribution, and these fonts are optimized for use with common Linux tools and desktop environments such as GNOME, KDE, and XFCE.
|
||||
|
||||
6. **Easy Installation:**
|
||||
Installing **snigdhaos-asian-fonts** is simple and can be done through the package manager. Once installed, users will have access to a wide range of fonts without needing to manually configure font settings or install individual font packages.
|
||||
|
||||
### Example Fonts Included:
|
||||
The **snigdhaos-asian-fonts** package might include popular and widely-used fonts such as:
|
||||
- **Noto Sans CJK**: A comprehensive font family that covers Simplified Chinese, Traditional Chinese, Japanese, and Korean.
|
||||
- **Source Han Sans**: A font family designed for global compatibility, offering support for both Japanese and Chinese characters.
|
||||
- **Migu 1M**: A Japanese font with good readability for both modern and traditional scripts.
|
||||
- **UnBatang**: A well-known Korean font that provides clear rendering for Hangul characters.
|
||||
|
||||
These fonts are known for their clarity, style, and comprehensive support for characters in various Asian languages, making them a great choice for users in these regions or anyone who works with Asian language content.
|
||||
|
||||
### How It Works:
|
||||
Once **snigdhaos-asian-fonts** is installed, the system will have access to a broad range of Asian fonts that are automatically available for use in any application that requires them. Applications like web browsers (for browsing Chinese, Japanese, or Korean websites), office suites (for working with documents in Asian languages), and text editors (for writing code or content in these languages) will automatically detect and use the appropriate font from the installed package.
|
||||
|
||||
### Installation:
|
||||
Since **snigdhaos-asian-fonts** is available through the SnigdhaOS PKGBUILD repository, it can be installed easily via the package manager. To install the package, follow these steps:
|
||||
1. Clone the repository containing the **snigdhaos-asian-fonts** PKGBUILD.
|
||||
2. Navigate to the directory where the PKGBUILD is located.
|
||||
3. Build and install the package using the following command:
|
||||
```
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
This command will download the necessary sources, build the package, and install it onto your system, ensuring that the fonts are correctly configured.
|
||||
|
||||
### Conclusion:
|
||||
**snigdhaos-asian-fonts** is an essential package for SnigdhaOS users who require support for Asian languages. By providing a collection of fonts designed for clear and readable display of characters from scripts such as Chinese, Japanese, and Korean, this package helps ensure that SnigdhaOS users can enjoy a seamless experience when working with Asian text in various applications. Whether you're browsing the web, editing documents, or developing software in an Asian language, **snigdhaos-asian-fonts** provides the font support needed for smooth operation.
|
Reference in New Issue
Block a user