diff --git a/switch/libntfs-3g/.gitignore b/switch/libntfs-3g/.gitignore new file mode 100644 index 00000000..9e30eb9b --- /dev/null +++ b/switch/libntfs-3g/.gitignore @@ -0,0 +1 @@ +*.tgz \ No newline at end of file diff --git a/switch/libntfs-3g/PKGBUILD b/switch/libntfs-3g/PKGBUILD new file mode 100644 index 00000000..3158786b --- /dev/null +++ b/switch/libntfs-3g/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Rhys Koedijk + +pkgname=switch-libntfs-3g +pkgver=2017.3.23 +pkgrel=2 +pkgdesc='Read-Write NTFS Driver' +arch=('any') +url='https://www.tuxera.com/community/open-source-ntfs-3g/' +license=('GPL') +options=(!strip libtool staticlibs) +source=("https://tuxera.com/opensource/ntfs-3g_ntfsprogs-${pkgver}.tgz") +sha256sums=('3e5a021d7b761261836dcb305370af299793eedbded731df3d6943802e1262d5') +makedepends=('switch-pkg-config' 'devkitpro-pkgbuild-helpers') +groups=('switch-portlibs') + +prepare() { + cd ntfs-3g_ntfsprogs-$pkgver + patch -Np1 -i "$srcdir/../ntfs-3g_ntfsprogs-2017.3.23-fix_syslog_include.patch" + patch -Np1 -i "$srcdir/../ntfs-3g_ntfsprogs-2017.3.23-timespec_already_defined.patch" + patch -Np1 -i "$srcdir/../ntfs-3g_ntfsprogs-2017.3.23-define_dev_major_minor.patch" + patch -Np1 -i "$srcdir/../ntfs-3g_ntfsprogs-2017.3.23-remove_install_exec_hook_target.patch" +} + +build() { + cd ntfs-3g_ntfsprogs-$pkgver + + source /opt/devkitpro/switchvars.sh + + ./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \ + --disable-shared --enable-static --disable-device-default-io-ops \ + --disable-ntfs-3g --disable-ntfsprogs --disable-plugins --disable-crypto \ + --without-uuid --without-hd + + make +} + +package() { + cd ntfs-3g_ntfsprogs-$pkgver + + make DESTDIR="$pkgdir" install + + install -Dm644 COPYING.LIB "$pkgdir"/opt/devkitpro/portlibs/switch/licenses/$pkgname/COPYING + rm -r "$pkgdir"/opt/devkitpro/portlibs/switch/share +} diff --git a/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-define_dev_major_minor.patch b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-define_dev_major_minor.patch new file mode 100644 index 00000000..4c4d794f --- /dev/null +++ b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-define_dev_major_minor.patch @@ -0,0 +1,25 @@ +diff --git a/libntfs-3g/dir.c b/libntfs-3g/dir.c +index a66f807..5bc0709 100644 +--- a/libntfs-3g/dir.c ++++ b/libntfs-3g/dir.c +@@ -50,6 +50,19 @@ + #include + #endif + ++#ifndef MINORBITS ++#define MINORBITS 20 ++#endif ++#ifndef MINORMASK ++#define MINORMASK ((1U << MINORBITS) - 1) ++#endif ++#ifndef major ++#define major(dev) ((unsigned int) ((dev) >> MINORBITS)) ++#endif ++#ifndef minor ++#define minor(dev) ((unsigned int) ((dev) & MINORMASK)) ++#endif ++ + #include "param.h" + #include "types.h" + #include "debug.h" + \ No newline at end of file diff --git a/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-fix_syslog_include.patch b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-fix_syslog_include.patch new file mode 100644 index 00000000..a270070a --- /dev/null +++ b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-fix_syslog_include.patch @@ -0,0 +1,14 @@ +diff --git a/libntfs-3g/ioctl.c b/libntfs-3g/ioctl.c +index 2eef5a5..b3e3801 100644 +--- a/libntfs-3g/ioctl.c ++++ b/libntfs-3g/ioctl.c +@@ -48,7 +48,9 @@ + #ifdef HAVE_LIMITS_H + #include + #endif ++#ifdef HAVE_SYSLOG_H + #include ++#endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif diff --git a/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-remove_install_exec_hook_target.patch b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-remove_install_exec_hook_target.patch new file mode 100644 index 00000000..bac84027 --- /dev/null +++ b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-remove_install_exec_hook_target.patch @@ -0,0 +1,14 @@ +diff --git a/libntfs-3g/Makefile.in b/libntfs-3g/Makefile.in +index d3829ec..82143d2 100644 +--- a/libntfs-3g/Makefile.in ++++ b/libntfs-3g/Makefile.in +@@ -984,7 +984,7 @@ install-dvi-am: + + install-exec-am: install-libLTLIBRARIES + @$(NORMAL_INSTALL) +- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook ++ $(MAKE) $(AM_MAKEFLAGS) + install-html: install-html-am + + install-html-am: + \ No newline at end of file diff --git a/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-timespec_already_defined.patch b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-timespec_already_defined.patch new file mode 100644 index 00000000..f155a5c6 --- /dev/null +++ b/switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-timespec_already_defined.patch @@ -0,0 +1,16 @@ +diff --git a/include/ntfs-3g/ntfstime.h b/include/ntfs-3g/ntfstime.h +index f3a89dd..ce0d458 100644 +--- a/include/ntfs-3g/ntfstime.h ++++ b/include/ntfs-3g/ntfstime.h +@@ -36,6 +36,10 @@ + + #include "types.h" + ++#ifdef _SYS__TIMESPEC_H_ ++#define __timespec_defined ++#endif ++ + /* + * assume "struct timespec" is not defined if st_mtime is not defined + */ + \ No newline at end of file