Support EFL libraries via jhbuild 29/142829/1
authorYoungsoo Choi <kenshin.choi@samsung.com>
Wed, 2 Aug 2017 14:07:53 +0000 (14:07 +0000)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Mon, 7 Aug 2017 05:13:39 +0000 (05:13 +0000)
The ecore, elocation, and elementary are added to be linked in build.

Change-Id: Ie021c85e209108bbb51e89baba0fa1dd61a55511
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
efl/build/build_desktop.sh
efl/build/common.sh
efl/build/jhbuild/jhbuild.modules [new file with mode: 0755]
efl/build/jhbuild/jhbuildrc [new file with mode: 0644]
efl/build/system.gyp [new file with mode: 0644]
electron.gyp
vendor/brightray/brightray.gyp
vendor/brightray/vendor/libchromiumcontent/tools/generate_filenames_gypi.py

index 63f629f..1cb62a3 100755 (executable)
@@ -5,6 +5,8 @@ export SCRIPTDIR=$(readlink -e $(dirname $0))
 source ${SCRIPTDIR}/common.sh
 trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
 
+host_arch=$(getHostArch)
+
 # "|| :" means "or always succeeding built-in command"
 CHROMIUM_EFL_PATH=$(echo "$@" | grep -Po "(?<=\--libcc_chromium_efl_path\s)[^\s]*" || :)
 
@@ -15,6 +17,42 @@ if [ "$CHROMIUM_EFL_PATH" == "" ]; then
   exit 1
 fi
 
+# jhbuild
+
+JHBUILD_STAMPFILE="${TOPDIR}/out/Dependencies/Root/jhbuild.stamp"
+
+forceJHBuildIfNeeded() {
+  if [[ $FORCE_JHBUILD == 1 ]]; then
+    rm -f $JHBUILD_STAMPFILE
+    return
+  fi
+
+  # Check if anything in jhbuild is more recent than stamp file.
+  if [ $(find $SCRIPTDIR/jhbuild -type f -newer $JHBUILD_STAMPFILE -print | wc -l) != "0" ]; then
+    rm -f $JHBUILD_STAMPFILE
+  fi
+}
+
+forceJHBuildIfNeeded
+
+JHBUILD_DEPS="${TOPDIR}/out/Dependencies/Root"
+if [ "${host_arch}" == "x64" ]; then
+  _LIBDIR=lib64
+elif [ "${host_arch}" == "x86" ]; then
+  _LIBDIR=lib
+fi
+export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
+
+jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
+
+if [ ! -f "$JHBUILD_STAMPFILE" ]; then
+  if [[ $? == 0 ]]; then
+    echo "Yay! jhbuild done!" > $JHBUILD_STAMPFILE
+  fi
+fi
+
+# bootstrap
+
 ${TOPDIR}/script/bootstrap.py \
     --define "use_efl=1 libchromiumcontent_component=1" \
     --dev \
@@ -22,4 +60,6 @@ ${TOPDIR}/script/bootstrap.py \
     -v \
     $@
 
+# build
+
 ${TOPDIR}/script/build.py -c D
index a46b567..25583ce 100644 (file)
@@ -7,3 +7,16 @@ function error_report() {
   echo "Error: File:$1 Line:$2"
   exit 1
 }
