From 7e5e9a012ae25dbcbd13291dafee494309f70f35 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 29 Nov 2014 21:56:31 +0100 Subject: [PATCH] - new - shared patch to use shared boost libraries instead of static - no-svn patch not to use svn to determine build (.svn dir is not included in release anyway) - opencl patch to define OpenCL library name on Linux --- clcc-no-svn.patch | 16 ++++++++++++ clcc-opencl.patch | 13 ++++++++++ clcc-shared.patch | 10 ++++++++ clcc.spec | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 clcc-no-svn.patch create mode 100644 clcc-opencl.patch create mode 100644 clcc-shared.patch create mode 100644 clcc.spec diff --git a/clcc-no-svn.patch b/clcc-no-svn.patch new file mode 100644 index 0000000..0e839f7 --- /dev/null +++ b/clcc-no-svn.patch @@ -0,0 +1,16 @@ +--- clcc-0.3.0/CMakeLists.txt.orig 2012-01-15 17:52:10.000000000 +0100 ++++ clcc-0.3.0/CMakeLists.txt 2014-11-29 21:15:55.441208753 +0100 +@@ -19,13 +19,6 @@ + set(CLCC_VERSION_PATCH 0) + set(CLCC_VERSION_BUILD 0) # Undetermined, set by subversion (if present) + +-find_package(Subversion) +- +-if (Subversion_FOUND) +- Subversion_WC_INFO(${PROJECT_SOURCE_DIR} clcc) +- set(CLCC_VERSION_BUILD ${clcc_WC_REVISION}) +-endif() +- + if (WIN32) + set(CLCC_PLATFORM win32) + endif() diff --git a/clcc-opencl.patch b/clcc-opencl.patch new file mode 100644 index 0000000..4b1bf6f --- /dev/null +++ b/clcc-opencl.patch @@ -0,0 +1,13 @@ +--- clcc-0.3.0/src/options.cpp.orig 2011-12-13 14:48:00.000000000 +0100 ++++ clcc-0.3.0/src/options.cpp 2014-11-29 21:25:19.837851731 +0100 +@@ -33,8 +33,8 @@ + #define CLCC_OPENCL_DYNLIB_NAME "/Library/Frameworks/OpenCL.framework/OpenCL" + #endif + +-#ifdef __LINUX__ +-#define CLCC_OPENCL_DYNLIB_NAME "libOpenCL.so"; ++#if defined(__LINUX__) || defined(__linux__) ++#define CLCC_OPENCL_DYNLIB_NAME "libOpenCL.so.1"; + #endif + + static const char* opencl_lib_default = CLCC_OPENCL_DYNLIB_NAME; //!< The default dynamic library name to open, its value is platform-specific diff --git a/clcc-shared.patch b/clcc-shared.patch new file mode 100644 index 0000000..f839fe4 --- /dev/null +++ b/clcc-shared.patch @@ -0,0 +1,10 @@ +--- clcc-0.3.0/src/CMakeLists.txt.orig 2012-01-15 17:52:10.000000000 +0100 ++++ clcc-0.3.0/src/CMakeLists.txt 2014-11-29 20:44:33.061287745 +0100 +@@ -10,7 +10,6 @@ + # (See accompanying file license.txt) + ########################################################################## + +-set(Boost_USE_STATIC_LIBS ON) + find_package(Boost REQUIRED program_options) + + if (MSVC) diff --git a/clcc.spec b/clcc.spec new file mode 100644 index 0000000..d0c340f --- /dev/null +++ b/clcc.spec @@ -0,0 +1,63 @@ +Summary: CLCC - The OpenCL kernel compiler +Summary(pl.UTF-8): CLCC - kompilator jąder OpenCL +Name: clcc +Version: 0.3.0 +Release: 1 +License: Boost v1.0 +Group: Development/Tools +Source0: http://downloads.sourceforge.net/clcc/%{name}-%{version}-25-src.zip +# Source0-md5: 7ec003cc775d1cd06e789fb054c1d695 +Patch0: %{name}-shared.patch +Patch1: %{name}-no-svn.patch +Patch2: %{name}-opencl.patch +URL: http://clcc.sourceforge.net/ +BuildRequires: boost-devel +BuildRequires: cmake >= 2.8 +BuildRequires: doxygen +BuildRequires: libstdc++-devel +Requires: OpenCL +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +CLCC is a compiler for OpenCL kernel source files. It is intended to +be a tool for application developers who need to incorporate OpenCL +source code into their programs and who want to verify their OpenCL +code actually gets compiled by the driver before their program tries +to compile it on-demand. + +%description -l pl.UTF-8 +CLCC to kompilator plików źródłowych jąder OpenCL. Jest pomyślany jako +narzędzie dla programistów potrzebujących wykorzystywać we własnych +programach kody źródłowe OpenCL i chcących zweryfikować je przed +skompilowaniem przez sterownik na żądanie w przypadku użycia przez +program. + +%prep +%setup -q -c +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +install -d build +cd build +%cmake .. \ + -DBOOST_LIBRARIES=%{_libdir} +%{__make} all clcc_doc + +%install +rm -rf $RPM_BUILD_ROOT + +%{__make} -C build install \ + DESTDIR=$RPM_BUILD_ROOT + +# not really useful for non-clcc developers +%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc license.txt +%attr(755,root,root) %{_bindir}/clcc -- 2.43.0