mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Build: Download and uncompress gzipped version of pci.ids
Partially addresses #5611.
This commit is contained in:
parent
15ae22f7cc
commit
3775507613
Notes:
sideshowbarker
2024-07-18 21:43:31 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/37755076133 Pull-request: https://github.com/SerenityOS/serenity/pull/5627
1 changed files with 15 additions and 5 deletions
|
@ -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