INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/bsdiff)
+if (${ENABLE_LIBDIVSUFSORT})
+ ADD_DEFINITIONS("-DENABLE_LIBDIVSUFSORT=1")
+ SET(PKG_MODULES
+ libdivsufsort
+ libbrotlienc
+ )
+else()
+ ADD_DEFINITIONS("-DENABLE_LIBDIVSUFSORT=0")
+ SET(PKG_MODULES
+ libbrotlienc
+ )
+endif()
+
INCLUDE(FindPkgConfig)
-pkg_check_modules(${PROJECT_NAME}_pkgs REQUIRED libdivsufsort libbrotlienc)
+pkg_check_modules(${PROJECT_NAME}_pkgs REQUIRED ${PKG_MODULES})
FOREACH(flag ${${PROJECT_NAME}_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
snprintf(ts1, 256, "%06d.%03d", sec % 100000, msec);
}
#endif
+
#ifdef SUFSORT_MOD
+
+/**
+ * FIXME:
+ * Since the TV profile does not support libdivsufsort package, it is required
+ * to not use libdivsufsort if build profile is TV.
+ * Thus, dummy codes for libdivsufsort is added to use when the profile is TV.
+ * ENABLE_LIBDIVSUFSORT is 0 if it is TV profile,
+ * else ENABLE_LIBDIVSUFSORT is 1.
+ */
+#if ENABLE_LIBDIVSUFSORT == 1
+
//supporting only 32 bit divsufsort for now.
#include <divsufsort.h>
+
+#elif ENABLE_LIBDIVSUFSORT == 0
+
+#include <stdint.h>
+
+typedef int32_t saidx_t;
+typedef int32_t saint_t;
+typedef uint8_t sauchar_t;
+
+saint_t divsufsort(const sauchar_t *T, saidx_t *SA, saidx_t n)
+{
+ return 0;
+}
+
+saidx_t sa_search(const sauchar_t *T, saidx_t Tsize,
+ const sauchar_t *P, saidx_t Psize,
+ const saidx_t *SA, saidx_t SAsize,
+ saidx_t *left)
+{
+ return 0;
+}
+
+#endif
+
#endif
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
BuildRequires: cmake
BuildRequires: pkgconfig(libbrotlienc)
+%if "%{tizen_profile_name}" != "tv"
BuildRequires: pkgconfig(libdivsufsort)
+%endif
%description
Tools for upgrade
%prep
%setup -q
-%cmake . -DINSTALL_PATH=%{bin_install_path}
+%cmake . \
+ -DINSTALL_PATH=%{bin_install_path} \
+%if "%{tizen_profile_name}" == "tv"
+ -DENABLE_LIBDIVSUFSORT=0
+%else
+ -DENABLE_LIBDIVSUFSORT=1
+%endif
%build
make %{?jobs:-j%jobs}