# https://docs.fedoraproject.org/en-US/quick-docs/publish-rpm-on-copr # https://rpm-software-management.github.io/rpm/manual/macros.html # https://rpm-packaging-guide.github.io/ %global _owner pgnd %global _build_timestamp %( date +%%Y%%m%%d_%%H%%M%%S --utc ) %global _dist .%{_build_timestamp}.%{_owner}.fc%{fedora} # https://stackoverflow.com/questions/47838041/rpmbuild-how-to-disable-check-buildroot # https://rpm-software-management.github.io/rpm/manual/dependency_generators.html # %%global __spec_install_pre /bin/true # %%global __arch_install_post %%{nil} # %%global __os_install_post %%{nil} %global _disable_source_fetch 0 %global debug_package %{nil} # %%undefine _auto_set_build_flags %global _hardened_build 1 # %%global __brp_mangle_shebangs %%{nil} # %%global __brp_strip %%{nil} # %%global __requires_exclude ^.*/xxx/bin/python.*$ # %%global __requires_exclude_from ^.*/xxx/bin/python.*$ # %%global _build_id_links none # %%bcond_with XXX : opt build with XXX; default, without # %%bcond_without XXX : opt build without XXX; default, with # VULKAN-WSI-LAYER # https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer # MIRRORED @: https://codeberg.org/pgnd/vulkan-wsi-layer-UPSTREAM-MIRROR.git %global _vwl_name vulkan-wsi-layer %global _vwl_pkgnm vulkan-wsi-layer %global _vwl_comment A Vulkan window system integration layer for Linux %global _vwl_descrip %{expand: %{_vwl_comment}.} %global _vwl_impl_lyr_dir %{_datadir}/vulkan/implicit_layer.d # https://spdx.org/licenses/MIT.html %global _vwl_license MIT # https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/ # https://codeberg.org/pgnd/vulkan-wsi-layer-UPSTREAM-MIRROR.git %global _vwl0_scm_host https://codeberg.org %global _vwl0_scm_repo pgnd/vulkan-wsi-layer-UPSTREAM-MIRROR %global _vwl0_scm_branch main %global _vwl0_scm_url %{_vwl0_scm_host}/%{_vwl0_scm_repo} %global _vwl0_commit %( git ls-remote %{_vwl0_scm_url} | grep /%{_vwl0_scm_branch}$ | cut -f1 ) %global _vwl0_shortcommit %( c=%{_vwl0_commit}; echo ${c} | head -c 7 ) %global _vwl0_scm_repo_esc %( echo %{_vwl0_scm_repo} | sed 's|_|-|g' | sed 's|/|%2F|g') %global _vwl0_scm_repo_norm %( echo %{_vwl0_scm_repo} | sed 's|_|-|g' | sed 's|/|-|g' ) %global _vwl0_scm_branch_norm %( echo %{_vwl0_scm_branch} | sed 's|_|-|g' | sed 's|/|-|g' ) # CODEBERG/FORGEJO API: # https://codeberg.org/api/swagger#/repository/repoGetArchive %global _vwl0_scm_host_api %{_vwl0_scm_host}/api/v1/repos %global _vwl0_scm_tarball %{_vwl0_scm_host_api}/%{_vwl0_scm_repo}/archive/%{_vwl0_commit}.tar.gz %global _vwl0_scm_extract_dir %( basename %{_vwl0_scm_repo} | tr '[:upper:]' '[:lower:]' | sed 's|_|-|g') %global forgeurl0 %{_vwl0_scm_url} %global commit0 %{_vwl0_commit} %global shortcommit0 %{_vwl0_shortcommit} %global forgesource0 %{_vwl0_scm_tarball} %global extractdir0 %{_vwl0_scm_extract_dir} %global forgesetupargs0 -T -D -b 0 -n %{extractdir0} %forgemeta -i -a %global dist %{_dist} # Vendor Pinning Vendor: %{_owner} # NEVRA (n-e:v-r.a) Name: %{_vwl_pkgnm} Epoch: 3 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/ Version: %{scm0}_%( echo %{_vwl0_scm_branch} | sed 's|-|_|g' ) Release: 0%{?dist} # https://blog.jasonantman.com/2014/07/how-yum-and-rpm-compare-versions/ %global _same_evr %{epoch}:%{version}-%{release} Summary: %{_vwl_comment} License: %{_vwl_license} URL: %{forgeurl0} Source0: %{forgesource0} BuildRequires: coreutils BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: git BuildRequires: git-core BuildRequires: cmake3 BuildRequires: libdrm-devel BuildRequires: kernel-devel BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-cursor) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-server) BuildRequires: python3-devel BuildRequires: python3-pip BuildRequires: vulkan-headers BuildRequires: vulkan-loader BuildRequires: wayland-protocols-devel Requires: mesa-vulkan-drivers Requires: vulkan-loader Provides: vulkan-wsi-layer = %{_same_evr} Obsoletes: vulkan-wsi-layer < %{_same_evr} %description %{_vwl_descrip} %prep echo '##### STARTING PREP #####' %forgesetup -a %build echo '##### STARTING BUILD #####' cd %{_builddir}/%{extractdir0} %cmake3 \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_WSI_HEADLESS=1 \ -DBUILD_WSI_WAYLAND=0 \ -DKERNEL_DIR="%{_usrsrc}/kernels/`uname -r`" # -DBUILD_WSI_WAYLAND=1 -DSELECT_EXTERNAL_ALLOCATOR=ion \ %cmake_build %install echo '##### STARTING INSTALL #####' mkdir -p ${RPM_BUILD_ROOT}/%{_vwl_impl_lyr_dir} install -D -p -m 755 \ redhat-linux-build/libVkLayer_window_system_integration.so \ ${RPM_BUILD_ROOT}/%{_vwl_impl_lyr_dir} install -D -p -m 644 \ redhat-linux-build/VkLayer_window_system_integration.json \ ${RPM_BUILD_ROOT}/%{_vwl_impl_lyr_dir} %post %preun %postun %files # http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html %{_vwl_impl_lyr_dir}/VkLayer_window_system_integration.json %{_vwl_impl_lyr_dir}/libVkLayer_window_system_integration.so %changelog * Fri Aug 2 2024 pgnd _ - bump 1722605378