Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP_TARGET on custom ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
TribesTom
n00b
n00b


Joined: 17 Jul 2006
Posts: 9

PostPosted: Tue Jan 15, 2013 12:42 pm    Post subject: PHP_TARGET on custom ebuild Reply with quote

Hello guys


I need to install Ice with php i have found a thread on bug list : https://bugs.gentoo.org/show_bug.cgi?id=236264&list_id=cookie

I have created a custom overlay, make ebuild digest etc

but when i try to install it it require php 5.3 but i have php 5.4 and don't want to have multiple install of php.

I have forced php 5.4 in make.conf

Have someone an idea to make it compile with php 5.4 ?

Here is the résult of emerge command :

Code:
controle Ice # emerge -ua --newuse --deep world system

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS    ] dev-lang/php-5.3.18 [5.4.8] USE="apache2 berkdb bzip2 cgi cli crypt ctype exif fileinfo filter gd gdbm hash iconv ipv6 json kerberos ldap mysql mysqli nls phar posix readline session simplexml sockets spell ssl tokenizer truetype unicode xml zip zlib -bcmath -calendar -cdb -cjk -curl -curlwrappers -debug -doc -embed -enchant -firebird -flatfile -fpm -frontbase -ftp -gmp -imap -inifile -intl -iodbc (-kolab) -ldap-sasl -libedit -mhash -mssql -mysqlnd -oci8-instant-client -odbc -pcntl -pdo -pic -postgres -qdbm -recode (-selinux) -sharedmem -snmp -soap -sqlite2 -sqlite3 -sybase-ct -sysvipc -threads -tidy -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl"
[ebuild  N    ~] dev-libs/Ice-3.4.2-r2  USE="ncurses php python -debug -doc -examples -mono -ruby {-test}" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18"

The following USE changes are necessary to proceed:
#
>=dev-libs/Ice-3.4.2-r2 php_targets_php5-3

Use --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).


Here is the code of the ebuild :
Code:
EAPI="2"

PYTHON_DEPEND="python? 2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.*"
RUBY_OPTIONAL="yes"
USE_RUBY="ruby18"
PHP_EXT_NAME="IcePHP"

inherit toolchain-funcs versionator php-ext-source-r2 php-lib-r1 python mono ruby-ng db-use

DESCRIPTION="ICE middleware C++ library and generator tools"
HOMEPAGE="http://www.zeroc.com/"
SRC_URI="http://www.zeroc.com/download/Ice/$(get_version_component_range 1-2)/${P}.tar.gz
   doc? ( http://www.zeroc.com/download/Ice/$(get_version_component_range 1-2)/${P}.pdf.gz )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="doc examples +ncurses mono php php_namespaces python ruby test debug"

RDEPEND=">=dev-libs/expat-2.0.1
   >=app-arch/bzip2-1.0.5
   >=dev-libs/openssl-0.9.8o
   >=sys-libs/db-4.8.30[cxx]
   ~dev-cpp/libmcpp-2.7.2
   ruby? ( $(ruby_implementation_depend ruby18) )
   mono? ( dev-lang/mono )
   php? ( >=dev-lang/php-5.3.1 )
   php_namespaces? ( >=dev-lang/php-5.3 )"

DEPEND="${RDEPEND}
   ncurses? ( sys-libs/ncurses sys-libs/readline )
   test? ( =dev-lang/python-2* )"

# Maintainer notes:
# - yes, we have to do the trickery with the move for the python functions
#   since the build and test frameworks deduce various settings from the path
#   and they can't be tricked by a symlink. And we also need
#   SUPPORT_PYTHON_ABIS=1 otherwise we can't get pyc/pyo anymore the sane way
#   with EAPI=2 which is needed since ruby-ng does not support EAPI=3.
# TODO: java bindings

pkg_setup() {
   if use python || use test; then
      python_pkg_setup
   fi
}

src_unpack() {
   # prevent ruby-ng.eclass from messing with src_unpack
   default
}

src_prepare() {
   epatch "${FILESDIR}"/${PN}-3.4.1-db5.patch
   epatch "${FILESDIR}"/${PN}-3.4.2-gcc46.patch

   sed -i \
      -e 's|\(install_docdir[[:space:]]*\):=|\1?=|' \
      -e 's|\(install_configdir[[:space:]]*\):=|\1?=|' \
      cpp/config/Make.rules || die "sed failed"

   sed -i \
      -e 's|\(install_phpdir[[:space:]]*\):=|\1?=|' \
      -e 's|\(install_libdir[[:space:]]*\):=|\1?=|' \
      php/config/Make.rules.php || die "sed failed"

   sed -i \
      -e 's|\(install_pythondir[[:space:]]*\):=|\1?=|' \
      -e 's|\(install_rubydir[[:space:]]*\):=|\1?=|' \
      -e 's|\(install_libdir[[:space:]]*\):=|\1?=|' \
      {py,rb}/config/Make.rules || die "sed failed"

   sed -i \
      -e 's|-O2 ||g' \
      cpp/config/Make.rules.Linux || die "sed failed"

   sed -i \
      -e 's|install-common||' \
      -e 's|demo||' \
      {cpp,cs,php,py,rb}/Makefile || die "sed failed"

   sed -i \
      -e 's|-f -root|-f -gacdir $(GAC_DIR) -root|' \
      cs/config/Make.rules.cs || die "sed failed"

   if ! use test ; then
      sed -i \
         -e 's|^\(SUBDIRS.*\)test|\1|' \
         {cpp,cs,php,py,rb}/Makefile || die "sed failed"
   fi
}

src_configure() {
   MAKE_RULES="prefix=\"${ED}/usr\"
      install_docdir=\"${ED}/usr/share/doc/${PF}\"
      install_configdir=\"${ED}/usr/share/Ice-${PV}/config\"
      embedded_runpath_prefix=\"${EPREFIX}/usr\"
      LP64=yes"

   use ncurses && OPTIONS="${MAKE_RULES} USE_READLINE=yes" || MAKE_RULES="${MAKE_RULES} USE_READLINE=no"
   use debug && OPTIONS"${MAKE_RULES} OPTIMIZE=no" || MAKE_RULES="${MAKE_RULES} OPTIMIZE=yes"

   MAKE_RULES="${MAKE_RULES} DB_FLAGS=-I$(db_includedir)"
   sed -i \
      -e "s|c++|$(tc-getCXX)|" \
      -e "s|\(CFLAGS[[:space:]]*=\)|\1 ${CFLAGS}|" \
      -e "s|\(CXXFLAGS[[:space:]]*=\)|\1 ${CXXFLAGS}|" \
      -e "s|\(LDFLAGS[[:space:]]*=\)|\1 ${LDFLAGS}|" \
      -e "s|\(DB_LIBS[[:space:]]*=\) \-ldb_cxx|\1 -ldb_cxx-$(db_findver sys-libs/db)|" \
      cpp/config/Make.rules{,.Linux} php/config/Make.rules.php py/config/Make.rules || die "sed failed"

   if use php ; then
      MAKE_RULES_PHP="PHP_HOME=$(php-config --prefix)"
      if use php_namespaces ; then
         MAKE_RULES_PHP="${MAKE_RULES_PHP} USE_NAMESPACES=yes"
      fi
   fi

   if use python ; then
      python_copy_sources py
      mv py py.orig
   fi

   if use ruby ; then
      SITERUBY="$(ruby18 -r rbconfig -e 'print Config::CONFIG["sitedir"]')"
      MAKE_RULES_RB="install_rubydir=\"${ED}/${SITERUBY}\"
         install_libdir=\"${ED}/${SITERUBY}\""

      # make it use ruby18 only
      sed -i \
         -e 's|RUBY = ruby|\018|' \
         rb/config/Make.rules || die "sed failed"
   fi

   MAKE_RULES_CS="GACINSTALL=yes GAC_ROOT=\"${ED}/usr/$(get_libdir)\" GAC_DIR=${EPREFIX}/usr/$(get_libdir)"

}

src_compile() {
   if tc-is-cross-compiler ; then
      export CXX="${CHOST}-g++"
   fi

   emake -C cpp ${MAKE_RULES} || die "emake failed"

   if use doc ; then
      emake -C cpp/doc || die "building docs failed"
   fi

   if use php; then
      emake -C php ${MAKE_RULES} ${MAKE_RULES_PHP} || die "emake php failed"
   fi

   if use python ; then
      building() {
         mv py-${PYTHON_ABI} py
         emake -C py ${MAKE_RULES} || die "emake py failed (for py-${PYTHON_ABI})"
         mv py py-${PYTHON_ABI}
      }
      python_execute_function building
   fi

   if use ruby ; then
      emake -C rb ${MAKE_RULES} ${MAKE_RULES_RB} || die "emake rb failed"
   fi

   if use mono ; then
      emake -C cs ${MAKE_RULES} ${MAKE_RULES_CS} || die "emake cs failed"
   fi
}

src_install() {
   dodoc CHANGES README

   insinto /usr/share/${P}
   doins -r slice

   emake -C cpp ${MAKE_RULES} install || die "emake install failed"

   docinto cpp
   dodoc CHANGES README

   if use examples ; then
      insinto /usr/share/doc/${PF}/examples-cpp
      doins cpp/config/*.cfg
      doins -r cpp/demo/*
   fi

   if use doc ; then
      dohtml -r cpp/doc/reference/*
      dodoc "${WORKDIR}/${P}.pdf"
   fi

   if use php ; then
      docinto php
      dodoc php/CHANGES php/README
      if use examples ; then
         insinto /usr/share/doc/${PF}/examples-php
         doins -r php/demo/*
      fi
      mkdir modules
      mv php/lib/${PHP_EXT_NAME}.so modules
      php-ext-source-r2_src_install "${PHP_EXT_NAME}.so"
      php-lib-r1_src_install php/lib $(cd php/lib; find . -name '*.php' -print)
   fi

   if use python ; then
      installation() {
         dodir $(python_get_sitedir)
         mv py-${PYTHON_ABI} py
         emake -C py ${MAKE_RULES} install_pythondir="\"${D}/$(python_get_sitedir)\"" install_libdir="\"${D}/$(python_get_sitedir)\"" install || die "emake py install failed (for py-${PYTHON_ABI})"
         mv py py-${PYTHON_ABI}
      }
      python_execute_function installation

      docinto py
      dodoc py.orig/CHANGES py.orig/README

      if use examples ; then
         insinto /usr/share/doc/${PF}/examples-py
         doins -r py.orig/demo/*
      fi

      cd "${ED}/$(python_get_sitedir -f)"
      PYTHON_MODULES=(*.py)
      PYTHON_MODULES+=(IceBox IceGrid IcePatch2 IceStorm)
      cd "${S}"
   fi

   if use ruby ; then
      dodir "${SITERUBY}"
      emake -C rb ${MAKE_RULES} ${MAKE_RULES_RB} install || die "emake rb install failed"

      docinto rb
      dodoc rb/CHANGES rb/README

      if use examples ; then
         insinto /usr/share/doc/${PF}/examples-rb
         doins -r rb/demo/*
      fi
   fi

   if use mono ; then
      emake -C cs ${MAKE_RULES} ${MAKE_RULES_CS} install || die "emake cs install failed"

      # TODO: anyone has an idea what those are for?
      rm "${ED}"/usr/bin/*.xml

      docinto cs
      dodoc cs/CHANGES cs/README

      if use examples ; then
         insinto /usr/share/doc/${PF}/examples-cs
         doins -r cs/demo/*
      fi
   fi
}

src_test() {
   emake -C cpp ${MAKE_RULES} test || die "emake test failed"

   if use php ; then
      emake -C php ${MAKE_RULES} ${MAKE_RULES_PHP} test || die "emake php test failed"
   fi

   if use python ; then
      testing() {
         mv py-${PYTHON_ABI} py
         emake -C py ${MAKE_RULES} test || die "emake py test failed (for py-${PYTHON_ABI})"
         mv py py-${PYTHON_ABI}
      }
      python_execute_function testing
   fi

   if use ruby ; then
      emake -C rb ${MAKE_RULES} ${MAKE_RULES_RB} test || die "emake rb test failed"
   fi

   if use mono ; then
#      ewarn "Tests for C# are currently disabled."
      emake -C cs ${MAKE_RULES} ${MAKE_RULES_CS} test || die "emake cs test failed"
   fi
}

pkg_postinst() {
   use python && python_mod_optimize "${PYTHON_MODULES[@]}"
}

pkg_postrm() {
   use python && python_mod_cleanup "${PYTHON_MODULES[@]}"
}


Here is my make.conf :
Code:
controle Ice # cat /etc/make.conf
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j3"
USE="-x11 X -qt4 -gtk -alsa sockets gd apache2 php mysql java python perl bash-completion bzip2 cgi gzip jpeg ldap libcaca lzo lzma mime mmx mng sse sse2 kerberos samba xml mysqli zip latin1 sqlite relp"
PHP_TARGETS="php5-4"


#GENTOO_MIRRORS="ftp://mirror.ovh.net/gentoo-distfiles/ http://mirror.ovh.net/gentoo-distfiles/ http://mirror.leaseweb.com/gentoo/ ftp://mirror.leaseweb.com/gentoo/ ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo rsync://ftp.snt.utwente.nl/gentoo"

#SYNC="rsync://rsync2.fr.gentoo.org/gentoo-portage"
source /var/lib/layman/make.conf
controle Ice # cat /var/lib/layman/make.conf
PORTDIR_OVERLAY="
/var/lib/layman/zugaina
/var/lib/layman/heroxbd
/usr/self-portage
$PORTDIR_OVERLAY
"

Here is my emerge --info :
Code:

controle Ice # emerge --info
Portage 2.1.11.31 (default/linux/x86/10.0/desktop, gcc-4.6.3, glibc-2.15-r3, 3.7.0-gentoo i686)
=================================================================
System uname: Linux-3.7.0-gentoo-i686-Intel-R-_Xeon-R-_CPU_E5606_@_2.13GHz-with-gentoo-2.1
Timestamp of tree: Tue, 15 Jan 2013 08:30:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo zugaina heroxbd x-self-portage
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/zugaina /var/lib/layman/heroxbd /usr/self-portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi apache2 bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cgi cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gd gdbm gif gpm gzip iconv ipv6 java jpeg kerberos latin1 lcms ldap libcaca libnotify lzma lzo mad mime mmx mng modules mp3 mp4 mpeg mudflap mysql mysqli ncurses nls nptl ogg opengl openmp pam pango pcre pdf perl php png policykit ppds pppd python qt3support readline relp samba sdl session sockets spell sqlite sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 x86 xcb xml xv xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON



Thanks four your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum