mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
Build: Download and uncompress gzipped version of pci.ids
Partially addresses #5611.
This commit is contained in:
parent
15ae22f7cc
commit
3775507613
1 changed files with 15 additions and 5 deletions
|
@ -184,9 +184,19 @@ add_subdirectory(AK)
|
||||||
add_subdirectory(Kernel)
|
add_subdirectory(Kernel)
|
||||||
add_subdirectory(Userland)
|
add_subdirectory(Userland)
|
||||||
|
|
||||||
set(PCI_IDS_URL https://pci-ids.ucw.cz/v2.2/pci.ids)
|
set(PCI_IDS_GZ_URL https://pci-ids.ucw.cz/v2.2/pci.ids.gz)
|
||||||
set(PCI_IDS_PATH ${CMAKE_INSTALL_DATAROOTDIR}/pci.ids)
|
set(PCI_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/pci.ids.gz)
|
||||||
if(ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS ${PCI_IDS_PATH})
|
set(PCI_IDS_PATH ${CMAKE_BINARY_DIR}/pci.ids)
|
||||||
message(STATUS "Downloading PCI ID database from ${PCI_IDS_URL}...")
|
set(PCI_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/pci.ids)
|
||||||
file(DOWNLOAD ${PCI_IDS_URL} ${PCI_IDS_PATH} INACTIVITY_TIMEOUT 10)
|
|
||||||
|
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()
|
endif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue