diff options
author | knu <knu@FreeBSD.org> | 2000-09-11 04:13:12 +0800 |
---|---|---|
committer | knu <knu@FreeBSD.org> | 2000-09-11 04:13:12 +0800 |
commit | 21a106b4b18b777da12ce69efa7e5d4ca1f21d11 (patch) | |
tree | cb464ed8c9fe99b1a5ff444cc364e6ad698fe2e3 /lang | |
parent | 11aae1de6e88a39e79c376e0b662601e9a4f09d8 (diff) | |
download | freebsd-ports-gnome-21a106b4b18b777da12ce69efa7e5d4ca1f21d11.tar.gz freebsd-ports-gnome-21a106b4b18b777da12ce69efa7e5d4ca1f21d11.tar.zst freebsd-ports-gnome-21a106b4b18b777da12ce69efa7e5d4ca1f21d11.zip |
Improve the configure script and add a knob to use another version of
Python than 1.5. (Currently this module only works with 1.5 though)
Feedback status: submitted to the author
Diffstat (limited to 'lang')
-rw-r--r-- | lang/ruby-python/Makefile | 10 | ||||
-rw-r--r-- | lang/ruby-python/files/patch-aa | 90 |
2 files changed, 88 insertions, 12 deletions
diff --git a/lang/ruby-python/Makefile b/lang/ruby-python/Makefile index ce10d0fefa95..dea3dc6c14d3 100644 --- a/lang/ruby-python/Makefile +++ b/lang/ruby-python/Makefile @@ -15,22 +15,20 @@ DIST_SUBDIR= ruby MAINTAINER= knu@FreeBSD.org -PYTHON_VERSION= python1.5 +PYTHON_VERSION?= python1.5 USE_RUBY= yes USE_RUBY_EXTCONF= yes WRKSRC= ${WRKDIR}/${PORTNAME} +CONFIGURE_ARGS= --with-python="${PYTHON_VERSION}" --with-pthread INSTALL_TARGET= site-install -post-configure: - ${PERL} -i -pe 's/-lc\b/-lc_r/g' ${WRKSRC}/Makefile - post-install: .if !defined(NOPORTDOCS) - ${MKDIR} ${RUBY_EXAMPLESDIR}/python/Lib + ${MKDIR} ${RUBY_EXAMPLESDIR}/python + ${CP} -R ${WRKSRC}/examples/ ${RUBY_EXAMPLESDIR}/python/ ${MKDIR} ${RUBY_DOCDIR}/python/ja - cd ${WRKSRC}/examples; find . -exec ${INSTALL_DATA} {} ${RUBY_EXAMPLESDIR}/python/{} \; ${INSTALL_DATA} ${WRKSRC}/ChangeLog ${WRKSRC}/README ${WRKSRC}/doc/* \ ${RUBY_DOCDIR}/python/ ${INSTALL_DATA} ${WRKSRC}/README.ja ${WRKSRC}/doc-ja/* \ diff --git a/lang/ruby-python/files/patch-aa b/lang/ruby-python/files/patch-aa index f1d7e93eff57..c234b7cafff8 100644 --- a/lang/ruby-python/files/patch-aa +++ b/lang/ruby-python/files/patch-aa @@ -1,11 +1,89 @@ ---- extconf.rb.orig Sun Nov 7 15:38:30 1999 -+++ extconf.rb Mon Aug 7 12:34:46 2000 -@@ -29,7 +30,7 @@ - exit(1) unless File.exists? py_makefile +--- extconf.rb.orig Mon Sep 11 01:14:42 2000 ++++ extconf.rb Mon Sep 11 04:31:30 2000 +@@ -1,35 +1,41 @@ + require 'mkmf' - $CFLAGS = "-I#{py_includedir}" +-py_dir = with_config("python-dir") +-if py_dir +- dirs = [py_dir] ++python = with_config("python", "python1.5") ++python = `which #{python}`.chomp ++ ++exit(1) unless File.executable? python ++ ++py_name = File.basename(python) ++py_dir = `#{python} -c 'import sys; print sys.exec_prefix' < /dev/null`.split(/\n/)[0] ++ ++exit(1) unless File.directory? py_dir ++ ++py_includedir = py_dir + "/include/" + py_name ++py_libdir = py_dir + "/lib/" + py_name ++py_configdir = py_libdir + "/config" ++py_makefile = py_configdir + "/Makefile" ++ ++print "checking for #{py_makefile}... " ++if File.exists? py_makefile ++ print "yes\n" + else +- dirs = ['/usr/local', '/usr'] +- if File.executable? `which python`.chomp +- d = `python -c 'import sys; print sys.exec_prefix' < /dev/null` +- d = d.split(/\n/).shift +- dirs.unshift d if d and File.directory? d +- end ++ print "no\n" ++ exit(1) + end + +-for py_dir in dirs +- py_includedir = py_dir + "/include/python1.5" +- py_libdir = py_dir + "/lib/python1.5" +- py_configdir = py_libdir + "/config" +- py_makefile = py_configdir + "/Makefile" ++$CFLAGS += " -I#{py_includedir}" ++$LDFLAGS += " -L#{py_configdir}" + +- print "checking for #{py_makefile}... " +- if File.exists? py_makefile +- print "yes\n" +- break +- else +- print "no\n" ++if with_config("pthread") ++ if !have_library("pthread", "pthread_create") ++ $LDFLAGS += " -pthread" ++ $libs.sub!(/-lc\b/, '-lc_r') ++ ++ if !have_func("pthread_create") ++ exit(1) ++ end + end + end +-exit(1) unless File.exists? py_makefile +- +-$CFLAGS = "-I#{py_includedir}" -$LDFLAGS = "-L#{py_configdir}" -+$LDFLAGS = "-L#{py_configdir} -pthread" # If python is linked with extra libraries (e.g. -lpthread on Linux, # -lsocket on Solaris, etc.), have_library test will fail and built +@@ -59,11 +65,13 @@ + end + $LOCAL_LIBS << py_extralibs + +-if have_library("python1.5", "Py_Initialize") && have_header("Python.h") +- # If DEBUG defined, you need python compiled with Py_DEBUG defined, +- # like as building python with "make OPT='-g -O2 -DPy_DEBUG'" +- if have_func('_Py_NewReference') +- $CFLAGS += " -DDEBUG" +- end +- create_makefile("python") ++if !have_library(py_name, "Py_Initialize") || !have_header("Python.h") ++ exit(1) ++end ++ ++# If DEBUG defined, you need python compiled with Py_DEBUG defined, ++# like as building python with "make OPT='-g -O2 -DPy_DEBUG'" ++if have_func('_Py_NewReference') ++ $CFLAGS += " -DDEBUG" + end ++create_makefile("python") |