+
+function getHostOs() {
+  echo $(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
+}
+
+function getHostArch() {
+  echo $(uname -m | sed -e \
+        's/i.86/x86/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/x86/;s/aarch64/arm64/')
+}
+
+function getPythonVersion() {
+  echo $(python --version  2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/')
+}
diff --git a/efl/build/jhbuild/jhbuild.modules b/efl/build/jhbuild/jhbuild.modules
new file mode 100755 (executable)
index 0000000..d87eb36
--- /dev/null
@@ -0,0 +1,222 @@
+<?xml version="1.0"?>
+<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
+<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
+<moduleset>
+
+  <metamodule id="electron-efl-dependencies">
+    <dependencies>
+      <dep package="gstreamer"/>
+      <dep package="efl"/>
+      <dep package="elementary"/>
+    </dependencies>
+  </metamodule>
+
+  <repository type="tarball" name="download.enlightenment.org"
+      href="http://download.enlightenment.org"/>
+  <repository type="tarball" name="ftp.gnome.org"
+      href="http://ftp.gnome.org"/>
+  <repository type="git" name="git.gnome.org"
+      href="http://git.gnome.org/"/>
+  <repository type="tarball" name="gstreamer"
+      href="http://gstreamer.freedesktop.org/src/"/>
+  <repository type="tarball" name="sourceware.org"
+      href="ftp://sourceware.org"/>
+  <repository type="tarball" name="freedesktop.org"
+      href="http://freedesktop.org"/>
+  <repository type="tarball" name="zlib.net"
+      href="http://zlib.net"/>
+
+  <autotools id="at-spi2-core"
+        autogenargs="--disable-introspection">
+  <branch module="pub/GNOME/sources/at-spi2-core/2.10/at-spi2-core-2.10.0.tar.xz" version="2.10.0"
+        repo="ftp.gnome.org"
+        hash="sha256:964155c7574220a00e11e1c0d91f2d3017ed603920eb1333ff9cbdb6a22744db">
+  </branch>
+    <dependencies>
+      <dep package="glib"/>
+    </dependencies>
+  </autotools>
+
+  <autotools id="at-spi2-atk">
+    <branch module="pub/GNOME/sources/at-spi2-atk/2.10/at-spi2-atk-2.10.0.tar.xz" version="2.10.0"
+          repo="ftp.gnome.org"
+          hash="sha256:dea7ff2f9bc9bbdb0351112616d738de718b55739cd2511afecac51604c31a94">
+    </branch>
+    <dependencies>
+      <dep package="glib"/>
+      <dep package="atk"/>
+      <dep package="at-spi2-core"/>
+    </dependencies>
+  </autotools>
+
+  <autotools id="atk"
+          autogen-sh="configure"
+          autogenargs="--disable-introspection">
+    <branch module="pub/GNOME/sources/atk/2.12/atk-2.12.0.tar.xz" version="2.12.0"
+          repo="ftp.gnome.org"
+          hash="sha256:48a8431974639c5a59c24fcd3ece1a19709872d5dfe78907524d9f5e9993f18f"/>
+    <dependencies>
+      <dep package="glib"/>
+    </dependencies>
+  </autotools>
+
+  <!-- The long and scary "enable-i-really" option is needed to build EFL with disable-pulseaudio and disable-physics options.
+       Apparently EFL configure script considers such configuration unsupported. Still we don't need audio or physics support
+       in EFL and building extra libraries just to satisfy dependencies we don't need is pointless. -->
+  <autotools id="efl" autogen-sh="configure"
+             autogenargs="--with-x11=xlib --with-opengl=es --with-glib=yes --disable-pulseaudio --disable-physics
+                          --enable-i-really-know-what-i-am-doing-and-that-this-will-probably-break-things-and-i-will-fix-them-myself-and-send-patches-aba">
+    <branch module="rel/libs/efl/efl-1.16.0.tar.xz" version="1.16.0"
+            repo="download.enlightenment.org"
+            hash="sha256:7efebbd9964e5daf35c7e978e7cbef25f62ea933a8df73b0c4d287ef65868323"
+            md5sum="0552eed3f337a1268aff4a476c6a5fa7">
+    </branch>
+    <dependencies>
+      <dep package="glib"/>
+    </dependencies>
+  </autotools>
+
+  <autotools id="elementary" autogen-sh="configure"
+             autogenargs="--enable-ecore-x">
+    <branch module="rel/libs/elementary/elementary-1.16.0.tar.xz" version="1.16.0"
+            repo="download.enlightenment.org"
+            hash="sha256:483f3cf927edceaec8b61b0e4c0fe5ffbe86f227c7f82e61e8d6f0dbee598694"
+            md5sum="317cc2f8f9f18f5473027ba9fa1b000d">
+    </branch>
+    <dependencies>
+      <dep package="efl"/>
+    </dependencies>
+  </autotools>
+
+  <autotools id="libffi" autogen-sh="configure">
+    <branch module="/pub/libffi/libffi-3.0.11.tar.gz" version="3.0.11"
+            repo="sourceware.org"
+            hash="sha256:70bfb01356360089aa97d3e71e3edf05d195599fd822e922e50d46a0055a6283"
+            md5sum="f69b9693227d976835b4857b1ba7d0e3"/>
+  </autotools>
+
+  <autotools id="glib"
+             autogen-sh="configure"
+             autogenargs="--disable-dtrace">
+    <dependencies>
+      <dep package="libffi"/>
+    </dependencies>
+    <branch module="/pub/GNOME/sources/glib/2.40/glib-2.40.2.tar.xz" version="2.40.2"
+            repo="ftp.gnome.org"
+            hash="sha256:e8ff8af2950897e805408480c454c415d1eade4e670ec5fb507f5e5853726c7a"/>
+  </autotools>
+
+  <autotools id="glib-networking">
+    <dependencies>
+      <dep package="glib"/>
+    </dependencies>
+    <branch module="/pub/GNOME/sources/glib-networking/2.33/glib-networking-2.33.2.tar.xz" version="2.33.2"
+            repo="ftp.gnome.org"
+            hash="e298cff3935eb752be290bbf734e457f1870bdb5370ee292606e6040a82074e7"
+            md5sum="5abb364f2a0babe2ec1e3a6d59f69043"/>
+  </autotools>
+
+  <autotools id="libsoup"
+             autogen-sh="configure"
+             autogenargs="--without-gnome --disable-introspection">
+    <dependencies>
+      <dep package="glib-networking"/>
+    </dependencies>
+    <branch module="/pub/gnome/sources/libsoup/2.42/libsoup-2.42.0.tar.xz" version="2.42.0"
+            repo="ftp.gnome.org"
+            hash="sha256:9e0e7eb5d3f7401ccf521fbc289fc1fa0923b7c7833729e2ed7696f7b848893e">
+    </branch>
+  </autotools>
+
+  <autotools id="orc" autogen-sh="configure">
+    <branch module="orc/orc-0.4.18.tar.gz" version="0.4.18"
+            repo="gstreamer"
+            hash="sha256:34d3c8a7259f42bed4dcfbc106c5e3d0cc8e17eeaa73128d1c5eaf92883a6a24">
+    </branch>
+  </autotools>
+
+  <autotools id="gstreamer"
+             autogen-sh="configure"
+             autogenargs="--disable-examples --disable-tests --disable-failing-tests">
+    <branch repo="gstreamer"
+            module="gstreamer/gstreamer-1.6.2.tar.xz" version="1.6.2"
+            hash="sha256:5896716bd8e089dba452932a2eff2bb6f6c9d58ff64a96635d157f1ffaf8feb2">
+    </branch>
+  </autotools>
+
+  <autotools id="gst-plugins-base"
+             autogen-sh="configure"
+             autogenargs="--disable-examples --enable-iso-codes --enable-theora --enable-vorbis">
+    <dependencies>
+      <dep package="gstreamer"/>
+    </dependencies>
+    <branch repo="gstreamer"
+            module="gst-plugins-base/gst-plugins-base-1.6.2.tar.xz" version="1.6.2"
+            hash="sha256:c75dd400e451526ed71e1c4955e33d470a2581f5e71ecf84920a41c0a5c75322"/>
+  </autotools>
+
+  <autotools id="gst-plugins-good"
+             autogen-sh="configure"
+             autogenargs="--disable-examples --enable-pulse">
+    <dependencies>
+      <dep package="gst-plugins-base"/>
+      <dep package="libsoup"/>
+    </dependencies>
+    <branch repo="gstreamer"
+            module="gst-plugins-good/gst-plugins-good-1.6.2.tar.xz" version="1.6.2"
+            hash="sha256:876e54dfce93274b98e024f353258d35fa4d49d1f9010069e676c530f6eb6a92">
+    </branch>
+  </autotools>
+
+  <autotools id="gst-plugins-ugly"
+             autogen-sh="configure"
+             autogenargs="--disable-examples">
+    <dependencies>
+      <dep package="gst-plugins-base"/>
+    </dependencies>
+    <branch repo="gstreamer"
+            module="gst-plugins-ugly/gst-plugins-ugly-1.6.2.tar.xz" version="1.6.2"
+            hash="sha256:e7f1b6321c8667fabc0dedce3998a3c6e90ce9ce9dea7186d33dc4359f9e9845"/>
+  </autotools>
+
+  <autotools id="gst-plugins-bad"
+             autogen-sh="configure"
+             autogenargs="--disable-examples --enable-faad">
+    <dependencies>
+      <dep package="gst-plugins-base"/>
+    </dependencies>
+    <branch repo="gstreamer"
+            module="gst-plugins-bad/gst-plugins-bad-1.6.2.tar.xz" version="1.6.2"
+            hash="sha256:650855e39ff56a8bb6cb0c192109c5926ce12f536d06e19ebf829de71ef396fe">
+    </branch>
+  </autotools>
+
+  <autotools id="gst-libav"
+             autogen-sh="configure"
+             autogenargs="--with-libav-extra-configure='--disable-yasm'">
+    <dependencies>
+      <dep package="gst-plugins-base"/>
+      <dep package="orc"/>
+    </dependencies>
+    <branch repo="gstreamer"
+            module="gst-libav/gst-libav-1.6.2.tar.xz" version="1.6.2"
+            hash="sha2546:2597acc00171006d49f0d300440a87df51b113d557466e532153abc740db3469">
+    </branch>
+  </autotools>
+
+  <autotools id="harfbuzz" autogen-sh="configure">
+    <branch module="software/harfbuzz/release/harfbuzz-1.3.1.tar.bz2" version="1.3.1"
+            repo="freedesktop.org"
+            hash="sha256:a242206dd119d5e6cc1b2253c116abbae03f9d930cb60b515fb0d248decf89a1"
+            md5sum="3ec86969a58f2d687bbbf27e5ebd4ee7">
+    </branch>
+  </autotools>
+
+  <autotools id="zlib" autogen-sh="configure" autogenargs="--64 #">
+    <branch module="fossils/zlib-1.2.8.tar.gz" version="1.2.8"
+            repo="zlib.net"
+            md5sum="44d667c142d7cda120332623eab69f40">
+    </branch>
+  </autotools>
+
+</moduleset>
diff --git a/efl/build/jhbuild/jhbuildrc b/efl/build/jhbuild/jhbuildrc
new file mode 100644 (file)
index 0000000..122866e
--- /dev/null
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+# Copyright (C) 2013 Samsung Electronics
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+import multiprocessing
+import sys
+import os
+
+__efl_build_directory = os.path.abspath(os.path.dirname(__file__))
+sys.path = [__efl_build_directory] + sys.path
+
+build_policy = 'updated'
+
+__moduleset_file_uri = 'file://' + os.path.join(__efl_build_directory, 'jhbuild.modules')
+moduleset = [ __moduleset_file_uri, ]
+
+#__extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",")
+modules = [ 'electron-efl-dependencies', ]
+
+#outdir = os.environ.get('GN_GENERATOR_OUTPUT', 'out')
+outdir = os.path.join(__efl_build_directory, '../../../out')
+
+checkoutroot = os.path.abspath(os.path.join(outdir,'Dependencies', 'Source'))
+prefix = os.path.abspath(os.path.join(outdir,'Dependencies', 'Root'))
+
+del outdir
+
+nonotify = True
+notrayicon = True
+
+if 'NUMBER_OF_PROCESSORS' in os.environ:
+    jobs = os.environ['NUMBER_OF_PROCESSORS']
+
+# Use system libraries while building.
+if use_lib64:
+    _libdir = 'lib64'
+else:
+    _libdir = 'lib'
+
+partial_build = False
+
diff --git a/efl/build/system.gyp b/efl/build/system.gyp
new file mode 100644 (file)
index 0000000..e1894c0
--- /dev/null
@@ -0,0 +1,92 @@
+# Copyright (c) 2015 Samsung Electronics. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+  'variables': {
+    'pkg-config': 'pkg-config',
+  },
+  'targets': [
+    {
+      'target_name': 'ecore-x',
+      'type': 'none',
+      'direct_dependent_settings': {
+        'cflags': [
+          '<!@(<(pkg-config) --cflags ecore-x)',
+        ],
+      },
+      'link_settings': {
+        'ldflags': [
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other ecore-x)',
+        ],
+        'libraries': [
+          '<!@(<(pkg-config) --libs-only-l ecore-x)',
+        ],
+      },
+    }, # ecore-x
+    {
+      'target_name': 'elocation',
+      'type': 'none',
+      'direct_dependent_settings': {
+        'cflags': [
+          '<!@(<(pkg-config) --cflags elocation)',
+        ],
+      },
+      'link_settings': {
+        'ldflags': [
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other elocation)',
+        ],
+        'libraries': [
+          '<!@(<(pkg-config) --libs-only-l elocation)',
+        ],
+      },
+    }, # elocation
+    {
+      'target_name': 'elementary',
+      'type': 'none',
+      'direct_dependent_settings': {
+        'cflags': [
+          '<!@(<(pkg-config) --cflags elementary)',
+        ],
+      },
+      'link_settings': {
+        'ldflags': [
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other elementary)',
+        ],
+        'libraries': [
+          '<!@(<(pkg-config) --libs-only-l elementary)',
+        ],
+      },
+      'conditions': [
+         ['clang==1', {
+            'direct_dependent_settings': {
+              'cflags': [
+                 # Fix: elm_prefs_common.h:27:9: warning: empty struct has size 0 in C, size 1 in C++
+                 '-Wno-extern-c-compat',
+              ],
+            },
+         }],
+      ],
+    }, # elementary
+    {
+      'target_name': 'icu',
+      'type': 'none',
+      'direct_dependent_settings': {
+        'cflags': [
+          '<!@(<(pkg-config) --cflags icu-uc)',
+          '<!@(<(pkg-config) --cflags icu-i18n)',
+        ],
+      },
+      'link_settings': {
+        'ldflags': [
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other icu-uc)',
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other icu-i18n)',
+        ],
+        'libraries': [
+          '<!@(<(pkg-config) --libs-only-l icu-uc)',
+          '<!@(<(pkg-config) --libs-only-l icu-i18n)',
+        ],
+      },
+    }, # icu
+  ],
+}
index d14a04e..2017805 100644 (file)
             'vendor/breakpad/breakpad.gyp:breakpad_client',
           ],
         }],  # OS=="linux"
-        ['use_efl!=1', {
+        ['use_efl==1', {
+          'dependencies': [
+            '<(DEPTH)/efl/build/system.gyp:ecore-x',
+            '<(DEPTH)/efl/build/system.gyp:elocation',
+            '<(DEPTH)/efl/build/system.gyp:elementary',
+          ],
           'link_settings': {
             'ldflags': [
               # Make binary search for libraries under current directory, so we
               '-rdynamic',
             ],
           },
-        }],  # use_efl!=1
+        }],  # use_efl==1
       ],
     },  # target <(product_name)_lib
     {
index e1a4bb2..eca85a1 100644 (file)
@@ -1,7 +1,7 @@
 {
   'variables': {
     # The libraries brightray will be compiled to.
-    'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss'
+    'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss icu-i18n icu-uc'
   },
   'includes': [
     'filenames.gypi',
index 9db8a7a..150999f 100755 (executable)
@@ -85,7 +85,7 @@ def main(target_file, code_dir, shared_dir, static_dir):
   (shared_libraries, shared_v8_libraries) = searh_files(
       shared_dir, SHARED_LIBRARY_SUFFIX, EXCLUDE_SHARED_LIBRARIES)
   (shared_root_libraries, shared_v8_libraries) = searh_files(
-      os.path.join(shared_dir, 'Dependencies/Root/lib64'), SHARED_LIBRARY_SUFFIX, EXCLUDE_SHARED_LIBRARIES)
+      '../../../../../out/Dependencies/Root/lib64', SHARED_LIBRARY_SUFFIX, EXCLUDE_SHARED_LIBRARIES)
   (static_libraries, static_v8_libraries) = searh_files(
       static_dir, STATIC_LIBRARY_SUFFIX, EXCLUDE_STATIC_LIBRARIES)
   content = GYPI_TEMPLATE % {