Files
magic/appimage/Makefile
T
Donn 2820aa49e2 Add AppImage Building Capabilities
(Take two)

+ Adds a GitHub Actions flow that builds an AppImage (see AppImages.org) that can produce a monolithic magic binary
~ Fix a portability issue in tcltk/magic.sh.in

This binary should theoretically work on any Linux distro with Glibc 2.3+ and Cairo 1.8+, which is any up to date distro in the last decade.
2022-05-03 08:28:53 -04:00

36 lines
849 B
Makefile

all: appimage
RESOURCES = $(shell find rsc/ -type f)
ARCH = $(shell uname -i)
APPIMAGE = Magic-$(ARCH).AppImage
prefix.tar.gz: Dockerfile
docker build -t magic_build -f ./Dockerfile ..
id=$$(docker create magic_build) ; \
docker cp $$id:/prefix.tar.gz ./prefix.tar.gz ; \
docker rm -v $$id
prefix: prefix.tar.gz Makefile
rm -rf $@
mkdir -p $@
tar -xf $< -C $@ .
mkdir -p $@/lib/tcl8.6.12
cp -r $@/lib/tcl8.6 $@/lib/tcl8.6.12/library
appimagetool:
curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage > ./appimagetool
chmod +x ./appimagetool
appimage: $(APPIMAGE)
$(APPIMAGE): prefix appimagetool $(RESOURCES)
cp $(RESOURCES) ./prefix
./appimagetool prefix
PREFIX ?= /usr/local
install:
install $(APPIMAGE) $(PREFIX)/bin/magic
.PHONY: clean
clean:
rm -f prefix.tar.gz
rm -rf prefix