Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the libmagic vcpkg port overlay to version 5.45. (#5332) #5418

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ jobs:
timeout: 120
bootstrap_args: '--enable-azure'

ci_manylinux:
uses: ./.github/workflows/ci-linux_mac.yml
with:
ci_backend: MANYLINUX
matrix_image: ubuntu-20.04
matrix_compiler_cflags: "-lrt"
matrix_compiler_cxxflags: "-lrt"
timeout: 120
bootstrap_args: '--enable-serialization'
manylinux: true
#ci_manylinux:
# uses: ./.github/workflows/ci-linux_mac.yml
# with:
# ci_backend: MANYLINUX
# matrix_image: ubuntu-20.04
# matrix_compiler_cflags: "-lrt"
# matrix_compiler_cxxflags: "-lrt"
# timeout: 120
# bootstrap_args: '--enable-serialization'
# manylinux: true

ci_msvc:
uses: ./.github/workflows/build-windows.yml
Expand Down Expand Up @@ -145,7 +145,6 @@ jobs:
ci7,
ci8,
ci9,
ci_manylinux,
ci_msvc,
backward_compatibility,
standalone
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ jobs:
- platform: windows-x86_64
os: windows-2019
triplet: x64-windows-release
- platform: linux-x86_64
os: ubuntu-20.04
manylinux: true
triplet: x64-linux-release
- platform: linux-x86_64-noavx2
os: ubuntu-20.04
cmake_args: -DCOMPILER_SUPPORTS_AVX2=OFF
triplet: x64-linux-release
manylinux: true
#- platform: linux-x86_64
# os: ubuntu-20.04
# manylinux: true
# triplet: x64-linux-release
#- platform: linux-x86_64-noavx2
# os: ubuntu-20.04
# cmake_args: -DCOMPILER_SUPPORTS_AVX2=OFF
# triplet: x64-linux-release
# manylinux: true
- platform: macos-x86_64
os: macos-12
MACOSX_DEPLOYMENT_TARGET: 11
Expand Down
2 changes: 1 addition & 1 deletion ports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ After copying the port, add an entry to the table below. You should also contrib

| Port | Reason |
|----------------------------|---------------------------------------------------------------------------------------------------------|
| `libmagic` | Updating to the upstream port deferred due to failures. |
| `libmagic` | Using a custom CMake-based port that is not accepted upstream. |
| `pcre2` | To be removed alongside libmagic. |
| `azure-storage-common-cpp` | Patching to disable default features on libxml2 (https://github.com/Azure/azure-sdk-for-cpp/pull/5221). |
| `libfaketime` | Port does not yet exist upstream |
Expand Down
8 changes: 4 additions & 4 deletions ports/libmagic/0003-Fix-WIN32-macro-checks.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ index 299ac0c..2c365a6 100644
#define PATHSEP ':'
@@ -103,7 +103,7 @@

#define private static
#define file_private static

-#if HAVE_VISIBILITY && !defined(WIN32)
+#if HAVE_VISIBILITY && !defined(_WIN32)
#define public __attribute__ ((__visibility__("default")))
#ifndef protected
#define protected __attribute__ ((__visibility__("hidden")))
#define file_public __attribute__ ((__visibility__("default")))
#ifndef file_protected
#define file_protected __attribute__ ((__visibility__("hidden")))
--
2.29.2.windows.2

Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ diff --git a/src/file.h b/src/file.h
index 0332506..4aa9f60 100644
--- a/src/file.h
+++ b/src/file.h
@@ -88,6 +88,7 @@
@@ -88,7 +88,8 @@
/* Do this here and now, because struct stat gets re-defined on solaris */
#include <sys/stat.h>
#include <stdarg.h>
+#include <dirent.h>

#define ENABLE_CONDITIONALS

#include <locale.h>
#if defined(HAVE_XLOCALE_H)
#include <xlocale.h>
#endif
--
2.29.2.windows.2

2 changes: 1 addition & 1 deletion ports/libmagic/0006-Remove-Wrap-POSIX-headers.patch
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ index 3ab52d1..fc48d84 100644
--- a/src/pread.c
+++ b/src/pread.c
@@ -3,7 +3,9 @@
FILE_RCSID("@(#)$File: pread.c,v 1.2 2013/04/02 16:23:07 christos Exp $")
FILE_RCSID("@(#)$File: pread.c,v 1.5 2022/09/24 20:30:13 christos Exp $")
#endif /* lint */
#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
Expand Down
25 changes: 0 additions & 25 deletions ports/libmagic/0009-No-fcntl-in-magic.c.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index 5204f20..7244841 100644
#undef HAVE_MAJOR
-#ifdef S_IFLNK
+#if S_IFLNK != 0
private int
file_private int
bad_link(struct magic_set *ms, int err, char *buf)
{
@@ -108,7 +108,7 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ diff --git a/src/funcs.c b/src/funcs.c
index b926625..b585486 100644
--- a/src/funcs.c
+++ b/src/funcs.c
@@ -809,6 +809,7 @@ file_print_guid(char *str, size_t len, const uint64_t *guid)
g->data4[6], g->data4[7]);
@@ -888,5 +888,6 @@
}

+#ifndef _WIN32
protected int
file_protected int
file_pipe_closexec(int *fds)
{
@@ -827,6 +828,7 @@ protected int
file_clear_closexec(int fd) {
return fcntl(fd, F_SETFD, 0);
@@ -914,5 +915,6 @@
#endif
}
+#endif

protected char *
file_protected char *
file_strtrim(char *str)
--
2.29.2.windows.2
Expand Down
38 changes: 0 additions & 38 deletions ports/libmagic/0014-Define-POSIX-macros-if-missing.patch

This file was deleted.

4 changes: 2 additions & 2 deletions ports/libmagic/0015-MSYS2-Remove-ioctl-call.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ index 33ce2bc..f172eda 100644
sread(int fd, void *buf, size_t n, int canbepipe __attribute__((__unused__)))
{
ssize_t rv;
-#ifdef FIONREAD
-#if defined(FIONREAD) && !defined(__MINGW32__)
+#if defined(FIONREAD) && !defined(__MINGW32__) && !defined(WIN32)
int t = 0;
#endif
Expand All @@ -20,7 +20,7 @@ index 33ce2bc..f172eda 100644
if (fd == STDIN_FILENO)
goto nocheck;

-#ifdef FIONREAD
-#if defined(FIONREAD) && !defined(__MINGW32__)
+#if defined(FIONREAD) && !defined(__MINGW32__) && !defined(WIN32)
if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) {
#ifdef FD_ZERO
Expand Down
1 change: 1 addition & 0 deletions ports/libmagic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ list(APPEND LIBMAGIC_SOURCE_FILES
${LIBMAGIC_SOURCE_DIR}/fsmagic.c
${LIBMAGIC_SOURCE_DIR}/funcs.c
${LIBMAGIC_SOURCE_DIR}/is_json.c
${LIBMAGIC_SOURCE_DIR}/is_simh.c
${LIBMAGIC_SOURCE_DIR}/is_tar.c
${LIBMAGIC_SOURCE_DIR}/magic.c
${LIBMAGIC_SOURCE_DIR}/print.c
Expand Down
6 changes: 2 additions & 4 deletions ports/libmagic/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ if(VCPKG_TARGET_IS_WINDOWS)
"0006-Remove-Wrap-POSIX-headers.patch"
"0007-Substitute-unistd-macros-for-MSVC.patch"
"0008-Add-FILENO-defines.patch"
"0009-No-fcntl-in-magic.c.patch"
"0010-Properly-check-for-the-presence-of-bitmasks.patch"
"0011-Remove-pipe-related-functions-in-funcs.c.patch"
"0014-Define-POSIX-macros-if-missing.patch"
"0015-MSYS2-Remove-ioctl-call.patch"
)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO file/file
REF FILE5_40
SHA512 d76bfe5326e1b40368e055c2e049a24b4ffdbd727371f4f3aa1dd3f53787d16b88550b3cc71ecf02151e2fb3e567eb2598e4707badab8c391eb71113c2dcc319
REF FILE5_45
SHA512 fdd4c5d13d5ea1d25686c76d8ebc3252c54040c4871e3f0f623c4548b3841795d4e36050292a9453eedf0fbf932573890e9d6ac9fa63ccf577215598ae84b9ea
HEAD_REF master
PATCHES ${PATCHES}
)
Expand Down
2 changes: 1 addition & 1 deletion ports/libmagic/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libmagic",
"version-string": "5.40",
"version-string": "5.45",
"port-version": 1,
"description": "This library can be used to classify files according to magic number tests.",
"homepage": "https://github.com/file/file",
Expand Down
Loading