public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/nix/files/, sys-apps/nix/
Date: Mon, 23 Jan 2017 21:24:10 +0000 (UTC)	[thread overview]
Message-ID: <1485206643.fe992f877f5bc3bee3033b693a6f5a8601d423ca.slyfox@gentoo> (raw)

commit:     fe992f877f5bc3bee3033b693a6f5a8601d423ca
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 23 21:24:03 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Jan 23 21:24:03 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe992f87

sys-apps/nix: respect CFLAGS/CXXFLAGS/LDFLAGS, require boehm-gx[cxx]

Thanks to wiselord on freenode/#haskell-by who
noticed missing boehm-gx[cxx] DEPEND.

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../nix/files/nix-1.11.6-respect-CXXFLAGS.patch    |   9 ++
 .../nix/files/nix-1.11.6-respect-LDFLAGS.patch     |  36 ++++++
 sys-apps/nix/nix-1.11.6-r2.ebuild                  | 130 +++++++++++++++++++++
 3 files changed, 175 insertions(+)

diff --git a/sys-apps/nix/files/nix-1.11.6-respect-CXXFLAGS.patch b/sys-apps/nix/files/nix-1.11.6-respect-CXXFLAGS.patch
new file mode 100644
index 00000000..091fdca
--- /dev/null
+++ b/sys-apps/nix/files/nix-1.11.6-respect-CXXFLAGS.patch
@@ -0,0 +1,9 @@
+diff --git a/configure.ac b/configure.ac
+index 3a24053..1b99702 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -57,4 +57,2 @@ fi
+ 
+-CFLAGS=
+-CXXFLAGS=
+ AC_PROG_CC

diff --git a/sys-apps/nix/files/nix-1.11.6-respect-LDFLAGS.patch b/sys-apps/nix/files/nix-1.11.6-respect-LDFLAGS.patch
new file mode 100644
index 00000000..12c094e
--- /dev/null
+++ b/sys-apps/nix/files/nix-1.11.6-respect-LDFLAGS.patch
@@ -0,0 +1,36 @@
+diff --git a/Makefile.config.in b/Makefile.config.in
+index f0de4da..c82fbfd 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -5,2 +5,3 @@ CXX = @CXX@
+ CXXFLAGS = @CXXFLAGS@
++LDFLAGS = @LDFLAGS@
+ HAVE_SODIUM = @HAVE_SODIUM@
+diff --git a/mk/libraries.mk b/mk/libraries.mk
+index 3cd7a53..f7bd015 100644
+--- a/mk/libraries.mk
++++ b/mk/libraries.mk
+@@ -88,3 +88,3 @@ define build-library
+     $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) | $$(_d)/
+-	$$(trace-ld) $(CXX) -o $$(abspath $$@) -shared $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE)) $$($(1)_LDFLAGS_UNINSTALLED)
++	$$(trace-ld) $(CXX) -o $$(abspath $$@) -shared $$(LDFLAGS) $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE)) $$($(1)_LDFLAGS_UNINSTALLED)
+ 
+@@ -102,3 +102,3 @@ define build-library
+     $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $(DESTDIR)$$($(1)_INSTALL_DIR)/
+-	$$(trace-ld) $(CXX) -o $$@ -shared $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED))
++	$$(trace-ld) $(CXX) -o $$@ -shared $$(LDFLAGS) $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED))
+ 
+diff --git a/mk/programs.mk b/mk/programs.mk
+index 3ac6449..f553ce2 100644
+--- a/mk/programs.mk
++++ b/mk/programs.mk
+@@ -34,3 +34,3 @@ define build-program
+   $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) | $$(_d)/
+-	$$(trace-ld) $(CXX) -o $$@ $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
++	$$(trace-ld) $(CXX) -o $$@ $$(LDFLAGS) $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
+ 
+@@ -48,3 +48,3 @@ define build-program
+     $(DESTDIR)$$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $(DESTDIR)$$($(1)_INSTALL_DIR)/
+-	$$(trace-ld) $(CXX) -o $$@ $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED))
++	$$(trace-ld) $(CXX) -o $$@ $$(LDFLAGS) $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED))
+ 

