From 1b212fb3992f03e40bded2ad55d038163ae897d6 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Sun, 29 Sep 2019 18:10:31 +1300 Subject: [PATCH 1/2] libntfs-3g first draft --- switch/libntfs-3g/PKGBUILD | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 switch/libntfs-3g/PKGBUILD diff --git a/switch/libntfs-3g/PKGBUILD b/switch/libntfs-3g/PKGBUILD new file mode 100644 index 00000000..6bb9b1e0 --- /dev/null +++ b/switch/libntfs-3g/PKGBUILD @@ -0,0 +1,37 @@ +# 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 . +} + +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 +} From 071ea3df03c26ecf090a7d1fd1bf6833d0ea1139 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Sun, 29 Sep 2019 23:14:22 +1300 Subject: [PATCH 2/2] Added src patches, cleaned up package output --- switch/libntfs-3g/.gitignore | 1 + switch/libntfs-3g/PKGBUILD | 11 ++++++-- ...ogs-2017.3.23-define_dev_major_minor.patch | 25 +++++++++++++++++++ ...fsprogs-2017.3.23-fix_syslog_include.patch | 14 +++++++++++ ...3.23-remove_install_exec_hook_target.patch | 14 +++++++++++ ...s-2017.3.23-timespec_already_defined.patch | 16 ++++++++++++ 6 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 switch/libntfs-3g/.gitignore create mode 100644 switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-define_dev_major_minor.patch create mode 100644 switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-fix_syslog_include.patch create mode 100644 switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-remove_install_exec_hook_target.patch create mode 100644 switch/libntfs-3g/ntfs-3g_ntfsprogs-2017.3.23-timespec_already_defined.patch 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 index 6bb9b1e0..3158786b 100644 --- a/switch/libntfs-3g/PKGBUILD +++ b/switch/libntfs-3g/PKGBUILD @@ -14,7 +14,11 @@ makedepends=('switch-pkg-config' 'devkitpro-pkgbuild-helpers') groups=('switch-portlibs') prepare() { - cd . + 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() { @@ -25,7 +29,7 @@ build() { ./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 + --without-uuid --without-hd make } @@ -34,4 +38,7 @@ 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