mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-04 15:09:40 +00:00
Build: Download and uncompress gzipped version of pci.ids
Partially addresses #5611.
This commit is contained in:
parent
15ae22f7cc
commit
3775507613
|
@ -184,9 +184,19 @@ add_subdirectory(AK)
|
|||
add_subdirectory(Kernel)
|
||||
add_subdirectory(Userland)
|
||||
|
||||
set(PCI_IDS_URL https://pci-ids.ucw.cz/v2.2/pci.ids)
|
||||
set(PCI_IDS_PATH ${CMAKE_INSTALL_DATAROOTDIR}/pci.ids)
|
||||
if(ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS ${PCI_IDS_PATH})
|
||||
message(STATUS "Downloading PCI ID database from ${PCI_IDS_URL}...")
|
||||
file(DOWNLOAD ${PCI_IDS_URL} ${PCI_IDS_PATH} INACTIVITY_TIMEOUT 10)
|
||||
set(PCI_IDS_GZ_URL https://pci-ids.ucw.cz/v2.2/pci.ids.gz)
|
||||
set(PCI_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/pci.ids.gz)
|
||||
set(PCI_IDS_PATH ${CMAKE_BINARY_DIR}/pci.ids)
|
||||
set(PCI_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/pci.ids)
|
||||
|
||||
if(ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS ${PCI_IDS_GZ_PATH})
|
||||
message(STATUS "Downloading PCI ID database from ${PCI_IDS_GZ_URL}...")
|
||||
file(DOWNLOAD ${PCI_IDS_GZ_URL} ${PCI_IDS_GZ_PATH} INACTIVITY_TIMEOUT 10)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${PCI_IDS_GZ_PATH} AND NOT EXISTS ${PCI_IDS_INSTALL_PATH})
|
||||
message(STATUS "Extracting PCI ID database from ${PCI_IDS_GZ_PATH}...")
|
||||
execute_process(COMMAND gzip -k -d ${PCI_IDS_GZ_PATH})
|
||||
file(MAKE_DIRECTORY ${CMAKE_INSTALL_DATAROOTDIR})
|
||||
file(RENAME ${PCI_IDS_PATH} ${PCI_IDS_INSTALL_PATH})
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue