Create dist/ to hold all the distribution build files ##build (#18131)

This commit is contained in:
pancake 2020-12-31 18:57:05 +01:00 committed by GitHub
parent b2117e48c5
commit 658c6a0918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 77 additions and 32 deletions

View File

@ -863,6 +863,8 @@ jobs:
if: github.event_name == 'push' if: github.event_name == 'push'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Moving the Dockerfile to the root
run: cp -f dist/docker/Dockerfile .
- name: Publish to Registry - name: Publish to Registry
uses: docker/build-push-action@v1 uses: docker/build-push-action@v1
with: with:

View File

@ -128,7 +128,7 @@ before_install:
if [ "${FUZZIT}" == "1" ]; then if [ "${FUZZIT}" == "1" ]; then
docker pull gcr.io/fuzzit-public/builders:llvm9.v1 docker pull gcr.io/fuzzit-public/builders:llvm9.v1
elif [ "$TRAVIS_OS_NAME" != "osx" ] && [ "$NODOCKER" != "1" ]; then elif [ "$TRAVIS_OS_NAME" != "osx" ] && [ "$NODOCKER" != "1" ]; then
docker pull radareorg/r2-travis:latest || docker build -t radareorg/r2-travis:latest -f Dockerfile.travis . docker pull radareorg/r2-travis:latest || docker build -t radareorg/r2-travis:latest -f dist/docker/Dockerfile.travis .
fi fi
script: script:

View File

