diff --git a/ports/physfs/001-fix-lzmasdk-arm64-windows.patch b/ports/physfs/001-fix-lzmasdk-arm64-windows.patch deleted file mode 100644 index 0fad2b5800..0000000000 --- a/ports/physfs/001-fix-lzmasdk-arm64-windows.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/src/physfs_lzmasdk.h b/src/physfs_lzmasdk.h ---- a/src/physfs_lzmasdk.h -+++ b/src/physfs_lzmasdk.h -@@ -506,6 +506,7 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem - #endif - - #if defined(MY_CPU_AMD64) \ -+ || defined(_M_ARM64) \ - || defined(_M_IA64) \ - || defined(__AARCH64EL__) \ - || defined(__AARCH64EB__) -@@ -531,6 +532,8 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem - - #if defined(_WIN32) && defined(_M_ARM) - #define MY_CPU_ARM_LE -+#elif defined(_WIN64) && defined(_M_ARM64) -+#define MY_CPU_ARM_LE - #endif - - #if defined(_WIN32) && defined(_M_IA64) diff --git a/ports/physfs/002-fix-posix-eintr.patch b/ports/physfs/002-fix-posix-eintr.patch deleted file mode 100644 index 08d314af1c..0000000000 --- a/ports/physfs/002-fix-posix-eintr.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/src/physfs_platform_posix.c b/src/physfs_platform_posix.c ---- a/src/physfs_platform_posix.c -+++ b/src/physfs_platform_posix.c -@@ -6,8 +6,6 @@ - * This file written by Ryan C. Gordon. - */ - --/* !!! FIXME: check for EINTR? */ -- - #define __PHYSICSFS_INTERNAL__ - #include "physfs_platforms.h" - -@@ -167,7 +165,9 @@ static void *doOpen(const char *filename, int mode) - /* O_APPEND doesn't actually behave as we'd like. */ - mode &= ~O_APPEND; - -- fd = open(filename, mode, S_IRUSR | S_IWUSR); -+ do { -+ fd = open(filename, mode, S_IRUSR | S_IWUSR); -+ } while ((fd < 0) && (errno == EINTR)); - BAIL_IF(fd < 0, errcodeFromErrno(), NULL); - - if (appending) -@@ -219,7 +219,9 @@ PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer, - if (!__PHYSFS_ui64FitsAddressSpace(len)) - BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); - -- rc = read(fd, buffer, (size_t) len); -+ do { -+ rc = read(fd, buffer, (size_t) len); -+ } while ((rc == -1) && (errno == EINTR)); - BAIL_IF(rc == -1, errcodeFromErrno(), -1); - assert(rc >= 0); - assert(rc <= len); -@@ -236,7 +238,9 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer, - if (!__PHYSFS_ui64FitsAddressSpace(len)) - BAIL(PHYSFS_ERR_INVALID_ARGUMENT, -1); - -- rc = write(fd, (void *) buffer, (size_t) len); -+ do { -+ rc = write(fd, (void *) buffer, (size_t) len); -+ } while ((rc == -1) && (errno == EINTR)); - BAIL_IF(rc == -1, errcodeFromErrno(), rc); - assert(rc >= 0); - assert(rc <= len); -@@ -275,8 +279,13 @@ PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque) - int __PHYSFS_platformFlush(void *opaque) - { - const int fd = *((int *) opaque); -- if ((fcntl(fd, F_GETFL) & O_ACCMODE) != O_RDONLY) -- BAIL_IF(fsync(fd) == -1, errcodeFromErrno(), 0); -+ int rc = -1; -+ if ((fcntl(fd, F_GETFL) & O_ACCMODE) != O_RDONLY) { -+ do { -+ rc = fsync(fd); -+ } while ((rc == -1) && (errno == EINTR)); -+ BAIL_IF(rc == -1, errcodeFromErrno(), 0); -+ } - return 1; - } /* __PHYSFS_platformFlush */ - -@@ -284,7 +293,10 @@ int __PHYSFS_platformFlush(void *opaque) - void __PHYSFS_platformClose(void *opaque) - { - const int fd = *((int *) opaque); -- (void) close(fd); /* we don't check this. You should have used flush! */ -+ int rc = -1; -+ do { -+ rc = close(fd); /* we don't check this. You should have used flush! */ -+ } while ((rc == -1) && (errno == EINTR)); - allocator.Free(opaque); - } /* __PHYSFS_platformClose */ - diff --git a/ports/physfs/003-fix-posix-cloexec.patch b/ports/physfs/003-fix-posix-cloexec.patch deleted file mode 100644 index 6ff2114a5e..0000000000 --- a/ports/physfs/003-fix-posix-cloexec.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/src/physfs_platform_posix.c b/src/physfs_platform_posix.c ---- a/src/physfs_platform_posix.c -+++ b/src/physfs_platform_posix.c -@@ -160,16 +160,30 @@ static void *doOpen(const char *filename, int mode) - const int appending = (mode & O_APPEND); - int fd; - int *retval; -+ int flags; -+ flags = -1; - errno = 0; - - /* O_APPEND doesn't actually behave as we'd like. */ - mode &= ~O_APPEND; -+ -+#ifdef O_CLOEXEC -+ /* Add O_CLOEXEC if defined */ -+ mode |= O_CLOEXEC; -+#endif - - do { - fd = open(filename, mode, S_IRUSR | S_IWUSR); - } while ((fd < 0) && (errno == EINTR)); - BAIL_IF(fd < 0, errcodeFromErrno(), NULL); - -+#if !defined(O_CLOEXEC) && defined(FD_CLOEXEC) -+ flags = fcntl(fd, F_GETFD); -+ if (flags != -1) { -+ fcntl(fd, F_SETFD, flags | FD_CLOEXEC); -+ } -+#endif -+ - if (appending) - { - if (lseek(fd, 0, SEEK_END) < 0) diff --git a/ports/physfs/portfile.cmake b/ports/physfs/portfile.cmake index b47465de29..fa62bf2f53 100644 --- a/ports/physfs/portfile.cmake +++ b/ports/physfs/portfile.cmake @@ -1,20 +1,8 @@ -set(PHYSFS_VERSION 3.0.2) - -vcpkg_download_distfile(ARCHIVE - URLS "https://icculus.org/physfs/downloads/physfs-${PHYSFS_VERSION}.tar.bz2" - "https://hg.icculus.org/icculus/physfs/archive/release-${PHYSFS_VERSION}.tar.bz2" - FILENAME "physfs-${PHYSFS_VERSION}.tar.bz2" - SHA512 4024b6c3348e0b6fc1036aac330192112dfe17de3e3d14773be9f06e9a062df5a1006869f21162b4e0b584989f463788a35e64186b1913225c073fea62754472 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE "${ARCHIVE}" - REF ${PHYSFS_VERSION} - PATCHES - "001-fix-lzmasdk-arm64-windows.patch" - "002-fix-posix-eintr.patch" # Remove this patch in the next update - "003-fix-posix-cloexec.patch" # Remove this patch in the next update + REPO icculus/physfs + REF eb3383b532c5f74bfeb42ec306ba2cf80eed988c # release-3.2.0 + SHA512 4231b379107a8dbacad18d98c0800bad4a3aae1bdd1db0bd4cf0c89c69bb7590ed14422c77671c28bd7556f606d3ff155ad8432940ce6222340f647f9e73ae8e ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PHYSFS_STATIC) @@ -36,6 +24,7 @@ vcpkg_cmake_configure( vcpkg_cmake_install() vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/PhysFS) vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/ports/physfs/vcpkg.json b/ports/physfs/vcpkg.json index 649fa93849..8fe3db08a7 100644 --- a/ports/physfs/vcpkg.json +++ b/ports/physfs/vcpkg.json @@ -1,14 +1,18 @@ { "name": "physfs", - "version-semver": "3.0.2", - "port-version": 7, + "version-semver": "3.2.0", "description": "a library to provide abstract access to various archives", "homepage": "https://icculus.org/physfs/", + "license": "Zlib", "dependencies": [ { "name": "vcpkg-cmake", "host": true }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "zlib" ] } diff --git a/versions/baseline.json b/versions/baseline.json index 4f98d7f26d..c280c341bd 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5653,8 +5653,8 @@ "port-version": 0 }, "physfs": { - "baseline": "3.0.2", - "port-version": 7 + "baseline": "3.2.0", + "port-version": 0 }, "physx": { "baseline": "4.1.2", diff --git a/versions/p-/physfs.json b/versions/p-/physfs.json index 7961b91513..1dc795a88b 100644 --- a/versions/p-/physfs.json +++ b/versions/p-/physfs.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7d594baf908325d64c1223954daf61842e7be1db", + "version-semver": "3.2.0", + "port-version": 0 + }, { "git-tree": "0acbb8771db07ce3e4641f015189fb48e732bdd5", "version-semver": "3.0.2",