easyblock = 'ConfigureMake'

name = 'QtWebkit'
version = '5.8.0'

homepage = 'http://www.linuxfromscratch.org/blfs/view/svn/x/qtwebkit5.html'
description = "Qtwebkit is a Qt based web browser engine"

toolchain = {'name': 'intel', 'version': '2018'}

source_urls = [
    'https://download.qt.io/community_releases/5.8/5.8.0-final/',
    'http://www.linuxfromscratch.org/patches/blfs/svn/'
]
sources = ['qtwebkit-opensource-src-5.8.0.tar.xz']

patches = ['qtwebkit-5.9.0-icu_59-1.patch']

builddependencies = [
    ('Bison', '3.0.4'),
    ('flex', '2.6.4'),
]

dependencies = [
    ('libwebp', '0.6.0'), 
    ('libxslt', '1.1.29'),
    ('ICU', '59.1'),
    ('Ruby', '2.3.1'),
    ('gperf', '3.0.4'),
    ('SQLite', '3.20.1'),
    ('libpng', '1.6.32'),
    ('libjpeg-turbo', '1.5.1'),
    ('Qt5', '5.8.0'),
]

skipsteps = ['configure', 'build', 'install']

# Install by brute force
installqtwebkit = "cd %(builddir)s &&"
installqtwebkit += "cd qtwebkit-opensource-src-%s &&" % (version)
installqtwebkit += "mkdir build && cd build &&"
installqtwebkit += "qmake ../WebKit.pro && make && make install"
postinstallcmds = [installqtwebkit]

sanity_check_paths = {
    'files': ["../../Qt5/5.8.0-intel-2018/lib/libQt5WebKit.so.5.8.0"],
    'dirs': [],
}

moduleclass = 'lib'
