diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d815cc0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +SOURCES/Vulkan-Headers-sdk-1.1.97.0.tar.gz +SOURCES/Vulkan-Loader-sdk-1.1.97.0.tar.gz +SOURCES/Vulkan-Tools-sdk-1.1.97.0.tar.gz +SOURCES/Vulkan-ValidationLayers-sdk-1.1.97.0.tar.gz +SOURCES/cmake-3.4.3.tar.gz +SOURCES/glslang-05d12a9461dd0a76053bdd42f062a37a10d56afb.tar.gz +SOURCES/spirv-headers-8bea0a266ac9b718aa0818d9e3a47c0b77c2cb23.tar.gz +SOURCES/spirv-tools-2019.1.tar.gz diff --git a/.vulkan.metadata b/.vulkan.metadata new file mode 100644 index 0000000..9ae50b2 --- /dev/null +++ b/.vulkan.metadata @@ -0,0 +1,8 @@ +6690c4d0beb5a5755bab4ee3da33f33ebe158b42 SOURCES/Vulkan-Headers-sdk-1.1.97.0.tar.gz +2b464a75043656a42fccfab29bb35cfc25186b73 SOURCES/Vulkan-Loader-sdk-1.1.97.0.tar.gz +a3d915b98295c3daa8a7b30a94d33ab1eb7a7dc3 SOURCES/Vulkan-Tools-sdk-1.1.97.0.tar.gz +268ea8cda8663f82c596cb957d5821e5566362b5 SOURCES/Vulkan-ValidationLayers-sdk-1.1.97.0.tar.gz +49e4f05d46d4752e514b19ba36bf97d20a7da66a SOURCES/cmake-3.4.3.tar.gz +99fda2cddfb80d15355d8d7a97f6351234bf4132 SOURCES/glslang-05d12a9461dd0a76053bdd42f062a37a10d56afb.tar.gz +b7e356dbe0e362af10f7af41fc4e60a00205cec2 SOURCES/spirv-headers-8bea0a266ac9b718aa0818d9e3a47c0b77c2cb23.tar.gz +d910f817eba72458bbf0701789414d159a859d91 SOURCES/spirv-tools-2019.1.tar.gz diff --git a/SOURCES/fix_shared.patch b/SOURCES/fix_shared.patch new file mode 100644 index 0000000..8082da8 --- /dev/null +++ b/SOURCES/fix_shared.patch @@ -0,0 +1,12 @@ +diff -up Vulkan-ValidationLayers-sdk-1.1.92.0/CMakeLists.txt.dma Vulkan-ValidationLayers-sdk-1.1.92.0/CMakeLists.txt +--- Vulkan-ValidationLayers-sdk-1.1.92.0/CMakeLists.txt.dma 2019-02-13 09:20:44.590959278 +1000 ++++ Vulkan-ValidationLayers-sdk-1.1.92.0/CMakeLists.txt 2019-02-13 09:21:29.178151673 +1000 +@@ -294,7 +294,7 @@ set_target_properties(generate_helper_fi + # files directly in layers. + + add_library(VkLayer_utils +- STATIC ++ SHARED + layers/vk_layer_config.cpp + layers/vk_layer_extension_utils.cpp + layers/vk_layer_utils.cpp diff --git a/SOURCES/layers-no-rpath.patch b/SOURCES/layers-no-rpath.patch new file mode 100644 index 0000000..4b923ff --- /dev/null +++ b/SOURCES/layers-no-rpath.patch @@ -0,0 +1,13 @@ +diff -up Vulkan-ValidationLayers-sdk-1.1.97.0/tests/layers/CMakeLists.txt.dma Vulkan-ValidationLayers-sdk-1.1.97.0/tests/layers/CMakeLists.txt +--- Vulkan-ValidationLayers-sdk-1.1.97.0/tests/layers/CMakeLists.txt.dma 2019-02-26 09:09:22.661039052 +1000 ++++ Vulkan-ValidationLayers-sdk-1.1.97.0/tests/layers/CMakeLists.txt 2019-02-26 09:09:25.906125123 +1000 +@@ -17,9 +17,6 @@ + + set(TEST_LAYER_NAME VkLayer_device_profile_api) + +-set(VK_LAYER_RPATH /usr/lib/x86_64-linux-gnu/vulkan/layer:/usr/lib/i386-linux-gnu/vulkan/layer) +-set(CMAKE_INSTALL_RPATH ${VK_LAYER_RPATH}) +- + if(WIN32) + if(NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) + file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/windows/${TEST_LAYER_NAME}.json src_json) diff --git a/SOURCES/spirv-tools-fix.patch b/SOURCES/spirv-tools-fix.patch new file mode 100644 index 0000000..e408759 --- /dev/null +++ b/SOURCES/spirv-tools-fix.patch @@ -0,0 +1,20 @@ +diff -up SPIRV-Tools-2019.1/tools/io.h.dm SPIRV-Tools-2019.1/tools/io.h +--- SPIRV-Tools-2019.1/tools/io.h.dm 2019-02-18 14:14:46.362572748 +1000 ++++ SPIRV-Tools-2019.1/tools/io.h 2019-02-18 14:15:12.446271338 +1000 +@@ -34,13 +34,14 @@ bool ReadFile(const char* filename, cons + while (size_t len = fread(buf, sizeof(T), buf_size, fp)) { + data->insert(data->end(), buf, buf + len); + } +- if (ftell(fp) == -1L) { ++ long _pos = ftell(fp); ++ if (_pos == -1L) { + if (ferror(fp)) { + fprintf(stderr, "error: error reading file '%s'\n", filename); + return false; + } + } else { +- if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) { ++ if (sizeof(T) != 1 && (_pos % sizeof(T))) { + fprintf( + stderr, + "error: file size should be a multiple of %zd; file '%s' corrupt\n", diff --git a/SOURCES/spirv_tools_commit_id.h b/SOURCES/spirv_tools_commit_id.h new file mode 100644 index 0000000..c4269ad --- /dev/null +++ b/SOURCES/spirv_tools_commit_id.h @@ -0,0 +1,29 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See external_revision_generator.py for modifications + +/*************************************************************************** + * + * Copyright (c) 2015-2017 The Khronos Group Inc. + * Copyright (c) 2015-2017 Valve Corporation + * Copyright (c) 2015-2017 LunarG, Inc. + * Copyright (c) 2015-2017 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Author: Chris Forbes + * Author: Cort Stratton + * + ****************************************************************************/ +#pragma once + +#define SPIRV_TOOLS_COMMIT_ID "26a698c34788bb69123a1f3789970a16cf4d9641" diff --git a/SPECS/vulkan.spec b/SPECS/vulkan.spec new file mode 100644 index 0000000..f7cb471 --- /dev/null +++ b/SPECS/vulkan.spec @@ -0,0 +1,342 @@ + +%global srcname Vulkan-Loader + +%global commit1 05d12a9461dd0a76053bdd42f062a37a10d56afb +%global srcname1 glslang + +%global commit2 8bea0a266ac9b718aa0818d9e3a47c0b77c2cb23 +%global srcname2 spirv-headers + +%global ver3 2019.1 +%global srcname3 spirv-tools + +%global srcname4 Vulkan-Headers +%global srcname5 Vulkan-ValidationLayers +%global srcname6 Vulkan-Tools + +Name: vulkan +Version: 1.1.97.0 +Release: 1%{?dist} +Summary: Vulkan loader and validation layers + +License: ASL 2.0 +URL: https://github.com/KhronosGroup + +Source0: %url/%{srcname}/archive/sdk-%{version}.tar.gz#/%{srcname}-sdk-%{version}.tar.gz +Source1: %url/%{srcname1}/archive/%{commit1}.tar.gz#/%{srcname1}-%{commit1}.tar.gz +Source2: %url/%{srcname2}/archive/%{commit2}.tar.gz#/%{srcname2}-%{commit2}.tar.gz +Source3: %url/%{srcname3}/archive/%{ver3}.tar.gz#/%{srcname3}-%{ver3}.tar.gz +Source4: %url/%{srcname4}/archive/sdk-%{version}.tar.gz#/%{srcname4}-sdk-%{version}.tar.gz +Source5: %url/%{srcname5}/archive/sdk-%{version}.tar.gz#/%{srcname5}-sdk-%{version}.tar.gz +Source6: %url/%{srcname6}/archive/sdk-%{version}.tar.gz#/%{srcname6}-sdk-%{version}.tar.gz +Source7: spirv_tools_commit_id.h +Source8: cmake-3.4.3.tar.gz + +Patch0: fix_shared.patch +Patch1: spirv-tools-fix.patch +Patch2: layers-no-rpath.patch + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: bison +BuildRequires: cmake +BuildRequires: /usr/bin/chrpath +BuildRequires: pkgconfig(libsystemd) +BuildRequires: pkgconfig(pciaccess) +%if 0%{?fedora} +BuildRequires: python3 +%else +BuildRequires: rh-python36-python +%endif +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-cursor) +BuildRequires: pkgconfig(wayland-server) +BuildRequires: pkgconfig(wayland-egl) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xcb) +BuildRequires: pkgconfig(xrandr) + +Requires: vulkan-filesystem = %{version}-%{release} + +%if 0%{?fedora} +Recommends: mesa-vulkan-drivers +%endif + +%description +Vulkan is a new generation graphics and compute API that provides +high-efficiency, cross-platform access to modern GPUs used in a wide variety of +devices from PCs and consoles to mobile phones and embedded platforms. + +This package contains the reference ICD loader and validation layers for +Vulkan. + +%package devel +Summary: Vulkan development package +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development headers for Vulkan applications. + +%package filesystem +Summary: Vulkan filesystem package +BuildArch: noarch + +%description filesystem +Filesystem for Vulkan. + +%prep +%setup -T -D -b 0 -n %{srcname}-sdk-%{version} +%setup -T -D -b 8 -n cmake-3.4.3 +%setup -T -D -b 2 -n SPIRV-Headers-%{commit2} +%setup -T -D -b 3 -n SPIRV-Tools-%{ver3} +%patch1 -p1 +%setup -T -D -b 1 -n glslang-%{commit1} +%setup -T -D -b 4 -n %{srcname4}-sdk-%{version} +%setup -T -D -b 5 -n %{srcname5}-sdk-%{version} +%patch0 -p1 +%patch2 -p1 +%setup -T -D -b 6 -n %{srcname6}-sdk-%{version} +cd - + +%build + +# enable python 3.6 +set +e +source scl_source enable rh-python36 +set -e + +cd ../cmake-3.4.3 +BUILD_DIR=`pwd`/cmake_build +cmake . -DCMAKE_INSTALL_PREFIX=$BUILD_DIR +make +make install +cd - + +export PATH=$BUILD_DIR/bin:$PATH +%global __cmake $BUILD_DIR/bin/cmake + +# install into somewhere outside the buildroot temporarily +export DESTDIR=../../install +export USRDIR=$PWD/../install/usr +cd .. +pushd %{srcname4}-sdk-%{version} +mkdir -p build +cd build +%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. +%make_build +make install +cd - +popd + +pushd SPIRV-Headers-%{commit2} +mkdir -p build +cd build +%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. +%make_build +make install +cd - +popd + +pushd SPIRV-Tools-%{ver3} +mkdir -p build +cd build +%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. -DSPIRV-Headers_SOURCE_DIR=$USRDIR +%make_build +make install +cd - +popd + +pushd %{srcname}-sdk-%{version} +mkdir -p build +cd build +%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. -DVULKAN_HEADERS_INSTALL_DIR=$USRDIR +%make_build +make install +cd - +popd + +pushd glslang-%{commit1} +mkdir -p build +cd build +%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. -DVULKAN_HEADERS_INSTALL_DIR=$USRDIR -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_SKIP_RPATH:BOOL=yes -DBUILD_SHARED_LIBS=OFF +%make_build +make install +cd - +popd + +# hack to avoid running of memory on aarch64 and i686 build +%ifarch %{ix86} aarch64 +# Decrease debuginfo verbosity to reduce memory consumption even more +%global optflags %(echo %{optflags} | sed 's/-g /-g1 /') +%endif + +pushd %{srcname5}-sdk-%{version} +mkdir -p build +cd build +%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. -DVULKAN_HEADERS_INSTALL_DIR=$USRDIR -DGLSLANG_INSTALL_DIR=$USRDIR +%make_build +cd - +popd + +pushd %{srcname6}-sdk-%{version} +mkdir -p build +cd build +%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. -DVULKAN_HEADERS_INSTALL_DIR=$USRDIR -DGLSLANG_INSTALL_DIR=$USRDIR -DBUILD_CUBE:BOOL=OFF +%make_build +cd - +popd + +%install + +cd .. +pushd %{srcname4}-sdk-%{version}/build +%{make_install} +popd + +pushd %{srcname}-sdk-%{version}/build +%{make_install} +popd + +pushd SPIRV-Tools-%{ver3}/build +%{make_install} +popd + +pushd %{srcname5}-sdk-%{version}/build +# this doesn't use the macro as we don't want to trigger cmake rebuilds here +DESTDIR=$RPM_BUILD_ROOT cmake -P cmake_install.cmake +popd + +pushd %{srcname6}-sdk-%{version}/build +# this doesn't use the macro as we don't want to trigger cmake rebuilds here +DESTDIR=$RPM_BUILD_ROOT cmake -P cmake_install.cmake +popd +cd - +# create the filesystem +mkdir -p %{buildroot}%{_sysconfdir}/vulkan/{explicit,implicit}_layer.d/ \ +%{buildroot}%{_datadir}/vulkan/{explicit,implicit}_layer.d/ \ +%{buildroot}{%{_sysconfdir},%{_datadir}}/vulkan/icd.d + +# don't want spirv-tools +rm -f %{buildroot}%{_bindir}/spirv-* +rm -f %{buildroot}%{_libdir}/pkgconfig/SPIRV* +rm -rf %{buildroot}%{_includedir}/spirv-tools +rm -f %{buildroot}%{_libdir}/libSPIRV-Tools-link.so +rm -f %{buildroot}%{_libdir}/libSPIRV-Tools-reduce.so +rm -f %{buildroot}%{_libdir}/libSPIRV-Tools-shared.so + +# remove unused includes and registry +rm -rf %{buildroot}%{_datadir}/vulkan/registry +rm -f %{buildroot}%{_includedir}/vk*.h %{buildroot}%{_includedir}/hash*.h %{buildroot}%{_includedir}/*.cpp + +# remove RPATH +chrpath -d %{buildroot}%{_bindir}/vulkaninfo + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%license LICENSE.txt +%doc README.md CONTRIBUTING.md +%{_bindir}/vulkaninfo +%{_datadir}/vulkan/explicit_layer.d/*.json +%{_libdir}/libVkLayer_*.so +%{_libdir}/libvulkan.so.* +%{_libdir}/libSPIRV*so + +%files devel +%{_includedir}/vulkan/ +%{_libdir}/pkgconfig/vulkan.pc +%{_libdir}/libvulkan.so + +%files filesystem +%dir %{_sysconfdir}/vulkan/ +%dir %{_sysconfdir}/vulkan/explicit_layer.d/ +%dir %{_sysconfdir}/vulkan/icd.d/ +%dir %{_sysconfdir}/vulkan/implicit_layer.d/ +%dir %{_datadir}/vulkan/ +%dir %{_datadir}/vulkan/explicit_layer.d/ +%dir %{_datadir}/vulkan/icd.d/ +%dir %{_datadir}/vulkan/implicit_layer.d/ + +%changelog +* Tue Feb 19 2019 Dave Airlie 1.1.97.0-1 +- Update to 1.1.97.0 +- rework spec for new upstream layout + +* Tue May 08 2018 Dave Airlie 1.1.73.0-1 +- Update to 1.1.73.0 release +- fixup spec for spirv-tools etc + +* Tue Oct 10 2017 Dave Airlie - 1.0.61.1-2 +- fix 32-bit textrels + +* Thu Sep 21 2017 Dave Airlie - 1.0.61.1-1 +- Update to 1.0.61.1 release +- bring spec updates in from Fedora spec. + +* Sat Feb 11 2017 Fedora Release Engineering - 1.0.39.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Jan 31 2017 Leigh Scott - 1.0.39.1-1 +- Update to 1.0.39.1 release + +* Tue Jan 24 2017 Leigh Scott - 1.0.39.0-1 +- Update to 1.0.39.0 release +- Add build requires libXrandr-devel + +* Fri Dec 16 2016 leigh scott - 1.0.37.0-1 +- Update to 1.0.37.0 release +- Disable Mir as it's lame ubuntu rubbish + +* Fri Dec 02 2016 leigh scott - 1.0.34.0-0.1.gitd4cd34f +- Update to latest git + +* Thu Dec 01 2016 leigh scott - 1.0.30.0-2 +- Fix VkLayer undefined symbol: util_GetExtensionProperties + +* Sat Oct 15 2016 Leigh Scott - 1.0.30.0-1 +- Update to 1.0.30.0 release + +* Mon Oct 10 2016 Leigh Scott - 1.0.26.0-4 +- Build with wayland support (rhbz 1383115) + +* Tue Sep 27 2016 Leigh Scott - 1.0.26.0-3 +- Move unversioned libraries +- Disable vkjson build +- Fix license tag + +* Sun Sep 11 2016 Leigh Scott - 1.0.26.0-2 +- Make layers conditional. + +* Sun Sep 11 2016 Leigh Scott - 1.0.26.0-1 +- Update to 1.0.26.0 release + +* Thu Sep 08 2016 Leigh Scott - 1.0.26.0-0.3.gitfbb8667 +- Clean up + +* Thu Sep 08 2016 Leigh Scott - 1.0.26.0-0.2.gitfbb8667 +- Change build requires python3 +- Use release for cmake +- Make build verbose + +* Wed Sep 07 2016 Leigh Scott - 1.0.26.0-0.1.gitfbb8667 +- Update to latest git + +* Tue Feb 16 2016 Igor Gnatenko - 1.0.3-0.1.git1affe90 +- Add ldconfig in post/postun +- Use upstream tarball from commit + patches +- Fix versioning. In fact it was never released +- Fixup mixing of spaces/tabs +- Remove rpath from vulkaninfo +- Make filesystem subpkg noarch (it is really noarch) +- BuildRequire gcc and gcc-c++ explicitly +- Require main pkg with isa tag +- Fix perms and perm of README.md +- Use %%license tag + +* Tue Feb 16 2016 Adam Jackson - 1.0.3-0 +- Update loader to not build cube or tri. Drop bundled LunarGLASS and llvm + since they're only needed for those demos. + +* Tue Feb 16 2016 Adam Jackson - 1.0.3-0 +- Initial packaging