Date: Thursday, November 15, 2018 @ 01:30:23 Author: anthraxx Revision: 407614
upgpkg: distorm 3.3.8-1 Modified: distorm/trunk/PKGBUILD Deleted: distorm/trunk/build.patch distorm/trunk/python3.patch ---------------+ PKGBUILD | 35 ++++++++++++-------------------- build.patch | 61 -------------------------------------------------------- python3.patch | 40 ------------------------------------ 3 files changed, 14 insertions(+), 122 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2018-11-15 01:09:23 UTC (rev 407613) +++ PKGBUILD 2018-11-15 01:30:23 UTC (rev 407614) @@ -4,8 +4,8 @@ pkgbase=distorm pkgname=('distorm' 'python-distorm' 'python2-distorm') -pkgver=3.3.4 -pkgrel=3 +pkgver=3.3.8 +pkgrel=1 pkgdesc='Powerful disassembler library for x86/AMD64' url='https://github.com/gdabah/distorm' arch=('x86_64') @@ -12,26 +12,18 @@ license=('BSD') makedepends=('python' 'python2' 'glibc') options=('staticlibs') -source=(${pkgname}-${pkgver}.tar.gz::https://github.com/gdabah/distorm/archive/v${pkgver}.tar.gz - python3.patch - build.patch) -sha512sums=('172bb1a9a3f92089daf140fd019c94cf3b63f646b78e7aa527640819f418b1e3df2e2d727a76863a7800e6e3735c404054aeb48fceeec7a94f95480b89883b90' - '91bfa096e8de1c494a84e781aa27c48a1063239c4d1e1c746d32fde9273e79769af37240559341edf6547055fbf80698339474ad77c3581c01d4057ba5cef0ea' - 'f7ec10c577715b3c8907dc999652de377f21b33acb78954544f920bc65be7e19d13368cf9915be10a5162c149cb9b48816f52f0258d219a3ea1cf26bb63ed8c2') +source=(${pkgname}-${pkgver}.tar.gz::https://github.com/gdabah/distorm/archive/v${pkgver}.tar.gz) +sha512sums=('bf65fe500089b4aa38d6430eb985f1dc3494b43c829379c56f91b5b4b25d19504fa3781a2fb2b03946f541962f6e564e46d6ec464c469ee21ecb773303b8494e') prepare() { - (cd ${pkgbase}-${pkgver} - patch -p1 < "${srcdir}/build.patch" - patch -p1 < "${srcdir}/python3.patch" - ) cp -ra ${pkgbase}-${pkgver}{,-py2} - sed -e '1i#!/usr/bin/env python' -i ${pkgbase}-${pkgver}/python/distorm3/sample.py - sed -e '1i#!/usr/bin/env python2' -i ${pkgbase}-${pkgver}-py2/python/distorm3/sample.py + sed -e '1i#!/usr/bin/env python' -i ${pkgbase}-${pkgver}/examples/python/sample.py + sed -e '1i#!/usr/bin/env python2' -i ${pkgbase}-${pkgver}-py2/examples/python/sample.py } build() { (cd ${pkgbase}-${pkgver} - make -C make/linux + make -C make/linux CFLAGS="${CFLAGS} ${CPPFLAGS} -fPIC" python setup.py build ) (cd ${pkgbase}-${pkgver}-py2 @@ -41,10 +33,12 @@ package_distorm() { depends=('glibc') + provides=('libdistorm3.so') cd ${pkgbase}-${pkgver} make -C make/linux PREFIX=/usr DESTDIR="${pkgdir}" install install -Dm 644 include/*.h -t "${pkgdir}/usr/include" - install -Dm 644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}" + ln -s /usr/lib/libdistorm3.so "${pkgdir}/usr/lib/libdistorm3.so".$(grep 'LIB_S_VERSION =' make/linux/Makefile|cut -d' ' -f3) } package_python-distorm() { @@ -51,8 +45,8 @@ depends=('python') cd ${pkgbase}-${pkgver} python setup.py install --root="${pkgdir}" -O1 --skip-build - install -Dm 755 python/distorm3/sample.py "${pkgdir}/usr/bin/disasm" - install -Dm 644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm 755 examples/python/sample.py -t "${pkgdir}/usr/share/doc/${pkgname}" + install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}" } package_python2-distorm() { @@ -59,9 +53,8 @@ depends=('python2') cd ${pkgbase}-${pkgver}-py2 python2 setup.py install --root="${pkgdir}" -O1 --skip-build - install -Dm 755 python/distorm3/sample.py "${pkgdir}/usr/bin/disasm" - install -Dm 644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" - mv "${pkgdir}/usr/bin/disasm"{,-py2} + install -Dm 755 examples/python/sample.py -t "${pkgdir}/usr/share/doc/${pkgname}" + install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}" } # vim: ts=2 sw=2 et: Deleted: build.patch =================================================================== --- build.patch 2018-11-15 01:09:23 UTC (rev 407613) +++ build.patch 2018-11-15 01:30:23 UTC (rev 407614) @@ -1,61 +0,0 @@ -From 26d3959ac90cfbecd36458fee2fbb67807457d54 Mon Sep 17 00:00:00 2001 -From: anthraxx <leve...@leventepolyak.net> -Date: Mon, 6 Jun 2016 00:03:20 +0200 -Subject: [PATCH] more distribution friendly Makefile improvements - -- append CFLAGS instead of force-set it, this was distributions - can also add their own CFLAGS in addition (this is very common). -- introduce LDFLAGS so distributions can set their own additional - flags for the linker and append instead of set (this is very common) -- replace static /usr/local/lib with a PREFIX variable with default - value of /usr/local so a distribution can easily use PREFIX=/usr - (this is also common) -- introduce DESTDIR for distribution wide packaging as they build in - chroots and deploy into a special directory structure that will later - put into a tarball and lands in a distribution package. - f.e. DESTDIR="/build/package" (this is also common for packaging) -- adding -D to install call to create all leading components of the - destination. This is very important if the DESTDIR is set for - packaging the therefor the structure does not yet exists. This will - then basically freate the directory structure. in case DESTDIR is not - used and /usr/local/lib f.e. already exists this will do nothing - this is highly common to do it this way. - We add the ${TARGET} to the end because we use the -D parameter and - therefor we need to also pass the resulting filename ---- - make/linux/Makefile | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/make/linux/Makefile b/make/linux/Makefile -index c2ad39e..d142bb4 100644 ---- a/make/linux/Makefile -+++ b/make/linux/Makefile -@@ -5,7 +5,10 @@ - TARGET = libdistorm3.so - COBJS = ../../src/mnemonics.o ../../src/wstring.o ../../src/textdefs.o ../../src/prefix.o ../../src/operands.o ../../src/insts.o ../../src/instructions.o ../../src/distorm.o ../../src/decoder.o - CC = gcc --CFLAGS = -fPIC -O2 -Wall -DSUPPORT_64BIT_OFFSET -DDISTORM_STATIC -+CFLAGS += -fPIC -O2 -Wall -DSUPPORT_64BIT_OFFSET -DDISTORM_STATIC -+LDFLAGS += -shared -+PREFIX = /usr/local -+DESTDIR = - - all: clib - -@@ -13,11 +16,11 @@ clean: - /bin/rm -rf ../../src/*.o ${TARGET} ../../distorm3.a ./../*.o - - clib: ${COBJS} -- ${CC} ${CFLAGS} ${VERSION} ${COBJS} -shared -o ${TARGET} -+ ${CC} ${CFLAGS} ${VERSION} ${COBJS} ${LDFLAGS} -o ${TARGET} - ar rs ../../distorm3.a ${COBJS} - - install: libdistorm3.so -- install -s ${TARGET} /usr/local/lib -+ install -D -s ${TARGET} ${DESTDIR}/${PREFIX}/lib/${TARGET} - @echo "... running ldconfig might be smart ..." - - .c.o: --- -2.8.3 - Deleted: python3.patch =================================================================== --- python3.patch 2018-11-15 01:09:23 UTC (rev 407613) +++ python3.patch 2018-11-15 01:30:23 UTC (rev 407614) @@ -1,40 +0,0 @@ -From 28b3af2136bcc465830631afa9357fbf73048e52 Mon Sep 17 00:00:00 2001 -From: gil_dabah <da...@north-bit.com> -Date: Sat, 4 Jun 2016 17:37:40 +0300 -Subject: [PATCH] Fix for cross Python support. - ---- - python/distorm3/__init__.py | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/python/distorm3/__init__.py b/python/distorm3/__init__.py -index c8f881c..176677b 100644 ---- a/python/distorm3/__init__.py -+++ b/python/distorm3/__init__.py -@@ -537,6 +537,15 @@ def DecodeGenerator(codeOffset, code, dt): - p_result = byref(result) - instruction_off = 0 - -+ # Support cross Python compatibility -+ toUnicode = lambda s: s -+ spaceCh = b" " -+ if sys.version_info[0] >= 3: -+ if sys.version_info[1] > 0: -+ toUnicode = lambda s: s.decode() -+ else: -+ spaceCh = " " -+ - while codeLen > 0: - - usedInstructionsCount = c_uint(0) -@@ -553,8 +562,8 @@ def DecodeGenerator(codeOffset, code, dt): - di = result[index] - asm = di.mnemonic.p - if len(di.operands.p): -- asm += b" " + di.operands.p -- pydi = (di.offset, di.size, asm, di.instructionHex.p) -+ asm += spaceCh + di.operands.p -+ pydi = (di.offset, di.size, toUnicode(asm), toUnicode(di.instructionHex.p)) - instruction_off += di.size - yield pydi -