forked from pool/lzma-sdk
Accepting request 562636 from home:jengelh:branches:Archiving
- Update to new upstream release 17.01 * Some bugs were fixed. - Replace lzma-sdk-16.04-sharedlib.patch with lzma-sdk-shlib.patch. To be used by games/gzdoom. OBS-URL: https://build.opensuse.org/request/show/562636 OBS-URL: https://build.opensuse.org/package/show/Archiving/lzma-sdk?expand=0&rev=5
This commit is contained in:
parent
2736d7eae5
commit
1423bfa2f6
@ -1,480 +0,0 @@
|
||||
Index: lzma1604/C/LzmaDec.c
|
||||
===================================================================
|
||||
--- lzma1604.orig/C/LzmaDec.c
|
||||
+++ lzma1604/C/LzmaDec.c
|
||||
@@ -7,123 +7,10 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
-#define kNumTopBits 24
|
||||
-#define kTopValue ((UInt32)1 << kNumTopBits)
|
||||
-
|
||||
-#define kNumBitModelTotalBits 11
|
||||
-#define kBitModelTotal (1 << kNumBitModelTotalBits)
|
||||
-#define kNumMoveBits 5
|
||||
-
|
||||
-#define RC_INIT_SIZE 5
|
||||
-
|
||||
-#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
|
||||
-
|
||||
-#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
|
||||
-#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
|
||||
-#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
|
||||
-#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
|
||||
- { UPDATE_0(p); i = (i + i); A0; } else \
|
||||
- { UPDATE_1(p); i = (i + i) + 1; A1; }
|
||||
-#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
|
||||
-
|
||||
-#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
|
||||
-#define TREE_DECODE(probs, limit, i) \
|
||||
- { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
|
||||
-
|
||||
-/* #define _LZMA_SIZE_OPT */
|
||||
-
|
||||
-#ifdef _LZMA_SIZE_OPT
|
||||
-#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
|
||||
-#else
|
||||
-#define TREE_6_DECODE(probs, i) \
|
||||
- { i = 1; \
|
||||
- TREE_GET_BIT(probs, i); \
|
||||
- TREE_GET_BIT(probs, i); \
|
||||
- TREE_GET_BIT(probs, i); \
|
||||
- TREE_GET_BIT(probs, i); \
|
||||
- TREE_GET_BIT(probs, i); \
|
||||
- TREE_GET_BIT(probs, i); \
|
||||
- i -= 0x40; }
|
||||
-#endif
|
||||
-
|
||||
-#define NORMAL_LITER_DEC GET_BIT(prob + symbol, symbol)
|
||||
-#define MATCHED_LITER_DEC \
|
||||
- matchByte <<= 1; \
|
||||
- bit = (matchByte & offs); \
|
||||
- probLit = prob + offs + bit + symbol; \
|
||||
- GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)
|
||||
-
|
||||
-#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
|
||||
-
|
||||
-#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
|
||||
-#define UPDATE_0_CHECK range = bound;
|
||||
-#define UPDATE_1_CHECK range -= bound; code -= bound;
|
||||
-#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
|
||||
- { UPDATE_0_CHECK; i = (i + i); A0; } else \
|
||||
- { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
|
||||
-#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
|
||||
-#define TREE_DECODE_CHECK(probs, limit, i) \
|
||||
- { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
|
||||
-
|
||||
-
|
||||
-#define kNumPosBitsMax 4
|
||||
-#define kNumPosStatesMax (1 << kNumPosBitsMax)
|
||||
-
|
||||
-#define kLenNumLowBits 3
|
||||
-#define kLenNumLowSymbols (1 << kLenNumLowBits)
|
||||
-#define kLenNumMidBits 3
|
||||
-#define kLenNumMidSymbols (1 << kLenNumMidBits)
|
||||
-#define kLenNumHighBits 8
|
||||
-#define kLenNumHighSymbols (1 << kLenNumHighBits)
|
||||
-
|
||||
-#define LenChoice 0
|
||||
-#define LenChoice2 (LenChoice + 1)
|
||||
-#define LenLow (LenChoice2 + 1)
|
||||
-#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
-#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
-#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
-
|
||||
-
|
||||
-#define kNumStates 12
|
||||
-#define kNumLitStates 7
|
||||
-
|
||||
-#define kStartPosModelIndex 4
|
||||
-#define kEndPosModelIndex 14
|
||||
-#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
|
||||
-
|
||||
-#define kNumPosSlotBits 6
|
||||
-#define kNumLenToPosStates 4
|
||||
-
|
||||
-#define kNumAlignBits 4
|
||||
-#define kAlignTableSize (1 << kNumAlignBits)
|
||||
-
|
||||
-#define kMatchMinLen 2
|
||||
-#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
|
||||
-
|
||||
-#define IsMatch 0
|
||||
-#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
|
||||
-#define IsRepG0 (IsRep + kNumStates)
|
||||
-#define IsRepG1 (IsRepG0 + kNumStates)
|
||||
-#define IsRepG2 (IsRepG1 + kNumStates)
|
||||
-#define IsRep0Long (IsRepG2 + kNumStates)
|
||||
-#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
|
||||
-#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
|
||||
-#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
|
||||
-#define LenCoder (Align + kAlignTableSize)
|
||||
-#define RepLenCoder (LenCoder + kNumLenProbs)
|
||||
-#define Literal (RepLenCoder + kNumLenProbs)
|
||||
-
|
||||
-#define LZMA_BASE_SIZE 1846
|
||||
-#define LZMA_LIT_SIZE 0x300
|
||||
-
|
||||
#if Literal != LZMA_BASE_SIZE
|
||||
StopCompilingDueBUG
|
||||
#endif
|
||||
|
||||
-#define LzmaProps_GetNumProbs(p) (Literal + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
|
||||
-
|
||||
-#define LZMA_DIC_MIN (1 << 12)
|
||||
-
|
||||
/* First LZMA-symbol is always decoded.
|
||||
And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization
|
||||
Out:
|
||||
@@ -782,7 +669,7 @@ void LzmaDec_InitDicAndState(CLzmaDec *p
|
||||
p->needInitState = 1;
|
||||
}
|
||||
|
||||
-void LzmaDec_Init(CLzmaDec *p)
|
||||
+MY_EXTERN_C void LzmaDec_Init(CLzmaDec *p)
|
||||
{
|
||||
p->dicPos = 0;
|
||||
LzmaDec_InitDicAndState(p, True, True);
|
||||
@@ -800,7 +687,7 @@ static void LzmaDec_InitStateReal(CLzmaD
|
||||
p->needInitState = 0;
|
||||
}
|
||||
|
||||
-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
|
||||
+MY_EXTERN_C SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
|
||||
ELzmaFinishMode finishMode, ELzmaStatus *status)
|
||||
{
|
||||
SizeT inSize = *srcLen;
|
||||
@@ -975,7 +862,7 @@ SRes LzmaDec_DecodeToBuf(CLzmaDec *p, By
|
||||
}
|
||||
}
|
||||
|
||||
-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
|
||||
+MY_EXTERN_C void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
|
||||
{
|
||||
alloc->Free(alloc, p->probs);
|
||||
p->probs = NULL;
|
||||
@@ -1019,7 +906,7 @@ SRes LzmaProps_Decode(CLzmaProps *p, con
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
-static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
|
||||
+MY_EXTERN_C SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
|
||||
{
|
||||
UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
|
||||
if (!p->probs || numProbs != p->numProbs)
|
||||
Index: lzma1604/C/LzmaDec.h
|
||||
===================================================================
|
||||
--- lzma1604.orig/C/LzmaDec.h
|
||||
+++ lzma1604/C/LzmaDec.h
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "7zTypes.h"
|
||||
|
||||
+#include "../CPP/Common/MyGuidDef.h"
|
||||
+
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
/* #define _LZMA_PROB32 */
|
||||
@@ -18,6 +20,118 @@ EXTERN_C_BEGIN
|
||||
#define CLzmaProb UInt16
|
||||
#endif
|
||||
|
||||
+#define kNumTopBits 24
|
||||
+#define kTopValue ((UInt32)1 << kNumTopBits)
|
||||
+
|
||||
+#define kNumBitModelTotalBits 11
|
||||
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
|
||||
+#define kNumMoveBits 5
|
||||
+
|
||||
+#define RC_INIT_SIZE 5
|
||||
+
|
||||
+#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
|
||||
+
|
||||
+#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
|
||||
+#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
|
||||
+#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
|
||||
+#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
|
||||
+ { UPDATE_0(p); i = (i + i); A0; } else \
|
||||
+ { UPDATE_1(p); i = (i + i) + 1; A1; }
|
||||
+#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
|
||||
+
|
||||
+#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
|
||||
+#define TREE_DECODE(probs, limit, i) \
|
||||
+ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
|
||||
+
|
||||
+/* #define _LZMA_SIZE_OPT */
|
||||
+
|
||||
+#ifdef _LZMA_SIZE_OPT
|
||||
+#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
|
||||
+#else
|
||||
+#define TREE_6_DECODE(probs, i) \
|
||||
+ { i = 1; \
|
||||
+ TREE_GET_BIT(probs, i); \
|
||||
+ TREE_GET_BIT(probs, i); \
|
||||
+ TREE_GET_BIT(probs, i); \
|
||||
+ TREE_GET_BIT(probs, i); \
|
||||
+ TREE_GET_BIT(probs, i); \
|
||||
+ TREE_GET_BIT(probs, i); \
|
||||
+ i -= 0x40; }
|
||||
+#endif
|
||||
+
|
||||
+#define NORMAL_LITER_DEC GET_BIT(prob + symbol, symbol)
|
||||
+#define MATCHED_LITER_DEC \
|
||||
+ matchByte <<= 1; \
|
||||
+ bit = (matchByte & offs); \
|
||||
+ probLit = prob + offs + bit + symbol; \
|
||||
+ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)
|
||||
+
|
||||
+#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
|
||||
+
|
||||
+#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
|
||||
+#define UPDATE_0_CHECK range = bound;
|
||||
+#define UPDATE_1_CHECK range -= bound; code -= bound;
|
||||
+#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
|
||||
+ { UPDATE_0_CHECK; i = (i + i); A0; } else \
|
||||
+ { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
|
||||
+#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
|
||||
+#define TREE_DECODE_CHECK(probs, limit, i) \
|
||||
+ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
|
||||
+
|
||||
+
|
||||
+#define kNumPosBitsMax 4
|
||||
+#define kNumPosStatesMax (1 << kNumPosBitsMax)
|
||||
+
|
||||
+#define kLenNumLowBits 3
|
||||
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
|
||||
+#define kLenNumMidBits 3
|
||||
+#define kLenNumMidSymbols (1 << kLenNumMidBits)
|
||||
+#define kLenNumHighBits 8
|
||||
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
|
||||
+
|
||||
+#define LenChoice 0
|
||||
+#define LenChoice2 (LenChoice + 1)
|
||||
+#define LenLow (LenChoice2 + 1)
|
||||
+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
|
||||
+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
|
||||
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
|
||||
+
|
||||
+
|
||||
+#define kNumStates 12
|
||||
+#define kNumLitStates 7
|
||||
+
|
||||
+#define kStartPosModelIndex 4
|
||||
+#define kEndPosModelIndex 14
|
||||
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
|
||||
+
|
||||
+#define kNumPosSlotBits 6
|
||||
+#define kNumLenToPosStates 4
|
||||
+
|
||||
+#define kNumAlignBits 4
|
||||
+#define kAlignTableSize (1 << kNumAlignBits)
|
||||
+
|
||||
+#define kMatchMinLen 2
|
||||
+#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
|
||||
+
|
||||
+#define IsMatch 0
|
||||
+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
|
||||
+#define IsRepG0 (IsRep + kNumStates)
|
||||
+#define IsRepG1 (IsRepG0 + kNumStates)
|
||||
+#define IsRepG2 (IsRepG1 + kNumStates)
|
||||
+#define IsRep0Long (IsRepG2 + kNumStates)
|
||||
+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
|
||||
+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
|
||||
+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
|
||||
+#define LenCoder (Align + kAlignTableSize)
|
||||
+#define RepLenCoder (LenCoder + kNumLenProbs)
|
||||
+#define Literal (RepLenCoder + kNumLenProbs)
|
||||
+
|
||||
+#define LZMA_BASE_SIZE 1846
|
||||
+#define LZMA_LIT_SIZE 0x300
|
||||
+
|
||||
+#define LzmaProps_GetNumProbs(p) (Literal + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
|
||||
+
|
||||
+#define LZMA_DIC_MIN (1 << 12)
|
||||
|
||||
/* ---------- LZMA Properties ---------- */
|
||||
|
||||
@@ -68,7 +182,7 @@ typedef struct
|
||||
|
||||
#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
|
||||
|
||||
-void LzmaDec_Init(CLzmaDec *p);
|
||||
+MY_EXTERN_C void LzmaDec_Init(CLzmaDec *p);
|
||||
|
||||
/* There are two types of LZMA streams:
|
||||
0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
|
||||
@@ -128,9 +242,11 @@ LzmaDec_Allocate* can return:
|
||||
SZ_ERROR_MEM - Memory allocation error
|
||||
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
||||
*/
|
||||
-
|
||||
+
|
||||
+MY_EXTERN_C SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc);
|
||||
+
|
||||
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
|
||||
-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
|
||||
+MY_EXTERN_C void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
|
||||
|
||||
SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
|
||||
void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
|
||||
@@ -176,7 +292,7 @@ Returns:
|
||||
SZ_ERROR_DATA - Data error
|
||||
*/
|
||||
|
||||
-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
|
||||
+MY_EXTERN_C SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
|
||||
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
|
||||
|
||||
|
||||
Index: lzma1604/C/LzmaEnc.c
|
||||
===================================================================
|
||||
--- lzma1604.orig/C/LzmaEnc.c
|
||||
+++ lzma1604/C/LzmaEnc.c
|
||||
@@ -47,7 +47,7 @@ static unsigned g_STAT_OFFSET = 0;
|
||||
#define kNumBitPriceShiftBits 4
|
||||
#define kBitPrice (1 << kNumBitPriceShiftBits)
|
||||
|
||||
-void LzmaEncProps_Init(CLzmaEncProps *p)
|
||||
+MY_EXTERN_C void LzmaEncProps_Init(CLzmaEncProps *p)
|
||||
{
|
||||
p->level = 5;
|
||||
p->dictSize = p->mc = 0;
|
||||
@@ -2328,7 +2328,7 @@ SRes LzmaEnc_MemEncode(CLzmaEncHandle pp
|
||||
}
|
||||
|
||||
|
||||
-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
|
||||
+MY_EXTERN_C SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
|
||||
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
|
||||
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
|
||||
{
|
||||
Index: lzma1604/C/LzmaEnc.h
|
||||
===================================================================
|
||||
--- lzma1604.orig/C/LzmaEnc.h
|
||||
+++ lzma1604/C/LzmaEnc.h
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "7zTypes.h"
|
||||
|
||||
+#include "../CPP/Common/MyGuidDef.h"
|
||||
+
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
#define LZMA_PROPS_SIZE 5
|
||||
@@ -30,7 +32,7 @@ typedef struct _CLzmaEncProps
|
||||
int numThreads; /* 1 or 2, default = 2 */
|
||||
} CLzmaEncProps;
|
||||
|
||||
-void LzmaEncProps_Init(CLzmaEncProps *p);
|
||||
+MY_EXTERN_C void LzmaEncProps_Init(CLzmaEncProps *p);
|
||||
void LzmaEncProps_Normalize(CLzmaEncProps *p);
|
||||
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
|
||||
|
||||
@@ -69,7 +71,7 @@ Return code:
|
||||
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
|
||||
*/
|
||||
|
||||
-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
|
||||
+MY_EXTERN_C SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
|
||||
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
|
||||
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
|
||||
|
||||
Index: lzma1604/CPP/7zip/Bundles/LzmaCon/makefile.gcc
|
||||
===================================================================
|
||||
--- lzma1604.orig/CPP/7zip/Bundles/LzmaCon/makefile.gcc
|
||||
+++ lzma1604/CPP/7zip/Bundles/LzmaCon/makefile.gcc
|
||||
@@ -1,7 +1,8 @@
|
||||
-PROG = lzma
|
||||
-CXX = g++ -O2
|
||||
-# -Wall -Werror -Wno-delete-non-virtual-dtor
|
||||
-CXX_C = gcc -O2 -Wall -Werror
|
||||
+LIBRARY = liblzmasdk.so
|
||||
+LIBRARYMINOR = $(LIBRARY).__LIBMAJ__
|
||||
+LIBRARYMAJOR = $(LIBRARYMINOR).__LIBMIN__
|
||||
+CXX = g++ $(RPM_OPT_FLAGS) -Wall -fPIC
|
||||
+CXX_C = g++ $(RPM_OPT_FLAGS) -Wall -fPIC
|
||||
|
||||
ifdef SystemDrive
|
||||
IS_MINGW = 1
|
||||
@@ -70,12 +71,12 @@ OBJS = \
|
||||
LzmaEnc.o \
|
||||
Lzma86Dec.o \
|
||||
Lzma86Enc.o \
|
||||
+ LzmaLib.o \
|
||||
|
||||
+all: $(LIBRARYMAJOR)
|
||||
|
||||
-all: $(PROG)
|
||||
-
|
||||
-$(PROG): $(OBJS)
|
||||
- $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB2)
|
||||
+$(LIBRARYMAJOR): $(OBJS)
|
||||
+ $(CXX) -o $(LIBRARYMAJOR) -shared -Wl,-soname=$(LIBRARYMINOR) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2)
|
||||
|
||||
LzmaAlone.o: LzmaAlone.cpp
|
||||
$(CXX) $(CFLAGS) LzmaAlone.cpp
|
||||
@@ -191,5 +192,9 @@ Lzma86Dec.o: ../../../../C/Lzma86Dec.c
|
||||
Lzma86Enc.o: ../../../../C/Lzma86Enc.c
|
||||
$(CXX_C) $(CFLAGS) ../../../../C/Lzma86Enc.c
|
||||
|
||||
+LzmaLib.o: ../../../../C/LzmaLib.c
|
||||
+ $(CXX_C) $(CFLAGS) ../../../../C/LzmaLib.c
|
||||
+
|
||||
clean:
|
||||
- -$(RM) $(PROG) $(OBJS)
|
||||
+ -$(RM) $(LIBRARYMAJOR) $(OBJS)
|
||||
+
|
||||
Index: lzma1604/C/7zCrc.h
|
||||
===================================================================
|
||||
--- lzma1604.orig/C/7zCrc.h
|
||||
+++ lzma1604/C/7zCrc.h
|
||||
@@ -19,6 +19,11 @@ void MY_FAST_CALL CrcGenerateTable(void)
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
|
||||
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
|
||||
+UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
+#ifndef MY_CPU_BE
|
||||
+ UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
+ UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
+#endif
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
Index: lzma1604/C/7zCrcOpt.c
|
||||
===================================================================
|
||||
--- lzma1604.orig/C/7zCrcOpt.c
|
||||
+++ lzma1604/C/7zCrcOpt.c
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#ifndef MY_CPU_BE
|
||||
|
||||
+EXTERN_C_BEGIN
|
||||
+
|
||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
@@ -54,6 +56,8 @@ UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v
|
||||
return v;
|
||||
}
|
||||
|
||||
+EXTERN_C_END
|
||||
+
|
||||
#endif
|
||||
|
||||
|
||||
Index: lzma1604/C/7zCrc.c
|
||||
===================================================================
|
||||
--- lzma1604.orig/C/7zCrc.c
|
||||
+++ lzma1604/C/7zCrc.c
|
||||
@@ -19,11 +19,6 @@
|
||||
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
#endif
|
||||
|
||||
-#ifndef MY_CPU_BE
|
||||
- UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
- UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
-#endif
|
||||
-
|
||||
typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
|
||||
CRC_FUNC g_CrcUpdateT4;
|
88
lzma-sdk-shlib.patch
Normal file
88
lzma-sdk-shlib.patch
Normal file
@ -0,0 +1,88 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: 2018-01-08 14:43:34.344321909 +0100
|
||||
|
||||
This exports most of LzmaLib (minus code that does not compile because it
|
||||
requires too much Windows or Windows-like APIs) as a library for use by
|
||||
other packages.
|
||||
|
||||
---
|
||||
C/Bcj2Enc.c | 2 ++
|
||||
C/Lzma2Enc.c | 4 ++--
|
||||
Makefile.am | 11 +++++++++++
|
||||
clzma.pc.in | 10 ++++++++++
|
||||
configure.ac | 6 ++++++
|
||||
5 files changed, 31 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: 1/C/Bcj2Enc.c
|
||||
===================================================================
|
||||
--- 1.orig/C/Bcj2Enc.c
|
||||
+++ 1/C/Bcj2Enc.c
|
||||
@@ -12,7 +12,9 @@
|
||||
#define PRF(x)
|
||||
#endif
|
||||
|
||||
+#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
+#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "Bcj2.h"
|
||||
Index: 1/C/Lzma2Enc.c
|
||||
===================================================================
|
||||
--- 1.orig/C/Lzma2Enc.c
|
||||
+++ 1/C/Lzma2Enc.c
|
||||
@@ -720,10 +720,10 @@ SRes Lzma2Enc_Encode2(CLzma2EncHandle pp
|
||||
CLzma2Enc *p = (CLzma2Enc *)pp;
|
||||
|
||||
if (inStream && inData)
|
||||
- return E_INVALIDARG;
|
||||
+ return SZ_ERROR_PARAM;
|
||||
|
||||
if (outStream && outBuf)
|
||||
- return E_INVALIDARG;
|
||||
+ return SZ_ERROR_PARAM;
|
||||
|
||||
{
|
||||
unsigned i;
|
||||
Index: 1/Makefile.am
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ 1/Makefile.am
|
||||
@@ -0,0 +1,11 @@
|
||||
+AM_CPPFLAGS = -D_7ZIP_ST -D_7ZIP_PPMD_SUPPPORT
|
||||
+lib_LTLIBRARIES = libclzma.la
|
||||
+pkgconfigdir = ${libdir}/pkgconfig
|
||||
+pkgconfig_DATA = clzma.pc
|
||||
+# source list: C/Util/LzmaLib/makefile
|
||||
+libclzma_la_SOURCES = C/7zAlloc.c C/7zArcIn.c C/7zBuf2.c C/7zBuf.c C/7zCrc.c C/7zCrcOpt.c C/7zDec.c C/7zFile.c C/7zStream.c C/7zVersion.rc C/Aes.c C/AesOpt.c C/Alloc.c C/Bcj2.c C/Bra86.c C/Bra.c C/BraIA64.c C/CpuArch.c C/Delta.c C/DllSecur.c C/LzFind.c C/Lzma2Dec.c C/Lzma2Enc.c C/Lzma86Dec.c C/Lzma86Enc.c C/LzmaDec.c C/LzmaEnc.c C/LzmaLib.c C/Ppmd7.c C/Ppmd7Dec.c C/Ppmd7Enc.c C/Sha256.c C/Sort.c C/Xz.c C/XzCrc64.c C/XzCrc64Opt.c C/XzDec.c C/XzEnc.c C/XzIn.c
|
||||
+#ifWIN32#SOURCES += C/Bcj2Enc.c C/LzFindMt.c C/MtCoder.c C/Threads.c
|
||||
+libclzma_la_LDFLAGS = -release suse -version-info 0:0:0
|
||||
+clzmadir = ${includedir}/clzma
|
||||
+clzma_HEADERS = C/7zAlloc.h C/7zBuf.h C/7zCrc.h C/7zFile.h C/7z.h C/7zTypes.h C/7zVersion.h C/Aes.h C/Alloc.h C/Bcj2.h C/Bra.h C/Compiler.h C/CpuArch.h C/Delta.h C/DllSecur.h C/LzFind.h C/LzFindMt.h C/LzHash.h C/Lzma2Dec.h C/Lzma2Enc.h C/Lzma86.h C/LzmaDec.h C/LzmaEnc.h C/LzmaLib.h C/MtCoder.h C/Ppmd7.h C/Ppmd.h C/Precomp.h C/RotateDefs.h C/Sha256.h C/Sort.h C/Threads.h C/XzCrc64.h C/XzEnc.h C/Xz.h
|
||||
+clzma.pc: ${top_builddir}/config.status
|
||||
Index: 1/clzma.pc.in
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ 1/clzma.pc.in
|
||||
@@ -0,0 +1,10 @@
|
||||
+prefix=@prefix@
|
||||
+exec_prefix=@exec_prefix@
|
||||
+libdir=@libdir@
|
||||
+includedir=@includedir@
|
||||
+
|
||||
+Name: clzma
|
||||
+Description: 7-Zip implementation of LZMA compression
|
||||
+Version: @PACKAGE_VERSION@
|
||||
+Libs: -L${libdir} -lclzma
|
||||
+Cflags: -I${includedir}/clzma
|
||||
Index: 1/configure.ac
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ 1/configure.ac
|
||||
@@ -0,0 +1,6 @@
|
||||
+AC_INIT([lzma-sdk], [0])
|
||||
+AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
+AC_PROG_CC
|
||||
+LT_INIT([disable-static])
|
||||
+AC_CONFIG_FILES([Makefile clzma.pc])
|
||||
+AC_OUTPUT
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 8 08:02:11 UTC 2018 - jengelh@inai.de
|
||||
|
||||
- Update to new upstream release 17.01
|
||||
* Some bugs were fixed.
|
||||
- Replace lzma-sdk-16.04-sharedlib.patch with lzma-sdk-shlib.patch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 16 14:56:41 UTC 2017 - jengelh@inai.de
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package lzma-sdk
|
||||
#
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -15,11 +15,12 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
%define _sver 1604
|
||||
%define _maver 16
|
||||
%define _miver 04
|
||||
|
||||
%define _sver 1701
|
||||
%define _maver 17
|
||||
%define _miver 01
|
||||
Name: lzma-sdk
|
||||
Version: 16.04
|
||||
Version: 17.01
|
||||
Release: 0
|
||||
Summary: An implementation of LZMA compression
|
||||
# Actually the site says "Public Domain". See license file.
|
||||
@ -28,10 +29,12 @@ Group: Productivity/Archiving/Compression
|
||||
Url: http://www.7-zip.org/sdk.html
|
||||
Source0: http://www.7-zip.org/a/lzma%{_sver}.7z
|
||||
Source1: lzma-sdk-LICENSE.fedora
|
||||
Patch0: lzma-sdk-16.04-sharedlib.patch
|
||||
Patch1: lzma-sdk-shlib.patch
|
||||
BuildRequires: automake
|
||||
BuildRequires: dos2unix
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libtool
|
||||
BuildRequires: p7zip
|
||||
BuildRequires: pkg-config
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -50,72 +53,48 @@ zlib's speed, and around 40%% when trading more time.
|
||||
%package devel
|
||||
Summary: Development libraries and headers for %{name}
|
||||
Group: Development/Languages/C and C++
|
||||
Requires: liblzmasdk%{_maver} = %{version}
|
||||
Requires: libclzma-suse0 = %{version}
|
||||
|
||||
%description devel
|
||||
This package contains development libraries and headers for %{name}.
|
||||
|
||||
%package -n liblzmasdk%{_maver}
|
||||
Summary: 7-Zip LZMA library
|
||||
Group: Productivity/Archiving/Compression
|
||||
%package -n libclzma-suse0
|
||||
Summary: LZMA stream encoding/decoding library from 7-Zip
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n liblzmasdk%{_maver}
|
||||
Library for encoding/decoding LZMA files from the 7-Zip project.
|
||||
%description -n libclzma-suse0
|
||||
Library for encoding/decoding LZMA streams, using the 7-Zip library
|
||||
implementation.
|
||||
|
||||
%prep
|
||||
%setup -q -c -n lzma%{_sver}
|
||||
%patch0 -p1
|
||||
sed -e 's/__LIBMAJ__/%{_maver}/' \
|
||||
-e 's/__LIBMIN__/%{_miver}/' \
|
||||
-i CPP/7zip/Bundles/LzmaCon/makefile.gcc
|
||||
%patch -P 1 -p1
|
||||
perl -i -pe 's{AC_INIT.*}{AC_INIT([lzma-sdk], [%version])}' configure.ac
|
||||
dos2unix DOC/*.txt
|
||||
install -p -m 0644 %{SOURCE1} .
|
||||
|
||||
%build
|
||||
cd CPP/7zip/Bundles/LzmaCon
|
||||
make %{?_smp_mflags} -f makefile.gcc clean all
|
||||
autoreconf -fi
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_libdir}
|
||||
install -m0755 CPP/7zip/Bundles/LzmaCon/liblzmasdk.so.%{_maver}.%{_miver} %{buildroot}%{_libdir}
|
||||
pushd %{buildroot}%{_libdir}
|
||||
ln -s liblzmasdk.so.%{version} liblzmasdk.so.%{_maver}
|
||||
ln -s liblzmasdk.so.%{version} liblzmasdk.so
|
||||
popd
|
||||
mkdir -p %{buildroot}/%{_includedir}/lzma%{_sver}/
|
||||
find . -iname '*.h' | xargs -I {} install -m0644 -D {} %{buildroot}/%{_includedir}/lzma-sdk/{}
|
||||
%make_install
|
||||
rm -f "%buildroot/%_libdir"/*.la
|
||||
|
||||
# creates support file for pkg-config
|
||||
mkdir %{buildroot}/%{_libdir}/pkgconfig
|
||||
tee %{buildroot}/%{_libdir}/pkgconfig/lzma-sdk.pc <<"EOF"
|
||||
prefix=%{_prefix}
|
||||
exec_prefix=%{_prefix}
|
||||
libdir=%{_libdir}
|
||||
includedir=%{_includedir}
|
||||
%post -n libclzma-suse0 -p /sbin/ldconfig
|
||||
%postun -n libclzma-suse0 -p /sbin/ldconfig
|
||||
|
||||
Name: lzma-sdk
|
||||
Description: 7-Zip implementation of LZMA compression
|
||||
Version: %{version}
|
||||
Libs: -L${libdir} -llzmasdk
|
||||
Cflags: -I${includedir}/lzma-sdk
|
||||
EOF
|
||||
|
||||
%fdupes -s %{buildroot}/%{_includedir}/lzma-sdk
|
||||
|
||||
%post -n liblzmasdk%{_maver} -p /sbin/ldconfig
|
||||
%postun -n liblzmasdk%{_maver} -p /sbin/ldconfig
|
||||
|
||||
%files -n liblzmasdk%{_maver}
|
||||
%files -n libclzma-suse0
|
||||
%defattr(-,root,root)
|
||||
%doc DOC/lzma.txt DOC/lzma-history.txt lzma-sdk-LICENSE.fedora
|
||||
%{_libdir}/liblzmasdk.so.%{_maver}.%{_miver}
|
||||
%{_libdir}/liblzmasdk.so.%{_maver}
|
||||
%{_libdir}/libclzma-suse.so.0*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%doc DOC/7z*.txt DOC/Methods.txt lzma-sdk-LICENSE.fedora
|
||||
%{_includedir}/lzma-sdk/
|
||||
%{_libdir}/liblzmasdk.so
|
||||
%{_libdir}/pkgconfig/lzma-sdk.pc
|
||||
%{_includedir}/clzma/
|
||||
%{_libdir}/libclzma.so
|
||||
%{_libdir}/pkgconfig/clzma.pc
|
||||
|
||||
%changelog
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:edf8690e9d5ae0dbe80751e3df247bb4e1b497b100c4af5b95fc50a5c2e5b04f
|
||||
size 971074
|
3
lzma1701.7z
Normal file
3
lzma1701.7z
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0daa0a15a3a2b6a8c9459744e4a25f7a26fdae0e9e406e0ac0809c3fbbacf2e4
|
||||
size 1005375
|
Loading…
Reference in New Issue
Block a user