diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-10-18 23:00:19 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-10-19 07:48:15 +0000 |
commit | 67867f77d90eae4de276ef477a973ce68357d7d6 (patch) | |
tree | 0741a3595f06d80ab8c1d7669ef9f9378269de87 /external/mythes | |
parent | fdo#70393: move mysqlcppconn to a subdir of external (diff) | |
download | core-67867f77d90eae4de276ef477a973ce68357d7d6.tar.gz core-67867f77d90eae4de276ef477a973ce68357d7d6.zip |
fdo#70393: move mythes to a subdir of external
Change-Id: I132479fd26e45276f25af5615175b0fdaeaaeb01
Reviewed-on: https://gerrit.libreoffice.org/6347
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'external/mythes')
-rw-r--r-- | external/mythes/ExternalProject_mythes.mk | 26 | ||||
-rw-r--r-- | external/mythes/Makefile | 7 | ||||
-rw-r--r-- | external/mythes/Module_mythes.mk | 25 | ||||
-rw-r--r-- | external/mythes/README | 1 | ||||
-rw-r--r-- | external/mythes/StaticLibrary_mythes.mk | 21 | ||||
-rw-r--r-- | external/mythes/UnpackedTarball_mythes.mk | 20 | ||||
-rw-r--r-- | external/mythes/mythes-1.2.0-android.patch | 20 | ||||
-rw-r--r-- | external/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch | 90 | ||||
-rw-r--r-- | external/mythes/mythes-ssizet.patch | 20 |
9 files changed, 230 insertions, 0 deletions
diff --git a/external/mythes/ExternalProject_mythes.mk b/external/mythes/ExternalProject_mythes.mk new file mode 100644 index 000000000000..8681cc292e12 --- /dev/null +++ b/external/mythes/ExternalProject_mythes.mk @@ -0,0 +1,26 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalProject_ExternalProject,mythes)) + +$(eval $(call gb_ExternalProject_use_external,mythes,hunspell)) + +$(eval $(call gb_ExternalProject_register_targets,mythes,\ + build \ +)) + +$(call gb_ExternalProject_get_state_target,mythes,build): + $(call gb_ExternalProject_run,build,\ + LIBS="$(gb_STDLIBS) $(LIBS)" ./configure --disable-shared --with-pic \ + $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \ + $(if $(filter C52U,$(COM)$(CPU)),CFLAGS="-m64") \ + && $(MAKE) \ + ) + +# vim: set noet sw=4 ts=4: diff --git a/external/mythes/Makefile b/external/mythes/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/mythes/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/mythes/Module_mythes.mk b/external/mythes/Module_mythes.mk new file mode 100644 index 000000000000..56d95fc9179d --- /dev/null +++ b/external/mythes/Module_mythes.mk @@ -0,0 +1,25 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,mythes)) + +$(eval $(call gb_Module_add_targets,mythes,\ + UnpackedTarball_mythes \ +)) +ifeq ($(COM),MSC) +$(eval $(call gb_Module_add_targets,mythes,\ + StaticLibrary_mythes \ +)) +else +$(eval $(call gb_Module_add_targets,mythes,\ + ExternalProject_mythes \ +)) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/mythes/README b/external/mythes/README new file mode 100644 index 000000000000..8a1792ee05b3 --- /dev/null +++ b/external/mythes/README @@ -0,0 +1 @@ +Library for handling thesaurus files from [http://hunspell.sourceforge.net]. diff --git a/external/mythes/StaticLibrary_mythes.mk b/external/mythes/StaticLibrary_mythes.mk new file mode 100644 index 000000000000..d955b6a025e7 --- /dev/null +++ b/external/mythes/StaticLibrary_mythes.mk @@ -0,0 +1,21 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_StaticLibrary_StaticLibrary,mythes)) + +$(eval $(call gb_StaticLibrary_use_unpacked,mythes,mythes)) + +$(eval $(call gb_StaticLibrary_set_warnings_not_errors,mythes)) + +$(eval $(call gb_StaticLibrary_add_generated_cxxobjects,mythes,\ + UnpackedTarball/mythes/mythes \ +)) + + +# vim: set noet sw=4 ts=4: diff --git a/external/mythes/UnpackedTarball_mythes.mk b/external/mythes/UnpackedTarball_mythes.mk new file mode 100644 index 000000000000..d2d4e1d6e772 --- /dev/null +++ b/external/mythes/UnpackedTarball_mythes.mk @@ -0,0 +1,20 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,mythes)) + +$(eval $(call gb_UnpackedTarball_set_tarball,mythes,$(MYTHES_TARBALL))) + +$(eval $(call gb_UnpackedTarball_add_patches,mythes,\ + external/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch \ + external/mythes/mythes-1.2.0-android.patch \ + external/mythes/mythes-ssizet.patch \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/mythes/mythes-1.2.0-android.patch b/external/mythes/mythes-1.2.0-android.patch new file mode 100644 index 000000000000..9b5293876281 --- /dev/null +++ b/external/mythes/mythes-1.2.0-android.patch @@ -0,0 +1,20 @@ +--- misc/mythes-1.2.3/config.sub 2010-02-27 16:52:52.000000000 +0100 ++++ misc/build/mythes-1.2.3/config.sub 2011-09-26 23:39:04.000000000 +0200 +@@ -123,7 +123,7 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ ++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) +@@ -1294,7 +1294,7 @@ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ ++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ diff --git a/external/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch b/external/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch new file mode 100644 index 000000000000..3752e291200e --- /dev/null +++ b/external/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch @@ -0,0 +1,90 @@ +--- misc/mythes-1.2.3.orig/th_gen_idx.pl ++++ misc/build/mythes-1.2.3/th_gen_idx.pl +@@ -1,11 +1,25 @@ +-#!/usr/bin/perl +- +-# perl program to take a thesaurus structured text data file +-# and create the proper sorted index file (.idx) ++: ++eval 'exec perl -wS $0 ${1+"$@"}' ++ if 0; ++# ++# This file is part of the LibreOffice project. ++# ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++# ++# This file incorporates work covered by the following license notice: ++# ++# Licensed to the Apache Software Foundation (ASF) under one or more ++# contributor license agreements. See the NOTICE file distributed ++# with this work for additional information regarding copyright ++# ownership. The ASF licenses this file to you under the Apache ++# License, Version 2.0 (the "License"); you may not use this file ++# except in compliance with the License. You may obtain a copy of ++# the License at http://www.apache.org/licenses/LICENSE-2.0 . ++# + # +-# typically invoked as follows: +-# cat th_en_US_new.dat | ./th_gen_idx.pl > th_en_US_new.idx + # + + sub by_entry { + my ($aent, $aoff) = split('\|',$a); +@@ -13,6 +34,27 @@ sub by_entry { + $aent cmp $bent; + } + ++#FIXME: someone may want "infile" or even parameter parsing ++sub get_outfile { ++ my $next_is_file = 0; ++ foreach ( @ARGV ) { ++ if ( $next_is_file ) { ++ return $_ ++ } ++ if ( $_ eq "-o" ) { ++ $next_is_file = 1; ++ } ++ } ++ return ""; ++} ++ ++sub usage { ++ print "usage:\n"; ++ print "$0 -o outfile < input\n"; ++ ++ exit 99; ++} ++ + # main routine + my $ne = 0; # number of entries in index + my @tindex=(); # the index itself +@@ -24,6 +66,10 @@ my $nm=0; # number of meaning fo + my $meaning=""; # current meaning and synonyms + my $p; # misc uses + my $encoding; # encoding used by text file ++my $outfile = ""; ++ ++$outfile = get_outfile(); ++usage() if ( $outfile eq "" ); + + # top line of thesaurus provides encoding + $encoding=<STDIN>; +@@ -51,9 +97,13 @@ while ($rec=<STDIN>){ + # now we have all of the information + # so sort it and then output the encoding, count and index data + @tindex = sort by_entry @tindex; +-print STDOUT "$encoding\n"; +-print STDOUT "$ne\n"; ++ ++print "$outfile\n"; ++open OUTFILE, ">$outfile" or die "ERROR: Can't open $outfile for writing!"; ++print OUTFILE "$encoding\n"; ++print OUTFILE "$ne\n"; + foreach $one (@tindex) { +- print STDOUT "$one\n"; ++ print OUTFILE "$one\n"; + } ++close OUTFILE; + diff --git a/external/mythes/mythes-ssizet.patch b/external/mythes/mythes-ssizet.patch new file mode 100644 index 000000000000..25d95165d8f2 --- /dev/null +++ b/external/mythes/mythes-ssizet.patch @@ -0,0 +1,20 @@ +--- misc/mythes-1.2.3/mythes.cxx 2012-06-29 13:16:55.812939142 +0100 ++++ misc/build/mythes-1.2.3/mythes.cxx 2012-06-29 13:17:21.159198507 +0100 +@@ -48,7 +48,7 @@ + len = readLine(pifile,wrd,MAX_WD_LEN); + int idxsz = atoi(wrd); + +- if (idxsz <= 0 || idxsz > std::numeric_limits<ssize_t>::max() / sizeof(sizeof(char*))) { ++ if (idxsz <= 0 || idxsz > std::numeric_limits<int>::max() / sizeof(sizeof(char*))) { + fprintf(stderr,"Error - bad index %d\n", idxsz); + fclose(pifile); + return 0; +@@ -176,7 +176,7 @@ + return 0; + } + int nmeanings = atoi(buf+np+1); +- if (nmeanings < 0 || nmeanings > std::numeric_limits<ssize_t>::max() / sizeof(mentry)) ++ if (nmeanings < 0 || nmeanings > std::numeric_limits<int>::max() / sizeof(mentry)) + nmeanings = 0; + *pme = (mentry*)(nmeanings ? malloc(nmeanings * sizeof(mentry)) : NULL); + if (!(*pme)) { |