[build] Added cleanup after android/ubuntu build
authorParichay Kapoor <pk.kapoor@samsung.com>
Thu, 19 Sep 2019 03:18:51 +0000 (12:18 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 19 Sep 2019 06:02:47 +0000 (15:02 +0900)
Added cleanup of patches after android/ubuntu build
Changed relative path of files to patches in patch file

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
api/android/build-android-lib.sh
api/capi/meson.build
debian/rules
meson.build
packaging/non_tizen_build.patch

index 1d5be8f..25a68f2 100644 (file)
@@ -51,6 +51,7 @@ function check_package() {
 # Check required packages
 check_package svn
 check_package sed
+check_package patch
 
 # Android SDK (Set your own path)
 [ -z "$ANDROID_HOME" ] && echo "Need to set ANDROID_HOME." && exit 1
@@ -71,11 +72,10 @@ echo "NNStreamer root directory: $NNSTREAMER_ROOT"
 echo "Start to build NNStreamer library for Android."
 
 # Modify header for Android
-cd $NNSTREAMER_ROOT/api/capi
+cd $NNSTREAMER_ROOT
 if ! patch -R --dry-run -sfp1 -i $NNSTREAMER_ROOT/packaging/non_tizen_build.patch; then
   patch -sfp1 -i $NNSTREAMER_ROOT/packaging/non_tizen_build.patch
 fi
-cd $NNSTREAMER_ROOT
 
 # Make directory to build NNStreamer library
 mkdir -p build_android_lib
@@ -138,3 +138,6 @@ popd
 
 # Remove build directory
 rm -rf build_android_lib
+
+# Clean the applied patches
+patch -R -sfp1 -i $NNSTREAMER_ROOT/packaging/non_tizen_build.patch
index 31b688d..09b24c0 100644 (file)
@@ -47,15 +47,6 @@ if (get_option('enable-tizen'))
     dependency('capi-system-info'),
     dependency('dlog')
   ]
-else
-  r = run_command('patch', '-R', '--dry-run', '-sfp1', '-i', patch_file)
-  if (r.returncode() != 0)
-    r = run_command('patch', '-p1', '-i', patch_file)
-    if (r.returncode() != 0)
-      message('Non-Tizen mode support failed')
-    endif
-  endif
-  message('CAPI is in non-Tizen mode')
 endif
 
 capi_deps = [
index 4c447ef..a296c6d 100755 (executable)
@@ -58,4 +58,5 @@ override_dh_auto_install:
 
 override_dh_install:
        dh_install --sourcedir=debian/tmp --list-missing
+       patch -R -p1 -i ./packaging/non_tizen_build.patch
 # Add --fail-missing option after adding *.install files for all subpackages.
index 14b4606..98ba382 100644 (file)
@@ -230,6 +230,16 @@ endif
 
 # Patch for non-tizen build
 patch_file = join_paths(meson.current_source_dir(), 'packaging', 'non_tizen_build.patch')
+if (not get_option('enable-tizen')) and get_option('enable-capi')
+  r = run_command('patch', '-R', '--dry-run', '-sfp1', '-i', patch_file)
+  if (r.returncode() != 0)
+    r = run_command('patch', '-p1', '-i', patch_file)
+    if (r.returncode() != 0)
+      message('Non-Tizen mode support failed')
+    endif
+  endif
+  message('CAPI is in non-Tizen mode')
+endif
 
 # Build nnstreamer (common, plugins)
 subdir('gst')
index fe39d38..3138220 100644 (file)
@@ -1,7 +1,7 @@
-diff --git a/include/nnstreamer.h b/include/nnstreamer.h
+diff --git a/api/capi/include/nnstreamer.h b/api/capi/include/nnstreamer.h
 index a18a066..ab1808c 100644
---- a/include/nnstreamer.h
-+++ b/include/nnstreamer.h
+--- a/api/capi/include/nnstreamer.h
++++ b/api/capi/include/nnstreamer.h
 @@ -28,7 +28,15 @@
  #include <stdbool.h>