Use provided I915_HEADERS_DIR in osv style builds

Related-To: NEO-5838
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
This commit is contained in:
Pawel Cieslak
2022-09-14 22:10:09 +00:00
committed by Compute-Runtime-Automation
parent 4c05a54c2b
commit cf66060533
7 changed files with 56 additions and 9 deletions

View File

@@ -61,20 +61,26 @@ if [ "${BUILD_SRPM}" == "1" ]; then
cp $COPYRIGHT $BUILD_DIR/SOURCES/
cp $SPEC_SRC $BUILD_DIR/SPECS/
if [ -d "$I915_HEADERS_DIR" ]; then
tar -c -I 'xz -6 -T0' -f $BUILD_DIR/SOURCES/uapi.tar.xz -C $REPO_DIR --transform "s,${I915_HEADERS_DIR:1},uapi," $I915_HEADERS_DIR
perl -pi -e "s;^%global I915_HEADERS_DIR .*;%global I915_HEADERS_DIR %{_builddir}/uapi;" $SPEC
fi
PATCH_SPEC="${REPO_DIR}/scripts/packaging/${BRANCH_SUFFIX}/patch_spec.sh"
if [ -f "$PATCH_SPEC" ]; then
source "$PATCH_SPEC"
fi
if [ -z "${BRANCH_SUFFIX}" ]; then
sed -i '/^Epoch: /d' ${SPEC}
fi
# Update spec file with new version
perl -pi -e "s/^%global NEO_OCL_VERSION_MAJOR .*/%global NEO_OCL_VERSION_MAJOR ${NEO_OCL_VERSION_MAJOR}/" $BUILD_DIR/SPECS/opencl.spec
perl -pi -e "s/^%global NEO_OCL_VERSION_MINOR .*/%global NEO_OCL_VERSION_MINOR ${NEO_OCL_VERSION_MINOR}/" $BUILD_DIR/SPECS/opencl.spec
perl -pi -e "s/^%global NEO_OCL_VERSION_BUILD .*/%global NEO_OCL_VERSION_BUILD ${NEO_OCL_VERSION_BUILD}/" $BUILD_DIR/SPECS/opencl.spec
perl -pi -e "s/^%global NEO_RELEASE_WITH_REGKEYS .*/%global NEO_RELEASE_WITH_REGKEYS ${RELEASE_WITH_REGKEYS}/" $BUILD_DIR/SPECS/opencl.spec
perl -pi -e "s/^%global NEO_OCL_VERSION_MAJOR .*/%global NEO_OCL_VERSION_MAJOR ${NEO_OCL_VERSION_MAJOR}/" $SPEC
perl -pi -e "s/^%global NEO_OCL_VERSION_MINOR .*/%global NEO_OCL_VERSION_MINOR ${NEO_OCL_VERSION_MINOR}/" $SPEC
perl -pi -e "s/^%global NEO_OCL_VERSION_BUILD .*/%global NEO_OCL_VERSION_BUILD ${NEO_OCL_VERSION_BUILD}/" $SPEC
perl -pi -e "s/^%global NEO_RELEASE_WITH_REGKEYS .*/%global NEO_RELEASE_WITH_REGKEYS ${RELEASE_WITH_REGKEYS}/" $SPEC
perl -pi -e "s/^%global rel .*/%global rel ${RELEASE}/" $SPEC
perl -pi -e "s/^%global ver .*/%global ver ${VERSION}/" $SPEC

View File

@@ -5,6 +5,7 @@
%global NEO_OCL_VERSION_MINOR xxx
%global NEO_OCL_VERSION_BUILD xxx
%global NEO_RELEASE_WITH_REGKEYS FALSE
%global I915_HEADERS_DIR %{nil}
%define _source_payload w5T16.xzdio
%define _binary_payload w5T16.xzdio
@@ -20,6 +21,9 @@ License: MIT
URL: https://github.com/intel/compute-runtime
Source0: %{url}/archive/%{version}/compute-runtime.tar.xz
Source1: copyright
%if "%{I915_HEADERS_DIR}" != ""
Source2: uapi.tar.xz
%endif
Requires: intel-gmmlib
Requires: intel-igc-opencl
@@ -40,7 +44,11 @@ Intel(R) Graphics Compute Runtime for OpenCL(TM) is a open source project to con
%define debug_package %{nil}
%prep
%if "%{I915_HEADERS_DIR}" == ""
%autosetup -p1 -n compute-runtime
%else
%autosetup -p1 -n compute-runtime -b 2
%endif
%build
mkdir build
@@ -55,7 +63,8 @@ cd build
-DNEO_SKIP_UNIT_TESTS=TRUE \
-DNEO_ENABLE_i915_PRELIM_DETECTION=TRUE \
-DRELEASE_WITH_REGKEYS=%{NEO_RELEASE_WITH_REGKEYS} \
-DCMAKE_VERBOSE_MAKEFILE=FALSE
-DCMAKE_VERBOSE_MAKEFILE=FALSE \
-DI915_HEADERS_DIR=$(realpath %{I915_HEADERS_DIR})
%ninja_build
%install

View File

@@ -7,6 +7,7 @@
%global NEO_OCL_VERSION_MINOR xxx
%global NEO_OCL_VERSION_BUILD xxx
%global NEO_RELEASE_WITH_REGKEYS FALSE
%global I915_HEADERS_DIR %{nil}
%define gmmlib_sover 12
%define igc_sover 1
@@ -28,6 +29,9 @@ Group: System Environment/Libraries
Url: https://github.com/intel/compute-runtime
Source0: %{url}/archive/%{version}/compute-runtime.tar.xz
Source1: copyright
%if "%{I915_HEADERS_DIR}" != ""
Source2: uapi.tar.xz
%endif
ExclusiveArch: x86_64
BuildRequires: cmake gcc-c++ ninja make
@@ -50,7 +54,11 @@ Summary: ocloc package for opencl
%debug_package %{nil}
%prep
%if "%{I915_HEADERS_DIR}" == ""
%autosetup -p1 -n compute-runtime
%else
%autosetup -p1 -n compute-runtime -b 2
%endif
%build
%cmake .. \
@@ -63,7 +71,8 @@ Summary: ocloc package for opencl
-DNEO_SKIP_UNIT_TESTS=TRUE \
-DNEO_ENABLE_i915_PRELIM_DETECTION=TRUE \
-DRELEASE_WITH_REGKEYS=%{NEO_RELEASE_WITH_REGKEYS} \
-DCMAKE_VERBOSE_MAKEFILE=FALSE
-DCMAKE_VERBOSE_MAKEFILE=FALSE \
-DI915_HEADERS_DIR=$(realpath %{I915_HEADERS_DIR})
%ninja_build
%install