Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

ebuild for this?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
20 posts • Page 1 of 1
Author
Message
stefan11111
Veteran
Veteran
Posts: 1024
Joined: Sun Jan 29, 2023 6:08 pm
Location: Romania
Contact:
Contact stefan11111
Website

ebuild for this?

  • Quote

Post by stefan11111 » Fri Apr 07, 2023 12:35 pm

I have been trying to write an ebuild for this app.
Here is what I came up with:

Code: Select all

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the MIT License

EAPI=8

DESCRIPTION="Terminal irc client"
HOMEPAGE="https://github.com/stefan11111/kirc"
SRC_URI="https://github.com/stefan11111/kirc/releases/download/0.3.2/kirc-3.2.0.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND=""
However, this doesn't work:
# ebuild kirc-0.3.2.ebuild clean test install
Forcing test.
!!! Fetched file: kirc-3.2.0.tar.gz VERIFY FAILED!
!!! Reason: Insufficient data for checksum verification
!!! Got:
!!! Expected: BLAKE2B BLAKE2S MD5 RMD160 SHA1 SHA256 SHA3_256 SHA3_512 SHA512 WHIRLPOOL
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Top
spica
Guru
Guru
Posts: 382
Joined: Fri Jun 04, 2021 6:12 pm

  • Quote

Post by spica » Fri Apr 07, 2023 2:36 pm

Try to generate checksum file

Code: Select all

ebuild {path_to_file.ebuild} manifest
Top
stefan11111
Veteran
Veteran
Posts: 1024
Joined: Sun Jan 29, 2023 6:08 pm
Location: Romania
Contact:
Contact stefan11111
Website

  • Quote

Post by stefan11111 » Fri Apr 07, 2023 6:09 pm

spica wrote:Try to generate checksum file

Code: Select all

ebuild {path_to_file.ebuild} manifest
Thanks, now I get this error:

Code: Select all

# ebuild kirc-0.3.2.ebuild clean test install
Forcing test.
 * kirc-3.2.0.tar.gz BLAKE2B SHA512 size ;-) ...                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking kirc-3.2.0.tar.gz to /var/tmp/portage/net-irc/kirc-0.3.2/work
>>> Source unpacked in /var/tmp/portage/net-irc/kirc-0.3.2/work
 * ERROR: net-irc/kirc-0.3.2::local_overlay failed (prepare phase):
 *   The source directory '/var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-0.3.2' doesn't exist
 *
 * Call stack:
 *            ebuild.sh, line  780:  Called __ebuild_main 'prepare'
 *   phase-functions.sh, line 1072:  Called __dyn_prepare
 *   phase-functions.sh, line  400:  Called die
 * The specific snippet of code:
 *              die "The source directory '${S}' doesn't exist"
 *
 * If you need support, post the output of `emerge --info '=net-irc/kirc-0.3.2::local_overlay'`,
 * the complete build log and the output of `emerge -pqv '=net-irc/kirc-0.3.2::local_overlay'`.
 * The complete build log is located at '/var/tmp/portage/net-irc/kirc-0.3.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-irc/kirc-0.3.2/temp/environment'.
 * Working directory: '/var/tmp/portage/net-irc/kirc-0.3.2/empty'
 * S: '/var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-0.3.2'
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Fri Apr 07, 2023 6:24 pm

By default ebuild search sources in /var/tmp/portage/net-irc/kirc-0.3.2/work/<package-name>-<version> but can't find anything.
This mean that when package is unpacked in /var/tmp/portage/net-irc/kirc-0.3.2/work/ there is another directory instead of <package-name>-<version>.
Check what is correct name and you can override it with S variable in ebuild (see an example with grep -rE "^S=" /var/db/repos/gentoo command).
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
stefan11111
Veteran
Veteran
Posts: 1024
Joined: Sun Jan 29, 2023 6:08 pm
Location: Romania
Contact:
Contact stefan11111
Website

  • Quote

Post by stefan11111 » Fri Apr 07, 2023 6:38 pm

Now this is what happens:

Code: Select all

Total: 1 package (1 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) net-irc/kirc-0.3.2::local_overlay
 * kirc-3.2.0.tar.gz BLAKE2B SHA512 size ;-) ...                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking kirc-3.2.0.tar.gz to /var/tmp/portage/net-irc/kirc-0.3.2/work
>>> Source unpacked in /var/tmp/portage/net-irc/kirc-0.3.2/work
>>> Preparing source in /var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-latest ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-latest ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-latest ...
make -j4
rm -f kirc *.o
c99 -Wall -Wextra -pedantic -o kirc.o -c kirc.c
c99 -Wl,-O1 -Wl,--as-needed -o kirc kirc.o -lm
>>> Source compiled.
>>> Test phase [not enabled]: net-irc/kirc-0.3.2

>>> Install net-irc/kirc-0.3.2 into /var/tmp/portage/net-irc/kirc-0.3.2/image
make -j4 DESTDIR=/var/tmp/portage/net-irc/kirc-0.3.2/image install
rm -f kirc *.o
mkdir -p /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/bin
mkdir -p /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/share/man/man1
cp -f kirc /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/bin
cp: cannot stat 'kirc': No such file or directory
make: *** [Makefile:13: install] Error 1
 * ERROR: net-irc/kirc-0.3.2::local_overlay failed (install phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=net-irc/kirc-0.3.2::local_overlay'`,
 * the complete build log and the output of `emerge -pqv '=net-irc/kirc-0.3.2::local_overlay'`.
 * The complete build log is located at '/var/tmp/portage/net-irc/kirc-0.3.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-irc/kirc-0.3.2/temp/environment'.
 * Working directory: '/var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-latest'
 * S: '/var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-latest'

>>> Failed to emerge net-irc/kirc-0.3.2, Log file:

>>>  '/var/tmp/portage/net-irc/kirc-0.3.2/temp/build.log'

 * Messages for package net-irc/kirc-0.3.2:

 * ERROR: net-irc/kirc-0.3.2::local_overlay failed (install phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=net-irc/kirc-0.3.2::local_overlay'`,
 * the complete build log and the output of `emerge -pqv '=net-irc/kirc-0.3.2::local_overlay'`.
 * The complete build log is located at '/var/tmp/portage/net-irc/kirc-0.3.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-irc/kirc-0.3.2/temp/environment'.
 * Working directory: '/var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-latest'
 * S: '/var/tmp/portage/net-irc/kirc-0.3.2/work/kirc-latest'
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Top
hdcg
Tux's lil' helper
Tux's lil' helper
Posts: 122
Joined: Sun Apr 07, 2013 8:30 am

  • Quote

Post by hdcg » Sat Apr 08, 2023 2:26 am

These are now Makefile issues. I am not a Makefile pro, but noticed the following points:

Code: Select all

...
all: clean kirc
install: all
	mkdir -p $(DESTDIR)$(BINDIR)
	mkdir -p $(DESTDIR)$(MANDIR)/man1
...
Install should only install and not rebuild.

The shown error is caused by the fact, the build artifacts are cleaned and hence the install step failed.

Code: Select all

rm -f kirc *.o
mkdir -p /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/bin
mkdir -p /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/share/man/man1
cp -f kirc /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/bin
cp: cannot stat 'kirc': No such file or directory
My guess, this is an parallelization issue. Most likely make -j1 may succeed. But better to fix that Makefile.
Top
stefan11111
Veteran
Veteran
Posts: 1024
Joined: Sun Jan 29, 2023 6:08 pm
Location: Romania
Contact:
Contact stefan11111
Website

  • Quote

Post by stefan11111 » Sat Apr 08, 2023 11:11 am

hdcg wrote:These are now Makefile issues. I am not a Makefile pro, but noticed the following points:

Code: Select all

...
all: clean kirc
install: all
	mkdir -p $(DESTDIR)$(BINDIR)
	mkdir -p $(DESTDIR)$(MANDIR)/man1
...
Install should only install and not rebuild.

The shown error is caused by the fact, the build artifacts are cleaned and hence the install step failed.

Code: Select all

rm -f kirc *.o
mkdir -p /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/bin
mkdir -p /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/share/man/man1
cp -f kirc /var/tmp/portage/net-irc/kirc-0.3.2/image/usr/local/bin
cp: cannot stat 'kirc': No such file or directory
My guess, this is an parallelization issue. Most likely make -j1 may succeed. But better to fix that Makefile.
I fixed the Makefile to work in paralel.
Now I get this:

Code: Select all

 * QA Notice: The ebuild is installing to one or more unexpected paths:
 *
 *   /usr/local
 *
 * Please fix the ebuild to use correct FHS/Gentoo policy paths.
If I add this to the ebuild, it doesn't actually install anything:

Code: Select all

src_install() {
    chmod 775 kirc
    chmod 644 kirc.1
    mkdir -p {D}/usr/bin
    mkdir -p {D}/usr/share/man/man1/kirc.1
    cp -f kirc ${D}/usr/bin/kirc
    cp -f kirc.1 ${D}/usr/share/man/man1/kirc.1
}

Code: Select all

>>> Install net-irc/kirc-0.3.3 into /var/tmp/portage/net-irc/kirc-0.3.3/image
cp: cannot create regular file '/var/tmp/portage/net-irc/kirc-0.3.3/image/usr/bin/kirc': No such file or directory
cp: cannot create regular file '/var/tmp/portage/net-irc/kirc-0.3.3/image/usr/share/man/man1/kirc.1': No such file or directory
>>> Completed installing net-irc/kirc-0.3.3 into /var/tmp/portage/net-irc/kirc-0.3.3/image
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 08, 2023 12:36 pm

Hello Stefan,

//EDIT: this post has been updated after I read the replays.

p.s. seek help in #gentoo-dev-help
p.s.2. here's your ebuild:

Code: Select all

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the MIT License

EAPI=8

DESCRIPTION="Terminal irc client"
HOMEPAGE="https://github.com/stefan11111/kirc"
SRC_URI="https://github.com/stefan11111/${PN}/archive/refs/tags/${PV}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="|| (    sys-devel/gcc
                sys-devel/clang )"
RDEPEND="${DEPEND}"
BDEPEND=""

src_install() {
    emake install PREFIX=/usr DESTDIR=${D}
}

Best Regards,
Georgi
Last edited by logrusx on Sat Apr 08, 2023 6:54 pm, edited 5 times in total.
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Sat Apr 08, 2023 4:00 pm

Usually sed command as patch should be done in src_prepare function, and is better to use emake function instead of make.
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 08, 2023 4:10 pm

fedeliallalinea wrote:Usually sed command as patch should be done in src_prepare function, and is better to use emake function instead of make.
Thank you!
Noted and corrected in the original replay.

Best Regards,
Georgi
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Apr 08, 2023 4:42 pm

logrusx wrote:

Code: Select all

src_prepare() {
    default
    sed -i '3d' Makefile
}

src_install() {
    PREFIX=${D}/usr emake install
}
Make variables can be overridden on the command line. It might be simpler to leave the Makefile unchanged and pass PREFIX=/usr. Note also that using $D/usr is incorrect, since the program is copied into $D/usr, but is installed to /usr (if we ignore prefix-based systems, which need special paths). Some build systems will embed the value of PREFIX into generated outputs, so putting $D into PREFIX causes such systems both to rebuild during the install phase and to generate files that are not correct once merged to the live system, neither of which are desirable results.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 08, 2023 4:58 pm

Hu wrote:
logrusx wrote:

Code: Select all

src_prepare() {
    default
    sed -i '3d' Makefile
}

src_install() {
    PREFIX=${D}/usr emake install
}
Make variables can be overridden on the command line. It might be simpler to leave the Makefile unchanged and pass PREFIX=/usr. Note also that using $D/usr is incorrect, since the program is copied into $D/usr, but is installed to /usr (if we ignore prefix-based systems, which need special paths). Some build systems will embed the value of PREFIX into generated outputs, so putting $D into PREFIX causes such systems both to rebuild during the install phase and to generate files that are not correct once merged to the live system, neither of which are desirable results.
This particular make file is ugly, because it sets the value or PREFIX inside it, hence the sed line. If I don't sed it out, it tries to write in /usr/local no matter what. If I sed PREFIX initialization out and don't set PREFIX to ${D}/usr it tries to write in / directly. If I set it to /usr, it tries to install in /usr. In the same time I never did write Makefiles and never were familiar with how things were done under unix-like OS' and I don't understand how it works. Maybe it's not the best educational example, but the OP seems to like that particular package and wants to have an ebuild for it. If it were me, I would just compile the binary and use it from my home fir.

Best Regards,
Georgi
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Apr 08, 2023 5:03 pm

I am aware that it sets PREFIX inside the Makefile, which is why I noted that you can override it on the command line.

Code: Select all

$ cat -n Makefile 
     1  PREFIX=/usr/local
     2  all:
     3          echo PREFIX="$(PREFIX)"
$ make -f Makefile 
echo PREFIX="/usr/local"
PREFIX=/usr/local
$ make -f Makefile PREFIX=/usr
echo PREFIX="/usr"
PREFIX=/usr
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 08, 2023 5:11 pm

Hu wrote:I am aware that it sets PREFIX inside the Makefile, which is why I noted that you can override it on the command line.

Code: Select all

$ cat -n Makefile 
     1  PREFIX=/usr/local
     2  all:
     3          echo PREFIX="$(PREFIX)"
$ make -f Makefile 
echo PREFIX="/usr/local"
PREFIX=/usr/local
$ make -f Makefile PREFIX=/usr
echo PREFIX="/usr"
PREFIX=/usr
I tried that first and it didn't work. I don't know why.

I sure don't understand something or have a wrong idea about it.

p.s. I think I got what's wrong. It runs mkdir commands on the prefix... So I guess if stefan11111 fixes the make file everything will work out of the box without even needing to redefine any of the phases.
p.s.2 post updated with an improved version without sed-ing the Makefile.
p.s.3 I think I finally got it, updated the post one more time, please comment if I've got it wrong.
p.s.4. thank you for taking the time, not only for me, but for every thread you decide to participate. Almost always I learn something from your posts.

Best Regards,
Georgi
Top
stefan11111
Veteran
Veteran
Posts: 1024
Joined: Sun Jan 29, 2023 6:08 pm
Location: Romania
Contact:
Contact stefan11111
Website

  • Quote

Post by stefan11111 » Sat Apr 08, 2023 6:37 pm

logrusx wrote:Hello Stefan,

Edit out the PREFIX = /usr/local line from Makefile and set it manually in the ebuild, let portage handle everything else.

p.s. seek help in #gentoo-dev-help
p.s.2. here's your ebuild:

Code: Select all

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the MIT License

EAPI=8

DESCRIPTION="Terminal irc client"
HOMEPAGE="https://github.com/stefan11111/kirc"
SRC_URI="https://github.com/stefan11111/${PN}/archive/refs/tags/${PV}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="|| (    sys-devel/gcc
                sys-devel/clang )"
RDEPEND="${DEPEND}"
BDEPEND=""

src_install() {
    emake install PREFIX=/usr DESTDIR=${D}
}

Thank you.
logrusx wrote: If you decide to remove the PREFIX line from the Makefile in your repo, remove the sed line from the ebuild. In general patching make files is not recommended, because they are rather fluid over time.

Best Regards,
Georgi
If I remove the PREFIX from the Makefile, it will also install kirc in /bin instead of /usr/local/bin when running make && make install.
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 08, 2023 6:52 pm

stefan11111 wrote:
logrusx wrote:Hello Stefan,

Edit out the PREFIX = /usr/local line from Makefile and set it manually in the ebuild, let portage handle everything else.

p.s. seek help in #gentoo-dev-help
p.s.2. here's your ebuild:

Code: Select all

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the MIT License

EAPI=8

DESCRIPTION="Terminal irc client"
HOMEPAGE="https://github.com/stefan11111/kirc"
SRC_URI="https://github.com/stefan11111/${PN}/archive/refs/tags/${PV}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="|| (    sys-devel/gcc
                sys-devel/clang )"
RDEPEND="${DEPEND}"
BDEPEND=""

src_install() {
    emake install PREFIX=/usr DESTDIR=${D}
}

Thank you.
logrusx wrote: If you decide to remove the PREFIX line from the Makefile in your repo, remove the sed line from the ebuild. In general patching make files is not recommended, because they are rather fluid over time.

Best Regards,
Georgi
If I remove the PREFIX from the Makefile, it will also install kirc in /bin instead of /usr/local/bin when running make && make install.
Do not remove prefix, do not remove anything, this is an outdated part of the post, before I read all other replays and updated it.

Best Regards,
Georgi
Top
grknight
Retired Dev
Retired Dev
Posts: 2556
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Sat Apr 08, 2023 7:13 pm

Really it should be:

Code: Select all

PREFIX ?= /usr/local
Such that a command-line variable can be used but then /usr/local is a default fallback.
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Apr 08, 2023 7:36 pm

A variable specified on the command line overrides one specified in the Makefile via non-conditional assignment, as I showed above (unless the Makefile uses override, but that is not in effect here). A variable specified in the Make process's environment is overridden by a non-conditional assignment in the Makefile, which is why logrusx had problems (though with the repeated post edits after responses were made, it's now a bit unclear who read what when). A conditional assignment, as grknight shows, has even lower precedence, and applies only when neither a command line argument nor a process environment variable provide a value.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 08, 2023 8:08 pm

grknight wrote:Really it should be:

Code: Select all

PREFIX ?= /usr/local
Such that a command-line variable can be used but then /usr/local is a default fallback.
In Makefile or in the ebuild? If latter, I don't understand. Isn't /usr/local undesired location? I think I've got QA warning about that in the past.
Hu wrote:A variable specified on the command line overrides one specified in the Makefile via non-conditional assignment, as I showed above (unless the Makefile uses override, but that is not in effect here). A variable specified in the Make process's environment is overridden by a non-conditional assignment in the Makefile, which is why logrusx had problems (though with the repeated post edits after responses were made, it's now a bit unclear who read what when). A conditional assignment, as grknight shows, has even lower precedence, and applies only when neither a command line argument nor a process environment variable provide a value.
Is setting DESTDIR to ${D} correct? And then is setting PREFIX correct as I've done it?

Best Regards,
Georgi
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Sun Apr 09, 2023 4:39 pm

logrusx wrote:
grknight wrote:Really it should be:

Code: Select all

PREFIX ?= /usr/local
Such that a command-line variable can be used but then /usr/local is a default fallback.
In Makefile or in the ebuild?
In the makefile. It would be better if it also used $(INSTALL) in the recipe of the install rule instead of direct invocations to mkdir and cp.
logrusx wrote:Is setting DESTDIR to ${D} correct? And then is setting PREFIX correct as I've done it?
Yes.
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Top
Post Reply

20 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy