A-So-Nya / NightLoliRepo

gentoo repo
2 stars 1 forks source link

I can help #1

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi,

Welcome to the world of Gentoo packagers :) I will try to guide you and help with my knowledge. Forgive me for my grammar mistakes, I'm not a native English speaker.

Part1: The documentation 1) How to create a local custom repository. 2) Your bedside book: Gentoo dev manual, ebuild guide. 3) man 1 ebuild and man 5 ebuild

Part2: The practice The best way to learn is to take example from what already exists. For that I advise you to clone the Gentoo repository somewhere in your home directory.

git clone https://github.com/gentoo/gentoo.git

You can also look at the existing from others package manager, but nothing more. Portage is extremely powerful and eclass are the heart of ebuild.

Let's take an example with the source code you want to package. It use a CMakeLists.txt file which contains a set of directives and instructions describing the project's source files and targets (executable, library, or both). So here we will use the Gentoo cmake eclass. You can also take a look at the common ebuild functions for cmake-based packages.

What this class offers us. Let's take an example easy to understand. At the line 363 we have a function named cmake_src_configure(). Let's look at the line 530 of this cmake_src_configure() function

-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"

As you can see here, we have a default value for the variable CMAKE_INSTALL_PREFIX which is set by default when we use this function to /usr.

This is how thanks to the functions we will simplify the task. Obviously it all depends on the good work done on the part of the developer to provide a good CMakeLists.txt.

Part3: Overview and fix

Now about your code and concerning your problem to recover the source code. Let's start first by looking at what the git-r3.eclass offer us. You could also carry out a search in the existing files of the freshly cloned Gentoo ebuild repository.

You are missing a variable: EGIT_BRANCH Let's see which name is used for the default branch on the repository https://github.com/OpenXRay/xray-16 It's xd_dev so in your ebuild just after the EGIT_REPO_URI= you will have to write if you want to use this branch: EGIT_BRANCH="xd_dev"

That's it!

I hope I was able to help you to understand a little better how all of this work and that you could see now where are your mistakes in your ebuild.

Thx

A-So-Nya commented 4 years ago

Thanks for your help I have read some documentation before starting to write ebuild and asking for help on reddit, but i'll read more, since I obviously didn't read and understand everything clear enough, thanks for the links and man pages. My main problem was that I had src_unpack(), which git_r3 modifies, rewritten with mine, which was default one without git_r3's modifications (it was default + me renaming folder) At the moment i've removed my modifications to src_unpack() and it downloads source code fine. I'll add your fixes though to make sure it downloads the right branch, thanks! And i also need to fix src_configure and src_install after reading about cmake_utils, you're right.