diff --git a/app-arch/unrar/patches/unrar-5.8.1.patchset b/app-arch/unrar/patches/unrar-5.8.1.patchset new file mode 100644 index 000000000..647163d4e --- /dev/null +++ b/app-arch/unrar/patches/unrar-5.8.1.patchset @@ -0,0 +1,21 @@ +From 1c19dea55d375f6968ce54a51ab42958347726a8 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Mon, 12 May 2014 18:07:44 +0000 +Subject: initial Haiku patch + + +diff --git a/archive.hpp b/archive.hpp +index fd33ac3..787977b 100644 +--- a/archive.hpp ++++ b/archive.hpp +@@ -67,7 +67,6 @@ class Archive:public File + size_t SearchSubBlock(const wchar *Type); + size_t SearchRR(); + void WriteBlock(HEADER_TYPE HeaderType,BaseBlock *wb=NULL,bool OnlySetSize=false,bool NonFinalWrite=false); +- void SetBlockSize(HEADER_TYPE HeaderType,BaseBlock *wb=NULL) {WriteBlock(HeaderType,wb,true);} + size_t ReadHeader(); + void CheckArc(bool EnableBroken); + void CheckOpen(const wchar *Name); +-- +2.16.2 + diff --git a/app-arch/unrar/unrar-5.8.1.recipe b/app-arch/unrar/unrar-5.8.1.recipe new file mode 100644 index 000000000..8d3903302 --- /dev/null +++ b/app-arch/unrar/unrar-5.8.1.recipe @@ -0,0 +1,112 @@ +SUMMARY="Uncompress rar files" +DESCRIPTION="UnRAR decompresses rar files. It is a powerful archive manager \ +that can backup your data and reduce the size of email attachments. UnRAR can \ +decompress the following file formats: +- RAR +- ZIP +- CAB +- ARJ +- JZH +- TAR +- GZ and TAR.GZ +- BZ2 and TAR.BZ2 +- ACE +- UUE +- JAR (Java Archive) +- ISO +- 7Z +- XZ +- Z (Unix Compress)" +HOMEPAGE="https://www.rarlab.com/rar_add.htm" +COPYRIGHT="1993-2018 Alexander Roshal" +LICENSE="UnRAR" +REVISION="1" +SOURCE_URI="https://www.rarlab.com/rar/unrarsrc-$portVersion.tar.gz" +CHECKSUM_SHA256="035f1f436f0dc2aea09aec146b9cc3e47ca2442f2c62b4ad9374c7c9cc20e632" +SOURCE_DIR="unrar" +PATCHES="unrar-$portVersion.patchset" +ADDITIONAL_FILES=" + test.rar + unrar.rdef + " + +ARCHITECTURES="x86_gcc2 x86 x86_64" + +PROVIDES=" + unrar = $portVersion + cmd:unrar = $portVersion + devel:libunrar = $portVersion + lib:libunrar = $portVersion + " +REQUIRES=" + haiku + " + +BUILD_REQUIRES=" + haiku_devel + " +BUILD_PREREQUIRES=" + cmd:cut + cmd:g++ + cmd:make + cmd:sed + " + +PATCH() +{ + if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then + sed -i \ + -e "/^CXXFLAGS=/ s/ -Wno-logical-op-parentheses//;" \ + -e "/^CXXFLAGS=/ s/ -Wno-dangling-else//;" \ + makefile + fi + sed -i -e "/^LDFLAGS=/ d;" makefile +} + +BUILD() +{ + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + sed \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + "$portDir"/additional-files/unrar.rdef > unrar.rdef + + for i in unrar lib sfx; do + mkdir -p $i + cd $i + ln -f -s ../*.cpp ../*.hpp ../makefile . + CPPFLAGS="-D_BSD_SOURCE" LDFLAGS="-lbsd" make $i + cd .. + done +} + +INSTALL() +{ + install -d "$libDir"/unrar + install -t "$libDir"/unrar sfx/default.sfx + for i in unrar lib; do + make -C $i DESTDIR="$prefix" install-$i + done + rm "$libDir"/libunrar.a + + prepareInstalledDevelLib libunrar + + addResourcesToBinaries unrar.rdef "$binDir"/unrar + mimeset -f "$binDir"/unrar +} + +TEST() +{ + rm -rf dir + "$sourceDir"/unrar/unrar x "$portDir"/additional-files/test.rar + test "`cat dir/haiku.txt`" = Haiku + + cat sfx/default.sfx "$portDir"/additional-files/test.rar >dir/sfxtest + cd dir + chmod +x sfxtest + ./sfxtest + test "`cat dir/haiku.txt`" = Haiku +}