░██████╗░███████╗███╗░░██╗████████╗░█████╗░░█████╗░░░░░░░██████╗░██╗███╗░░██╗██╗░░██╗░█████╗░░██████╗████████╗
██╔════╝░██╔════╝████╗░██║╚══██╔══╝██╔══██╗██╔══██╗░░░░░░██╔══██╗██║████╗░██║██║░░██║██╔══██╗██╔════╝╚══██╔══╝
██║░░██╗░█████╗░░██╔██╗██║░░░██║░░░██║░░██║██║░░██║█████╗██████╦╝██║██╔██╗██║███████║██║░░██║╚█████╗░░░░██║░░░
██║░░╚██╗██╔══╝░░██║╚████║░░░██║░░░██║░░██║██║░░██║╚════╝██╔══██╗██║██║╚████║██╔══██║██║░░██║░╚═══██╗░░░██║░░░
╚██████╔╝███████╗██║░╚███║░░░██║░░░╚█████╔╝╚█████╔╝░░░░░░██████╦╝██║██║░╚███║██║░░██║╚█████╔╝██████╔╝░░░██║░░░
░╚═════╝░╚══════╝╚═╝░░╚══╝░░░╚═╝░░░░╚════╝░░╚════╝░░░░░░░╚═════╝░╚═╝╚═╝░░╚══╝╚═╝░░╚═╝░╚════╝░╚═════╝░░░░╚═╝░░░
Fork from GitHub - coldnew/gentoo-binhost: Provide Gentoo binhosts using github infrastructure
This repository now provides the following CHOST (branches):
x86_64-pc-linux-gnu(desktop)
x86_64-pc-linux-gnu(desktop/plasma)
-
Package upload is done through a small upload script executed by portage hooks.
-
For each package merged via portage, the Gentoo Packages manifest file is committed to Git.
-
Binary packages are not stored in the repository but are uploaded as GitHub release artifacts.
-
UPDATES (06-06-2023): The script will check if the network is accessible before it start, if not, it will store the information of the binary packages that need to be uploaded in the same directory as offline_mode.json (which will be created automatically). Once it has access to the network it will automatically upload the packages that have not yet been uploaded.
To make everything work, the following nomenclature has to apply:
Gentoo Idiom | GitHub entity |
---|---|
CATEGORY/PN | GitHub release |
PF | GitHub release asset |
CHOST(PROFILE) | Git branch name |
CHOST(PROFILE)/CATEGORY/PN | Git release tag |
CHOST(PROFILE): Your branch name will be automatically generated based on the host's chost and profile (if this branch does not exist in the repo).
For example:
CHOST = x86_64-pc-linux-gnu
PROFILE = default/linux/amd64/17.1/desktop (stable)
Git branch name = x86_64-pc-linux-gnu(desktop)
Setup a gentoo binhost Github and provide the following.
This upload script requires the dependencies listed below.
-
app-alternatives/sh
-
app-misc/jq
-
sys-apps/diffutils
-
net-misc/curl
-
dev-vcs/git
-
virtual/perl-MIME-Base64
-
sys-apps/coreutils
Add the following lines to enable gentoo-binhost.
FEATURES="${FEATURES} buildpkg -collision-protect protect-owned"
# -collision-protect protect-owned : The default configuration on Gentoo systems is FEATURES="protect-owned"which works similarly to FEATURES="collision-protect" but it allows collisions between orphaned files.
ACCEPT_LICENSE="-* @BINARY-REDISTRIBUTABLE"
# The repo you want to use as gentoo-binhost. Example: night-every/gentoo-binhost
PORTAGE_BINHOST_HEADER_URI="https://github.com/<repo>/releases/download/${CHOST}"
BINHOST="bindist"
USE="${BINHOST}"
## You can also write it like this
## USE="${USE} bindist"
In script, PORTAGE_BINHOST_HEADER_URI will be modified. Set it up like this first
Add the following lines in /etc/portage/bashrc
# Refer https://wiki.gentoo.org/wiki//etc/portage/bashrc#Hook_functions
function post_pkg_postinst() {
# grep "buildpkg" absolutely
grep -Fq ' buildpkg ' <<< {$PORTAGE_FEATURES}
if [ $? -eq 0 ]; then
# Change this according to your settings.
# Add your repository taht you want to use as gentoo-binhost, your personal GitHub access token and your email.
# To proceed, you must generate a GitHub access token with permissions to access the repository and create releases.
/etc/portage/github_upload.sh -r '<repo>' -t '<token>' -e '<email>'
fi
}
The script will first check the PKGDIR for the binary package built for the ebuild being processed this time. If not it will exit immediately. When it encounters software specified in -B or --buildpkg-exclude, it will simply skip.
Put github_upload.sh under /etc/portage/
And REMEMEBER !!!!
sudo chmod +x /etc/portage/github_upload.sh
Although the source code of this software is released under the MIT license, it's important to note that the binary packages included in the distribution may have different licenses. Please refer to the Packages Manifest file for details on the specific licenses of each package. Additionally, please consult the Gentoo license and License groups - Gentoo Wiki for further information on the licensing terms and conditions that apply.