From 98d05cddeff325b70ce4c7dbb206eb1f583b83b9 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Thu, 13 Aug 2020 23:46:05 -0700 Subject: [PATCH] [cspice] Add 64bit packages --- ports/cspice/CMakeLists.txt | 8 +++-- ports/cspice/CONTROL | 5 ++- ports/cspice/portfile.cmake | 70 +++++++++++++++++++++++-------------- scripts/ci.baseline.txt | 2 -- 4 files changed, 54 insertions(+), 31 deletions(-) diff --git a/ports/cspice/CMakeLists.txt b/ports/cspice/CMakeLists.txt index e82b3a2804a3ae..af5c3e22b15a82 100644 --- a/ports/cspice/CMakeLists.txt +++ b/ports/cspice/CMakeLists.txt @@ -18,8 +18,12 @@ if (WIN32) target_compile_definitions(cspice PUBLIC "_COMPLEX_DEFINED;MSDOS;OMIT_BLANK_CC;NON_ANSI_STDIO") set_target_properties(cspice PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) elseif (UNIX) - target_compile_definitions(cspice PUBLIC "NON_ANSI_STDIO") - target_compile_options(cspice PUBLIC -m64 -ansi -fPIC) + target_compile_definitions(cspice PUBLIC "NON_UNIX_STDIO") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + target_compile_options(cspice PUBLIC -m64 -ansi -fPIC) + elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + target_compile_options(cspice PUBLIC -m32 -ansi -fPIC) + endif() endif () if (NOT _SKIP_HEADERS) diff --git a/ports/cspice/CONTROL b/ports/cspice/CONTROL index 670f75a3ae1f88..bb83e586d2ae9b 100644 --- a/ports/cspice/CONTROL +++ b/ports/cspice/CONTROL @@ -1,3 +1,6 @@ Source: cspice -Version: 66-1 +Version: 66 +Port-Version: 2 +Homepage: https://naif.jpl.nasa.gov/naif/toolkit_C.html Description: NASA C SPICE toolkit +Supports: !uwp \ No newline at end of file diff --git a/ports/cspice/portfile.cmake b/ports/cspice/portfile.cmake index 7c52772f355fb4..865325a7a3b5ef 100644 --- a/ports/cspice/portfile.cmake +++ b/ports/cspice/portfile.cmake @@ -1,31 +1,49 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "uwp") -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() - -if (WIN32) - vcpkg_download_distfile(ARCHIVE - URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_32bit/packages/cspice.zip" - FILENAME "cspice.zip" - SHA512 4f6129b26543729f4eb4f8240b43ca87530db9c6d9a5c0e3f43faf30561eaad95dcf507e3fecfd1c3d4388ccaa4e22a76df7bf7945b6ce9a68eb3b4893885992 - ) -elseif (APPLE) - vcpkg_download_distfile(ARCHIVE - URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_32bit/packages/cspice.tar.Z" - FILENAME "cspice.tar.Z" - SHA512 bd5cc20206e48b3712c5077a2beb05c98cd58a25ce374ed363699a04998eb8ba93e42b5f7c2104c5296db95b3bccdc7cc9b6a2ba45875454d0c3914834aa4c42 - ) -else () - vcpkg_download_distfile(ARCHIVE - URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z" - FILENAME "cspice.tar.Z" - SHA512 b387bc2cfca4deccc451d198af49564ea0b19cf665ba143d39196ed532639cbc11aad7e1d63f71f1bb88d72c0e6ac30757b6e1babca9e0ee3b92f9c205c1b908 - ) +if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_32bit/packages/cspice.zip" + FILENAME "cspice_32bit.zip" + SHA512 4f6129b26543729f4eb4f8240b43ca87530db9c6d9a5c0e3f43faf30561eaad95dcf507e3fecfd1c3d4388ccaa4e22a76df7bf7945b6ce9a68eb3b4893885992 + ) + elseif (VCPKG_TARGET_IS_OSX) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_32bit/packages/cspice.tar.Z" + FILENAME "cspice_32bit.tar.Z" + SHA512 bd5cc20206e48b3712c5077a2beb05c98cd58a25ce374ed363699a04998eb8ba93e42b5f7c2104c5296db95b3bccdc7cc9b6a2ba45875454d0c3914834aa4c42 + ) + else () + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z" + FILENAME "cspice_32bit.tar.Z" + SHA512 b387bc2cfca4deccc451d198af49564ea0b19cf665ba143d39196ed532639cbc11aad7e1d63f71f1bb88d72c0e6ac30757b6e1babca9e0ee3b92f9c205c1b908 + ) + endif() +else() + if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_64bit/packages/cspice.zip" + FILENAME "cspice_64bit.zip" + SHA512 7b5353c638fdba67ed2e9fd21c4f78ac56c0afba408caa70f910f23bb025f6dc822fbaa7d6d7fa277d1038f835e6a962563f4b11a6adf63150d48354959e3c62 + ) + elseif (VCPKG_TARGET_IS_OSX) + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z" + FILENAME "cspice_64bit.tar.Z" + SHA512 0d4ef95dfa65d127c1d6f9cf1f637d41ca6680660ee3003f357652f12ed9d04a21888ef796f347ba90354a445b5aea9ffca7dedc6c1617f253b0002683d54a0f + ) + else () + vcpkg_download_distfile(ARCHIVE + URLS "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z" + FILENAME "cspice_64bit.tar.Z" + SHA512 7d090e9196596436740b53180a7c6ca885c12e301771a83fc62d625a63691129c69012cb0385a6c8f246cc5edf1c1af57ffac8a9d766061e1bde8584c57c6ca4 + ) + endif() endif() set(PATCHES isatty.patch) -if (NOT WIN32) +if (NOT VCPKG_TARGET_IS_WINDOWS) set(PATCHES ${PATCHES} mktemp.patch) endif() @@ -55,6 +73,6 @@ vcpkg_copy_pdbs() file( INSTALL ${CMAKE_CURRENT_LIST_DIR}/License.txt - DESTINATION ${CURRENT_PACKAGES_DIR}/share/cspice + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright -) +) \ No newline at end of file diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 0ca4b30d9e6370..47bd7eab2c07c1 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -270,8 +270,6 @@ crashpad:x86-windows=fail crfsuite:arm-uwp=fail crfsuite:x64-uwp=fail crossguid:x64-osx=fail -cspice:arm-uwp=fail -cspice:x64-uwp=fail ctemplate:arm64-windows=fail ctemplate:arm-uwp=fail ctemplate:x64-linux=fail