You should use pkgconfig() or cmake() when possible. It makes the spec file easier to maintain and portable to other rpm based distros. You can find out what is specified for the name using that and the given name from the following site:
Please support that site if you can. They work with us to make sure we know some things are broken with the package info from our repos, as well.
Specifying a compiler is not necessary. Most package building frameworks should have the base tools needed to compile things with C/C++ source code.
New packages should also use declarative builds:
This is really just a top level view of the capabilities and you should ask in the Cooker channel for more info about it. Packagers should be active in that channel.
Specifying a compiler is not necessary. Most package building frameworks should have the base tools needed to compile things with C/C++ source code.
In this context, are we referring to “compiler” as ninja, and meson? I know GCC is a compiler for C code, so that helps. I was looking up ninja and meson, and all the info I’m finding that I’m understanding is that they’re pieces of software known as build systems. What is a “build system”, anyway (or is it even important to know the distinction in this case)? I’ve looked it up and also plugged my question into an LLM, but I’m afraid I’m not exactly understanding what the output means in a high-level way. All I get is something like “a build system is a more comprehensive automation tool that orchestrates the entire process of transforming source code into a final, usable software product”. Like, what is the difference between a build system and a compiler?
No, I mean gcc, llvm, etc… Mostly because it may not be gcc that every distro uses, like us. Our primary toolchain is llvm based.
Build systems are things like CMake, Meson, and some others. ninja-build is a more optimized make-style builder that is normally bolted onto a build system.
That was really a bad idea, anyway. AI is not meant to help us.
But, I digress…
Build systems can use compilers to build code with a builder app. All a build system does is create a project hierarchy and framework to handle how your source code is laid out and how to deliver it once it has been built. The compiler takes source code and turns it into either machine code, or an intermediate language (IL).
So, are we saying here that, because every OMLx install by default already has llvm pre-installed, that we wouldn’t need to specify a compiler in the BuildRequires fields within the spec file?
However, in the case of for the specific package I’m putting into an RPM, we’d still need the other pieces of software (such as build systems) listed in the BuildRequiresthat is needed to build it listed in the spec?
BuildRequires only matter when the package is created. llvm is not needed for an average user or the package.
This takes reviewing the source code to determine. Many times they will include the dependencies for building in their README’s. In the case of CMake, you can tell because the sources will contain a file called CMakeLists.txt in some or all of the directories, including the root.
You should use pkgconfig() or cmake() when possible. It makes the spec file easier to maintain and portable to other rpm based distros. You can find out what is specified for the name using that and the given name from the following site:
Okay, so I’m liking this bit here so far. I’m a bit confused about what exactly pkgconfig() and cmake() is. To elaborate, I’m looked pkgconfig() up and read the Fedora documentation article BuildRequires: pkgconfig(foo) vs. foo-devel.
From what I’m picking up, in our case it works like a function with a parameter, where we plug in a value name of the dependency within the parenthesis to make the RPM “portable” between RPM-based distributions. So in the case of Z-PDF-P and girara, we could plug in something like:
BuildRequires: pkgconfig(girara)
Instead of:
BuildRequires: girara-i18n
If this is the case, where would the value of girara come in from the distribution as the “parameter value”? Like how would “girara” be found if the package is named differently between two different distros which might name the package differently? Or, am I misunderstanding how pkgconfig build dependencies work?
Look at it from the perspective of the package itself. It is “providing” software, with the name of itself and other points of reference to make finding the package simpler when it comes to using it to satisfy the build dependencies of another package (the BuildRequires).
Another thing I would suggest before you delve into packaging specific things, is to check our Issues page for good first issue tags with package update or package request tags.
I use the rpmbuild stuff for local builds because I was learning packaging with PCLOS before I landed here. I’m sure I make it harder on myself than I have to, but it’s still possible to do that. I also attach my build tree as a repo so I can just use dnf as normal.