diff --git a/sys-apps/nix/nix-1.11.6-r2.ebuild b/sys-apps/nix/nix-1.11.6-r2.ebuild
new file mode 100644
index 00000000..c9c976b
--- /dev/null
+++ b/sys-apps/nix/nix-1.11.6-r2.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools flag-o-matic readme.gentoo-r1 user
+
+DESCRIPTION="A purely functional package manager"
+HOMEPAGE="https://nixos.org/nix"
+
+SRC_URI="http://nixos.org/releases/${PN}/${P}/${P}.tar.xz"
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+etc_profile +gc doc sodium"
+
+RDEPEND="
+	app-arch/bzip2
+	app-arch/xz-utils
+	dev-db/sqlite
+	dev-libs/openssl:0=
+	net-misc/curl
+	sys-libs/zlib
+	gc? ( dev-libs/boehm-gc[cxx] )
+	doc? ( dev-libs/libxml2
+		dev-libs/libxslt
+		app-text/docbook-xsl-stylesheets
+	)
+	sodium? ( dev-libs/libsodium )
+	dev-lang/perl:=
+	dev-perl/DBD-SQLite
+	dev-perl/WWW-Curl
+	dev-perl/DBI
+"
+DEPEND="${RDEPEND}
+	>=sys-devel/bison-2.6
+	>=sys-devel/flex-2.5.35
+	virtual/perl-ExtUtils-ParseXS
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-systemd.patch
+	"${FILESDIR}"/${P}-per-user.patch
+	"${FILESDIR}"/${P}-respect-CXXFLAGS.patch
+	"${FILESDIR}"/${P}-respect-LDFLAGS.patch
+)
+
+DISABLE_AUTOFORMATTING=yes
+DOC_CONTENTS=" Quick start user guide on Gentoo:
+
+[as root] enable nix-daemon service:
+	[systemd] # systemctl enable nix-daemon
+	[openrc]  # rc-update add nix-daemon
+[as an user] relogin to get environment and profile update
+[as an user] fetch nixpkgs update:
+	\$ nix-channel --update
+[as an user] install nix packages:
+	\$ nix-env -i mc
+[as an 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_setup() {
+	enewgroup nixbld 30000
+	for i in {1..10}; do
+		# we list 'nixbld' twice to
+		# both assign a primary group for user
+		# and add an user to /etc/group
+		enewuser nixbld${i} $((30000 +$i)) -1 /var/empty nixbld,nixbld
+	done
+}
+
+src_prepare() {
+	default
+
+	eautoreconf
+}
+
+src_configure() {
+	econf \
+		--localstatedir="${EPREFIX}"/nix/var \
+		$(use_enable gc)
+}
+
+src_compile() {
+	local make_vars=(
+		OPTIMIZE=0 # disable hardcoded -O3
+		V=1 # verbose build
+	)
+	emake "${make_vars[@]}"
+}
+
+src_install() {
+	# TODO: emacs highlighter
+	default
+
+	readme.gentoo_create_doc
+
+	# here we an eager variant of something that
+	# is lazily done by  nix-daemo and root nix-env
+
+	# TODO: will need a tweak for prefix
+	keepdir             /nix/store
+	fowners root:nixbld /nix/store
+	fperms 1775         /nix/store
+
+	keepdir             /nix/var/nix/profiles/per-user
+	fperms 1777         /nix/var/nix/profiles/per-user
+
+	doenvd "${FILESDIR}"/60nix-remote-daemon
+	newinitd "${FILESDIR}"/nix-daemon.initd nix-daemon
+
+	if ! use etc_profile; then
+		rm "${ED}"/etc/profile.d/nix.sh || die
+	fi
+}
+
+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
+}


             reply	other threads:[~2017-01-23 21:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 21:24 Sergei Trofimovich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-09-07  8:03 [gentoo-commits] repo/gentoo:master commit in: sys-apps/nix/files/, sys-apps/nix/ Sergei Trofimovich
2017-12-21  8:01 Sergei Trofimovich
2017-07-15 11:29 Sergei Trofimovich
2017-01-17 11:37 Sergei Trofimovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485206643.fe992f877f5bc3bee3033b693a6f5a8601d423ca.slyfox@gentoo \
    --to=slyfox@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox