aboutsummaryrefslogtreecommitdiffstats
path: root/testing/amiitool
diff options
context:
space:
mode:
authorTBK <tbk@jjtc.eu>2019-03-10 12:51:27 +0100
committerKevin Daudt <kdaudt@alpinelinux.org>2019-03-12 22:41:56 +0000
commit63ec6741303e8849e82d9b0930963535f0a82df6 (patch)
tree61e9465558c4ed326b8e614f8697fe2b24d535bd /testing/amiitool
parent554674f570fbe8c000edc65546d91a5d51ed3004 (diff)
downloadaports-63ec6741303e8849e82d9b0930963535f0a82df6.tar.bz2
aports-63ec6741303e8849e82d9b0930963535f0a82df6.tar.xz
testing/amiitool: new aport
Diffstat (limited to 'testing/amiitool')
-rw-r--r--testing/amiitool/APKBUILD27
-rw-r--r--testing/amiitool/fix-mbedtls_include.patch56
2 files changed, 83 insertions, 0 deletions
diff --git a/testing/amiitool/APKBUILD b/testing/amiitool/APKBUILD
new file mode 100644
index 0000000000..7bfee44eb8
--- /dev/null
+++ b/testing/amiitool/APKBUILD
@@ -0,0 +1,27 @@
+# Contributor: TBK <alpine@jjtc.eu>
+# Maintainer: TBK <alpine@jjtc.eu>
+pkgname=amiitool
+pkgver=2
+_pkgver=r2
+pkgrel=0
+pkgdesc="Reverse-engineered amiibo cryptography"
+url="https://github.com/socram8888/amiitool"
+arch="all"
+license="MIT"
+options="!check" # No test suite
+makedepends="git mbedtls-dev" # git is used to pull head version
+source="$pkgname-$_pkgver.tar.gz::https://github.com/socram8888/amiitool/archive/$_pkgver.tar.gz
+ fix-mbedtls_include.patch
+ "
+builddir="$srcdir/$pkgname-$_pkgver"
+
+build() {
+ make prefix=/usr
+}
+
+package() {
+ make prefix=/usr DESTDIR="$pkgdir" install
+}
+
+sha512sums="28087a022a88ca604f610dff6f49f19f4c273d7787401a3e1dd998243ba4ca3628adb58bf9ea20e8e6c77cc021bedfeda8b632e0a50efe752eec543f20ef33d6 amiitool-r2.tar.gz
+50bc13ff736c65b05b402e3dc1c3e61242271e9d311f5a60169263e2dd6ca5765dee6b1cde963e3a76980deaf29ee1e65991b9028f9c58c3a6402d959015993e fix-mbedtls_include.patch"
diff --git a/testing/amiitool/fix-mbedtls_include.patch b/testing/amiitool/fix-mbedtls_include.patch
new file mode 100644
index 0000000000..44ef9f9157
--- /dev/null
+++ b/testing/amiitool/fix-mbedtls_include.patch
@@ -0,0 +1,56 @@
++++ a/Makefile
++++ b/Makefile
+@@ -19,7 +19,7 @@
+ bindir = $(exec_prefix)/bin
+
+ # mbed TLS libraries
+-MBEDTLS_DIR = $(PWD)/mbedtls
++MBEDTLS_DIR = /usr/include/
+ MBEDTLS_CONFIG = $(PWD)/configs/mbedtls.h
+ MBEDTLS_CFLAGS = -DMBEDTLS_CONFIG_FILE='\"$(MBEDTLS_CONFIG)\"' $(CFLAGS)
+
+@@ -39,7 +39,7 @@
+ # Default target: compile all programs
+ all: $(BINS)
+
+-%: %.o $(LIBSOBJ) $(STATICLIBS)
++%: %.o $(LIBSOBJ)
+ $(CC) $(ALL_CFLAGS) $(LIBSOBJ) $< -o $@ $(LDFLAGS)
+
+ %.o: %.c $(HEADERS)
+
+--- a/configs/mbedtls.h
++++ b/configs/mbedtls.h
+@@ -24,6 +24,6 @@
+ #define MBEDTLS_HAVE_ASM
+ #define MBEDTLS_PLATFORM_C
+
+-#include "mbedtls/check_config.h"
++#include <mbedtls/check_config.h>
+
+ #endif
+
+--- a/amiibo.c
++++ b/amiibo.c
+@@ -7,8 +7,8 @@
+
+ #include "nfc3d/amiibo.h"
+ #include "util.h"
+-#include "mbedtls/md.h"
+-#include "mbedtls/aes.h"
++#include <mbedtls/md.h>
++#include <mbedtls/aes.h>
+ #include <errno.h>
+ #include "portable_endian.h"
+
+--- a/include/nfc3d/drbg.h
++++ b/include/nfc3d/drbg.h
+@@ -10,7 +10,7 @@
+
+ #include <stdbool.h>
+ #include <stdint.h>
+-#include "mbedtls/md.h"
++#include <mbedtls/md.h>
+
+ #define NFC3D_DRBG_MAX_SEED_SIZE 480 /* Hardcoded max size in 3DS NFC module */
+ #define NFC3D_DRBG_OUTPUT_SIZE 32 /* Every iteration generates 32 bytes */