mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-02 02:42:56 +02:00
notmuch: allow cross for notmuch-ruby
This commit is contained in:
parent
7ccbb2a24a
commit
5b056314eb
2 changed files with 55 additions and 8 deletions
|
@ -0,0 +1,36 @@
|
||||||
|
diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb
|
||||||
|
index d914537c..aae1d2fd 100644
|
||||||
|
--- a/bindings/ruby/extconf.rb
|
||||||
|
+++ b/bindings/ruby/extconf.rb
|
||||||
|
@@ -18,9 +18,31 @@ if not ENV['LIBNOTMUCH']
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
+# Use cross-compiler toolchain
|
||||||
|
+if ENV['_TARGET_PLATFORM']
|
||||||
|
+ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
||||||
|
+ RbConfig::MAKEFILE_CONFIG['CXX'] = ENV['CXX'] if ENV['CXX']
|
||||||
|
+ RbConfig::MAKEFILE_CONFIG['LD'] = ENV['LD'] if ENV['LD']
|
||||||
|
+ RbConfig::MAKEFILE_CONFIG['AR'] = ENV['AR'] if ENV['AR']
|
||||||
|
+ RbConfig::MAKEFILE_CONFIG['CFLAGS'] = ENV['CFLAGS'] if ENV['CFLAGS']
|
||||||
|
+ RbConfig::MAKEFILE_CONFIG['LDFLAGS'] = ENV['LDFLAGS'] if ENV['LDFLAGS']
|
||||||
|
+end
|
||||||
|
+
|
||||||
|
$LOCAL_LIBS += ENV['LIBNOTMUCH']
|
||||||
|
$LIBS += " -ltalloc"
|
||||||
|
|
||||||
|
# Create Makefile
|
||||||
|
dir_config('notmuch')
|
||||||
|
create_makefile('notmuch')
|
||||||
|
+
|
||||||
|
+# Fix makefile definitions for cross compile
|
||||||
|
+if ENV['_TARGET_PLATFORM']
|
||||||
|
+ system("sed -i 's|^V =.*|V = 1|' Makefile")
|
||||||
|
+ system("sed -i 's|^CFLAGS.*|CFLAGS = \$(CCDLFLAGS) $(VOID_TARGET_CFLAGS) \$(ARCH_FLAG)|' Makefile")
|
||||||
|
+ system("sed -i 's|^topdir.*|topdir = $(XBPS_CROSS_BASE)/usr/include/ruby-\$(ruby_version)|' Makefile")
|
||||||
|
+ system("sed -i 's|^hdrdir.*|hdrdir = $(XBPS_CROSS_BASE)/usr/include/ruby-\$(ruby_version)|' Makefile")
|
||||||
|
+ system("sed -i 's|^arch_hdrdir.*|arch_hdrdir = $(XBPS_CROSS_BASE)/usr/include/ruby-\$(ruby_version)/\$(arch)|' Makefile")
|
||||||
|
+ system("sed -i 's|^arch =.*|arch = $(_TARGET_PLATFORM)|' Makefile")
|
||||||
|
+ system("sed -i 's|^dldflags =.*|dldflags = $(LDFLAGS)|' Makefile")
|
||||||
|
+ system("sed -i 's|^libdir =.*|libdir = $(exec_prefix)/lib$(XBPS_TARGET_WORDSIZE)|' Makefile")
|
||||||
|
+end
|
|
@ -9,9 +9,9 @@ configure_args="--prefix=/usr
|
||||||
--emacsetcdir=/usr/share/emacs/site-lisp/notmuch"
|
--emacsetcdir=/usr/share/emacs/site-lisp/notmuch"
|
||||||
hostmakedepends="perl pkg-config python3-Sphinx python3-devel texinfo
|
hostmakedepends="perl pkg-config python3-Sphinx python3-devel texinfo
|
||||||
desktop-file-utils emacs gnupg python3-setuptools python3-cffi
|
desktop-file-utils emacs gnupg python3-setuptools python3-cffi
|
||||||
python3-build python3-installer doxygen"
|
python3-build python3-installer doxygen ruby-devel"
|
||||||
makedepends="bash-completion gmime3-devel talloc-devel xapian-core-devel
|
makedepends="bash-completion gmime3-devel talloc-devel xapian-core-devel
|
||||||
python3-cffi"
|
python3-cffi ruby-devel"
|
||||||
depends="gmime3>=3.2.7"
|
depends="gmime3>=3.2.7"
|
||||||
checkdepends="python3-pytest mdocml dtach gdb tar xz xapian-core
|
checkdepends="python3-pytest mdocml dtach gdb tar xz xapian-core
|
||||||
openssl"
|
openssl"
|
||||||
|
@ -32,14 +32,17 @@ make_check="ci-skip" # dtach based tests fail in CI due to no pty
|
||||||
# gpgme is optional dependency
|
# gpgme is optional dependency
|
||||||
conflicts="gpgme<1.14.0_1"
|
conflicts="gpgme<1.14.0_1"
|
||||||
subpackages="libnotmuch libnotmuch-devel notmuch-mutt
|
subpackages="libnotmuch libnotmuch-devel notmuch-mutt
|
||||||
notmuch-python3 python3-notmuch2"
|
notmuch-python3 python3-notmuch2 notmuch-ruby"
|
||||||
|
|
||||||
if [ ! "$CROSS_BUILD" ]; then
|
|
||||||
makedepends+=" ruby-devel"
|
|
||||||
subpackages+=" notmuch-ruby"
|
|
||||||
fi
|
|
||||||
|
|
||||||
do_build() {
|
do_build() {
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
_TARGET_PLATFORM="$(ruby -r \
|
||||||
|
$(find ${XBPS_CROSS_BASE}/usr/lib/ruby -iname rbconfig.rb) \
|
||||||
|
-e 'puts RbConfig::CONFIG["arch"]' 2>/dev/null)"
|
||||||
|
VOID_TARGET_CFLAGS="$CFLAGS"
|
||||||
|
export _TARGET_PLATFORM XBPS_CROSS_BASE VOID_TARGET_CFLAGS \
|
||||||
|
XBPS_TARGET_WORDSIZE
|
||||||
|
fi
|
||||||
make ${makejobs}
|
make ${makejobs}
|
||||||
make -C contrib/notmuch-mutt
|
make -C contrib/notmuch-mutt
|
||||||
cd ${wrksrc}/bindings/python-cffi
|
cd ${wrksrc}/bindings/python-cffi
|
||||||
|
@ -119,6 +122,14 @@ python3-notmuch2_package() {
|
||||||
notmuch-ruby_package() {
|
notmuch-ruby_package() {
|
||||||
short_desc+=" - Ruby bindings"
|
short_desc+=" - Ruby bindings"
|
||||||
pkg_install() {
|
pkg_install() {
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
_TARGET_PLATFORM="$(ruby -r \
|
||||||
|
$(find ${XBPS_CROSS_BASE}/usr/lib/ruby -iname rbconfig.rb) \
|
||||||
|
-e 'puts RbConfig::CONFIG["arch"]' 2>/dev/null)"
|
||||||
|
VOID_TARGET_CFLAGS="$CFLAGS"
|
||||||
|
export _TARGET_PLATFORM XBPS_CROSS_BASE VOID_TARGET_CFLAGS \
|
||||||
|
XBPS_TARGET_WORDSIZE
|
||||||
|
fi
|
||||||
make DESTDIR=${PKGDESTDIR} -C bindings/ruby install
|
make DESTDIR=${PKGDESTDIR} -C bindings/ruby install
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue