frida: add subpackages frida-python and frida-tools
Needs some more testing, and postinst scripts to install python dependencies.
This commit is contained in:
parent
d6e3c98a13
commit
f7e7c6db22
139
root-packages/frida-server/0001-Makefile.linux.mk.patch
Normal file
139
root-packages/frida-server/0001-Makefile.linux.mk.patch
Normal file
@ -0,0 +1,139 @@
|
||||
--- ../Makefile.linux.mk.orig 2020-02-23 10:58:44.621155388 +0100
|
||||
+++ ./Makefile.linux.mk 2020-02-23 11:19:08.482323493 +0100
|
||||
@@ -358,6 +358,10 @@
|
||||
python-linux-x86-thin: build/tmp_thin-linux-x86/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Linux/x86 without cross-arch support
|
||||
python-linux-x86_64-thin: build/tmp_thin-linux-x86_64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Linux/x86-64 without cross-arch support
|
||||
python-linux-arm64: build/tmp_thin-linux-arm64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Linux/ARM64
|
||||
+python-android-x86: build/tmp_thin-android-x86/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/x86
|
||||
+python-android-x86_64: build/tmp_thin-android-x86_64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/x86_64
|
||||
+python-android-arm: build/tmp_thin-android-arm/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/ARM
|
||||
+python-android-arm64: build/tmp_thin-android-arm64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings for Android/ARM64
|
||||
|
||||
define make-python-rule
|
||||
build/$2-%/frida-$$(PYTHON_NAME)/.frida-stamp: build/.frida-python-submodule-stamp build/$1-%/lib/pkgconfig/frida-core-1.0.pc
|
||||
@@ -404,13 +408,32 @@
|
||||
export PYTHONPATH="$(shell pwd)/build/frida_thin-linux-arm64/lib/$(PYTHON_NAME)/site-packages" \
|
||||
&& cd frida-python \
|
||||
&& ${PYTHON} -m unittest discover
|
||||
-
|
||||
+check-python-android-x86: build/tmp_thin-android-x86/frida-$(PYTHON_NAME)/.frida-stamp ##@python Test Python bindings for Android/x86
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-x86/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-python \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
+check-python-android-x86_64: build/tmp_thin-android-x86_64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Test Python bindings for Android/x86_64
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-x86_64/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-python \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
+check-python-android-arm: build/tmp_thin-android-arm/frida-$(PYTHON_NAME)/.frida-stamp ##@python Test Python bindings for Android/ARM
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-arm/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-python \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
+check-python-android-arm64: build/tmp_thin-android-arm64/frida-$(PYTHON_NAME)/.frida-stamp ##@python Test Python bindings for Android/ARM64
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-arm64/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-python \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
|
||||
node-linux-x86: build/frida-linux-x86/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Linux/x86
|
||||
node-linux-x86_64: build/frida-linux-x86_64/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Linux/x86-64
|
||||
node-linux-x86-thin: build/frida_thin-linux-x86/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Linux/x86 without cross-arch support
|
||||
node-linux-x86_64-thin: build/frida_thin-linux-x86_64/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Linux/x86-64 without cross-arch support
|
||||
node-linux-arm64: build/frida_thin-linux-arm64/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Linux/ARM64
|
||||
+node-android-x86: build/frida_thin-android-x86/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Android/x86
|
||||
+node-android-x86_64: build/frida_thin-android-x86_64/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Android/x86_64
|
||||
+node-android-arm: build/frida_thin-android-arm/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Android/ARM
|
||||
+node-android-arm64: build/frida_thin-android-arm64/lib/node_modules/frida build/.frida-node-submodule-stamp ##@node Build Node.js bindings for Android/ARM64
|
||||
|
||||
define make-node-rule
|
||||
build/$1-%/lib/node_modules/frida: build/$1-%/lib/pkgconfig/frida-core-1.0.pc build/.frida-node-submodule-stamp
|
||||
@@ -455,6 +478,14 @@
|
||||
$(call run-node-tests,frida_thin-linux-x86_64,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM))
|
||||
check-node-linux-arm64: node-linux-arm64 ##@node Test Node.js bindings for Linux/ARM64
|
||||
$(call run-node-tests,frida_thin-linux-arm64,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM))
|
||||
+check-node-android-x86: node-android-x86 ##@node Test Node.js bindings for Android/x86
|
||||
+ $(call run-node-tests,frida_thin-android-x86,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM))
|
||||
+check-node-android-x86_64: node-android-x86_64 ##@node Test Node.js bindings for Android/x86_64
|
||||
+ $(call run-node-tests,frida_thin-android-x86_64,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM))
|
||||
+check-node-android-arm: node-android-arm ##@node Test Node.js bindings for Android/ARM
|
||||
+ $(call run-node-tests,frida_thin-android-arm,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM))
|
||||
+check-node-android-arm64: node-android-arm64 ##@node Test Node.js bindings for Android/ARM64
|
||||
+ $(call run-node-tests,frida_thin-android-arm64,$(FRIDA),$(NODE_BIN_DIR),$(NODE),$(NPM))
|
||||
|
||||
|
||||
tools-linux-x86: build/tmp-linux-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/x86
|
||||
@@ -462,6 +493,10 @@
|
||||
tools-linux-x86-thin: build/tmp_thin-linux-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/x86 without cross-arch support
|
||||
tools-linux-x86_64-thin: build/tmp_thin-linux-x86_64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/x86-64 without cross-arch support
|
||||
tools-linux-arm64: build/tmp_thin-linux-arm64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Linux/ARM64
|
||||
+tools-android-x86: build/tmp_thin-android-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/x86
|
||||
+tools-android-x86_64: build/tmp_thin-android-x86_64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/x86_64
|
||||
+tools-android-arm: build/tmp_thin-android-arm/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/ARM
|
||||
+tools-android-arm64: build/tmp_thin-android-arm64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools for Android/ARM64
|
||||
|
||||
define make-tools-rule
|
||||
build/$2-%/frida-tools-$$(PYTHON_NAME)/.frida-stamp: build/.frida-tools-submodule-stamp build/$2-%/frida-$$(PYTHON_NAME)/.frida-stamp
|
||||
@@ -507,6 +542,23 @@
|
||||
export PYTHONPATH="$(shell pwd)/build/frida_thin-linux-arm64/lib/$(PYTHON_NAME)/site-packages" \
|
||||
&& cd frida-tools \
|
||||
&& ${PYTHON} -m unittest discover
|
||||
+check-tools-android-x86: build/tmp_thin-android-x86/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Test CLI tools for Android/x86
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-x86/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-tools \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
+check-tools-android-x86_64: build/tmp_thin-android-x86_64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Test CLI tools for Android/x86_64
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-x86_64/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-tools \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
+check-tools-android-arm: build/tmp_thin-android-arm/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Test CLI tools for Android/ARM
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-arm/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-tools \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
+check-tools-android-arm64: build/tmp_thin-android-arm64/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Test CLI tools for Android/ARM64
|
||||
+ export PYTHONPATH="$(shell pwd)/build/frida_thin-android-arm64/lib/$(PYTHON_NAME)/site-packages" \
|
||||
+ && cd frida-tools \
|
||||
+ && ${PYTHON} -m unittest discover
|
||||
+
|
||||
|
||||
|
||||
.PHONY: \
|
||||
@@ -536,27 +588,41 @@
|
||||
check-core-linux-x86 check-core-linux-x86_64 \
|
||||
check-core-linux-x86-thin check-core-linux-x86_64-thin \
|
||||
check-core-linux-arm64 \
|
||||
+ check-core-android-x86 check-core-android-x86_64 \
|
||||
+ check-core-android-arm check-core-android-arm64 \
|
||||
frida-core-update-submodule-stamp \
|
||||
python-linux-x86 python-linux-x86_64 \
|
||||
python-linux-x86-thin python-linux-x86_64-thin \
|
||||
python-linux-arm64 \
|
||||
+ python-android-x86 python-android-x86_64 \
|
||||
+ python-android-arm python-android-arm64 \
|
||||
check-python-linux-x86 check-python-linux-x86_64 \
|
||||
check-python-linux-x86-thin check-python-linux-x86_64-thin \
|
||||
check-python-linux-arm64 \
|
||||
+ check-python-android-x86 check-python-android-x86_64 \
|
||||
+ check-python-android-arm check-python-android-arm64 \
|
||||
frida-python-update-submodule-stamp \
|
||||
node-linux-x86 node-linux-x86_64 \
|
||||
node-linux-x86-thin node-linux-x86_64-thin \
|
||||
node-linux-arm64 \
|
||||
+ node-android-x86 node-android-x86_64 \
|
||||
+ node-android-arm node-android-arm64 \
|
||||
check-node-linux-x86 check-node-linux-x86_64 \
|
||||
check-node-linux-x86-thin check-node-linux-x86_64-thin \
|
||||
check-node-linux-arm64 \
|
||||
+ check-node-android-x86 check-node-android-x86_64 \
|
||||
+ check-node-android-arm check-node-android-arm64 \
|
||||
frida-node-update-submodule-stamp \
|
||||
tools-linux-x86 tools-linux-x86_64 \
|
||||
tools-linux-x86-thin tools-linux-x86_64-thin \
|
||||
tools-linux-arm64 \
|
||||
+ tools-android-x86 tools-android-x86_64 \
|
||||
+ tools-android-arm tools-android-arm64 \
|
||||
check-tools-linux-x86 check-tools-linux-x86_64 \
|
||||
check-tools-linux-x86-thin check-tools-linux-x86_64-thin \
|
||||
check-tools-linux-arm64 \
|
||||
+ check-tools-android-x86 check-tools-android-x86_64 \
|
||||
+ check-tools-android-arm check-tools-android-arm64 \
|
||||
frida-tools-update-submodule-stamp \
|
||||
glib glib-symlinks \
|
||||
v8 v8-symlinks
|
13
root-packages/frida-server/0002-Makefile.linux.mk.patch
Normal file
13
root-packages/frida-server/0002-Makefile.linux.mk.patch
Normal file
@ -0,0 +1,13 @@
|
||||
--- ../Makefile.linux.mk.orig 2020-02-23 10:58:44.621155388 +0100
|
||||
+++ ./Makefile.linux.mk 2020-02-23 11:19:08.482323493 +0100
|
||||
@@ -374,8 +378,8 @@
|
||||
--prefix $$(FRIDA)/build/$1-$$* \
|
||||
--libdir $$(FRIDA)/build/$1-$$*/lib \
|
||||
$$$$cross_args \
|
||||
- -Dpython=$$(PYTHON) \
|
||||
- -Dpython_incdir=$$(PYTHON_INCDIR) \
|
||||
+ -Dpython=/usr/bin/python3.8 \
|
||||
+ -Dpython_incdir=@TERMUX_PREFIX@/include/python3.8 \
|
||||
frida-python $$$$builddir || exit 1; \
|
||||
fi; \
|
||||
$$(NINJA) -C $$$$builddir install || exit 1
|
@ -7,9 +7,12 @@ _MINOR_VERSION=8
|
||||
_MICRO_VERSION=11
|
||||
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.${_MINOR_VERSION}.${_MICRO_VERSION}
|
||||
TERMUX_PKG_SRCURL=https://github.com/frida/frida.git
|
||||
TERMUX_PKG_DEPENDS="libiconv"
|
||||
TERMUX_PKG_DEPENDS="libiconv, python"
|
||||
TERMUX_PKG_BUILD_DEPENDS="openssl"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_EXTRA_MAKE_ARGS="ANDROID_NDK_ROOT=$HOME/lib/android-ndk"
|
||||
TERMUX_PKG_EXTRA_MAKE_ARGS="
|
||||
ANDROID_NDK_ROOT=$HOME/lib/android-ndk
|
||||
"
|
||||
TERMUX_PKG_HOSTBUILD=true
|
||||
|
||||
termux_step_extract_package() {
|
||||
@ -56,11 +59,24 @@ termux_step_make () {
|
||||
else
|
||||
arch=${TERMUX_ARCH}
|
||||
fi
|
||||
PATH=${TERMUX_PKG_HOSTBUILD_DIR}/bin:$PATH make core-android-${arch} ${TERMUX_PKG_EXTRA_MAKE_ARGS}
|
||||
PATH=${TERMUX_PKG_HOSTBUILD_DIR}/bin:$PATH make python-android-${arch} \
|
||||
${TERMUX_PKG_EXTRA_MAKE_ARGS}
|
||||
PATH=${TERMUX_PKG_HOSTBUILD_DIR}/bin:$PATH make tools-android-${arch} \
|
||||
${TERMUX_PKG_EXTRA_MAKE_ARGS}
|
||||
}
|
||||
|
||||
termux_step_make_install () {
|
||||
# Only include frida-server and frida-inject. Is something else useful?
|
||||
install ${TERMUX_PKG_BUILDDIR}/build/frida-android-${arch}/bin/frida-server ${TERMUX_PREFIX}/bin/
|
||||
install ${TERMUX_PKG_BUILDDIR}/build/frida-android-${arch}/bin/frida-inject ${TERMUX_PREFIX}/bin/
|
||||
install build/frida-android-${arch}/bin/frida-server \
|
||||
build/frida-android-${arch}/bin/frida-inject \
|
||||
build/frida-android-${arch}/bin/frida-discover \
|
||||
build/frida-android-${arch}/bin/frida \
|
||||
build/frida-android-${arch}/bin/frida-kill \
|
||||
build/frida-android-${arch}/bin/frida-ls-devices \
|
||||
build/frida-android-${arch}/bin/frida-ps \
|
||||
build/frida-android-${arch}/bin/frida-trace \
|
||||
${TERMUX_PREFIX}/bin/
|
||||
install build/frida-android-${arch}/lib/{frida-gadget.so,libfrida-gumpp-*.so} ${TERMUX_PREFIX}/lib/
|
||||
cp -r build/frida-android-${arch}/lib/{pkgconfig,python2.7,python3.8} ${TERMUX_PREFIX}/lib/
|
||||
cp -r build/frida-android-${arch}/include/{capstone,frida-*} ${TERMUX_PREFIX}/include/
|
||||
cp -r build/frida-android-${arch}/share/vala ${TERMUX_PREFIX}/share/
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
--- ../frida-python-src-meson.build.orig 2020-02-23 12:56:01.181265200 +0100
|
||||
+++ ./frida-python/src/meson.build 2020-02-23 16:08:00.390756673 +0100
|
||||
@@ -1,4 +1,4 @@
|
||||
-extra_link_args = []
|
||||
+extra_link_args = ['-L@TERMUX_PREFIX@/lib', '-lpython3.8']
|
||||
if host_os_family == 'darwin'
|
||||
extra_link_args += ['-Wl,-exported_symbol,_' + python_plugin_export_name]
|
||||
elif host_os_family != 'windows'
|
||||
@@ -9,7 +9,7 @@
|
||||
name_prefix: '',
|
||||
name_suffix: 'so',
|
||||
c_args: frida_component_cflags,
|
||||
- include_directories: include_directories(python_incdir),
|
||||
+ include_directories: include_directories('@TERMUX_PREFIX@/include', python_incdir),
|
||||
link_args: extra_link_args,
|
||||
dependencies: [frida_core_dep],
|
||||
install: true,
|
4
root-packages/frida-server/frida-python.subpackage.sh
Normal file
4
root-packages/frida-server/frida-python.subpackage.sh
Normal file
@ -0,0 +1,4 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="Python bindings for Frida"
|
||||
TERMUX_SUBPKG_INCLUDE="lib/python3.8 lib/python2.7"
|
||||
|
||||
|
9
root-packages/frida-server/frida-tools.subpackage.sh
Normal file
9
root-packages/frida-server/frida-tools.subpackage.sh
Normal file
@ -0,0 +1,9 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="CLI tools for Frida"
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/frida-discover
|
||||
bin/frida
|
||||
bin/frida-kill
|
||||
bin/frida-ls-devices
|
||||
bin/frida-ps
|
||||
bin/frida-trace
|
||||
"
|
@ -1,6 +1,6 @@
|
||||
--- ./releng/setup-env.sh.orig 2019-08-08 21:23:40.911592625 +0200
|
||||
+++ ./releng/setup-env.sh 2019-08-08 21:24:27.511533446 +0200
|
||||
@@ -461,26 +461,26 @@
|
||||
--- ./releng/setup-env.sh.orig 2020-02-23 11:01:20.820879043 +0100
|
||||
+++ ./releng/setup-env.sh 2020-02-23 11:01:20.830879026 +0100
|
||||
@@ -484,26 +484,26 @@
|
||||
|
||||
case $host_arch in
|
||||
x86)
|
||||
|
Loading…
Reference in New Issue
Block a user