Skip to content

Commit

Permalink
aspell: Import patches from cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexpux committed Jun 2, 2017
1 parent 8f54de4 commit 9ca477d
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 43 deletions.
40 changes: 23 additions & 17 deletions aspell/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,58 @@ license=('LGPL')
groups=('libraries')
makedepends=('gcc' 'gettext-devel' 'libiconv-devel' 'ncurses-devel')
options=()
source=("https://ftp.gnu.org/gnu/aspell/$pkgname-$pkgver.tar.gz"{,.sig}
source=("https://ftp.gnu.org/gnu/aspell/${pkgname}-${pkgver}.tar.gz"{,.sig}
"msys-platform.patch"
"aspell-0.60.6.1-fix-O_BINARY-macro.patch")
"aspell-noundefined.patch"
"aspell-so2dll.patch"
"aspell-fileno.patch")
sha256sums=('f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1'
'SKIP'
'ed9a09ee29c031b979b76a9146c60fadd8c591b072f09c1a29fd640be0bbca8a'
'35510b7637623c471f027650c531572abda89f1d40a81c0548d01b377aa72a59')
'5188d1443b04c095261b3fe01f77a9235ca4b3c5c35caa87167a5507a30f6bee'
'9b9e4300d35a92f029c098da7001235d1dd6aeb03a854591afd84606b5cd257b'
'8054609ba63038c7f488782a1f80ed31ba1fe18ded842707702ad08793903c7b')

prepare() {
cd "$srcdir/$pkgname-$pkgver"
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i ${srcdir}/msys-platform.patch
patch -p1 -i ${srcdir}/aspell-0.60.6.1-fix-O_BINARY-macro.patch
patch -p1 -i ${srcdir}/aspell-noundefined.patch
patch -p1 -i ${srcdir}/aspell-so2dll.patch
patch -p1 -i ${srcdir}/aspell-fileno.patch
autoreconf -ivf
}

build() {
cd "$srcdir/$pkgname-$pkgver"
cd "${srcdir}/${pkgname}-${pkgver}"
./configure --prefix=/usr --build=${CHOST} --enable-static
make
make DESTDIR="$srcdir/dest" install
make DESTDIR="${srcdir}/dest" install
}

check() {
cd "$srcdir/$pkgname-$pkgver"
cd "${srcdir}/${pkgname}-${pkgver}"
make -k check
}

package_aspell() {
depends=("gcc-libs" "gettext" "libiconv" "ncurses")

mkdir -p $pkgdir/usr/bin
cp -rf $srcdir/dest/usr/bin $pkgdir/usr/
mkdir -p ${pkgdir}/usr/bin
cp -rf ${srcdir}/dest/usr/bin ${pkgdir}/usr/

mkdir -p $pkgdir/usr/lib/aspell-0.60
cp -rf $srcdir/dest/usr/lib/aspell-0.60 $pkgdir/usr/lib/
mkdir -p ${pkgdir}/usr/lib/aspell-0.60
cp -rf ${srcdir}/dest/usr/lib/aspell-0.60 ${pkgdir}/usr/lib/

mkdir -p $pkgdir/usr/share
cp -rf $srcdir/dest/usr/share $pkgdir/usr/
mkdir -p ${pkgdir}/usr/share
cp -rf ${srcdir}/dest/usr/share ${pkgdir}/usr/
}

