diff options
author | tuftedocelot <tuftedocelot@fastmail.fm> | 2021-12-22 18:32:00 -0600 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-12-29 03:46:56 -0800 |
commit | 5810467c97b62a063545be47508072057dbbcb09 (patch) | |
tree | 0530f06ee75a42183dc64e07aeab561a84a2c25c /CMakeLists.txt | |
parent | ea0a00246815c9fe957c6564a28e0960a5d04433 (diff) | |
download | serenity-5810467c97b62a063545be47508072057dbbcb09.zip |
Build: Remove gzip -k usage in PCI/USB ID files and crypt for OpenBSD
OpenBSD gzip does not have the -k flag to keep the original after
extraction. Work around this by copying the original gzip to the dest
and then extracting. A bit of a hack, but only needs to be done for the
first-time or rebuilds
OpenBSD provides crypt in libc, not libcrypt. Adjust if/else to check
for either and proceed accordingly
Remove outdated OpenBSD checks when building the toolchain
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a56388c9b..ab356c3ed6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,10 +256,11 @@ endif() export_components("${CMAKE_BINARY_DIR}/components.ini") -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) +set(PCI_IDS_FILE pci.ids) +set(PCI_IDS_GZ_URL https://pci-ids.ucw.cz/v2.2/${PCI_IDS_FILE}.gz) +set(PCI_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/${PCI_IDS_FILE}.gz) +set(PCI_IDS_PATH ${CMAKE_BINARY_DIR}/${PCI_IDS_FILE}) +set(PCI_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/${PCI_IDS_FILE}) if(ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS ${PCI_IDS_GZ_PATH}) message(STATUS "Downloading PCI ID database from ${PCI_IDS_GZ_URL}...") @@ -268,15 +269,16 @@ 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}) + file(COPY ${PCI_IDS_GZ_PATH} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) + execute_process(COMMAND gzip -d -o ${PCI_IDS_INSTALL_PATH} ${CMAKE_INSTALL_DATAROOTDIR}/${PCI_IDS_FILE}.gz) endif() -set(USB_IDS_GZ_URL http://www.linux-usb.org/usb.ids.gz) -set(USB_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/usb.ids.gz) -set(USB_IDS_PATH ${CMAKE_BINARY_DIR}/usb.ids) -set(USB_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/usb.ids) +set(USB_IDS_FILE usb.ids) +set(USB_IDS_GZ_URL http://www.linux-usb.org/${USB_IDS_FILE}.gz) +set(USB_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/${USB_IDS_FILE}.gz) +set(USB_IDS_PATH ${CMAKE_BINARY_DIR}/${USB_IDS_FILE}) +set(USB_IDS_INSTALL_PATH ${CMAKE_INSTALL_DATAROOTDIR}/${USB_IDS_FILE}) if(ENABLE_USB_IDS_DOWNLOAD AND NOT EXISTS ${USB_IDS_GZ_PATH}) message(STATUS "Downloading USB ID database from ${USB_IDS_GZ_URL}...") @@ -285,7 +287,7 @@ endif() if(EXISTS ${USB_IDS_GZ_PATH} AND NOT EXISTS ${USB_IDS_INSTALL_PATH}) message(STATUS "Extracting USB ID database from ${USB_IDS_GZ_PATH}...") - execute_process(COMMAND gzip -k -d ${USB_IDS_GZ_PATH}) file(MAKE_DIRECTORY ${CMAKE_INSTALL_DATAROOTDIR}) - file(RENAME ${USB_IDS_PATH} ${USB_IDS_INSTALL_PATH}) + file(COPY ${USB_IDS_GZ_PATH} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) + execute_process(COMMAND gzip -d -o ${USB_IDS_INSTALL_PATH} ${CMAKE_INSTALL_DATAROOTDIR}/${USB_IDS_FILE}.gz) endif() |