Diff amdgpu-pro-vulkan-21.50.2.1384496 with a amdgpu-pro-vulkan-22.10.4.1452060

/usr/portage/media-libs/amdgpu-pro-vulkan/amdgpu-pro-vulkan-22.10.4.1452060.ebuild 2023-10-09 14:52:31.656368405 +0300
11 11
MY_PV_REV=$(ver_cut 4)
12 12

  
13 13
MY_PV="${MY_PV_HIGH}.${MY_PV_MIDDLE}.${MY_PV_LOW}"
14
[[ $MY_PV_LOW = "0" ]] && MY_PV="${MY_PV_HIGH}.${MY_PV_MIDDLE}"
15

  
14 16
MY_PV_FULL="${MY_PV}-${MY_PV_REV}"
15 17

  
16 18
MY_PN="vulkan-amdgpu-pro"
......
58 60
src_prepare() {
59 61
	if use abi_x86_64 ; then
60 62
		cd "${S}/${PN}-amd64/opt/amdgpu-pro/lib/x86_64-linux-gnu/" || die
61
		mv amdvlk64.so.1.0 amdvlkpro64.so.1.0 || die
62
		patchelf --set-soname amdvlkpro64.so.1.0 "${PWD}"/amdvlkpro64.so.1.0 || die
63

  
64
		# Make sure there's only one file in the folder, to prevent unexpected behavior of the next command
65
		[[ "$(ls | wc -l)" = '1' ]] || die "more than one file in opt/amdgpu-pro/lib/x86_64-linux-gnu/"
66

  
67
		# Add "pro" in the .so file's name, and remove any numeric extension "e.g. amdvlk64.so.1"
68
		mv amdvlk64.so* amdvlkpro64.so || die
69

  
70
		# same with the SONAME
71
		patchelf --set-soname amdvlkpro64.so "${PWD}"/amdvlkpro64.so || die
63 72

  
64 73
		cd "${S}/${PN}-amd64/opt/amdgpu-pro/etc/vulkan/icd.d/" || die
65 74
		eapply "${FILESDIR}"/icd_amd64.patch
......
68 77

  
69 78
	if use abi_x86_32 ; then
70 79
		cd "${S}/${PN}-i386/opt/amdgpu-pro/lib/i386-linux-gnu/" || die
71
		mv amdvlk32.so.1.0 amdvlkpro32.so.1.0 || die
72
		patchelf --set-soname amdvlkpro32.so.1.0 "${PWD}"/amdvlkpro32.so.1.0 || die
80

  
81
		# Make sure there's only one file in the folder, to prevent unexpected behavior of the next command
82
		[[ "$(ls | wc -l)" = '1' ]] || die "more than one file in opt/amdgpu-pro/lib/i386-linux-gnu/"
83

  
84
		# Add "pro" in the .so file's name, and remove any numeric extension "e.g. amdvlk32.so.1"
85
		mv amdvlk32.so* amdvlkpro32.so || die
86

  
87
		# same with the SONAME
88
		patchelf --set-soname amdvlkpro32.so "${PWD}"/amdvlkpro32.so || die
73 89

  
74 90
		cd "${S}/${PN}-i386/opt/amdgpu-pro/etc/vulkan/icd.d/" || die
75 91
		eapply "${FILESDIR}"/icd_x86.patch
......
81 97

  
82 98
src_install() {
83 99
	if use abi_x86_64 ; then
100
		# Vulkan driver
84 101
		insinto /usr/lib64
85

  
86
		# Vulkan
87
		doins "${S}"/"${PN}"-amd64/opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlkpro64.so.1.0
88
		dosym amdvlkpro64.so.1.0 /usr/lib64/amdvlkpro64.so
89
		dosym amdvlkpro64.so.1.0 /usr/lib64/amdvlkpro64.so.1
102
		doins "${S}"/"${PN}"-amd64/opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlkpro64.so
90 103

  
91 104
		# ICD loader
92 105
		insinto /usr/share/vulkan/icd.d
......
94 107
	fi
95 108

  
96 109
	if use abi_x86_32 ; then
110
		# Vulkan driver
97 111
		insinto /usr/lib
98

  
99
		# Vulkan
100
		doins "${S}"/"${PN}"-i386/opt/amdgpu-pro/lib/i386-linux-gnu/amdvlkpro32.so.1.0
101
		dosym amdvlkpro32.so.1.0 /usr/lib/amdvlkpro32.so
102
		dosym amdvlkpro32.so.1.0 /usr/lib/amdvlkpro32.so.1
112
		doins "${S}"/"${PN}"-i386/opt/amdgpu-pro/lib/i386-linux-gnu/amdvlkpro32.so
103 113

  
104 114
		# ICD loader
105 115
		insinto /usr/share/vulkan/icd.d
106 116
		doins "${S}"/"${PN}"-i386/opt/amdgpu-pro/etc/vulkan/icd.d/amd_pro_icd32.json
107 117
	fi
108 118
}
119

  
120
pkg_postinst() {
121

  
122
	if use abi_x86_32; then
123
		elog "To run a 32bit program using the amdgpu-pro vulkan driver, the environment variable"
124
		elog "     VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amd_pro_icd32.json"
125
		elog "must be set beforehand"
126
		elog
127
	fi
128

  
129
	if use abi_x86_64; then
130
		elog "To run a 64bit program using the amdgpu-pro vulkan driver, the environment variable"
131
		elog "     VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amd_pro_icd64.json"
132
		elog "must be set beforehand"
133
	fi
134
}
Thank you!