package_aspell-devel() {
pkgdesc="Aspell headers and libraries (development)"
groups=('development')
depends=("aspell=${pkgver}" "gettext-devel" "libiconv-devel" "ncurses-devel")

mkdir -p $pkgdir/usr/lib
cp -rf $srcdir/dest/usr/include $pkgdir/usr/
cp -f $srcdir/dest/usr/lib/*.a $pkgdir/usr/lib
mkdir -p ${pkgdir}/usr/lib
cp -rf ${srcdir}/dest/usr/include ${pkgdir}/usr/
cp -f ${srcdir}/dest/usr/lib/*.a ${pkgdir}/usr/lib
}
26 changes: 0 additions & 26 deletions aspell/aspell-0.60.6.1-fix-O_BINARY-macro.patch

This file was deleted.

28 changes: 28 additions & 0 deletions aspell/aspell-fileno.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--- aspell-0.60.6.1/prog/compress.c 2004-11-07 13:29:48.000000000 +0100
+++ aspell-0.60.6.1/prog/compress.c 2013-04-30 09:03:17.471947700 +0200
@@ -25,7 +25,11 @@
# include <io.h>
# include <fcntl.h>

+#if defined(__CYGWIN__)
+# define SETBIN(fno) _setmode( fileno( fno ), O_BINARY )
+#else
# define SETBIN(fno) _setmode( _fileno( fno ), _O_BINARY )
+#endif

#else

--- aspell-0.60.6.1/prog/prezip.c 2011-07-02 23:09:09.000000000 +0200
+++ aspell-0.60.6.1/prog/prezip.c 2013-04-30 09:02:30.307958600 +0200
@@ -39,7 +39,11 @@
# include <io.h>
# include <fcntl.h>

+#if defined(__CYGWIN__)
+# define SETBIN(fno) _setmode( fileno( fno ), O_BINARY )
+#else
# define SETBIN(fno) _setmode( _fileno( fno ), _O_BINARY )
+#endif

#else

45 changes: 45 additions & 0 deletions aspell/aspell-noundefined.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
--- aspell-0.60.6.1/Makefile.am 2011-07-03 01:42:34.000000000 +0200
+++ aspell-0.60.6.1/Makefile.am 2011-11-11 01:35:59.046875000 +0100
@@ -194,7 +194,7 @@ libaspell_la_SOURCES +=\
else # not COMPILE_IN_FILTERS

dynamic_optfiles += ${optfiles}
-filter_ldflags = -module -avoid-version
+filter_ldflags = -module -avoid-version -no-undefined

### Add name of filter library containing your filter. Name always
### must look like lib<filtername>-filter.la see development manual
@@ -203,27 +203,27 @@ filter_LTLIBRARIES = email-filter.la tex
nroff-filter.la texinfo-filter.la

email_filter_la_SOURCES = modules/filter/email.cpp
-email_filter_la_LIBADD = libaspell.la
+email_filter_la_LIBADD = libaspell.la $(LTLIBINTL)
email_filter_la_LDFLAGS = ${filter_ldflags}

tex_filter_la_SOURCES = modules/filter/tex.cpp
-tex_filter_la_LIBADD = libaspell.la
+tex_filter_la_LIBADD = libaspell.la $(LTLIBINTL)
tex_filter_la_LDFLAGS = ${filter_ldflags}

sgml_filter_la_SOURCES = modules/filter/sgml.cpp
-sgml_filter_la_LIBADD = libaspell.la
+sgml_filter_la_LIBADD = libaspell.la $(LTLIBINTL)
sgml_filter_la_LDFLAGS = ${filter_ldflags}

context_filter_la_SOURCES = modules/filter/context.cpp
-context_filter_la_LIBADD = libaspell.la
+context_filter_la_LIBADD = libaspell.la $(LTLIBINTL)
context_filter_la_LDFLAGS = ${filter_ldflags}

nroff_filter_la_SOURCES = modules/filter/nroff.cpp
-nroff_filter_la_LIBADD = libaspell.la
+nroff_filter_la_LIBADD = libaspell.la $(LTLIBINTL)
nroff_filter_la_LDFLAGS = ${filter_ldflags}

texinfo_filter_la_SOURCES = modules/filter/texinfo.cpp
-texinfo_filter_la_LIBADD = libaspell.la
+texinfo_filter_la_LIBADD = libaspell.la $(LTLIBINTL)
texinfo_filter_la_LDFLAGS = ${filter_ldflags}

### Before this line add the corresponding <yourfilterlibrary>_SOURCES and
22 changes: 22 additions & 0 deletions aspell/aspell-so2dll.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- aspell-0.60.6.1/lib/new_filter.cpp 2011-07-02 23:09:09.000000000 +0200
+++ aspell-0.60.6.1/lib/new_filter.cpp 2011-11-11 01:35:59.046875000 +0100
@@ -458,11 +458,19 @@ namespace acommon
module->file.assign(option_file.str(), slash + 1 - option_file.str());
//module->file += "lib";
module->file += filter_name;
+#ifdef __CYGWIN__
+ module->file += "-filter.dll";
+#else
module->file += "-filter.so";
+#endif
} else {
if (module->file[0] != '/')
module->file.insert(0, option_file.str(), slash + 1 - option_file.str());
+#ifdef __CYGWIN__
+ module->file += ".dll";
+#else
module->file += ".so";
+#endif
}

return module.release();

0 comments on commit 9ca477d

Please sign in to comment.