![]() |
|
ForumThu Jan 19 19:09:24 2023 UTC Help: GeneralDj ![]() Thu Jan 19 19:07:12 2023 UTC Help: GeneralDj ![]() Tue Jan 17 00:38:36 2023 UTC Help: Generalsurimelow ![]() Fri Jan 13 08:08:47 2023 UTC Help: GeneralThierry ![]() Tue Jan 10 12:42:30 2023 UTC Help: GeneralDj ![]() Mon Jan 9 13:27:25 2023 UTC Help: Generalndawka ![]() Mon Jan 9 10:15:03 2023 UTC Help: GeneralThierry ![]() Mon Jan 9 00:21:08 2023 UTC Help: Generalndawka ![]() Sat Jan 7 14:08:17 2023 UTC Help: GeneralDj ![]() Sat Jan 7 09:04:12 2023 UTC Help: GeneralDj ![]() |
Sun Mar 15 15:38:54 2020 UTC Build in a chrootContentsIntroductionThis article explains every step to compile packages in a chroot.
This tutorial is depreciate, it's higly recommended to use this tutorial from now on.
Adjust /etc/cards.confTo be able to install the compiled packages from your chroot, you need to adjust your /etc/cards.conf file. You will add on to the top of this file: dir /mnt/hd/usr/ports/perso You are now ready to proceed with your chroot. Installation of your chroot
VERSION="rolling" install-nutyx Enter the chroot
install-nutyx -ec
From now on, everything you do, you do it in your isolated chroot.
Development tools installationThe default installation is already adapted so just install the development packages if not already installed: get cards.devel The Configurations files/etc/cards.confcat >/etc/cards.conf << EOF dir /usr/ports/perso dir /usr/ports/gui dir /usr/ports/cli dir /usr/ports/base logdir /var/log/pkgbuild base /usr/ports/base EOF A folder containing my personal recipes is added. We do not specify any URL because we don't plan to use cards sync. Folder /var/log/pkgbuild will contain compilation logs. I don't need any specific NLS files, they can all be installed. The folder /usr/ports/base defines the base system when the command cards base -r. is used. /etc/pkgmk.confcat > /etc/pkgmk.conf << EOF export CFLAGS="-O2 -pipe" export CXXFLAGS="\${CFLAGS}" case \${PKGMK_ARCH} in "x86_64"|"") export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" ;; "i686") export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" export CFLAGS="${CFLAGS} -m32" export CXXFLAGS="${CXXFLAGS} -m32" export LDFLAGS="${LDFLAGS} -m32" ;; *) echo "Unknown architecture selected! Exiting." exit 1 ;; esac PKGMK_SOURCE_DIR="/tmp" PKGMK_KEEP_SOURCES="yes" PKGMK_WORK_DIR="/tmp/work" PKGMK_IGNORE_REPO="no" PKGMK_IGNORE_COLLECTION="no" PKGMK_GROUPS=() PKGMK_LOCALES=() PKGMK_COMPRESS_PACKAGE="yes" PKGMK_COMPRESSION_MODE="xz" PKGMK_CLEAN="no" PKGMK_IGNORE_RUNTIMEDEPS="no" EOF It's very important to check all the variables so that the duo pkgmk/cards works fine as expected. Source codes are stored in a common folder. I want to keep them even after a successful compilation. The produced binaries are compressed in xz format. I want to keep my binaries once installed. I wish to have the runtime dependencies automatically added into the binary. Binaries synchronisation via rsyncThis operation consists of a download of all the binaries of the base, cli and gui collection. It can take a while depending on the speed of your internet connection.
Luckily, this operation has to be done only once.
We need to create the root folder first. mkdir -p /usr/ports/perso We can now synchronise all the binaries: The rolling branchfor i in base cli gui do rsync -avz --delete-after rsync://downloads.nutyx.org/nutyx/`uname -m`/rolling/$i/ \ /usr/ports/$i/ done
This can take some time so go get a coffee or a pizza.
Compilation and installation of your packageYou start by creating the folder where you want to locate your new package. Let's call it mypackage (you need to adjust this name to your package) mkdir /usr/ports/perso/mypackage We just need to create the build recipe of our package (you need to adjust this to your real recipe): description="My first package with plenty of dependancies" url="http://www.my-first-package.org/" packager="francis perrin" makedepends=(python gtk3 librsvg) name=mypackage version=1.0.0 release=1 source=(${url}downloads/$name/$name-$version.tar.xz) build() { cd $name-$version ./configure --prefix=/usr make make DESTDIR=$PKG install } We can now launch the process of compilation and installation. cards create -r mypackage I suggest that you read the man page of cards to understand the way cards create -r this works. man cards ConclusionThe following commands should be used: cards level cards base -r cards create -r |