Forums

Skip to content

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

Making an ebuild for pass-cli need help please...

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
GenIT
n00b
n00b
User avatar
Posts: 23
Joined: Mon Feb 09, 2026 10:11 am

Making an ebuild for pass-cli need help please...

  • Quote

Post by GenIT » Sat Apr 04, 2026 2:22 am

Hello,

I found out the other day about pass-cli

https://github.com/arimxyer/pass-cli

Let's just say, when it comes to some other distros and packing and compiling source I do ok, but with ebuild I'm lost.

SO I worked with AI to whip this up, but it's my understanding this does not coincide to Gentoo Standards, like this could not be redistrubted with Gentoo or for an overlay.

The problem I was runing into, trying to grab the source it needed, and then having to restrict it.

If anyone can help convert this to make it more official, or at least make sure this works in a correct manner as a local ebuild, I'd appreciate any help.

Also if there is anyone out there that loves password managers, and thinks pass-cli can be either added to Gentoo or an overlay that would be great.

THANKS

Code: Select all

# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="A secure, cross-platform password and API key manager"
HOMEPAGE="https://github.com/arimxyer/pass-cli"
SRC_URI="https://github.com/arimxyer/pass-cli/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"

# Required for the 'go mod download' step in src_unpack
PROPERTIES="test_network"
RESTRICT="network-sandbox"

RDEPEND="app-admin/pass"
DEPEND="${RDEPEND}"
BDEPEND=">=dev-lang/go-1.20"

S="${WORKDIR}/${P}"

src_unpack() {
	default

        cd "${S}" || die
        export GOPATH="${WORKDIR}/gopath"
        einfo "Fetching Go dependencies..."
        go mod download || die "Failed to fetch Go modules"
}

src_compile() {
        export GOPATH="${WORKDIR}/gopath"

        # Cleaned up the flags into a single string to avoid syntax errors
        local myldflags="-compressdwarf=false -linkmode external -X main.version=${PV} -X pass-cli/cmd.version=${PV} -X github.com/arimxyer/pass-cli/cmd.version=${PV}"

        einfo "Compiling pass-cli version ${PV}..."
        go build -ldflags "${myldflags}" -o pass-cli . || die "Go build failed"
}

