Skip to content

Commit 6fab894

Browse files
committed
Magic file updated to release 5.41 and fixed cross compilation.
1 parent 78ea040 commit 6fab894

File tree

547 files changed

+7705
-3692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

547 files changed

+7705
-3692
lines changed

highlight-wrapper/Makefile

+18-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CURRENT_DIR := $(subst $(SPACE),"\\ ",$(CURDIR))
55

66
LUA_DIR=lua-5.4.2
77
HIGHLIGHT_DIR=highlight
8-
MAGIC_DIR=file-5.39
8+
MAGIC_DIR=file-5.41
99

1010
ifeq ($(BUILT_PRODUCTS_DIR),)
1111
BUILD_DIR=${CURRENT_DIR}/build
@@ -219,19 +219,29 @@ ${BUILD_DIR}/libmagic-x86_64.a:
219219
ifneq ("$(wildcard $(MAGIC_DIR)/Makefile)","")
220220
@${MAKE} -C ${MAGIC_DIR} clean
221221
endif
222-
cd $(MAGIC_DIR) && CFLAGS="${CFLAGS_x86_64}" ./configure --enable-static --disable-zlib --disable-bzlib --disable-xzlib
223-
${MAKE} -C ${MAGIC_DIR}
222+
cd $(MAGIC_DIR) && CFLAGS="${CFLAGS_x86_64}" ./configure --host=x86_64-apple --enable-static --disable-zlib --disable-bzlib --disable-xzlib
223+
# Change the PATH to use the native `file`.
224+
PATH="${BUILD_DIR}:${PATH}" ${MAKE} -C ${MAGIC_DIR}
224225
mv ${MAGIC_DIR}/src/.libs/libmagic.a ${BUILD_DIR}/libmagic-x86_64.a
226+
ifeq ($(NATIVE_ARCH),x86_64)
227+
# Copy the file executable for the current cpu to be used to compile the magic.mgc file for a different cpu target.
228+
cp ${MAGIC_DIR}/src/file ${BUILD_DIR}/file
229+
endif
225230
@echo ""
226231

227232
${BUILD_DIR}/libmagic-arm64.a:
228233
@echo "${bold}Building magic for arm64 platform...${normal}"
229234
ifneq ("$(wildcard $(MAGIC_DIR)/Makefile)","")
230235
@${MAKE} -C ${MAGIC_DIR} clean
231236
endif
232-
cd $(MAGIC_DIR) && CFLAGS="-target arm64-apple-macos11.0" ./configure --host=arm-apple --enable-static --disable-zlib --disable-bzlib --disable-xzlib
233-
${MAKE} -C ${MAGIC_DIR}
237+
cd $(MAGIC_DIR) && CFLAGS="${CFLAGS_arm64}" ./configure --host=arm-apple --enable-static --disable-zlib --disable-bzlib --disable-xzlib
238+
# Change the PATH to use the native `file`.
239+
PATH="${BUILD_DIR}:${PATH}" ${MAKE} -C ${MAGIC_DIR}
234240
mv ${MAGIC_DIR}/src/.libs/libmagic.a ${BUILD_DIR}/libmagic-arm64.a
241+
ifeq ($(NATIVE_ARCH),arm64)
242+
# Copy the file executable for the current cpu to be used to compile the magic.mgc file for a different cpu target.
243+
cp ${MAGIC_DIR}/src/file ${BUILD_DIR}/file
244+
endif
235245
@echo ""
236246

237247
${BUILD_DIR}/libmagic.a: ${magic_libraries}
@@ -246,6 +256,7 @@ endif
246256
@echo ""
247257

248258
${BUILD_DIR}/magic.mgc:
259+
@echo "${bold}Creating magic.mgc...${normal}"
249260
file -C -m magic
250261
mv magic.mgc ${BUILD_DIR}/
251262

@@ -338,7 +349,8 @@ else
338349
cp ${BUILD_DIR}/libwrapper_highlight-${NATIVE_ARCH}.dylib ${BUILD_DIR}/libwrapper_highlight.dylib
339350
endif
340351

341-
all: check_arch build_dir lua highlight magic magic_db goutils highlight-wrapper
352+
all: check_arch build_dir magic magic_db lua highlight goutils highlight-wrapper
353+
install: check_arch build_dir magic magic_db lua highlight goutils highlight-wrapper
342354

343355
clean_intermediate: clean_lua clean_highlight clean_magic clean_goutils clean_highlight-wrapper
344356

highlight-wrapper/file-5.39/README

-159
This file was deleted.

highlight-wrapper/file-5.39/magic/Magdir/algol68

-19
This file was deleted.

highlight-wrapper/file-5.39/magic/Magdir/amigaos

-87
This file was deleted.

highlight-wrapper/file-5.39/magic/Magdir/citrus

-8
This file was deleted.

0 commit comments

Comments
 (0)