unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Cc: Michal Sapka <michal@sapka.me>
Subject: [PATCH 1/3] ruby: simplify build
Date: Wed,  1 Jan 2025 19:39:34 -0600	[thread overview]
Message-ID: <20250102013936.57479-2-felipe.contreras@gmail.com> (raw)
In-Reply-To: <20250102013936.57479-1-felipe.contreras@gmail.com>

We can just always add EXTRA_INCFLAGS and EXTRA_LDFLAGS.
---
 bindings/Makefile.local  |  2 +-
 bindings/ruby/extconf.rb | 10 ++--------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 9875123a..eb932613 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -9,8 +9,8 @@ $(dir)/ruby.stamp: lib/$(LINKER_NAME)
 ifeq ($(HAVE_RUBY_DEV),1)
 	cd $(dir)/ruby && \
 		EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
+		EXTRA_INCFLAGS="-I$(NOTMUCH_SRCDIR)/lib" \
 		LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
-		NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \
 		$(RUBY) extconf.rb --vendor
 	$(MAKE) -C $(dir)/ruby CFLAGS="$(CFLAGS) -pipe -fno-plt -fPIC" && touch $@
 endif
diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb
index d914537c..7cec711f 100644
--- a/bindings/ruby/extconf.rb
+++ b/bindings/ruby/extconf.rb
@@ -5,14 +5,8 @@
 
 require 'mkmf'
 
-dir = File.join(ENV['NOTMUCH_SRCDIR'], 'lib')
-
-# includes
-$INCFLAGS = "-I#{dir} #{$INCFLAGS}"
-
-if ENV['EXTRA_LDFLAGS']
-  $LDFLAGS += " " + ENV['EXTRA_LDFLAGS']
-end
+$INCFLAGS = "#{ENV['EXTRA_INCFLAGS']} #{$INCFLAGS}"
+$LDFLAGS = "#{ENV['EXTRA_LDFLAGS']} #{$LDFLAGS}"
 
 if not ENV['LIBNOTMUCH']
   exit 1
-- 
0.1

  reply	other threads:[~2025-01-02  1:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02  1:39 [PATCH 0/3] ruby: build cleanups Felipe Contreras
2025-01-02  1:39 ` Felipe Contreras [this message]
2025-01-02  1:39 ` [PATCH 2/3] ruby: use proper talloc flags Felipe Contreras
2025-01-02  1:39 ` [PATCH 3/3] ruby: trivial build cleanup Felipe Contreras

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=20250102013936.57479-2-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=michal@sapka.me \
    --cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).