src_install() {
        dobin pass-cli
        dodoc README.md

        # Optional: install the license file to the standard location
        insinto /usr/share/licenses/${PN}
        doins LICENSE
        
Top
salahx
Guru
Guru
Posts: 574
Joined: Sat Mar 12, 2005 6:39 am

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by salahx » Sat Apr 04, 2026 3:24 am

Try this ebuild, made with 100% NS (Natural Stupidity):

Code: Select all

# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="A pass extension for command-line interfaces"
HOMEPAGE="https://arimxyer.github.io/pass-cli/"
SRC_URI="https://github.com/arimxyer/pass-cli/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="app-admin/pass"
DEPEND="${RDEPEND}"

src_compile() {
	ego build
}

src_install() {
	dobin pass-cli
}
It may need some tweaking but it worked for me.
Top
GenIT
n00b
n00b
User avatar
Posts: 23
Joined: Mon Feb 09, 2026 10:11 am

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by GenIT » Sun Apr 05, 2026 12:27 am

Ohhh this is great, really appreciate this!

It will run like this for me to make a package, without it, it get's blocked.

Code: Select all

sudo FEATURES="-network-sandbox" ebuild pass-cli-0.17.21.ebuild clean install package
SO, I've used Gentoo a bit here and there, but rusty when it comes to ebuilds.

If I want to set this up as a local overlay for my own use, is this correct?

Code: Select all

# 1. Create/Overwrite the Portage configuration (The "Map")
sudo mkdir -p /etc/portage/repos.conf
sudo tee /etc/portage/repos.conf/local.conf <<EOF
[local-overlay]
location = /var/db/repos/local-overlay
masters = gentoo
auto-sync = no
EOF

# 2. Create the folder structure (The "Skeleton")
sudo mkdir -p /var/db/repos/local-overlay/metadata
sudo mkdir -p /var/db/repos/local-overlay/profiles
sudo mkdir -p /var/db/repos/local-overlay/app-admin/pass-cli

# 3. Create the repo_name file (The "ID Card")
# This creates a file named 'repo_name' containing the text 'local-overlay'
echo "local-overlay" | sudo tee /var/db/repos/local-overlay/profiles/repo_name

# 4. Create the layout.conf (The "Rules")
# This tells Portage this is a 'thin' repo (it doesn't need full GPG signing) ?
sudo tee /var/db/repos/local-overlay/metadata/layout.conf <<EOF
masters = gentoo
auto-sync = no
thin-manifests = true
EOF

# 5. Move your ebuild into the repo (The "Payload")
# IMPORTANT: This assumes your file is in your current directory!
sudo cp pass-cli-0.17.21.ebuild /var/db/repos/local-overlay/app-admin/pass-cli/

# 6. Generate the Manifest (The "Security Fingerprint")
# This creates a file called 'Manifest' inside the package folder
cd /var/db/repos/local-overlay/app-admin/pass-cli
sudo ebuild pass-cli-0.17.21.ebuild manifest

# 7. Refresh Portage and Test
# This makes Portage 'scan' the new folder
sudo emaint sync -r local-overlay
emerge -pv app-admin/pass-cli
THANKS!
Top
Phoenix591
Guru
Guru
Posts: 506
Joined: Mon Sep 17, 2007 3:52 am

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by Phoenix591 » Sun Apr 05, 2026 2:49 am

https://wiki.gentoo.org/wiki/Writing_go ... pendencies to fix you having to turn off the sandbox

sudo emaint sync -r local-overlay is completely unnecessary
Top
GenIT
n00b
n00b
User avatar
Posts: 23
Joined: Mon Feb 09, 2026 10:11 am

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by GenIT » Sun Apr 05, 2026 4:58 am

Ok, am I in the right ballpark here, with this ebuild now to deal with go and more of an official style of ebuild?

Code: Select all

# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="A pass extension for command-line interfaces"
HOMEPAGE="https://arimxyer.github.io/pass-cli/"
SRC_URI="https://github.com/arimxyer/pass-cli/archive/v${PV}.tar.gz -> ${P}.tar.gz"

EGO_SUM=(
	"al.essio.dev/pkg/shellescape v1.5.1 h1:86HrALUujYS/h+GtqoB26SBEdkWfmMI6FubjXlsXyho="
        "al.essio.dev/pkg/shellescape v1.5.1/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890="
        "github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4="
        "github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI="
        "github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI="
        "github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8="
        "github.com/clipperhouse/displaywidth v0.6.2 h1:ZDpTkFfpHOKte4RG5O/BOyf3ysnvFswpyYrV7z2uAKo="
        "github.com/clipperhouse/displaywidth v0.6.2/go.mod h1:R+kHuzaYWFkTm7xoMmK1lFydbci4X2CicfbGstSGg0o="
        "github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs="
        "github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA="
        "github.com/clipperhouse/uax29/v2 v2.3.0 h1:SNdx9DVUqMoBuBoW3iLOj4FQv3dN5mDtuqwuhIGpJy4="
        "github.com/clipperhouse/uax29/v2 v2.3.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g="
        "github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0="
        "github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8="
        "github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM="
        "github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU="
        "github.com/gdamore/encoding v1.0.1 h1:YzKZckdBL6jVt2Gc+5p82qhrGiqMdG/eNs6Wy0u3Uhw="
        "github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo="
        "github.com/gdamore/tcell/v2 v2.13.8 h1:Mys/Kl5wfC/GcC5Cx4C2BIQH9dbnhnkPgS9/wF3RlfU="
        "github.com/gdamore/tcell/v2 v2.13.8/go.mod h1:+Wfe208WDdB7INEtCsNrAN6O2m+wsTPk1RAovjaILlo="
        "github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag="
        "github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0="
        "github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY="
        "github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y="
        "github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw="
        "github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs="
        "github.com/mdp/qrterminal/v3 v3.2.1 h1:6+yQjiiOsSuXT5n9/m60E54vdgFsw0zhADHhHLrFet4="
        "github.com/mdp/qrterminal/v3 v3.2.1/go.mod h1:jOTmXvnBsMy5xqLniO0R++Jmjs2sTm9dFSuQ5kpz/SU="
        "github.com/rivo/tview v0.42.0 h1:b/ftp+RxtDsHSaynXTbJb+/n/BxDEi+W3UfF5jILK6c="
        "github.com/rivo/tview v0.42.0/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY="
        "github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ="
        "github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88="
        "golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8="
        "golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A="
        "golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ="
        "golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks="
        "golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY="
        "golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww="
        "golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE="
        "golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8="
        "gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA="
        "gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM="
        )
go-module_set_globals

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="app-admin/pass"
DEPEND="${RDEPEND}"

src_compile() {
        # Explicit output name and build from local context
        ego build -o pass-cli .
}

src_install() {
        dobin pass-cli
        einstalldocs
}
THANKS
Top
salahx
Guru
Guru
Posts: 574
Joined: Sat Mar 12, 2005 6:39 am

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by salahx » Mon Apr 06, 2026 2:28 am

It turns out upstream name for their application is misleading. It is NOT part of "app-admin/pass" and does not need it - it totally self-contained. It also has an optional dependency on "virtual/secret-service" as well.

I also discovered the only reason the ebuild I posted worked for me was because I was using a Podman container, and by default, the network sandbox is inoperative there (unless you gave the sandbox CAP_SYS_ADMIN). EGO_SUM works, but it is deprecated,a vendor tarball should be created instead. You'll need a web server for this: Add the URL to the SRC_URI. If you've got a web server upload the vendor tarball to it (if you intend to distribute this package, it needs to be publicly accessible); if you don't have a web server and only intend to use this locally, you can either create one instantly with with Python ("python -m http.server 8000" will serve files from the current directory) or a simple web server like www-servers/webfs (there's plenty to choose from).
Top
Phoenix591
Guru
Guru
Posts: 506
Joined: Mon Sep 17, 2007 3:52 am

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by Phoenix591 » Mon Apr 06, 2026 10:03 am

salahx wrote: Mon Apr 06, 2026 2:28 am It turns out upstream name for their application is misleading. It is NOT part of "app-admin/pass" and does not need it - it totally self-contained. It also has an optional dependency on "virtual/secret-service" as well.

I also discovered the only reason the ebuild I posted worked for me was because I was using a Podman container, and by default, the network sandbox is inoperative there (unless you gave the sandbox CAP_SYS_ADMIN). EGO_SUM works, but it is deprecated,a vendor tarball should be created instead. You'll need a web server for this: Add the URL to the SRC_URI. If you've got a web server upload the vendor tarball to it (if you intend to distribute this package, it needs to be publicly accessible); if you don't have a web server and only intend to use this locally, you can either create one instantly with with Python ("python -m http.server 8000" will serve files from the current directory) or a simple web server like www-servers/webfs (there's plenty to choose from).
you can use github's free bandwidth for it: fork upstream's repo, add a github action like https://github.com/Phoenix591/truffleho ... vendor.yml and then everytime I push a tag it makes the tarball and hosts it.
Top
Zucca
Administrator
Administrator
User avatar
Posts: 4706
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by Zucca » Mon Apr 06, 2026 10:19 am

salahx wrote: Mon Apr 06, 2026 2:28 am It turns out upstream name for their application is misleading. It is NOT part of "app-admin/pass" and does not need it - it totally self-contained. It also has an optional dependency on "virtual/secret-service" as well.
Can these two programs use the same "database"? Or do they have completely different method/protocol to store the secrets?
..: Zucca :..

Code: Select all

0100100100100000011000010110110100100000
0100111001100001010011100010000100100000
0100100100100000011000010110110100100000
0110000100100000011011010110000101101110
00100001
Top
salahx
Guru
Guru
Posts: 574
Joined: Sat Mar 12, 2005 6:39 am

Re: Making an ebuild for pass-cli need help please...

  • Quote

Post by salahx » Mon Apr 06, 2026 3:56 pm

Zucca wrote: Mon Apr 06, 2026 10:19 am
salahx wrote: Mon Apr 06, 2026 2:28 am It turns out upstream name for their application is misleading. It is NOT part of "app-admin/pass" and does not need it - it totally self-contained. It also has an optional dependency on "virtual/secret-service" as well.
Can these two programs use the same "database"? Or do they have completely different method/protocol to store the secrets?
Totally different: https://github.com/arimxyer/pass-cli/issues/67

BTW, using github to produce vendor tarballs is a nice trick. That would be a great addition to the wiki.
Top
Post Reply

9 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

 

 

magic