Added transplus recipe

This commit is contained in:
Vale
2016-01-02 15:00:23 -05:00
committed by DarkmatterVale
parent faa636bbf3
commit 4b1ecfe197
2 changed files with 427 additions and 0 deletions

View File

@@ -0,0 +1,379 @@
From 2a15e7e3e10adb2f919d6e3617beb6ba4a8425a4 Mon Sep 17 00:00:00 2001
From: DarkmatterVale <valetolpegin@gmail.com>
Date: Sat, 2 Jan 2016 16:42:32 +0000
Subject: make gcc2 happy
diff --git a/src/HTML/TransWP.h b/src/HTML/TransWP.h
index 6dc4780..7e6d035 100644
--- a/src/HTML/TransWP.h
+++ b/src/HTML/TransWP.h
@@ -2,6 +2,8 @@
#define _TRANS_WP_H
+#include <Picture.h>
+
enum { //-------------Common text attributes, use in WP_Attr::attr_type-----------
font = 'FONT',
color = 'COLR',
@@ -37,14 +39,14 @@ class TranslatorWP : public BArchivable { //----------Type Code is 'TRWP'-------
WP_Attr *getAttr(int32 *begin, int32 end, int32 index = 0); //-----do NOT deallocate or modify----
//-----------Embedded Data--------------------------------------------------
void AddEmbedded(uint32 data_type /*--See Translator Groups--*/,int32 offset,const void *data,size_t size);
-
+
status_t GetEmbedded(uint32 *data_type /*--See Translator Groups--*/,int32 offset,const void **data,size_t *size, int32 index = 0);
status_t GetEmbedded(uint32 data_type /*--See Translator Groups--*/,int32 offset,const void **data,size_t *size, int32 index = 0);
//-------Pictures-------
void AddPicture(int32 offset,BPicture *picture); //----Vector-------
void AddPicture(int32 offset,BBitmap *bitmap);
void AddPicture(int32 offset,const void *translatorBitmap,size_t size);
-
+
BPicture *GetPicture(int32 offset, int32 index = 0); //----Vector-------
BBitmap *GetBitmap(int32 offset,int32 index = 0);
//-------Text-----------
@@ -61,7 +63,7 @@ class TranslatorWP : public BArchivable { //----------Type Code is 'TRWP'-------
//----------Gloabal Attributes----------------------------------------------
void pushGlobal(uint32 type,const char *name,const void *data,size_t size);
void pushGlobal(const char *data,const char *name);
-
+
const void *getGlobal(int32 index,uint32 type,size_t *size,char **name);
const char *getGlobal(int32 index,char **name);
const void *getGlobal(const char *name,uint32 type,size_t *size,int32 index = 0);
@@ -78,4 +80,4 @@ class TranslatorWP : public BArchivable { //----------Type Code is 'TRWP'-------
attr_list *begin_attrs, *end_attrs;
};
-#endif
\ No newline at end of file
+#endif
diff --git a/src/HTML/main.cp b/src/HTML/main.cp
index 5393abe..fbe2ba6 100644
--- a/src/HTML/main.cp
+++ b/src/HTML/main.cp
@@ -1,3 +1,4 @@
+#include <ClassInfo.h>
#include <Sound.h>
#include <InterfaceDefs.h>
#include <image.h>
@@ -13,7 +14,7 @@
extern "C" _EXPORT status_t Identify(BPositionIO *inSource,const translation_format *inFormat,
BMessage *ioExtension,translator_info *outInfo, uint32 outType);
-
+
extern "C" _EXPORT status_t Translate(BPositionIO *inSource,const translator_info *inInfo,
BMessage *ioExtension,uint32 outType,BPositionIO *outDestination);
@@ -393,7 +394,7 @@ void pushAttrFromTag(TranslatorWP *work,BString tag /*No brackets*/,int32 begin,
} else {
sscanf(working.String(),"%f",&final_size);
final_size += baseTextSize;
- }
+ }
work->pushAttr(begin,end,size,&final_size,sizeof(float));
}
if (tag.IFindFirst("COLOR=") != B_ERROR) {
@@ -482,4 +483,4 @@ const char *pullFlag(BString tag, const char *flagName) {
tag.Remove(0,where_are_we);
string.SetTo(tag);
return string.String();
-}
\ No newline at end of file
+}
diff --git a/src/make2 b/src/make2
index 17259b9..b760c07 100644
--- a/src/make2
+++ b/src/make2
@@ -1,28 +1,28 @@
-## Haiku Generic Makefile v2.6 ##
+## Haiku Generic Makefile v2.6 ##
## Fill in this file to specify the project being created, and the referenced
## Makefile-Engine will do all of the hard work for you. This handles any
## architecture of Haiku.
# The name of the binary.
-NAME =
+NAME = HTML
# The type of binary, must be one of:
# APP: Application
# SHARED: Shared library or add-on
# STATIC: Static library archive
# DRIVER: Kernel driver
-TYPE = APP
+TYPE = SHARED
# If you plan to use localization, specify the application's MIME signature.
-APP_MIME_SIG =
+APP_MIME_SIG =
# The following lines tell Pe and Eddie where the SRCS, RDEFS, and RSRCS are
# so that Pe and Eddie can fill them in for you.
#%{
-# @src->@
+# @src->@
-# Specify the source files to use. Full paths or paths relative to the
+# Specify the source files to use. Full paths or paths relative to the
# Makefile can be included. All files, regardless of directory, will have
# their object files created in the common object directory. Note that this
# means this Makefile will not work correctly if two source files with the
@@ -32,14 +32,14 @@ SRCS = HTML/main.cp
# Specify the resource definition files to use. Full or relative paths can be
# used.
-RDEFS =
+RDEFS =
# Specify the resource files to use. Full or relative paths can be used.
# Both RDEFS and RSRCS can be utilized in the same Makefile.
-RSRCS =
+RSRCS =
# End Pe/Eddie support.
-# @<-src@
+# @<-src@
#%}
# Specify libraries to link against.
@@ -54,65 +54,65 @@ RSRCS =
# - if your library does not follow the standard library naming scheme,
# you need to specify the path to the library and it's name.
# (e.g. for mylib.a, specify "mylib.a" or "path/mylib.a")
-LIBS =
+LIBS =
# Specify additional paths to directories following the standard libXXX.so
# or libXXX.a naming scheme. You can specify full paths or paths relative
# to the Makefile. The paths included are not parsed recursively, so
# include all of the paths where libraries must be found. Directories where
# source files were specified are automatically included.
-LIBPATHS =
+LIBPATHS =
# Additional paths to look for system headers. These use the form
# "#include <header>". Directories that contain the files in SRCS are
# NOT auto-included here.
-SYSTEM_INCLUDE_PATHS =
+SYSTEM_INCLUDE_PATHS =
# Additional paths paths to look for local headers. These use the form
# #include "header". Directories that contain the files in SRCS are
# automatically included.
-LOCAL_INCLUDE_PATHS =
+LOCAL_INCLUDE_PATHS =
# Specify the level of optimization that you want. Specify either NONE (O0),
# SOME (O1), FULL (O2), or leave blank (for the default optimization level).
-OPTIMIZE :=
+OPTIMIZE :=
# Specify the codes for languages you are going to support in this
# application. The default "en" one must be provided too. "make catkeys"
# will recreate only the "locales/en.catkeys" file. Use it as a template
# for creating catkeys for other languages. All localization files must be
# placed in the "locales" subdirectory.
-LOCALES =
+LOCALES =
# Specify all the preprocessor symbols to be defined. The symbols will not
# have their values set automatically; you must supply the value (if any) to
# use. For example, setting DEFINES to "DEBUG=1" will cause the compiler
# option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" would pass
# "-DDEBUG" on the compiler's command line.
-DEFINES =
+DEFINES =
# Specify the warning level. Either NONE (suppress all warnings),
# ALL (enable all warnings), or leave blank (enable default warnings).
-WARNINGS =
+WARNINGS =
# With image symbols, stack crawls in the debugger are meaningful.
# If set to "TRUE", symbols will be created.
-SYMBOLS :=
+SYMBOLS :=
# Includes debug information, which allows the binary to be debugged easily.
# If set to "TRUE", debug info will be created.
-DEBUGGER :=
+DEBUGGER :=
# Specify any additional compiler flags to be used.
-COMPILER_FLAGS =
+COMPILER_FLAGS =
# Specify any additional linker flags to be used.
-LINKER_FLAGS =
+LINKER_FLAGS =
# Specify the version of this binary. Example:
# -app 3 4 0 d 0 -short 340 -long "340 "`echo -n -e '\302\251'`"1999 GNU GPL"
# This may also be specified in a resource.
-APP_VERSION :=
+APP_VERSION :=
# (Only used when "TYPE" is "DRIVER"). Specify the desired driver install
# location in the /dev hierarchy. Example:
@@ -120,7 +120,7 @@ APP_VERSION :=
# will instruct the "driverinstall" rule to place a symlink to your driver's
# binary in ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will
# appear at /dev/video/usb when loaded. The default is "misc".
-DRIVER_PATH =
+DRIVER_PATH =
## Include the Makefile-Engine
DEVEL_DIRECTORY := \
diff --git a/src/make3 b/src/make3
index ea5b13b..b120fcb 100644
--- a/src/make3
+++ b/src/make3
@@ -1,28 +1,28 @@
-## Haiku Generic Makefile v2.6 ##
+## Haiku Generic Makefile v2.6 ##
## Fill in this file to specify the project being created, and the referenced
## Makefile-Engine will do all of the hard work for you. This handles any
## architecture of Haiku.
# The name of the binary.
-NAME =
+NAME =
# The type of binary, must be one of:
# APP: Application
# SHARED: Shared library or add-on
# STATIC: Static library archive
# DRIVER: Kernel driver
-TYPE = APP
+TYPE = SHARED
# If you plan to use localization, specify the application's MIME signature.
-APP_MIME_SIG =
+APP_MIME_SIG =
# The following lines tell Pe and Eddie where the SRCS, RDEFS, and RSRCS are
# so that Pe and Eddie can fill them in for you.
#%{
-# @src->@
+# @src->@
-# Specify the source files to use. Full paths or paths relative to the
+# Specify the source files to use. Full paths or paths relative to the
# Makefile can be included. All files, regardless of directory, will have
# their object files created in the common object directory. Note that this
# means this Makefile will not work correctly if two source files with the
@@ -32,14 +32,14 @@ SRCS = PlainText/main.cp
# Specify the resource definition files to use. Full or relative paths can be
# used.
-RDEFS =
+RDEFS =
# Specify the resource files to use. Full or relative paths can be used.
# Both RDEFS and RSRCS can be utilized in the same Makefile.
-RSRCS =
+RSRCS =
# End Pe/Eddie support.
-# @<-src@
+# @<-src@
#%}
# Specify libraries to link against.
@@ -54,65 +54,65 @@ RSRCS =
# - if your library does not follow the standard library naming scheme,
# you need to specify the path to the library and it's name.
# (e.g. for mylib.a, specify "mylib.a" or "path/mylib.a")
-LIBS =
+LIBS =
# Specify additional paths to directories following the standard libXXX.so
# or libXXX.a naming scheme. You can specify full paths or paths relative
# to the Makefile. The paths included are not parsed recursively, so
# include all of the paths where libraries must be found. Directories where
# source files were specified are automatically included.
-LIBPATHS =
+LIBPATHS =
# Additional paths to look for system headers. These use the form
# "#include <header>". Directories that contain the files in SRCS are
# NOT auto-included here.
-SYSTEM_INCLUDE_PATHS =
+SYSTEM_INCLUDE_PATHS =
# Additional paths paths to look for local headers. These use the form
# #include "header". Directories that contain the files in SRCS are
# automatically included.
-LOCAL_INCLUDE_PATHS =
+LOCAL_INCLUDE_PATHS =
# Specify the level of optimization that you want. Specify either NONE (O0),
# SOME (O1), FULL (O2), or leave blank (for the default optimization level).
-OPTIMIZE :=
+OPTIMIZE :=
# Specify the codes for languages you are going to support in this
# application. The default "en" one must be provided too. "make catkeys"
# will recreate only the "locales/en.catkeys" file. Use it as a template
# for creating catkeys for other languages. All localization files must be
# placed in the "locales" subdirectory.
-LOCALES =
+LOCALES =
# Specify all the preprocessor symbols to be defined. The symbols will not
# have their values set automatically; you must supply the value (if any) to
# use. For example, setting DEFINES to "DEBUG=1" will cause the compiler
# option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" would pass
# "-DDEBUG" on the compiler's command line.
-DEFINES =
+DEFINES =
# Specify the warning level. Either NONE (suppress all warnings),
# ALL (enable all warnings), or leave blank (enable default warnings).
-WARNINGS =
+WARNINGS =
# With image symbols, stack crawls in the debugger are meaningful.
# If set to "TRUE", symbols will be created.
-SYMBOLS :=
+SYMBOLS :=
# Includes debug information, which allows the binary to be debugged easily.
# If set to "TRUE", debug info will be created.
-DEBUGGER :=
+DEBUGGER :=
# Specify any additional compiler flags to be used.
-COMPILER_FLAGS =
+COMPILER_FLAGS =
# Specify any additional linker flags to be used.
-LINKER_FLAGS =
+LINKER_FLAGS =
# Specify the version of this binary. Example:
# -app 3 4 0 d 0 -short 340 -long "340 "`echo -n -e '\302\251'`"1999 GNU GPL"
# This may also be specified in a resource.
-APP_VERSION :=
+APP_VERSION :=
# (Only used when "TYPE" is "DRIVER"). Specify the desired driver install
# location in the /dev hierarchy. Example:
@@ -120,7 +120,7 @@ APP_VERSION :=
# will instruct the "driverinstall" rule to place a symlink to your driver's
# binary in ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will
# appear at /dev/video/usb when loaded. The default is "misc".
-DRIVER_PATH =
+DRIVER_PATH =
## Include the Makefile-Engine
DEVEL_DIRECTORY := \
--
2.2.2

View File

@@ -0,0 +1,48 @@
SUMMARY="Extension to the data-stream translation kit"
DESCRIPTION="Translator Plus is an extension to the data-stream \
translation kit that is aimed at document file-types. For now, only HTML \
and plain text are supported."
HOMEPAGE="http://github.com/HaikuArchives/TransPlus"
COPYRIGHT="2000 Nathan Whitehorn"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/HaikuArchives/TransPlus/archive/e860d8e65d43fa0f7c5e095725e78ee5e104c0a4.tar.gz"
CHECKSUM_SHA256="d60788f8cdc2644f5ef2e099948903219643e75d6732119c6a6f38a238053d67"
SOURCE_DIR="TransPlus-e860d8e65d43fa0f7c5e095725e78ee5e104c0a4"
PATCHES="transplus-$portVersion.patchset"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
PROVIDES="
transplus = $portVersion
lib:Transplus = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
makefile_engine
cmd:make
cmd:gcc
"
BUILD()
{
cd src
make OBJ_DIR=objects
make OBJ_DIR=objects -f make2
make OBJ_DIR=objects -f make3
}
INSTALL()
{
mkdir -p $addOnsDir/Translators
mkdir -p $libDir
cp -r $sourceDir/src/objects/libtransplus $libDir
cp -r $sourceDir/src/objects/HTML $addOnsDir/Translators/
}