# IT4Innovations 2022
# JK

name = 'VTune'
version = '2022.2.0'
local modules = '2022_2_0'

homepage = 'https://software.intel.com/en-us/vtune'
description = """Intel VTune Amplifier XE is the premier performance profiler for C, C++, C#, Fortran,
 Assembly and Java."""

toolchain = {'name': 'intel', 'version': '2021b'}

# By downloading, you accept the Intel End User License Agreement
# (https://software.intel.com/content/www/us/en/develop/articles/end-user-license-agreement.html)
accept_eula = True
source_urls = ['https://registrationcenter-download.intel.com/akdlm/irc_nas/18602/']
sources = ['l_oneapi_vtune_p_%(version)s.172_offline.sh']
checksums = ['d9f92ab6486a02c8ba226c98893492a54eda706d9edd3206a6b6143bfbc97195']

dependencies = [
    ('Pango', '1.48.8'),
    ('X11', '20210802'),
    ('GTK3', '3.24.31'),
]

dontcreateinstalldir = 'True'
license_file = '/apps/licenses/intel/license.lic'

# Do necessary post-install steps to build VTune kernel modules
postinstallcmds = [
    'mkdir %(installdir)s/modules',
    'echo "Pičo moduly do jádra"',
    'ln -s  %(installdir)s  %(installdir)s/../%(modules)s'
#    'cd %(installdir)s/vtune/%(version)s/sepdk/src/ && '
#    './build-driver --install-dir=%(installdir)s/modules --non-interactive',
#    'sed "s|DEFAULT_GROUP=vtune|DEFAULT_GROUP=wheel|" %(installdir)s/modules/pax/insmod-pax -i',
#    'sed "s|DEFAULT_GROUP=vtune|DEFAULT_GROUP=wheel|" %(installdir)s/modules/vtsspp/insmod-vtsspp -i',
#    'sed "s|DEFAULT_GROUP=vtune|DEFAULT_GROUP=wheel|" %(installdir)s/modules/insmod-sep -i',
]

sanity_check_paths = {
    'files': ['%(namelower)s/%(version)s/bin64/amplxe-perf'],
    'dirs': ['%(namelower)s/%(version)s/bin64',
             '%(namelower)s/%(version)s/lib64',
             '%(namelower)s/%(version)s/include/intel64']
}

moduleclass = 'tools'
