<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged package</title>
<link>https://coderlegion.com/tag/package</link>
<description>Powered by Question2Answer</description>
<item>
<title>Publishing My First AUR Package: CPIG</title>
<link>https://coderlegion.com/1554/publishing-my-first-aur-package-cpig</link>
<description>
&lt;p&gt;Today, I&amp;rsquo;m excited to share that I&amp;rsquo;ve published my &lt;strong&gt;first package&lt;/strong&gt; to the &lt;strong&gt;Arch User Repository (AUR)&lt;/strong&gt;! ???? The package is &lt;strong&gt;CPIG - Color Palette Inference Generator&lt;/strong&gt;, a simple C-based tool that generates color palettes from images using the &lt;strong&gt;K-means clustering algorithm&lt;/strong&gt;. It&amp;rsquo;s been a rewarding experience, and I&amp;rsquo;d love to walk you through the process of creating and publishing a package to the AUR.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://nnisarg.in/images/blog/cpig.jpg&quot; alt=&quot;CPIG Banner&quot;&gt;&lt;/p&gt;
&lt;h2&gt;What is CPIG?&lt;/h2&gt;
&lt;p&gt;CPIG is a small, lightweight tool that allows you to extract dominant colors from an image and generate a color palette. It&amp;rsquo;s designed for &lt;strong&gt;designers&lt;/strong&gt;, &lt;strong&gt;developers&lt;/strong&gt;, or anyone who needs a color palette from an image, whether it&amp;rsquo;s for a website, a project, or inspiration.&lt;/p&gt;
&lt;p&gt;The tool uses the &lt;strong&gt;K-means clustering algorithm&lt;/strong&gt; to analyze the image and find the most prominent colors, which are then outputted in &lt;strong&gt;hexadecimal format&lt;/strong&gt;. You can easily adjust the number of colors to extract and even save the palette to a text file.&lt;/p&gt;
&lt;h2&gt;Why Publish to the AUR?&lt;/h2&gt;
&lt;p&gt;As an &lt;a rel=&quot;nofollow&quot; href=&quot;https://archlinux.org/&quot;&gt;&lt;strong&gt;Arch Linux&lt;/strong&gt;&lt;/a&gt; user, I&amp;rsquo;ve always admired the &lt;a rel=&quot;nofollow&quot; href=&quot;https://aur.archlinux.org/&quot;&gt;&lt;strong&gt;AUR&lt;/strong&gt;&lt;/a&gt; (Arch User Repository) for its flexibility and community-driven nature. The AUR allows developers to share their open-source projects with the Arch community, and I saw it as the perfect platform for CPIG.&lt;/p&gt;
&lt;p&gt;Publishing a package to the AUR not only allows other users to easily install and use your software but also gives back to the open-source community. As this was my first time packaging software for the AUR, I decided to take the plunge and learn about the process, packaging standards, and best practices. Here&amp;rsquo;s how I did it!&lt;/p&gt;
&lt;h2&gt;The Process of Publishing CPIG to the AUR&lt;/h2&gt;
&lt;h3&gt;Step 1: Packaging the Project&lt;/h3&gt;
&lt;p&gt;The first step in publishing to the AUR was &lt;strong&gt;packaging&lt;/strong&gt; my project. This involves creating a &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/nnisarggada/cpig/blob/master/PKGBUILD&quot;&gt;&lt;strong&gt;PKGBUILD&lt;/strong&gt;&lt;/a&gt; file, which is a script that defines how the package is built, installed, and maintained on Arch Linux.&lt;/p&gt;
&lt;p&gt;For CPIG, the PKGBUILD script included the project&amp;rsquo;s dependencies, such as the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/nothings/stb/blob/master/stb_image.h&quot;&gt;&lt;strong&gt;STB Image&lt;/strong&gt;&lt;/a&gt; library for loading images, and instructions for building the program using &lt;strong&gt;GCC&lt;/strong&gt; (GNU Compiler Collection). Once the PKGBUILD was ready, I tested it locally to ensure everything was working as expected.&lt;/p&gt;
&lt;h3&gt;Step 2: Testing the Package&lt;/h3&gt;
&lt;p&gt;Before submitting the package, I made sure it was working as intended by testing the build process. I used &lt;code&gt;makepkg&lt;/code&gt; to create a local package and verified that the generated binary was functional. I also checked the installation process, ensuring that CPIG installed cleanly and could be run from the terminal.&lt;/p&gt;
&lt;h3&gt;Step 3: Creating the AUR Submission&lt;/h3&gt;
&lt;p&gt;Once I was happy with the package, I created an &lt;strong&gt;AUR account&lt;/strong&gt; and submitted the package. The submission process involved uploading the &lt;strong&gt;PKGBUILD&lt;/strong&gt; file, the source code, and any additional files needed to build the package.&lt;/p&gt;
&lt;p&gt;After filling out all the details, I submitted the package for review. A few hours later, my package was approved and listed on the AUR! ????&lt;/p&gt;
&lt;h3&gt;Step 4: Maintaining the Package&lt;/h3&gt;
&lt;p&gt;After the package was live, I started keeping an eye on it. This includes ensuring compatibility with future versions of Arch Linux, fixing any reported issues, and adding features or updates as needed. It&amp;rsquo;s also important to keep the documentation up-to-date so users can easily install and use the package.&lt;/p&gt;
&lt;h2&gt;Why CPIG is Useful&lt;/h2&gt;
&lt;p&gt;I created CPIG because I found that many tools for generating color palettes from images were either too complex or didn&amp;rsquo;t give me enough control. CPIG is designed to be simple, lightweight, and customizable, making it perfect for anyone who needs to generate a color palette without all the extra bloat.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s what makes CPIG stand out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;K-means clustering&lt;/strong&gt; for color extraction&lt;/li&gt;
&lt;li&gt;Customizable number of colors&lt;/li&gt;
&lt;li&gt;Hexadecimal color output&lt;/li&gt;
&lt;li&gt;Lightweight and simple design&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Installing CPIG from the AUR&lt;/h2&gt;
&lt;p&gt;Installing CPIG on your Arch Linux system is simple. Once the package is available on the AUR, you can install it using an AUR helper like &lt;code&gt;yay&lt;/code&gt; or &lt;code&gt;paru&lt;/code&gt;. Here&amp;rsquo;s the command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;yay -S cpig-git
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or, if you prefer to build it manually:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;git clone &lt;a href=&quot;https://aur.archlinux.org/cpig-git.git&quot; rel=&quot;nofollow&quot;&gt;https://aur.archlinux.org/cpig-git.git&lt;/a&gt; /tmp/cpig
cd /tmp/cpig
makepkg -si
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once installed, you can use CPIG directly from the terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cpig input.jpg
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;What&amp;rsquo;s Next for CPIG?&lt;/h2&gt;
&lt;p&gt;While CPIG is fully functional, I have some exciting plans for future updates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Optimize the color extraction algorithm&lt;/strong&gt; for better speed and accuracy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Support more image formats&lt;/strong&gt; (e.g., TIFF, GIF).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enhance the output options&lt;/strong&gt; (e.g., JSON, CSV, or image previews of the palette).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Improve error handling&lt;/strong&gt; and user interface for smoother user experience.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;rsquo;m looking forward to continuing the development of CPIG and adding more features over time.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Publishing my first package to the AUR was a fulfilling and educational experience. It taught me a lot about packaging, the AUR submission process, and how to maintain open-source projects. If you&amp;rsquo;re an Arch Linux user, I hope you find CPIG useful for your projects. And if you&amp;rsquo;re new to packaging, I encourage you to give it a try&amp;mdash;there&amp;rsquo;s no better way to learn than by diving in!&lt;/p&gt;
&lt;p&gt;If you'd like to contribute to the project, check out the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/nnisarggada/cpig&quot;&gt;&lt;strong&gt;CPIG repository&lt;/strong&gt;&lt;/a&gt; on GitHub. Whether it's improving the code, adding new features, or simply reporting issues, contributions are always welcome. Open-source projects thrive on community involvement, and I look forward to collaborating with others to make CPIG even better.&lt;/p&gt;
&lt;p&gt;Check out CPIG on the &lt;a rel=&quot;nofollow&quot; href=&quot;https://aur.archlinux.org/packages/cpig-git&quot;&gt;AUR&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/nnisarggada/cpig&quot;&gt;GitHub&lt;/a&gt;. Let me know if you have any feedback or suggestions. Here's to more open-source contributions! ????&lt;/p&gt;

</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/1554/publishing-my-first-aur-package-cpig</guid>
<pubDate>Mon, 17 Mar 2025 21:40:07 +0000</pubDate>
</item>
</channel>
</rss>