diff --git a/sys-apps/nix/Manifest b/sys-apps/nix/Manifest index 92eb2a9..abea38c 100644 --- a/sys-apps/nix/Manifest +++ b/sys-apps/nix/Manifest @@ -2,3 +2,4 @@ DIST nix-2.23.3.tar.gz 1621575 BLAKE2B f068a8eb02724dc621efdee3d7c967884756f4968 DIST nix-2.24.0.tar.gz 1652048 BLAKE2B a871537bfa41ebc372acb8a88120c9147c209dd05fbc84b30989f31733f09e57a1f72f49490517e7ab21e0f48dd491dd58dedd11c9a62aef6fdb050530cd3a8d SHA512 208fdac247be822c811183f12a21abd93d72d8305af50d8c0e7a68b2d3b81ce79ee68e9220691574953b152c5acc8d7d4cc11c4d76a86a3c93050ec7ce1137db DIST nix-2.24.2.tar.gz 1652140 BLAKE2B 8b90d310065aa21f7fc760ce45b4777ecb86ed414d1dd1ed319a4b8caef43f41e8c37a7b2b26eee48aeef9e91b622b0199f0765472a80f6aaf69534bf260bb2b SHA512 8dde037d24b7ef508edb6b4a6b60b57de2ad349279652f01ee6772d564a43f5dcfa6be9316e33589abc782e20562d942f1d42440bd61291e443ebfa5fab0dbf0 DIST nix-2.24.3.tar.gz 1652156 BLAKE2B f82599322560453a05029e3df130c61137f7f0f2cb89e454cc25b2d62740487029516ca0966b6dbc0fd31226238a9fcb6efa5c5be93736319002f8f2645163e2 SHA512 ac52bfc74a52f92c83a8dfdf5c0c98e18771767c92d8288e5cc4dd92ad701cd8c1c20b6eeefb39d1d6fe710a434402b3dc0af4a4fcc245663feec8323c54cb6b +DIST nix-2.24.4.tar.gz 1649720 BLAKE2B fed037433fa0ea66f44f73d5bd8ea4aff9c5a829231eef566c961da458339e0c096132993778cd1949903ce709a109d64a670df5ed1070734348f0d24b4e6e24 SHA512 ba9868d1ecac5a1a1c911db2eefba66e169e95e65197d5c09033307c7230b11b6130abdde960e6c70e50ff8ce28195edb6fcbcb8c6ea678f9da98cf48cbc05fe diff --git a/sys-apps/nix/nix-2.24.4.ebuild b/sys-apps/nix/nix-2.24.4.ebuild new file mode 100644 index 0000000..53d10b3 --- /dev/null +++ b/sys-apps/nix/nix-2.24.4.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools linux-info readme.gentoo-r1 tmpfiles toolchain-funcs + +DESCRIPTION="A purely functional package manager" +HOMEPAGE="https://nixos.org/nix" + +SRC_URI="https://github.com/NixOS/nix/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64" +IUSE="+etc-profile +gc doc +sodium" + +BDEPEND=" + doc? ( app-text/mdbook + app-text/mdbook-linkcheck + ) +" +# sys-apps/busybox-nix-sandbox-shell is needed for sandbox mount of /bin/sh +RDEPEND=" + app-arch/brotli + app-arch/bzip2 + app-arch/xz-utils + app-misc/jq + app-text/lowdown-nix + dev-cpp/gtest + dev-db/sqlite + dev-libs/editline:0= + dev-libs/libgit2:0= + amd64? ( dev-libs/libcpuid:0= ) + dev-libs/openssl:0= + >=dev-libs/boost-1.66:0=[context] + net-misc/curl + sys-apps/busybox-nix-sandbox-shell + sys-libs/libseccomp + sys-libs/zlib + gc? ( >=dev-libs/boehm-gc-8.2.6[cxx] ) + doc? ( dev-libs/libxml2 + dev-libs/libxslt + app-text/docbook-xsl-stylesheets + ) + sodium? ( dev-libs/libsodium:0= ) +" +# add users and groups +RDEPEND+=" + acct-group/nixbld +" +for i in {1..64}; do + RDEPEND+=" + >=acct-user/nixbld${i}-1 + " +done +DEPEND="${RDEPEND} + dev-cpp/nlohmann_json + dev-cpp/toml11 + >=dev-cpp/rapidcheck-0_pre20231214 + >=sys-devel/bison-2.6 + >=sys-devel/flex-2.5.35 +" + +# Upstream does not bundle .m4 files, extract from upstreams: +# dev-util/pkgconfig: m4/pkg.m4 +# dev-build/autoconf-archive: m4/ax_boost_base.m4, m4/ax_require_defined.m4 +DEPEND+=" + dev-build/autoconf-archive + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.10-libpaths.patch + "${FILESDIR}"/${PN}-2.16-no-sandbox-fallback.patch + "${FILESDIR}"/${PN}-2.22-no-sandbox-fallback-README.patch +) + +DISABLE_AUTOFORMATTING=yes +DOC_CONTENTS=" Quick start user guide on Gentoo: + +[as root] enable nix-daemon service: + [systemd] # systemctl enable nix-daemon && systemctl start nix-daemon + [openrc] # rc-update add nix-daemon && /etc/init.d/nix-daemon start +[as a user] relogin to get environment and profile update +[as a user] fetch nixpkgs update: + \$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable + \$ nix-channel --update +[as a user] install nix packages: + \$ nix-env -i mc +[as a user] configure environment: + Somewhere in .bash_profile you might want to set + LOCALE_ARCHIVE=\$HOME/.nix-profile/lib/locale/locale-archive + but please read https://github.com/NixOS/nixpkgs/issues/21820 + +Next steps: + nix package manager user manual: http://nixos.org/nix/manual/ +" + +pkg_pretend() { + # USER_NS is used to run builders in a default setting in linux: + # https://nixos.wiki/wiki/Nix#Sandboxing + local CONFIG_CHECK="~USER_NS" + check_extra_config +} + +src_prepare() { + default + + eautoreconf + # workaround unhandled AC_CONFIG_AUX_DIR in autotools.eclass: + # https://bugs.gentoo.org/927017 + cp config.guess config/config.guess || die + cp config.sub config/config.sub || die + + # rely on users settings + sed 's/GLOBAL_CXXFLAGS += -O3/GLOBAL_CXXFLAGS += /' -i Makefile || die + + # inject our copy of lowdown-nix + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH:+:}${EPREFIX}/usr/$(get_libdir)/lowdown-nix/lib/pkgconfig" + export PATH="$PATH:${EPREFIX}/usr/$(get_libdir)/lowdown-nix/bin" + + # inject rapidcheck extra includes + export CXXFLAGS="${CXXFLAGS} -I${EPREFIX}/usr/include/rapidcheck/extras/gtest/include" +} + +src_configure() { + CONFIG_SHELL="${BROOT}/bin/bash" econf \ + --localstatedir="${EPREFIX}"/nix/var \ + $(use_enable gc) \ + $(use_enable doc doc-gen) \ + --with-sandbox-shell="${EPREFIX}"/usr/bin/busybox-nix-sandbox-shell + + emake Makefile.config # gets generated late + cat >> Makefile.config <<-EOF + V = 1 + CC = $(tc-getCC) + CXX = $(tc-getCXX) + EOF +} + +src_compile() { + # Upstream does not support building without installation. + # Rely on src_install's DESTDIR=. + : +} + +src_install() { + # TODO: emacs highlighter + default + + readme.gentoo_create_doc + + # TODO: will need a tweak for prefix + + # Follow the steps of 'scripts/install-multi-user.sh:create_directories()' + local dir dirs=( + /nix + /nix/var + /nix/var/log + /nix/var/log/nix + /nix/var/log/nix/drvs + /nix/var/nix{,/db,/gcroots,/profiles,/temproots,/userpool,/daemon-socket} + /nix/var/nix/{gcroots,profiles}/per-user + ) + for dir in "${dirs[@]}"; do + keepdir "${dir}" + fperms 0755 "${dir}" + done + + keepdir /nix/store + fowners root:nixbld /nix/store + fperms 1775 /nix/store + + newinitd "${FILESDIR}"/nix-daemon.initd nix-daemon + + if ! use etc-profile; then + rm "${ED}"/etc/profile.d/nix.sh || die + fi + # nix-daemon.sh should not be used for users' profile. + # Only for daemon itself. + rm "${ED}"/etc/profile.d/nix-daemon.sh || die +} + +pkg_postinst() { + if ! use etc-profile; then + ewarn "${EROOT}/etc/profile.d/nix.sh was removed (due to USE=-etc-profile)." + fi + + readme.gentoo_print_elog + tmpfiles_process nix-daemon.conf +}