From 173371c7386d9ce9e91695915ef2ffda4f63b839 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 26 Jan 2022 15:19:58 -0800 Subject: [PATCH] [cspice] Make URLs stable (#22794) --- ports/cspice/portfile.cmake | 24 +++++++++++------------- ports/cspice/vcpkg.json | 3 ++- versions/baseline.json | 2 +- versions/c-/cspice.json | 5 +++++ 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ports/cspice/portfile.cmake b/ports/cspice/portfile.cmake index 1109c1c747..33d481d7b0 100644 --- a/ports/cspice/portfile.cmake +++ b/ports/cspice/portfile.cmake @@ -1,36 +1,34 @@ if (VCPKG_TARGET_IS_WINDOWS) if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(URL "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_32bit/packages/cspice.zip") - set(FILENAME "cspice_32bit.zip") + set(SUBPATH "PC_Windows_VisualC_32bit/packages/cspice.zip") set(SHA512 1949fd12b30ca0e42f53311a97d8571e68737f6a667a56946d3415ee715dda0a1adca9bfc985b9b9447084189c50d261f2c00960cbe2ddf6a1d1d92cf8fa17ab) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(URL "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_64bit/packages/cspice.zip") - set(FILENAME "cspice_64bit.zip") + set(SUBPATH "PC_Windows_VisualC_64bit/packages/cspice.zip") set(SHA512 5457f24279fb485b0ac92713dab026d1c1ed766a358fcf7d9ce3f70693e75da85a656e72b1ada4dc334e9e68d6c0eb42b2a31f3ad0c83b491dd3afc79e5cda98) endif() elseif(VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(URL "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z") - set(FILENAME "cspice_64bit.tar.Z") + set(SUBPATH "MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z") set(SHA512 ea9a32c763cd54303de180b4895a195cd5ef6774051f18a1812f2fff39adc0ca9d5dd7878853af40e766882e79a0f542a45139656fb79fb4b436c4bc5bdecddc) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(URL "https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacM1_OSX_clang_64bit/packages/cspice.tar.Z") - set(FILENAME "cspice_64bit.tar.Z") + set(SUBPATH "MacM1_OSX_clang_64bit/packages/cspice.tar.Z") set(SHA512 a64f028ec1935dbc7f8d03c903fbfa40cfff097ec4aa0ca4aa1d2ee08561833000e7caf99d6550b06d2a0874cbaf1767382e7a9aea6a39228f3eaa89c6c31a6d) endif() else() if ((VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") OR (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")) - set(URL "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z") - set(FILENAME "cspice_32bit.tar.Z") + set(SUBPATH "PC_Linux_GCC_32bit/packages/cspice.tar.Z") set(SHA512 22a6250376e9f98d75ecc8682c5432a07a89addc9812010ad97059491e2c19cab418d7aa3f591bded9df132fcfb6865686f0ecfe70821ad31061ae2f7b165f2b) elseif((VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") OR (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")) - set(URL "https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z") - set(FILENAME "cspice_64bit.tar.Z") + set(SUBPATH "PC_Linux_GCC_64bit/packages/cspice.tar.Z") set(SHA512 59946f628284cd31c75a23c152d725ae7e01b179f97c52b98518eceeda54bc38875b1dd93dc17574c0bf00e706e0ee35d06ecb5d7871d49633baa8f16eb6c7c8) endif() endif() -vcpkg_download_distfile(ARCHIVE URLS ${URL} FILENAME ${FILENAME} SHA512 ${SHA512}) +set(VERSION 67) +set(URL "https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N00${VERSION}/C/${SUBPATH}") +get_filename_component(ext "${SUBPATH}" EXT) +string(SUBSTRING "${SHA512}" 0 6 subsha) +vcpkg_download_distfile(ARCHIVE URLS "${URL}" FILENAME "cspice-${subsha}${ext}" SHA512 "${SHA512}") set(PATCHES isatty.patch) if (NOT VCPKG_TARGET_IS_WINDOWS) diff --git a/ports/cspice/vcpkg.json b/ports/cspice/vcpkg.json index 4bdc82fd7d..af4d7c9f2e 100644 --- a/ports/cspice/vcpkg.json +++ b/ports/cspice/vcpkg.json @@ -1,6 +1,7 @@ { "name": "cspice", - "version-string": "67", + "version": "67", + "port-version": 1, "description": "NASA C SPICE toolkit", "homepage": "https://naif.jpl.nasa.gov/naif/toolkit_C.html", "supports": "!((arm | arm64) & windows)", diff --git a/versions/baseline.json b/versions/baseline.json index 1053bb196f..312e6c90f8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1670,7 +1670,7 @@ }, "cspice": { "baseline": "67", - "port-version": 0 + "port-version": 1 }, "ctbignum": { "baseline": "2019-08-02", diff --git a/versions/c-/cspice.json b/versions/c-/cspice.json index 20951a983c..d9b8ff3dd9 100644 --- a/versions/c-/cspice.json +++ b/versions/c-/cspice.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2ad682ffd7b5b7cb6316fd77dc99dda7e6100731", + "version": "67", + "port-version": 1 + }, { "git-tree": "1c8f251f7712ff12e7b94d059a56eff69915fb43", "version-string": "67",