Now Reading
Write package deal definitions in a breeze — 2023 — Weblog — GNU Guix

Write package deal definitions in a breeze — 2023 — Weblog — GNU Guix

2023-11-26 04:38:41

Write package deal definitions in a breeze

Greater than 28,000 packages can be found in Guix at this time, not counting
third-party channels. That’s quite a bit—the 5th largest GNU/Linux
! But it surely’s nothing if the one package deal you
care about is lacking. So even you, pricey reader, could sooner or later discover
your self defining a package deal for your loved one deployment device. This submit
introduces a brand new device poised to considerably decrease the barrier to
writing new packages.


for Guix shouldn’t be all that arduous however, as at all times, it’s a lot tougher the primary
time you do it, particularly when ranging from a clean web page and/or not
being aware of the programming surroundings of Guix. Guix
is a brand new
net person interface to get you began—try
. It arrived
proper in time as an support to the packaging

given final week on the Workshop on Reproducible Software program Environments.

Screenshot showing the Guix Packager interface.

The interface goals to be intuitive: fill in kinds on the left
and it produces an accurate, ready-to-use package deal definition on the appropriate.
Importantly, it helps you keep away from pitfalls that journey up many newcomers:

  • Once you add a dependency in one of many “Inputs” fields, it provides the
    proper variable title within the generated code and imports the appropriate
  • Likewise, you possibly can select a license and ensure the license discipline
    will discuss with the appropriate variable representing that license.
  • You may flip checks on and off, and add configure flags. These
    translate to a sound arguments discipline of your package deal, letting you
    uncover the likes of keyword

    with out having to first dive into the handbook.

Fairly cool, no?

All of the credit score for this device goes to co-worker and intrepid hacker
Philippe Virouleau. A novel mixture of paren aversion and net
growth superpowers—distinctive within the Guix neighborhood—led
Philippe to develop the entire thing in a glimpse (says Ludovic!).

The aim was to supply a single view to have the ability to edit a package deal recipe,
subsequently the appliance is a single-page utility (SPA) written in
utilizing the UI library Philippe is most comfy with: React,
and MaterialUI for styling the parts.
It is constructed with TypeScript, and the library
half truly defines all the kinds wanted to govern Guix packages and their
parts (equivalent to construct methods or package deal sources).
One of many tougher components was to have the ability to present quick and useful “search as you
sort” outcomes over the 28k+ packages. It required a mixture of
MaterialUI’s virtualized inputs,
in addition to caching the packages knowledge within the browser’s native storage,
when attainable (packaging metadata itself is fetched from, a generic illustration of the
present package deal set).

Whereas the function set gives a terrific start line, there are nonetheless a number of
issues which may be value implementing. For example, solely the GNU and
CMake construct methods are supported thus far; it could make sense to incorporate
a number of others (Python-related ones may be good candidates).

Working a neighborhood (growth) model of the appliance can occur on
high of Guix, since—clearly—it has been developed with the node
model packaged in Guix, utilizing the fairly normal packages.json for
JavaScript dependencies put in by way of npm. Contributions

This neat device enhances a set of steps we’ve taken over time to make
packaging in Guix approachable. Certainly, whereas package deal definitions are
truly code written within the Scheme language, the package deal “language”
was designed from the get-go to be
totally declarative—assume JSON with parens as a substitute of curly braces and
semicolons. Extra just lately we simplified the way package inputs are
with an
eye on making package deal definitions much less intimidating.

The guix import

additionally exists to make it simpler to simplify packaging: it could generate a
package deal definition for something accessible in different package deal
repositories equivalent to PyPI, CRAN,, and so forth. In case your
choice goes to curly braces somewhat than parens, it could additionally convert
a JSON package

to Scheme code. Upon getting your first .scm file, guix construct
prints hints for frequent errors such lacking module imports (these
#:use-module stanzas). We additionally put effort into offering reference
a video
, and
a tutorial for more complex

See Also

Do share your expertise with us and
till then, glad packaging!

Due to Felix Lechner and Timothy Pattern for offering suggestions on an
earlier draft of this submit.

About GNU Guix

GNU Guix is a transactional package deal supervisor and
a sophisticated distribution of the GNU system that respects user
Guix can be utilized on high of any system working the Hurd or the Linux
kernel, or it may be used as a standalone working system distribution
for i686, x86_64, ARMv7, AArch64 and POWER9 machines.

Along with normal package deal administration options, Guix helps
transactional upgrades and roll-backs, unprivileged package deal administration,
per-user profiles, and rubbish assortment. When used as a standalone
GNU/Linux distribution, Guix affords a declarative, stateless method to
working system configuration administration. Guix is extremely customizable
and hackable by way of Guile
programming interfaces and extensions to the
Scheme language.

Except in any other case said, weblog posts on this website are
copyrighted by their respective authors and printed below the phrases of
the CC-BY-SA 4.0 license and people of the GNU Free Documentation License (model 1.3 or later, with no Invariant Sections, no
Entrance-Cowl Texts, and no Again-Cowl Texts).

Source Link

What's Your Reaction?
In Love
Not Sure
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top