From 9968a2d6394d8d1c1724e78068a11490d790c20f Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 24 Sep 2013 02:17:00 -0700 Subject: [PATCH] Recreate ios.mk (creates .deb) out of rules.old. --- ios.mk | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ rules.old | 37 ------------------------------------- 2 files changed, 48 insertions(+), 37 deletions(-) create mode 100644 ios.mk diff --git a/ios.mk b/ios.mk new file mode 100644 index 0000000..4baa93d --- /dev/null +++ b/ios.mk @@ -0,0 +1,48 @@ +srcdir := . + +sed := sed +git := git + +arch := iphoneos-arm + +#ifneq ($(git),) +version := $(shell $(git) describe --always --tags --dirty="+" --match="v*" | $(sed) -e 's@-\([^-]*\)-\([^-]*\)$$@+\1.\2@;s@^v@@;s@%@~@g') +#else +#version := @PACKAGE_VERSION@ +#endif + +deb := $(shell grep ^Package: $(srcdir)/control.in | cut -d ' ' -f 2-)_$(shell grep ^Version: $(srcdir)/control.in | cut -d ' ' -f 2 | $(sed) -e 's/\#/$(version)/')_$(arch).deb + +binary := Cycript_/cycript + +$(deb): $(binary) $(patsubst %,Cycript_/libcycript%dylib,. -any. -sim. -sys.) control + rm -rf package + mkdir -p package/DEBIAN + cp -pR control package/DEBIAN + mkdir -p package/usr/{bin,lib} + cp -pR $(filter %.dylib,$^) package/usr/lib + cp -pR $< package/usr/bin + dpkg-deb -b package $(deb) + +control: control.tmp + [[ -e control ]] && diff control control.tmp &>/dev/null || cp -pRf control.tmp control + +# XXX: this is now all broken +depends := apr-lib, readline, libffi (>= 1:3.0.10-5), adv-cmds +ifeq ($(depends)$(dll),dylib) +control.tmp: control.in $(binary) .libs/$(lib)cycript.dylib + $(sed) -e 's/&/'"$$(dpkg-query -S $$(otool -lah $(binary) .libs/*.dylib | grep dylib | grep -v ':$$' | $(sed) -e 's/^ *name //;s/ (offset [0-9]*)$$//' | sort -u) 2>/dev/null | $(sed) -e 's/:.*//; /^cycript$$/ d; s/$$/,/' | sort -u | tr '\n' ' ')"'/;s/, $$//;s/#/$(version)/;s/%/$(arch)/' $< >$@ +else +ifeq ($(depends)$(dll),so) +control.tmp: control.in $(binary) .libs/$(lib)cycript.so + $(sed) -e 's/&/'"$$(dpkg-query -S $$(ldd $(binary) $(lib)cycript.so | $(sed) -e '/:$$/ d; s/^[ \t]*\([^ ]* => \)\?\([^ ]*\) .*/\2/' | sort -u) 2>/dev/null | $(sed) -e 's/:.*//; /^cycript$$/ d; s/$$/,/' | sort -u | tr '\n' ' ')"'/;s/, $$//;s/#/$(version)/;s/%/$(arch)/' $< >$@ +else +control.tmp: control.in + $(sed) -e 's/&/$(depends)/;s/,$$//;s/#/$(version)/;s/%/$(arch)/' $< >$@ +endif +endif + +clean:: + rm -rf control + +.PHONY: clean diff --git a/rules.old b/rules.old index 6ae996a..a7cb7b8 100644 --- a/rules.old +++ b/rules.old @@ -2,49 +2,12 @@ PACKAGE_TARNAME := @PACKAGE_TARNAME@ CY_ATTACH_GROUP := @CY_ATTACH_GROUP@ -ifneq ($(git),) -version := $(shell $(git) describe --always --tags --dirty="+" --match="v*" | $(sed) -e 's@-\([^-]*\)-\([^-]*\)$$@+\1.\2@;s@^v@@') -else -version := @PACKAGE_VERSION@ -endif - lib := lib dll := @SO@ depends ?= -ifdef arch deb := $(shell grep ^Package: $(srcdir)/control.in | cut -d ' ' -f 2-)_$(shell grep ^Version: $(srcdir)/control.in | cut -d ' ' -f 2 | $(sed) -e 's/\#/$(version)/')_$(arch).deb -ifeq ($(depends)$(dll),dylib) -control.tmp: control.in .libs/cycript .libs/$(lib)cycript.dylib - $(sed) -e 's/&/'"$$(dpkg-query -S $$(otool -lah .libs/cycript .libs/*.dylib | grep dylib | grep -v ':$$' | $(sed) -e 's/^ *name //;s/ (offset [0-9]*)$$//' | sort -u) 2>/dev/null | $(sed) -e 's/:.*//; /^cycript$$/ d; s/$$/,/' | sort -u | tr '\n' ' ')"'/;s/, $$//;s/#/$(version)/;s/%/$(arch)/' $< >$@ -else -ifeq ($(depends)$(dll),so) -control.tmp: control.in .libs/cycript .libs/$(lib)cycript.so - $(sed) -e 's/&/'"$$(dpkg-query -S $$(ldd cycript $(lib)cycript.so | $(sed) -e '/:$$/ d; s/^[ \t]*\([^ ]* => \)\?\([^ ]*\) .*/\2/' | sort -u) 2>/dev/null | $(sed) -e 's/:.*//; /^cycript$$/ d; s/$$/,/' | sort -u | tr '\n' ' ')"'/;s/, $$//;s/#/$(version)/;s/%/$(arch)/' $< >$@ -else -control.tmp: control.in - $(sed) -e 's/&/$(depends)/;s/,$$//;s/#/$(version)/;s/%/$(arch)/' $< >$@ -endif -endif - -control: control.tmp - [[ -e control ]] && diff control control.tmp &>/dev/null || cp -pRf control.tmp control - -$(deb): $(all) control - rm -rf package - mkdir -p package/DEBIAN - cp -pR control package/DEBIAN - mkdir -p package/usr/{bin,lib,sbin} - cp -pR .libs/$(lib)cycript.0.$(dll) package/usr/lib - cp -pR .libs/$(lib)cycript.$(dll) package/usr/lib - cp -pR .libs/cycript package/usr/bin - dpkg-deb -b package $(deb) -endif - -clean:: - rm -rf control - libcycript.la: $(code) $(ldid) .libs/$(lib)cycript.$(dll) -- 2.45.2