@ -33,7 +33,7 @@ help () {
cfg=./plugins.cfg cfg=./plugins.cfg
if [ ! -f "$cfg" ]; then if [ ! -f "$cfg" ]; then
cp -f ./plugins.def.cfg plugins.cfg cp -f dist/plugins-cfg/plugins.def.cfg plugins.cfg
fi fi
load () { load () {
@ -42,7 +42,7 @@ load () {
. $cfg . $cfg
else else
echo "configure-plugins: Loading $1 .." echo "configure-plugins: Loading $1 .."
. "$1" #plugins.def.cfg . "$1"
fi fi
} }
@ -186,7 +186,7 @@ make_ () { : ; }
MODE="" MODE=""
DONOTHING=0 DONOTHING=0
DEFCFG=./plugins.def.cfg DEFCFG=dist/plugins-cfg/plugins.def.cfg
rmstatic() { rmstatic() {
C=0 C=0

View File

@ -4,7 +4,7 @@ case "$1" in
: # nothing to do here : # nothing to do here
;; ;;
*) *)
[ plugins.def.cfg -nt ./plugins.cfg ] && rm -f plugins.cfg [ dist/plugins-cfg/plugins.def.cfg -nt ./plugins.cfg ] && rm -f plugins.cfg
./configure-plugins $* ./configure-plugins $*
;; ;;
esac esac

5
dist/macos/Makefile vendored Normal file
View File

@ -0,0 +1,5 @@
all:
cd ../.. && dist/macos/build-pkg.sh
clean:
rm -rf *.pkg

38
dist/macos/build-pkg.sh vendored Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
# based on
# http://blog.coolaj86.com/articles/how-to-unpackage-and-repackage-pkg-osx.html
# to uninstall:
# sudo pkgutil --forget org.radare.radare2
SRC=/tmp/r2osx
PREFIX=/usr/local
DST="$(pwd)/sys/osx-pkg/radare2.unpkg"
if [ -n "$1" ]; then
VERSION="$1"
else
VERSION="`./configure --version| head -n 1|awk '{print $1}'|cut -d - -f 2`"
[ -z "${VERSION}" ] && VERSION=3.6.0
fi
[ -z "${MAKE}" ] && MAKE=make
rm -rf "${SRC}"
${MAKE} mrproper 2>/dev/null
export CFLAGS=-O2
./configure --prefix="${PREFIX}" --without-libuv || exit 1
${MAKE} -j4 || exit 1
# TODO: run sys/install.sh
${MAKE} install PREFIX="${PREFIX}" DESTDIR=${SRC} || exit 1
if [ -d "${SRC}" ]; then
(
cd ${SRC} && \
find . | cpio -o --format odc | gzip -c > "${DST}/Payload"
)
mkbom ${SRC} "${DST}/Bom"
# Repackage
pkgutil --flatten "${DST}" "${DST}/../radare2-${VERSION}.pkg"
else
echo "Failed install. DESTDIR is empty"
exit 1
fi

View File

@ -12,8 +12,8 @@ if [ "${ARCH}" = "x86_64" ]; then
fi fi
echo "[debian] preparing radare2 package..." echo "[debian] preparing radare2 package..."
PKGDIR=sys/debian/radare2/root PKGDIR=dist/debian/radare2/root
DEVDIR=sys/debian/radare2-dev/root DEVDIR=dist/debian/radare2-dev/root
# clean # clean
rm -rf "${PKGDIR}" "${DEVDIR}" rm -rf "${PKGDIR}" "${DEVDIR}"
@ -42,9 +42,9 @@ done
# packages # packages
echo "[debian] building radare2 package..." echo "[debian] building radare2 package..."
make -C sys/debian/radare2 ARCH=${ARCH} make -C dist/debian/radare2 ARCH=${ARCH}
cp -f sys/debian/radare2/*.deb . cp -f dist/debian/radare2/*.deb .
echo "[debian] building radare2-dev package..." echo "[debian] building radare2-dev package..."
make -C sys/debian/radare2-dev ARCH=${ARCH} make -C dist/debian/radare2-dev ARCH=${ARCH}
cp -f sys/debian/radare2-dev/*.deb . cp -f dist/debian/radare2-dev/*.deb .

View File

@ -37,34 +37,36 @@ else
PREFIX=/usr PREFIX=/usr
fi fi
ROOT=dist/cydia/radare2/root
makeDeb() { makeDeb() {
make -C binr ios-sdk-sign make -C binr ios-sdk-sign
rm -rf /tmp/r2ios rm -rf /tmp/r2ios
make install DESTDIR=/tmp/r2ios make install DESTDIR=/tmp/r2ios
rm -rf /tmp/r2ios/${PREFIX}/share/radare2/*/www/*/node_modules rm -rf /tmp/r2ios/${PREFIX}/share/radare2/*/www/*/node_modules
( cd /tmp/r2ios && tar czvf ../r2ios-${CPU}.tar.gz ./* ) ( cd /tmp/r2ios && tar czvf ../r2ios-${CPU}.tar.gz ./* )
rm -rf sys/cydia/radare2/root rm -rf $(ROOT)
mkdir -p sys/cydia/radare2/root mkdir -p $(ROOT)
sudo tar xpzvf /tmp/r2ios-${CPU}.tar.gz -C sys/cydia/radare2/root sudo tar xpzvf /tmp/r2ios-${CPU}.tar.gz -C $(ROOT)
rm -f sys/cydia/radare2/root/${PREFIX}/lib/*.{a,dylib,dSYM} rm -f $(ROOT)/${PREFIX}/lib/*.{a,dylib,dSYM}
if [ "$static" = 1 ]; then if [ "$static" = 1 ]; then
( (
rm -f sys/cydia/radare2/root/${PREFIX}/bin/* rm -f $(ROOT)/${PREFIX}/bin/*
cp -f binr/blob/radare2 sys/cydia/radare2/root/${PREFIX}/bin cp -f binr/blob/radare2 $(ROOT)/${PREFIX}/bin
cd sys/cydia/radare2/root/${PREFIX}/bin cd $(ROOT)/${PREFIX}/bin
for a in r2 rabin2 rarun2 rasm2 ragg2 rahash2 rax2 rafind2 radiff2 ; do ln -fs radare2 $a ; done for a in r2 rabin2 rarun2 rasm2 ragg2 rahash2 rax2 rafind2 radiff2 ; do ln -fs radare2 $a ; done
) )
echo "Signing radare2" echo "Signing radare2"
ldid2 -Sbinr/radare2/radare2_ios.xml sys/cydia/radare2/root/usr/bin/radare2 ldid2 -Sbinr/radare2/radare2_ios.xml $(ROOT)/usr/bin/radare2
else else
for a in sys/cydia/radare2/root/usr/bin/* sys/cydia/radare2/root/usr/lib/*.dylib ; do for a in $(ROOT)/usr/bin/* $(ROOT)/usr/lib/*.dylib ; do
echo "Signing $a" echo "Signing $a"
ldid2 -Sbinr/radare2/radare2_ios.xml $a ldid2 -Sbinr/radare2/radare2_ios.xml $a
done done
fi fi
if [ "${STOW}" = 1 ]; then if [ "${STOW}" = 1 ]; then
( (
cd sys/cydia/radare2/root/ cd $(ROOT)/
mkdir -p usr/bin mkdir -p usr/bin
# stow # stow
echo "Stowing ${PREFIX} into /usr..." echo "Stowing ${PREFIX} into /usr..."
@ -77,11 +79,11 @@ if [ "${STOW}" = 1 ]; then
done done
fi fi
done done
) )
else else
echo "No need to stow anything" echo "No need to stow anything"
fi fi
( cd sys/cydia/radare2 ; sudo make clean ; sudo make PACKAGE=${PACKAGE} ) ( cd dist/cydia/radare2 ; sudo make clean ; sudo make PACKAGE=${PACKAGE} )
} }
if [ "$1" = makedeb ]; then if [ "$1" = makedeb ]; then
@ -116,8 +118,6 @@ else
xcrun --sdk iphoneos strip radare2 xcrun --sdk iphoneos strip radare2
) )
fi fi
if [ $? = 0 ]; then [ $? = 0 ] && makeDeb
makeDeb
fi
fi fi
fi fi

View File

@ -75,7 +75,7 @@ SelectPluginShared () {
} }
SelectPluginStatic() { SelectPluginStatic() {
. ./plugins.def.cfg . ./dist/plugins-cfg/plugins.def.cfg
PLUGINS="${STATIC} ${SHARED}" PLUGINS="${STATIC} ${SHARED}"
ARGS="" ARGS=""
for a in ${PLUGINS} ; do for a in ${PLUGINS} ; do