Skip to content

Commit

Permalink
Magic file updated to release 5.41 and fixed cross compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbarex committed Dec 27, 2021
1 parent 78ea040 commit 6fab894
Show file tree
Hide file tree
Showing 547 changed files with 7,705 additions and 3,692 deletions.
24 changes: 18 additions & 6 deletions highlight-wrapper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CURRENT_DIR := $(subst $(SPACE),"\\ ",$(CURDIR))

LUA_DIR=lua-5.4.2
HIGHLIGHT_DIR=highlight
MAGIC_DIR=file-5.39
MAGIC_DIR=file-5.41

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

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

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

${BUILD_DIR}/magic.mgc:
@echo "${bold}Creating magic.mgc...${normal}"
file -C -m magic
mv magic.mgc ${BUILD_DIR}/

Expand Down Expand Up @@ -338,7 +349,8 @@ else
cp ${BUILD_DIR}/libwrapper_highlight-${NATIVE_ARCH}.dylib ${BUILD_DIR}/libwrapper_highlight.dylib
endif

all: check_arch build_dir lua highlight magic magic_db goutils highlight-wrapper
all: check_arch build_dir magic magic_db lua highlight goutils highlight-wrapper
install: check_arch build_dir magic magic_db lua highlight goutils highlight-wrapper

clean_intermediate: clean_lua clean_highlight clean_magic clean_goutils clean_highlight-wrapper

Expand Down
159 changes: 0 additions & 159 deletions highlight-wrapper/file-5.39/README

This file was deleted.

19 changes: 0 additions & 19 deletions highlight-wrapper/file-5.39/magic/Magdir/algol68

This file was deleted.

87 changes: 0 additions & 87 deletions highlight-wrapper/file-5.39/magic/Magdir/amigaos

This file was deleted.

8 changes: 0 additions & 8 deletions highlight-wrapper/file-5.39/magic/Magdir/citrus

This file was deleted.

Loading

0 comments on commit 6fab894

Please sign in to comment.