Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
[makefile,{pre,post}{inst,rm}] this really sucks 😕
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Feb 26, 2018
1 parent 57eb760 commit 5e5395c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ endif
include $(THEOS_MAKE_PATH)/aggregate.mk

after-stage::
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/DEBIAN \
$(THEOS_STAGING_DIR)/Library/Frameworks \
$(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END)
$(ECHO_NOTHING)cp preinst $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END)
ifneq ($(PACKAGE_BUILDNAME)$(IMAGENT),debug)
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END)
$(ECHO_NOTHING)cp postinst postrm $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END)
endif

$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END)
$(ECHO_NOTHING)cp Resources/*.png $(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END)
$(ECHO_NOTHING)ln -s /usr/lib/TypeStatus/TypeStatusProvider.framework $(THEOS_STAGING_DIR)/Library/Frameworks/TypeStatusProvider.framework$(ECHO_END)
1 change: 1 addition & 0 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ TypeStatusProvider_FRAMEWORKS = MobileCoreServices
TypeStatusProvider_PRIVATE_FRAMEWORKS = AppSupport
TypeStatusProvider_EXTRA_FRAMEWORKS = Cephei CydiaSubstrate
TypeStatusProvider_LIBRARIES = rocketbootstrap
TypeStatusProvider_INSTALL_PATH = /usr/lib/TypeStatus

include $(THEOS)/makefiles/framework.mk

Expand Down
9 changes: 2 additions & 7 deletions postinst
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/bin/bash
set -e

# relaunch imagent so we get injected into it
launchctl stop com.apple.imagent

# create our providers directory and move it to the stash
if [[ -x /usr/libexec/cydia/move.sh ]]; then
/usr/libexec/cydia/move.sh /Library/TypeStatus
fi

mkdir -p /Library/TypeStatus/Providers
6 changes: 5 additions & 1 deletion postrm
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash
set -e

# relaunch imagent so we get injected into it, but not when we’re upgrading
# or it’ll get stopped again by postinst
if [[ "$1" != "upgrade" ]]; then
if [[ $1 != upgrade ]]; then
launchctl stop com.apple.imagent
else
:
fi
18 changes: 18 additions & 0 deletions preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e

# if /Library/TypeStatus exists and /usr/lib/TypeStatus/Providers doesn’t yet, move it over. else if
# cydia’s move script exists, use it to create a stashed providers dir. else, just create it ourselves
if [[ -d /Library/TypeStatus || -h /Library/TypeStatus ]] && [[ ! -d /usr/lib/TypeStatus/Providers ]]; then
mv /Library/TypeStatus /usr/lib/TypeStatus
rm -rf /Library/TypeStatus
elif [[ -x /usr/libexec/cydia/move.sh ]]; then
bash /usr/libexec/cydia/move.sh /usr/lib/TypeStatus
else
mkdir -p /usr/lib/TypeStatus/Providers
fi

# if /Library/TypeStatus isn’t a symlink, make it be one now
if [[ ! -h /Library/TypeStatus ]]; then
ln -s /usr/lib/TypeStatus /Library/TypeStatus
fi

0 comments on commit 5e5395c

Please sign in to comment.