Stop autogenerating chromium-efl.pc
authorAntonio Gomes <a1.gomes@samsung.com>
Thu, 15 Jan 2015 16:44:58 +0000 (08:44 -0800)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
As part of an earlier build system refactor [1],
we stopped using a static .pc file so that we
could export all chromium-efl defines to chromium-ewk
build system, as part of chromium-efl's pkgconfig cflags.
At this point, chromium-efl used GYP and chromium-ewk CMake.

After the build system integration [2], the situation
was fixed (defines were shared between both modules),
but we continued to export all internal defines in
chromium-efl.pc.
As a result, third-party apps that actually need to
deal with chromium-efl.pc, were wrongly having unrelated
defines set.

Particularly, in chromium-rgl beta/m40 branch, where "override"
and "final" are defined to nil due to compiler (GCC 4.6) limitations,
some ecore headers (namely Ecore_X.h) got affected, as the token
"override" was being used in its defitions.

Patch fixes that by switching back to a static
chromium-efl.pc file, and remove related code
that used to auto generate the pc file.

It allows the t-browser (beta/m34 branch) to build
out of the box on top of chromium-efl (beta/m40).

[1] http://165.213.202.130:8080/#/c/68779/
[2] http://165.213.202.130:8080/#/c/70211/
Reviewed by: Antonio Gomes, Piotr Tworek, Viatcheslav Ostapenko

Change-Id: I171233ab5c9812e9dd4a08cbbfcada3332fcce75
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/build/pkgconfig/chromium-efl.pc.in [new file with mode: 0644]
tizen_src/impl/chromium-efl.gyp
tizen_src/impl/pkgconfig/gen_pkgconfigs.py [deleted file]
tizen_src/packaging/chromium-efl.spec

diff --git a/tizen_src/build/pkgconfig/chromium-efl.pc.in b/tizen_src/build/pkgconfig/chromium-efl.pc.in
new file mode 100644 (file)
index 0000000..15c969d
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: chromium-efl
+Description: Chromium EFL port
+Version: ?VERSION?
+
+Libs: -L${libdir} -Wl,-rpath-link=${libdir} -lchromium-efl -lchromium-ewk
+Cflags: -I${includedir}/chromium-ewk -I${includedir}/v8
index b22f423..4b0710b 100644 (file)
         ],
       }],
     ],
-    'actions': [{
-      'action_name': 'generate_pkgconfigs',
-      'variables': {
-        'generator_path': 'pkgconfig/gen_pkgconfigs.py',
-      },
-      'inputs': [
-        '<(generator_path)',
-      ],
-      'outputs': [
-        '<(PRODUCT_DIR)/pkgconfig/chromium-efl.pc',
-        '<(PRODUCT_DIR)/pkgconfig/desktop/chromium-efl.pc',
-      ],
-      'action': [
-        'python', '<(generator_path)',
-        '--out-dir', '<(PRODUCT_DIR)',
-        '--defines', '${defines}',
-        '--chrome-src', '<(chrome_src_dir)',
-      ],
-    }], # actions
   },
   {
     'target_name': 'efl_webprocess',
diff --git a/tizen_src/impl/pkgconfig/gen_pkgconfigs.py b/tizen_src/impl/pkgconfig/gen_pkgconfigs.py
deleted file mode 100755 (executable)
index f83f694..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-
-import sys, os, getopt
-import subprocess
-
-
-def get_command_output(args):
-    proc = subprocess.Popen(args, stdout=subprocess.PIPE)
-    (stdout, stderr) = proc.communicate()
-    return (stdout, proc.returncode)
-
-
-def get_chrome_version(chrome_src):
-    tool = os.path.join(chrome_src, 'build/util/version.py')
-    file = os.path.join(chrome_src, 'chrome/VERSION')
-
-    (stdout, retval) = get_command_output([tool, '-f', file, '-t', '@MAJOR@.@MINOR@.@BUILD@'])
-
-    if not retval:
-        return stdout.rstrip()
-    else:
-        print("Failed to determine chromium version: " + stdout)
-        return "0.0.0"
-
-
-def gen_pkgconfig_file(path, version, defines):
-    pc_dir = os.path.join(path, 'pkgconfig')
-    pc_path = os.path.join(pc_dir, 'chromium-efl.pc')
-
-    print(" * Generating GBS chromium-efl.pc")
-
-    if not os.path.exists(pc_dir):
-        os.makedirs(pc_dir)
-
-    out = open(pc_path, "w");
-
-    out.write("prefix=/usr\n")
-    out.write("exec_prefix=${prefix}\n")
-    out.write("libdir=${prefix}/lib\n")
-    out.write("includedir=${prefix}/include\n\n")
-
-    out.write("Name: chromium-efl\n")
-    out.write("Description: Chromium EFL port\n")
-    out.write("Version: " + version + "\n\n")
-    out.write("Libs: -L${libdir} -Wl,-rpath-link=${libdir} -lchromium-efl -lchromium-ewk\n")
-    out.write("Cflags: -I${includedir}/chromium-ewk -I/usr/include/v8 " + defines + "\n")
-
-    out.close()
-
-
-def main():
-    try:
-        opts, args = getopt.getopt(sys.argv[1:], "o:d:c:", ["out-dir=", "defines=", "chrome-src="])
-    except getopt.GetoptError as err:
-        print (str(err))
-        usage()
-        sys.exit(2)
-
-    outdir = None
-    defines = None
-    chrome_src = None
-    for o, a in opts:
-        if o in ("-o", "--out-dir"):
-            outdir = a
-        elif o in ("-d", "--defines"):
-            defines = a
-        elif o in ("-c", "--chrome-src"):
-            chrome_src = a
-        else:
-            assert False, "unhandled option"
-
-    if not (outdir and defines and chrome_src):
-        print("Invalid arguments specified!")
-        sys.exit(2)
-
-    gen_pkgconfig_file(outdir, get_chrome_version(chrome_src), defines)
-
-    sys.exit(0)
-
-
-if __name__ == "__main__":
-    main()
index fc50f62..0c39f57 100755 (executable)
@@ -241,6 +241,11 @@ ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" angle_unittests env_chromium_unittests
 cp src/third_party/icu/android/icudtl.dat "%{OUTPUT_FOLDER}"
 
 %install
+
+# Generate pkg-confg file
+mkdir -p "%{OUTPUT_FOLDER}"/pkgconfig/
+sed -e 's#?VERSION?#%{version}#' build/pkgconfig/chromium-efl.pc.in > "%{OUTPUT_FOLDER}"/pkgconfig/chromium-efl.pc
+
 install -d "%{buildroot}"%{_sysconfdir}/smack/accesses2.d
 install -d "%{buildroot}"%{_bindir}
 install -d "%{buildroot}"%{_bindir}