Make elementary compatible with Tizen 4.0 build env. 40/107640/1
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 29 Dec 2016 02:14:03 +0000 (11:14 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 29 Dec 2016 04:31:51 +0000 (13:31 +0900)
In Tizen 4.0 Unified Project, there will be no more
profile macro available.

However, in order to make it keep compatible with obsolete
build environment including the "GBM/private" build systems,
if profile macro is defined as tv/mobile/wearble, we will
disable the modification.

Note: this is a workaround until the correspondants refactor
this package so that Elemetnary uses "configuration" at
run/boot-time. Without this workaround, before getting such
a nice refactored code, this package will disrupt all the
other packages in Tizen 4.0 Unified build environment.
So, after refactoring, please remove what this patch does.
(or you may nudge me when it is done.)

Note2: There will be yet another workaround that removed
the need for "TIZEN_PROFILE_WEARABLE", which is the one
that abandoned some time ago. That workaround has the
same characteristic; it is to keep it compatible before
you've done with refactoring.

Change-Id: If27ffd0ed419882d533c46499d45d16cdd727a07
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/elementary.spec

index 3af6c9acbd4a7424e06612f6a9de1676c2281686..1a6154cb2324b7c10a49f9ef2ac88b6d90d94b6c 100644 (file)
@@ -1,3 +1,7 @@
+# Do not let auto-provides searches for the workaround extension.
+# This is to be removed after the supposed refactoring that unifies the whole source code.
+%global __provides_exclude_from ^(.*\\.mobile)$
+
 %define dbus_unavailable 1
 
 %bcond_with wayland
@@ -53,6 +57,14 @@ BuildRequires:  pkgconfig(icu-i18n)
 
 Recommends:     %{name}-locale = %{version}
 
+Provides:       %{name}-profile_common = %{version}-%{release}
+Provides:       %{name}-profile_tv = %{version}-%{release}
+Provides:       %{name}-profile_ivi = %{version}-%{release}
+%if "%{?profile}" == "mobile" || "%{?profile}" == "wearable"
+Provides:       %{name}-profile_mobile = %{version}-%{release}
+Provides:       %{name}-profile_wearable = %{version}-%{release}
+%endif
+
 %description
 Elementary is a widget set. It is a new-style of widget set much more canvas
 object based than anything else. Why not ETK? Why not EWL? Well they both
@@ -64,6 +76,32 @@ fine-grained library splitting means all of this is shared, just a new
 widget "personality" is on top. And that is... Elementary, my dear watson.
 Elementary.
 
+# This subpackage is a workaround to support Tizen mobile/wearable functionalities in
+# Tizen 4.0 Unified environment where all the profiles coexist in one repository.
+# With the supposed refactoring efforts, this must be removed afterwards.
+# This is simply for the backward compatibility during the refactoring efforts.
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+# If it is common/ivi/"unified"
+%package extension-mobile
+Summary:       EFL elementary extension for mobile/wearable profile workaround
+Requires:      %{name} = %{version}-%{release}
+Provides:       %{name}-profile_mobile = %{version}-%{release}
+Provides:       %{name}-profile_wearable = %{version}-%{release}
+%description extension-mobile
+This is a workaround for Tizen mobile/wearable that uses different set of library
+source code. This extension will overwrite the library .so files of default
+%{name} package to fit Tizen mobile/wearable.
+Note that after the supposed refactoring that is going to unify the source code
+across all Tizen profiles, this extension is no longer required once the
+src/mobile_lib directory becomes empty.
+Because this package overwrites .so files of %{name}, uninstalling this while
+keeping %{name} does not have effects of the uninstall. You will need to
+reinstall %{name} after uninstalling this in order to use the default %{name}
+after installing this.
+
+%endif
+
+
 %package examples
 Summary:   EFL elementary examples
 
@@ -96,28 +134,70 @@ cp %{SOURCE1001} .
 
 %build
 
-# Patch profile dependency widgets
-%if "%{profile}" == "mobile"
-    cp %{_builddir}/%{buildsubdir}/src/mobile_lib/* %{_builddir}/%{buildsubdir}/src/lib
-%else
-    %if "%{profile}" == "wearable"
-        cp %{_builddir}/%{buildsubdir}/src/mobile_lib/* %{_builddir}/%{buildsubdir}/src/lib
-        export CFLAGS+=" -DTIZEN_PROFILE_WEARABLE"
+# This subpackage is a workaround to support Tizen mobile/wearable functionalities in
+# Tizen 4.0 Unified environment where all the profiles coexist in one repository.
+# With the supposed refactoring efforts, this must be removed afterwards.
+# This is simply for the backward compatibility during the refactoring efforts.
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+    cp %{_builddir}/%{buildsubdir}/src/lib/elc_ctxpopup.c %{_builddir}/%{buildsubdir}/src/lib/elc_ctxpopup.c.orig
+    cp %{_builddir}/%{buildsubdir}/src/lib/elm_genlist.c %{_builddir}/%{buildsubdir}/src/lib/elm_genlist.c.orig
+    cp %{_builddir}/%{buildsubdir}/src/mobile_lib/elc_ctxpopup.c %{_builddir}/%{buildsubdir}/src/lib
+    cp %{_builddir}/%{buildsubdir}/src/mobile_lib/elm_genlist.c %{_builddir}/%{buildsubdir}/src/lib
+
+# Create .mobile file required for the workaround extension
+    %autogen --disable-static \
+    %if %{with wayland}
+             --enable-ecore-wayland \
+    %endif
+    %if !%{with x}
+             --disable-ecore-x \
     %endif
+             --with-elementary-base-dir="share/.elementary" \
+    %if %dbus_unavailable
+             --disable-build-examples
+    %else
+             --enable-build-examples
+    %endif
+
+    %__make %{?_smp_mflags}
+    mkdir -p mobile_libs
+
+    /bin/sh ./libtool --mode=install /usr/bin/install -c src/lib/libelementary.la %{_builddir}/%{buildsubdir}/mobile_libs/
+    mv mobile_libs/libelementary.so.%{version} mobile_libs/libelementary.so.%{version}.mobile
+
+# Let's hope make do not build unaffected files.
+    cp %{_builddir}/%{buildsubdir}/src/lib/elc_ctxpopup.c.orig %{_builddir}/%{buildsubdir}/src/lib/elc_ctxpopup.c
+    cp %{_builddir}/%{buildsubdir}/src/lib/elm_genlist.c.orig %{_builddir}/%{buildsubdir}/src/lib/elm_genlist.c
+# If it is common/ivi/"unified"
 %endif
 
-%autogen --disable-static \
-%if %{with wayland}
-         --enable-ecore-wayland \
+
+
+# Patch profile dependency widgets
+%if "%{?profile}" == "mobile" || "%{?profile}" == "wearable"
+# Modifing devel packages is prohibited. Copy .c files only. (You have only two .c files at the moment)
+    cp %{_builddir}/%{buildsubdir}/src/mobile_lib/elc_ctxpopup.c %{_builddir}/%{buildsubdir}/src/lib
+    cp %{_builddir}/%{buildsubdir}/src/mobile_lib/elm_genlist.c %{_builddir}/%{buildsubdir}/src/lib
 %endif
-%if !%{with x}
-         --disable-ecore-x \
+%if "%{?profile}" == "wearable"
+    export CFLAGS+=" -DTIZEN_PROFILE_WEARABLE"
 %endif
-         --with-elementary-base-dir="share/.elementary" \
-%if %dbus_unavailable
-         --disable-build-examples
-%else
-         --enable-build-examples
+
+# With the workaround enabled, we've already done "autogen"
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+    %autogen --disable-static \
+    %if %{with wayland}
+             --enable-ecore-wayland \
+    %endif
+    %if !%{with x}
+             --disable-ecore-x \
+    %endif
+             --with-elementary-base-dir="share/.elementary" \
+    %if %dbus_unavailable
+             --disable-build-examples
+    %else
+             --enable-build-examples
+    %endif
 %endif
 
 %__make %{?_smp_mflags}
@@ -125,6 +205,11 @@ cp %{SOURCE1001} .
 %install
 %make_install
 
+# With the workaround extension
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+    install -m 0755 mobile_libs/libelementary.so.%{version}.mobile %{buildroot}%{_libdir}
+%endif
+
 mkdir -p %{buildroot}%{_tmpfilesdir}
 install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/elementary.conf
 
@@ -151,6 +236,22 @@ install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/elementary.conf
 
 %exclude %{_datadir}/elementary/config/
 
+# This subpackage is a workaround to support Tizen mobile/wearable functionalities in
+# Tizen 4.0 Unified environment where all the profiles coexist in one repository.
+# With the supposed refactoring efforts, this must be removed afterwards.
+# This is simply for the backward compatibility during the refactoring efforts.
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "wearable"
+# If it is common/ivi/"unified"
+%post extension-mobile
+mv %{_libdir}/libelementary.so.%{version}.mobile %{_libdir}/libelementary.so.%{version}
+/sbin/ldconfig
+%postun extension-mobile -p /sbin/ldconfig
+%files extension-mobile
+%manifest %{name}.manifest
+# The two files (elc_ctxpopup.c and elm_genlist.c in mobile_lib) affects libelementary
+%{_libdir}/libelementary.so.%{version}.mobile
+%endif
+
 %if ! %dbus_unavailable
 %files examples
 %manifest %{name}.manifest