From 4e62b9d0d23860417628c507a904a314f099c693 Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Tue, 22 Jan 2013 09:35:08 +0000 Subject: [PATCH] UnRAR 4.2.4 utility added. --- app-arch/unrar/patches/unrar-4.2.4.patch | 263 +++++++++++++++++++++++ app-arch/unrar/unrar-4.2.4.bep | 19 ++ 2 files changed, 282 insertions(+) create mode 100644 app-arch/unrar/patches/unrar-4.2.4.patch create mode 100644 app-arch/unrar/unrar-4.2.4.bep diff --git a/app-arch/unrar/patches/unrar-4.2.4.patch b/app-arch/unrar/patches/unrar-4.2.4.patch new file mode 100644 index 000000000..19d12f33b --- /dev/null +++ b/app-arch/unrar/patches/unrar-4.2.4.patch @@ -0,0 +1,263 @@ +diff -aur unrar/arcread.cpp unrar.4.2.4.haiku/arcread.cpp +--- unrar/arcread.cpp 2012-06-09 15:21:04.066584576 +0200 ++++ unrar.4.2.4.haiku/arcread.cpp 2013-01-17 21:57:19.749207552 +0100 +@@ -666,7 +666,7 @@ + { + if (*s=='/' || *s=='\\') + *s=CPATHDIVIDER; +-#if defined(_APPLE) && !defined(UNICODE_SUPPORTED) ++#if (defined(_APPLE) || defined(_BEOS)) && !defined(UNICODE_SUPPORTED) + if ((byte)*s<32 || (byte)*s>127) + *s='_'; + #endif +diff -aur unrar/consio.cpp unrar.4.2.4.haiku/consio.cpp +--- unrar/consio.cpp 2012-06-09 15:21:04.000524288 +0200 ++++ unrar.4.2.4.haiku/consio.cpp 2013-01-21 22:23:37.662437888 +0100 +@@ -141,7 +141,7 @@ + SetConsoleMode(hConOut,ConOutMode); + #else + char StrA[MAXPASSWORD]; +-#if defined(_EMX) || defined(_BEOS) || defined(__sparc) || defined(sparc) || defined (__VMS) ++#if defined(_EMX) || defined(__sparc) || defined(sparc) || defined (__VMS) + fgets(StrA,ASIZE(StrA)-1,stdin); + #else + strncpyz(StrA,getpass(""),ASIZE(StrA)); +diff -aur unrar/extract.cpp unrar.4.2.4.haiku/extract.cpp +--- unrar/extract.cpp 2012-06-09 15:21:04.002097152 +0200 ++++ unrar.4.2.4.haiku/extract.cpp 2013-01-17 21:42:21.914620416 +0100 +@@ -311,7 +311,7 @@ + bool WideName=false; + #endif + +-#ifdef _APPLE ++#if defined(_APPLE) || defined(_BEOS) + if (WideName) + { + // Prepare UTF-8 name for OS X. Since we are sure that destination +diff -aur unrar/file.cpp unrar.4.2.4.haiku/file.cpp +--- unrar/file.cpp 2012-06-09 15:21:04.002621440 +0200 ++++ unrar.4.2.4.haiku/file.cpp 2013-01-21 22:12:02.543162368 +0100 +@@ -304,6 +304,8 @@ + hFile=stderr; + #endif + break; ++ default: ++ break; + } + #endif + while (1) +diff -aur unrar/find.cpp unrar.4.2.4.haiku/find.cpp +--- unrar/find.cpp 2012-06-09 15:21:04.003145728 +0200 ++++ unrar.4.2.4.haiku/find.cpp 2013-01-17 21:43:25.860618752 +0100 +@@ -104,7 +104,7 @@ + } + } + *fd->NameW=0; +-#ifdef _APPLE ++#if defined(_APPLE) || defined(_BEOS) + if (!LowAscii(fd->Name)) + UtfToWide(fd->Name,fd->NameW,sizeof(fd->NameW)); + #elif defined(UNICODE_SUPPORTED) +@@ -170,7 +170,7 @@ + strcpy(fd->Name,FindMask); + + *fd->NameW=0; +-#ifdef _APPLE ++#if defined(_APPLE) || defined(_BEOS) + if (!LowAscii(fd->Name)) + UtfToWide(fd->Name,fd->NameW,sizeof(fd->NameW)); + #elif defined(UNICODE_SUPPORTED) +diff -aur unrar/makefile.unix unrar.4.2.4.haiku/makefile.unix +--- unrar/makefile.unix 2012-05-15 07:31:03.004980736 +0200 ++++ unrar.4.2.4.haiku/makefile.unix 2013-01-21 22:17:15.800325632 +0100 +@@ -7,7 +7,11 @@ + LIBFLAGS=-fPIC + DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + STRIP=strip +-DESTDIR=/usr ++LDFLAGS=-lbsd ++RC=rc ++XRES=xres ++MIMESET=mimeset ++DESTDIR=$(shell finddir B_COMMON_DIRECTORY) + + # Linux using LCC + #CXX=lcc +@@ -114,12 +118,14 @@ + uninstall: uninstall-unrar + + clean: +- @rm -f *.o *.bak *~ ++ @rm -f *.o *.bak *~ *.rsrc + + unrar: clean $(OBJECTS) $(UNRAR_OBJ) + @rm -f unrar + $(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS) +- $(STRIP) unrar ++ $(RC) -o unrar.rsrc unrar.rdef ++ $(XRES) -o unrar unrar.rsrc ++ $(MIMESET) unrar + + sfx: WHAT=SFX_MODULE + sfx: clean $(OBJECTS) +@@ -144,3 +150,29 @@ + + uninstall-lib: + rm -f $(DESTDIR)/lib/libunrar.so ++ ++MACHINE=$(shell uname -m) ++ifeq ($(MACHINE), BePC) ++ MACHINE = x86-gcc$(word 1, $(subst -, , $(subst ., , $(shell $(CC) -dumpversion)))) ++endif ++ ++VERSION=4.2.4 ++DATE := `date +%F` ++PACKAGE_NAME := UnRAR-$(VERSION)-$(MACHINE)-$(DATE) ++COMMENT = .OptionalPackageDescription ++DESCRIPTION = dist/$(COMMENT) ++ ++haiku_package: unrar ++ -rm -rf dist/common ++ -mkdir -p dist/common/bin ++ -cp unrar dist/common/bin ++ -mkdir -p dist/common/data/licenses ++ -cp license.txt dist/common/data/licenses/UnRAR ++ echo "Package: UnRAR" > $(DESCRIPTION) ++ echo "Version: $(VERSION)-$(MACHINE)-$(DATE)" >> $(DESCRIPTION) ++ echo "Copyright: Alexander Roshal." >> $(DESCRIPTION) ++ echo "Description: Utility to list, test and expand RAR archives." >> $(DESCRIPTION) ++ echo "License: UnRAR" >> $(DESCRIPTION) ++ echo "URL: http://www.rarlab.com/" >> $(DESCRIPTION) ++ cd dist && zip -9 -r -z -y $(PACKAGE_NAME).zip common $(COMMENT) < $(COMMENT) ++ +diff -aur unrar/os.hpp unrar.4.2.4.haiku/os.hpp +--- unrar/os.hpp 2012-06-09 15:21:04.005767168 +0200 ++++ unrar.4.2.4.haiku/os.hpp 2013-01-21 22:25:04.170655744 +0100 +@@ -134,8 +134,9 @@ + #define NM 1024 + + #ifdef _BEOS +-#include +-#include ++#include ++#include ++#include + #endif + + #include +@@ -206,6 +207,16 @@ + #endif + #endif + ++#ifdef _BEOS ++#if LITTLE_ENDIAN ++ #undef BIG_ENDIAN ++#elif BIG_ENDIAN ++ #undef LITTLE_ENDIAN ++#else ++ #error "Byte order must be defined!" ++#endif ++#endif ++ + #if defined(__sparc) || defined(sparc) || defined(__hpux) + #ifndef BIG_ENDIAN + #define BIG_ENDIAN +diff -aur unrar/raros.hpp unrar.4.2.4.haiku/raros.hpp +--- unrar/raros.hpp 2012-06-09 15:21:04.006553600 +0200 ++++ unrar.4.2.4.haiku/raros.hpp 2013-01-16 19:50:06.066060288 +0100 +@@ -29,7 +29,7 @@ + #endif + #endif + +-#ifdef __BEOS__ ++#if defined(__BEOS__) || defined(__HAIKU__) + #define _UNIX + #define _BEOS + #endif +diff -aur unrar/rartypes.hpp unrar.4.2.4.haiku/rartypes.hpp +--- unrar/rartypes.hpp 2012-06-09 15:21:04.006815744 +0200 ++++ unrar.4.2.4.haiku/rartypes.hpp 2013-01-19 23:12:46.715653120 +0100 +@@ -7,6 +7,7 @@ + + #define PRESENT_INT32 // undefine if signed 32 bits is not available + ++#ifndef _BEOS + typedef unsigned int uint32; // 32 bits exactly + typedef signed int int32; // signed 32 bits exactly + +@@ -20,6 +21,7 @@ + typedef unsigned long long uint64; // unsigned 64 bits + typedef signed long long int64; // signed 64 bits + #endif ++#endif // #ifndef _BEOS + + + #if defined(_WIN_ALL) || defined(__GNUC__) || defined(__sgi) || defined(_AIX) || defined(__sun) || defined(__hpux) || defined(_OSF_SOURCE) +diff -aur unrar/rarvm.cpp unrar.4.2.4.haiku/rarvm.cpp +--- unrar/rarvm.cpp 2012-06-09 15:21:04.007077888 +0200 ++++ unrar.4.2.4.haiku/rarvm.cpp 2013-01-21 22:12:02.605814784 +0100 +@@ -792,6 +792,8 @@ + case VM_CMP: + Cmd->OpCode=Cmd->ByteMode ? VM_CMPB:VM_CMPD; + continue; ++ default: ++ break; + } + if ((VM_CmdFlags[Cmd->OpCode] & VMCF_CHFLAGS)==0) + continue; +@@ -835,6 +837,8 @@ + case VM_NEG: + Cmd->OpCode=Cmd->ByteMode ? VM_NEGB:VM_NEGD; + continue; ++ default: ++ break; + } + } + } +@@ -1102,6 +1106,8 @@ + SET_VALUE(false,&Mem[VM_GLOBALMEMADDR+0x20],DataSize); + } + break; ++ default: ++ break; + } + } + +diff -aur unrar/unicode.cpp unrar.4.2.4.haiku/unicode.cpp +--- unrar/unicode.cpp 2012-06-09 15:21:04.010747904 +0200 ++++ unrar.4.2.4.haiku/unicode.cpp 2013-01-17 21:41:15.856686592 +0100 +@@ -13,7 +13,7 @@ + if (WideCharToMultiByte(CP_ACP,0,Src,-1,Dest,(int)DestSize,NULL,NULL)==0) + RetCode=false; + +-#elif defined(_APPLE) ++#elif defined(_APPLE) || defined(_BEOS) + WideToUtf(Src,Dest,DestSize); + + #elif defined(MBFUNCTIONS) +@@ -73,7 +73,7 @@ + if (MultiByteToWideChar(CP_ACP,0,Src,-1,Dest,(int)DestSize)==0) + RetCode=false; + +-#elif defined(_APPLE) ++#elif defined(_APPLE) || defined(_BEOS) + UtfToWide(Src,Dest,DestSize); + + #elif defined(MBFUNCTIONS) +diff -aur unrar/unrar.rdef unrar.4.2.4.haiku/unrar.rdef +--- unrar/unrar.rdef 1970-01-01 01:00:00.000000000 +0100 ++++ unrar.4.2.4.haiku/unrar.rdef 2013-01-16 20:43:32.898629632 +0100 +@@ -0,0 +1,13 @@ ++ ++resource app_signature "application/x-vnd.Roshal-UnRAR"; ++resource app_flags B_MULTIPLE_LAUNCH | B_BACKGROUND_APP; ++ ++resource app_version { ++ major = 4, ++ middle = 2, ++ minor = 4, ++ variety = 0, ++ internal = 0, ++ short_info = "4.2.4", ++ long_info = "4.2.4 Alexander Roshal" ++}; diff --git a/app-arch/unrar/unrar-4.2.4.bep b/app-arch/unrar/unrar-4.2.4.bep new file mode 100644 index 000000000..1b697795b --- /dev/null +++ b/app-arch/unrar/unrar-4.2.4.bep @@ -0,0 +1,19 @@ +DESCRIPTION="unrar" +HOMEPAGE="http://www.rarlab.com/" +SRC_URI="http://www.rarlab.com/rar/unrarsrc-4.2.4.tar.gz" +REVISION="1" +STATUS_HAIKU="stable" +DEPEND="" +CHECKSUM_MD5="8ea9d1b4139474b282d76e627a2de3e4" +BUILD { + cd unrar + make -f makefile.unix DESTDIR=`finddir B_COMMON_DIRECTORY` +} + +INSTALL { + cd unrar + make -f makefile.unix DESTDIR=`finddir B_COMMON_DIRECTORY` install +} + +LICENSE="UnRAR" +COPYRIGHT="Alexander Roshal"