Skip to content

Commit

Permalink
Refactor the build process [1/2].
Browse files Browse the repository at this point in the history
The data located in this module comes from, or is associated with,
one of two main sources: The zsh package itself, and the bits of glue
that make it work under magisk (Makefile, installer script, android specific
configs, etc).  Instead of lumping them together and committing random
prebuilt zsh stuff, the two are now separated until its time to build
the actual module, when one is overlaid on the other.
  • Loading branch information
partcyborg committed Aug 5, 2019
1 parent 57bb773 commit e0cb91d
Show file tree
Hide file tree
Showing 332 changed files with 38 additions and 27,865 deletions.
57 changes: 36 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
MODVERSION := 1.0
MODVERSION := $(shell sed -n 's/version=\(.*\)/\1/p' zsh_arm64/module.prop)
MOD := zsh_arm64
ZIP := $(MOD)-$(MODVERSION).zip
#ZIP := $(MOD)-$(MODVERSION)-$(shell date +%m-%d).zip

VCODE := $(subst .,,$(MODVERSION))

DEPS := $(shell find $(MOD) -type f)
STAGEDEPS := $(DEPS:$(MOD)/%=$(STAGE)/%)

ZSHVERSION := 5.7
SRCDIR=zsh-$(ZSHVERSION)
SRCURL := https://sourceforge.net/projects/zsh/files/zsh/$(ZSHVERSION)/zsh-$(ZSHVERSION).tar.xz/download
ARCHIVE := $(SRCDIR).tar.gz
ARCHIVE := $(SRCDIR).tar.xz
STAGE := stage

CURDIR := $(shell pwd)
PROCS := $(shell nproc)

.PHONY:

all: out/$(ZIP)

build/work/$(ARCHIVE):
Expand All @@ -27,52 +32,62 @@ build/work/$(SRCDIR)/Makefile: build/work/$(ARCHIVE)
./Util/preconfig; \
cp ../../config.modules .; \
./configure \
--host=aarch64-linux-gnu \
--bindir=/system/xbin \
--sbindir=/system/xbin \
--libexecdir=/system/xbin \
--datarootdir=/system/usr/share \
--prefix=/system \
--disable-dynamic \
--disable-dynamic-nss \
--disable-gdbm \
--disable-restricted-r \
--disable-runhelpdir \
--enable-cppflags=-static \
--enable-ldflags=-static \
--enable-zshenv=/system/etc/zsh/zshenv \
--enable-zprofile=/system/etc/zsh/zprofile \
--enable-zlogin=/system/etc/zsh/zlogin \
--enable-zlogout=/system/etc/zsh/zlogout \
--disable-dynamic \
--disable-restricted-r \
--disable-dynamic-nss \
--disable-gdbm \
--enable-multibyte \
--enable-pcre \
--enable-site-fndir=/system/usr/share/zsh/functions \
--enable-fndir=/system/usr/share/zsh/functions \
--disable-runhelpdir \
--sysconfdir=/system/etc \
--enable-function-subdirs \
--enable-scriptdir=/system/usr/share/zsh/scripts \
--enable-site-scriptdir=/system/usr/share/zsh/scripts \
--enable-etcdir=/system/etc \
--enable-libs=-lpthread
--enable-libs=-lpthread \
--host=aarch64-linux-gnu \
--libexecdir=/system/xbin \
--prefix=/system \
--sbindir=/system/xbin \
--sysconfdir=/system/etc

# --disable-runhelpdir \
build/work/$(SRCDIR)/Src/zsh: build/work/$(SRCDIR)/Makefile $(DEPS)
cd $(CURDIR)/build/work/$(SRCDIR); \
make -j$(PROCS)


$(MOD)/system/xbin/zsh: build/work/$(SRCDIR)/Src/zsh
$(STAGE)/%: build/work/$(SRCDIR)/Src/zsh
cd $(CURDIR)/build/work/$(SRCDIR); \
make install DESTDIR=$(CURDIR)/$(MOD); \
chmod 755 $(CURDIR)/$(MOD)/system/xbin/*
make install DESTDIR=$(CURDIR)/$(STAGE); \
chmod 755 $(CURDIR)/$(STAGE)/system/xbin/*

$(STAGE)/%: $(MOD)/%
mkdir -p $(@D)
cp $< $@

out/$(ZIP): $(MOD)/system/xbin/zsh
cd $(MOD); \
out/$(ZIP): $(STAGE)/%
cd $(STAGE); \
rm -rf system/usr/share/man; \
rm system/xbin/zsh-* system/xbin/zsh.old; \
sed -i "s/version=.*/version=$(MODVERSION)/" module.prop; \
sed -i "s/versionCode=.*/versionCode=$(VCODE)/" module.prop; \
zip -r ../out/$(ZIP) $(notdir $(wildcard $(MOD)/*))
zip -r ../out/$(ZIP) $(notdir $(wildcard $(STAGE)/*))

clean:
rm -f out/*.zip
rm -rf build/work/*
rm -rf $(MOD)/system/xbin/zsh $(MOD)/system/usr/share/zsh
rm -rf $(STAGE)/*

distclean: clean
rm -f out/*.zip

44 changes: 0 additions & 44 deletions build/build-zsh.sh

This file was deleted.

4 changes: 2 additions & 2 deletions zsh_arm64/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=zsh_arm64
name=ZSH for Arm
version=1.0
versionCode=10
version=1.1
versionCode=11
[email protected]
description=Zsh is a modern *nix shell with many advanced features.
minMagisk=1700
37 changes: 0 additions & 37 deletions zsh_arm64/system/etc/zsh/newuser.zshrc.recommended

This file was deleted.

8 changes: 0 additions & 8 deletions zsh_arm64/system/usr/share/zsh/5.7/scripts/newuser

This file was deleted.

36 changes: 0 additions & 36 deletions zsh_arm64/system/usr/share/zsh/functions/_add-zle-hook-widget

This file was deleted.

24 changes: 0 additions & 24 deletions zsh_arm64/system/usr/share/zsh/functions/_add-zsh-hook

This file was deleted.

24 changes: 0 additions & 24 deletions zsh_arm64/system/usr/share/zsh/functions/_alias

This file was deleted.

19 changes: 0 additions & 19 deletions zsh_arm64/system/usr/share/zsh/functions/_aliases

This file was deleted.

43 changes: 0 additions & 43 deletions zsh_arm64/system/usr/share/zsh/functions/_all_labels

This file was deleted.

Loading

0 comments on commit e0cb91d

Please sign in to comment.