Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jun 2021 05:14:02 GMT
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: b5c7ff857512 - main - games/hllib: Update to 2.4.6
Message-ID:  <202106010514.1515E24i031355@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b5c7ff8575121bdbac898ac0b3209451b018720b

commit b5c7ff8575121bdbac898ac0b3209451b018720b
Author:     Karsten Pedersen <kpedersen@disroot.org>
AuthorDate: 2021-06-01 04:47:04 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2021-06-01 04:47:04 +0000

    games/hllib: Update to 2.4.6
    
    - Patch to fix SGAFile (Many compilation issues on the latest upstream release).
    - Pass maintainership to the submitter
    - Pristine distfiles now hosted on GitHub (original site is now down).
    
    PR:             256249
---
 games/hllib/Makefile                              |  18 ++--
 games/hllib/distinfo                              |   5 +-
 games/hllib/files/patch-HLLib-BSPFile.cpp         |  19 ----
 games/hllib/files/patch-HLLib-DirectoryFolder.cpp |  58 ----------
 games/hllib/files/patch-HLLib-Error.cpp           |  12 ---
 games/hllib/files/patch-HLLib-FileStream.cpp      |  13 ---
 games/hllib/files/patch-HLLib-GCFFile.cpp         |  27 -----
 games/hllib/files/patch-HLLib-HLLib.cpp           |  31 ------
 games/hllib/files/patch-HLLib-NCFFile.cpp         |  27 -----
 games/hllib/files/patch-HLLib-SGAFile.cpp         |  34 ------
 games/hllib/files/patch-HLLib-SGAFile.h           |  14 ---
 games/hllib/files/patch-HLLib-VBSPFile.cpp        |  38 -------
 games/hllib/files/patch-HLLib-VPKFile.cpp         |  18 ----
 games/hllib/files/patch-HLLib-WADFile.cpp         |  18 ----
 games/hllib/files/patch-HLLib-XZPFile.cpp         |  27 -----
 games/hllib/files/patch-HLLib-ZIPFile.cpp         |  24 -----
 games/hllib/files/patch-HLLib_SGAFile.cpp         | 123 ++++++++++++++++++++++
 games/hllib/files/patch-HLLib_SGAFile.h           |  60 +++++++++++
 games/hllib/pkg-descr                             |   2 +-
 19 files changed, 193 insertions(+), 375 deletions(-)

diff --git a/games/hllib/Makefile b/games/hllib/Makefile
index fa915c9bc107..1e68b889a85a 100644
--- a/games/hllib/Makefile
+++ b/games/hllib/Makefile
@@ -1,12 +1,12 @@
 # Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
 
 PORTNAME=	hllib
-PORTVERSION=	2.4.4
+PORTVERSION=	2.4.6
 CATEGORIES=	games devel
-MASTER_SITES=	LOCAL/danilo
+MASTER_SITES=	https://github.com/osen/distfiles/raw/main/
 DISTNAME=	${PORTNAME}${PORTVERSION:S/.//g}
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	kpedersen@disroot.org
 COMMENT=	Library to work with various Half-Life file formats
 
 LICENSE=	LGPL21
@@ -18,8 +18,7 @@ CFLAGS+=	-fpic -DUSE_ZLIB
 
 PATCH_WRKSRC=	${WRKDIR}
 
-HLLIB_VERS=	2.4.4
-PLIST_FILES=	include/hl.h lib/libhl.so.${HLLIB_VERS} \
+PLIST_FILES=	include/hl.h lib/libhl.so.${PORTVERSION} \
 		lib/libhl.so.2 lib/libhl.so
 
 MAKE_ARGS=	PREFIX="${STAGEDIR}${PREFIX}"
@@ -28,14 +27,9 @@ post-patch:
 # Allow propagating of CXX, CXXFLAGS, and PREFIX; fix Linuxism and symlinks
 	@${REINPLACE_CMD} -E 's,^([CP][^=]*)=,\1?=, ; s,-g root,,g ; \
 		s,-o root,,g ; s,s \$$\(PREFIX\)/lib/,s ,' ${WRKSRC}/Makefile
-# Add forgotten file to the source list so it would be picked up by linker
-	@${REINPLACE_CMD} -e 's,ProcStream\.cpp,& SGAFile.cpp,' \
-		${WRKSRC}/Makefile
-# Remove two lines of code that offend C++ compiler
-	@${REINPLACE_CMD} -e '/friend CSGADirectory/d' ${WRKSRC}/SGAFile.h
+# Fix library version
+	@${REINPLACE_CMD} -e 's/2\.3\.0/2\.4\.6/' ${WRKSRC}/Makefile
 # Add missing -lz
 	@${REINPLACE_CMD} -e '/$$(LDFLAGS)/s,$$, -lz,' ${WRKSRC}/Makefile
-# Fix library version
-	@${REINPLACE_CMD} -e 's/2\.3\.0/2\.4\.4/' ${WRKSRC}/Makefile
 
 .include <bsd.port.mk>
diff --git a/games/hllib/distinfo b/games/hllib/distinfo
index 2aec4971ab18..467f38a8658d 100644
--- a/games/hllib/distinfo
+++ b/games/hllib/distinfo
@@ -1,2 +1,3 @@
-SHA256 (hllib244.zip) = cb94da1c32e9577dce1aa2bbb77f283212684afcd7814d42228c9ffff71d3699
-SIZE (hllib244.zip) = 593745
+TIMESTAMP = 1622320652
+SHA256 (hllib246.zip) = ed12bee31ec867a92e3daf4c52653ea2afb78c4ce69ca01a6f1588068ae5a1e9
+SIZE (hllib246.zip) = 419924
diff --git a/games/hllib/files/patch-HLLib-BSPFile.cpp b/games/hllib/files/patch-HLLib-BSPFile.cpp
deleted file mode 100644
index 1319946358d2..000000000000
--- a/games/hllib/files/patch-HLLib-BSPFile.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
---- ../orig/HLLib/BSPFile.cpp	2010-10-31 22:48:46.000000000 -0200
-+++ ./HLLib/BSPFile.cpp	2013-02-11 17:56:51.271215107 -0200
-@@ -203,10 +203,14 @@
- 						hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], uiPaletteSize, hlFalse);
- 						return hlTrue;
- 					}
-+					default:
-+						;
- 				}
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-Only in ./HLLib: BSPFile.cpp.orig
-diff -ru ../orig/HLLib/DirectoryFolder.cpp ./HLLib/DirectoryFolder.cpp
diff --git a/games/hllib/files/patch-HLLib-DirectoryFolder.cpp b/games/hllib/files/patch-HLLib-DirectoryFolder.cpp
deleted file mode 100644
index d30230ad81d5..000000000000
--- a/games/hllib/files/patch-HLLib-DirectoryFolder.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
---- ../orig/HLLib/DirectoryFolder.cpp	2012-09-17 20:16:52.000000000 -0300
-+++ ./HLLib/DirectoryFolder.cpp	2013-02-11 17:56:51.275211034 -0200
-@@ -517,6 +517,8 @@
- 		case HL_ITEM_FILE:
- 			uiSize += static_cast<const CDirectoryFile *>(pItem)->GetSize();
- 			break;
-+		default:
-+			;
- 		}
- 	}
- 
-@@ -541,6 +543,8 @@
- 		case HL_ITEM_FILE:
- 			uiSize += static_cast<hlULongLong>(static_cast<const CDirectoryFile *>(pItem)->GetSize());
- 			break;
-+		default:
-+			;
- 		}
- 	}
- 
-@@ -565,6 +569,8 @@
- 		case HL_ITEM_FILE:
- 			uiSize += static_cast<const CDirectoryFile *>(pItem)->GetSizeOnDisk();
- 			break;
-+		default:
-+			;
- 		}
- 	}
- 
-@@ -589,6 +595,8 @@
- 		case HL_ITEM_FILE:
- 			uiSize += static_cast<hlULongLong>(static_cast<const CDirectoryFile *>(pItem)->GetSizeOnDisk());
- 			break;
-+		default:
-+			;
- 		}
- 	}
- 
-@@ -611,6 +619,8 @@
- 				uiCount += static_cast<const CDirectoryFolder *>(pItem)->GetFolderCount(bRecurse);
- 			}
- 			break;
-+		default:
-+			;
- 		}
- 	}
- 
-@@ -635,6 +645,8 @@
- 		case HL_ITEM_FILE:
- 			uiCount++;
- 			break;
-+		default:
-+			;
- 		}
- 	}
- 
-Only in ./HLLib: DirectoryFolder.cpp.orig
-diff -ru ../orig/HLLib/Error.cpp ./HLLib/Error.cpp
diff --git a/games/hllib/files/patch-HLLib-Error.cpp b/games/hllib/files/patch-HLLib-Error.cpp
deleted file mode 100644
index eb7803eca274..000000000000
--- a/games/hllib/files/patch-HLLib-Error.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
---- ../orig/HLLib/Error.cpp	2010-04-17 13:48:52.000000000 -0300
-+++ ./HLLib/Error.cpp	2013-02-11 18:00:09.931600402 -0200
-@@ -139,7 +139,7 @@
- 
- 		hlUInt uiLength = (hlUInt)strlen(this->lpSystemError);
- 
--		while(uiLength >= 0 && isspace(this->lpSystemError[uiLength - 1]))
-+		while(isspace(this->lpSystemError[uiLength - 1]))
- 		{
- 			uiLength--;
- 		}
-diff -ru ../orig/HLLib/FileStream.cpp ./HLLib/FileStream.cpp
diff --git a/games/hllib/files/patch-HLLib-FileStream.cpp b/games/hllib/files/patch-HLLib-FileStream.cpp
deleted file mode 100644
index 93726d2bab45..000000000000
--- a/games/hllib/files/patch-HLLib-FileStream.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
---- ../orig/HLLib/FileStream.cpp	2010-10-28 20:41:26.000000000 -0200
-+++ ./HLLib/FileStream.cpp	2013-02-11 17:56:51.278212203 -0200
-@@ -216,6 +216,8 @@
- 	case HL_SEEK_END:
- 		iMode = SEEK_END;
- 		break;
-+	default:
-+		;
- 	}
- 
- 	return (hlUInt)lseek(this->iFile, iOffset, iMode);
-Only in ./HLLib: FileStream.cpp.orig
-diff -ru ../orig/HLLib/GCFFile.cpp ./HLLib/GCFFile.cpp
diff --git a/games/hllib/files/patch-HLLib-GCFFile.cpp b/games/hllib/files/patch-HLLib-GCFFile.cpp
deleted file mode 100644
index e0fd2cddfccf..000000000000
--- a/games/hllib/files/patch-HLLib-GCFFile.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
---- ../orig/HLLib/GCFFile.cpp	2010-11-01 20:56:16.000000000 -0200
-+++ ./HLLib/GCFFile.cpp	2013-02-11 17:56:51.281214140 -0200
-@@ -789,6 +789,8 @@
- 					}
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-@@ -819,9 +821,13 @@
- 					}
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-Only in ./HLLib: GCFFile.cpp.orig
-diff -ru ../orig/HLLib/HLLib.cpp ./HLLib/HLLib.cpp
diff --git a/games/hllib/files/patch-HLLib-HLLib.cpp b/games/hllib/files/patch-HLLib-HLLib.cpp
deleted file mode 100644
index baa8a8daeceb..000000000000
--- a/games/hllib/files/patch-HLLib-HLLib.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
---- ../orig/HLLib/HLLib.cpp	2010-11-01 19:45:14.000000000 -0200
-+++ ./HLLib/HLLib.cpp	2013-02-11 17:56:51.284213443 -0200
-@@ -153,6 +153,8 @@
- 	case HL_PACKAGE_BOUND:
- 		*pValue = pPackage != 0;
- 		return hlTrue;
-+	default:
-+		;
- 	}
- 
- 	return hlFalse;
-@@ -171,6 +173,8 @@
- 	case HL_FORCE_DEFRAGMENT:
- 		bForceDefragment = bValue;
- 		break;
-+	default:
-+		;
- 	}
- }
- 
-@@ -533,6 +537,8 @@
- 	case HL_PROC_DEFRAGMENT_PROGRESS_EX:
- 		pDefragmentProgressExProc = (PDefragmentProgressExProc)pValue;
- 		break;
-+	default:
-+		;
- 	}
- }
- 
-Only in ./HLLib: HLLib.cpp.orig
-diff -ru ../orig/HLLib/Makefile ./HLLib/Makefile
diff --git a/games/hllib/files/patch-HLLib-NCFFile.cpp b/games/hllib/files/patch-HLLib-NCFFile.cpp
deleted file mode 100644
index 4ee859b435dd..000000000000
--- a/games/hllib/files/patch-HLLib-NCFFile.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
---- ../orig/HLLib/NCFFile.cpp	2010-10-31 22:48:26.000000000 -0200
-+++ ./HLLib/NCFFile.cpp	2013-02-11 17:56:51.287210992 -0200
-@@ -347,6 +347,8 @@
- 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], this->lpDirectoryEntries[pFile->GetID()].uiDirectoryFlags, hlTrue);
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-@@ -360,9 +362,13 @@
- 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], this->lpDirectoryEntries[pFolder->GetID()].uiDirectoryFlags, hlTrue);
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-Only in ./HLLib: NCFFile.cpp.orig
-diff -ru ../orig/HLLib/SGAFile.cpp ./HLLib/SGAFile.cpp
diff --git a/games/hllib/files/patch-HLLib-SGAFile.cpp b/games/hllib/files/patch-HLLib-SGAFile.cpp
deleted file mode 100644
index 61a8bd920106..000000000000
--- a/games/hllib/files/patch-HLLib-SGAFile.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
---- ../orig/HLLib/SGAFile.cpp	2012-11-20 20:17:10.000000000 -0200
-+++ ./HLLib/SGAFile.cpp	2013-02-11 17:56:51.289212795 -0200
-@@ -387,6 +387,8 @@
- 						}
- 						return hlFalse;
- 					}
-+					default:
-+						;
- 				}
- 				break;
- 			}
-@@ -448,9 +450,13 @@
- 						}
- 						return hlFalse;
- 					}
-+					default:
-+						;
- 				}
- 				break;
- 			}
-+			default:
-+				;
- 		}
- 	}
- 	return hlFalse;
-@@ -624,4 +630,4 @@
- 	{
- 		delete []static_cast<const hlByte *>(static_cast<Streams::CMemoryStream &>(Stream).GetBuffer());
- 	}
--}
-\ No newline at end of file
-+}
-Only in ./HLLib: SGAFile.cpp.orig
-diff -ru ../orig/HLLib/SGAFile.h ./HLLib/SGAFile.h
diff --git a/games/hllib/files/patch-HLLib-SGAFile.h b/games/hllib/files/patch-HLLib-SGAFile.h
deleted file mode 100644
index 3876b7ea7b53..000000000000
--- a/games/hllib/files/patch-HLLib-SGAFile.h
+++ /dev/null
@@ -1,14 +0,0 @@
---- ../orig/HLLib/SGAFile.h	2012-09-17 20:16:38.000000000 -0300
-+++ ./HLLib/SGAFile.h	2013-02-11 17:56:51.311213431 -0200
-@@ -160,8 +160,6 @@
- 		typedef CSGADirectory<SGADirectoryHeader4, SGASection4, SGAFolder4, SGAFile, SGAFileHeader> CSGADirectory4;
- 		typedef CSGADirectory<SGADirectoryHeader5, SGASection5, SGAFolder5, SGAFile, SGAFileHeader> CSGADirectory5;
- 
--		friend CSGADirectory4;
--		friend CSGADirectory5;
- 
- 	private:
- 		static const char *lpAttributeNames[];
-Only in ./HLLib: SGAFile.h.bak
-Only in ./HLLib: SGAFile.h.orig
-diff -ru ../orig/HLLib/VBSPFile.cpp ./HLLib/VBSPFile.cpp
diff --git a/games/hllib/files/patch-HLLib-VBSPFile.cpp b/games/hllib/files/patch-HLLib-VBSPFile.cpp
deleted file mode 100644
index 362103bfd905..000000000000
--- a/games/hllib/files/patch-HLLib-VBSPFile.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
---- ../orig/HLLib/VBSPFile.cpp	2011-05-22 07:53:42.000000000 -0300
-+++ ./HLLib/VBSPFile.cpp	2013-02-11 17:56:51.294217852 -0200
-@@ -422,6 +422,8 @@
- 						delete []lpComment;
- 						return hlTrue;
- 					}
-+					default:
-+						;
- 				}
- 			}
- 			else
-@@ -444,6 +446,8 @@
- 						hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], *(hlUInt *)this->pHeader->lpLumps[uiID].lpFourCC, hlTrue);
- 						return hlTrue;
- 					}
-+					default:
-+						;
- 				}
- 
- 				if(this->pEndOfCentralDirectoryRecord != 0 && pItem->GetID() == HL_VBSP_LUMP_PAKFILE)
-@@ -466,11 +470,15 @@
- 							delete []lpComment;
- 							return hlTrue;
- 						}
-+						default:
-+							;
- 					}
- 				}
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-Only in ./HLLib: VBSPFile.cpp.orig
-diff -ru ../orig/HLLib/VPKFile.cpp ./HLLib/VPKFile.cpp
diff --git a/games/hllib/files/patch-HLLib-VPKFile.cpp b/games/hllib/files/patch-HLLib-VPKFile.cpp
deleted file mode 100644
index 3995ecf6fdeb..000000000000
--- a/games/hllib/files/patch-HLLib-VPKFile.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
---- ../orig/HLLib/VPKFile.cpp	2013-01-27 14:13:28.000000000 -0200
-+++ ./HLLib/VPKFile.cpp	2013-02-11 17:56:51.297217265 -0200
-@@ -415,9 +415,13 @@
- 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], pDirectoryItem->pDirectoryEntry->uiCRC, hlTrue);
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-Only in ./HLLib: VPKFile.cpp.orig
-diff -ru ../orig/HLLib/WADFile.cpp ./HLLib/WADFile.cpp
diff --git a/games/hllib/files/patch-HLLib-WADFile.cpp b/games/hllib/files/patch-HLLib-WADFile.cpp
deleted file mode 100644
index 415c11c737a1..000000000000
--- a/games/hllib/files/patch-HLLib-WADFile.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
---- ../orig/HLLib/WADFile.cpp	2010-10-31 22:56:14.000000000 -0200
-+++ ./HLLib/WADFile.cpp	2013-02-11 17:56:51.300216459 -0200
-@@ -200,9 +200,13 @@
- 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], (hlUInt)pLump->iType, hlTrue);
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-Only in ./HLLib: WADFile.cpp.orig
-diff -ru ../orig/HLLib/XZPFile.cpp ./HLLib/XZPFile.cpp
diff --git a/games/hllib/files/patch-HLLib-XZPFile.cpp b/games/hllib/files/patch-HLLib-XZPFile.cpp
deleted file mode 100644
index 4219d93d9b0d..000000000000
--- a/games/hllib/files/patch-HLLib-XZPFile.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
---- ../orig/HLLib/XZPFile.cpp	2010-10-31 22:49:18.000000000 -0200
-+++ ./HLLib/XZPFile.cpp	2013-02-11 17:56:51.302217604 -0200
-@@ -197,7 +197,7 @@
- 		for(hlUInt i = 0; i < this->pHeader->uiDirectoryEntryCount; i++)
- 		{
- 			hlChar lpTemp[16] = "";
--			hlChar *lpLookup[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
-+			const hlChar *lpLookup[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
- 			for(hlByte *lpCRC = (hlByte *)&this->lpDirectoryEntries[i].uiFileNameCRC; lpCRC < (hlByte *)&this->lpDirectoryEntries[i].uiFileNameCRC + sizeof(hlUInt); lpCRC++)
- 			{
- 				strcat(lpTemp, lpLookup[(hlByte)(*lpCRC >> 4)]);
-@@ -299,9 +299,13 @@
- 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], uiSize, hlFalse);
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-Only in ./HLLib: XZPFile.cpp.orig
-diff -ru ../orig/HLLib/ZIPFile.cpp ./HLLib/ZIPFile.cpp
diff --git a/games/hllib/files/patch-HLLib-ZIPFile.cpp b/games/hllib/files/patch-HLLib-ZIPFile.cpp
deleted file mode 100644
index a2c23064d955..000000000000
--- a/games/hllib/files/patch-HLLib-ZIPFile.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
---- ../orig/HLLib/ZIPFile.cpp	2012-09-18 19:51:30.000000000 -0300
-+++ ./HLLib/ZIPFile.cpp	2013-02-11 17:56:51.305211203 -0200
-@@ -393,9 +393,13 @@
- 					delete []lpComment;
- 					return hlTrue;
- 				}
-+				default:
-+					;
- 			}
- 			break;
- 		}
-+		default:
-+			;
- 	}
- 
- 	return hlFalse;
-@@ -598,4 +602,4 @@
- 	{
- 		delete []static_cast<const hlByte *>(static_cast<Streams::CMemoryStream &>(Stream).GetBuffer());
- 	}
--}
-\ No newline at end of file
-+}
-Only in ./HLLib: ZIPFile.cpp.orig
diff --git a/games/hllib/files/patch-HLLib_SGAFile.cpp b/games/hllib/files/patch-HLLib_SGAFile.cpp
new file mode 100644
index 000000000000..892bbd5d041a
--- /dev/null
+++ b/games/hllib/files/patch-HLLib_SGAFile.cpp
@@ -0,0 +1,123 @@
+--- HLLib/SGAFile.cpp.orig	2021-05-29 21:01:07 UTC
++++ HLLib/SGAFile.cpp
+@@ -301,37 +301,37 @@ CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeade
+ template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
+ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::MapDataStructures()
+ {
+-	if(!this->File.pMapping->Map(this->pHeaderDirectoryView, sizeof(SGAHeader), static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength))
++	if(!this->File.pMapping->Map(this->pHeaderDirectoryView, sizeof(TSGAHeader), static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength))
+ 	{
+ 		return hlFalse;
+ 	}
+ 
+-	this->pDirectoryHeader = static_cast<const SGADirectoryHeader *>(this->pHeaderDirectoryView->GetView());
++	this->pDirectoryHeader = static_cast<const TSGADirectoryHeader *>(this->pHeaderDirectoryView->GetView());
+ 
+-	if(this->pDirectoryHeader->uiSectionCount > 0 && this->pDirectoryHeader->uiSectionOffset + sizeof(SGASection) * this->pDirectoryHeader->uiSectionCount > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
++	if(this->pDirectoryHeader->uiSectionCount > 0 && this->pDirectoryHeader->uiSectionOffset + sizeof(TSGASection) * this->pDirectoryHeader->uiSectionCount > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
+ 	{
+ 		LastError.SetErrorMessage("Invalid file: the file map is too small for section data.");
+ 		return hlFalse;
+ 	}
+-	if(this->pDirectoryHeader->uiFolderCount > 0 && this->pDirectoryHeader->uiFolderOffset + sizeof(SGAFolder) * this->pDirectoryHeader->uiFolderCount > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
++	if(this->pDirectoryHeader->uiFolderCount > 0 && this->pDirectoryHeader->uiFolderOffset + sizeof(TSGAFolder) * this->pDirectoryHeader->uiFolderCount > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
+ 	{
+ 		LastError.SetErrorMessage("Invalid file: the file map is too small for folder data.");
+ 		return hlFalse;
+ 	}
+-	if(this->pDirectoryHeader->uiFileCount > 0 && this->pDirectoryHeader->uiFileOffset + sizeof(SGAFile) * this->pDirectoryHeader->uiFileCount > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
++	if(this->pDirectoryHeader->uiFileCount > 0 && this->pDirectoryHeader->uiFileOffset + sizeof(TSGAFile) * this->pDirectoryHeader->uiFileCount > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
+ 	{
+ 		LastError.SetErrorMessage("Invalid file: the file map is too small for file data.");
+ 		return hlFalse;
+ 	}
+-	if(this->pDirectoryHeader->uiStringTableOffset > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
++	if(this->pDirectoryHeader->uiStringTableOffset > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
+ 	{
+ 		LastError.SetErrorMessage("Invalid file: the file map is too small for string table data.");
+ 		return hlFalse;
+ 	}
+ 
+-	this->lpSections = reinterpret_cast<const SGASection *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiSectionOffset);
+-	this->lpFolders = reinterpret_cast<const SGAFolder *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFolderOffset);
+-	this->lpFiles = reinterpret_cast<const SGAFile *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFileOffset);
++	this->lpSections = reinterpret_cast<const TSGASection *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiSectionOffset);
++	this->lpFolders = reinterpret_cast<const TSGAFolder *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFolderOffset);
++	this->lpFiles = reinterpret_cast<const TSGAFile *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFileOffset);
+ 	this->lpStringTable = reinterpret_cast<const hlChar *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiStringTableOffset);
+ 
+ 	return hlTrue;
+@@ -352,7 +352,7 @@ hlVoid CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
+ template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
+ CDirectoryFolder *CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::CreateRoot()
+ {
+-	CDirectoryFolder *pRoot = new CDirectoryFolder(&File);
++	CDirectoryFolder *pRoot = new CDirectoryFolder(&this->File);
+ 
+ 	for(hlUInt i = 0; i < this->pDirectoryHeader->uiSectionCount; i++)
+ 	{
+@@ -558,7 +558,7 @@ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
+ 			case HL_ITEM_FILE:
+ 			{
+ 				const CDirectoryFile *pFile = static_cast<const CDirectoryFile *>(pItem);
+-				const SGAFile &File = this->lpFiles[pFile->GetID()];
++				const TSGAFile &File = this->lpFiles[pFile->GetID()];
+ 				switch(eAttribute)
+ 				{
+ 					case HL_SGA_ITEM_SECTION_ALIAS:
+@@ -613,7 +613,7 @@ template<typename TSGAHeader, typename TSGADirectoryHe
+ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::GetFileExtractableInternal(const CDirectoryFile *pFile, hlBool &bExtractable) const
+ {
+ #if !USE_ZLIB
+-	const SGAFile &File = this->lpFiles[pFile->GetID()];
++	const TSGAFile &File = this->lpFiles[pFile->GetID()];
+ 
+ 	bExtractable = File.uiType == 0;
+ #else
+@@ -831,7 +831,7 @@ hlBool CSGAFile::CSGASpecializedDirectory<TSGAHeader, 
+ template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
+ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::GetFileSizeInternal(const CDirectoryFile *pFile, hlUInt &uiSize) const
+ {
+-	const SGAFile &File = this->lpFiles[pFile->GetID()];
++	const TSGAFile &File = this->lpFiles[pFile->GetID()];
+ 
+ 	uiSize = File.uiSize;
+ 
+@@ -841,7 +841,7 @@ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
+ template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
+ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::GetFileSizeOnDiskInternal(const CDirectoryFile *pFile, hlUInt &uiSize) const
+ {
+-	const SGAFile &File = this->lpFiles[pFile->GetID()];
++	const TSGAFile &File = this->lpFiles[pFile->GetID()];
+ 
+ 	uiSize = File.uiSizeOnDisk;
+ 
+@@ -851,18 +851,18 @@ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
+ template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
+ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::CreateStreamInternal(const CDirectoryFile *pFile, Streams::IStream *&pStream) const
+ {
+-	const SGAFile &File = this->lpFiles[pFile->GetID()];
++	const TSGAFile &File = this->lpFiles[pFile->GetID()];
+ 
+ 	if(File.uiType == 0)
+ 	{
+-		pStream = new Streams::CMappingStream(*this->File.pMapping, static_cast<const SGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk);
++		pStream = new Streams::CMappingStream(*this->File.pMapping, static_cast<const TSGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk);
+ 		return hlTrue;
+ 	}
+ 	else
+ 	{
+ #if USE_ZLIB
+ 		Mapping::CView *pFileDataView = 0;
+-		if(this->File.pMapping->Map(pFileDataView, static_cast<const SGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk))
++		if(this->File.pMapping->Map(pFileDataView, static_cast<const TSGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk))
+ 		{
+ 			hlBool bResult = hlFalse;
+ 			hlByte *lpInflateBuffer = new hlByte[File.uiSize];
+@@ -905,4 +905,4 @@ hlVoid CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
+ 	{
+ 		delete []static_cast<const hlByte *>(static_cast<Streams::CMemoryStream &>(Stream).GetBuffer());
+ 	}
+-}
+\ No newline at end of file
++}
diff --git a/games/hllib/files/patch-HLLib_SGAFile.h b/games/hllib/files/patch-HLLib_SGAFile.h
new file mode 100644
index 000000000000..3d2dece120ac
--- /dev/null
+++ b/games/hllib/files/patch-HLLib_SGAFile.h
@@ -0,0 +1,60 @@
+--- HLLib/SGAFile.h.orig	2021-05-29 20:58:37 UTC
++++ HLLib/SGAFile.h
+@@ -163,11 +163,11 @@ namespace HLLib
+ 		class CSGASpecializedDirectory : public ISGADirectory
+ 		{
+ 		public:
+-			typedef typename TSGAHeader SGAHeader;
+-			typedef typename TSGADirectoryHeader SGADirectoryHeader;
+-			typedef typename TSGASection SGASection;
+-			typedef typename TSGAFolder SGAFolder;
+-			typedef typename TSGAFile SGAFile;
++			typedef TSGAHeader SGAHeader;
++			typedef TSGADirectoryHeader SGADirectoryHeader;
++			typedef TSGASection SGASection;
++			typedef TSGAFolder SGAFolder;
++			typedef TSGAFile SGAFile;
+ 
+ 			CSGASpecializedDirectory(CSGAFile& File);
+ 
+@@ -192,10 +192,10 @@ namespace HLLib
+ 		class CSGASpecializedDirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, SGAFile4> : public ISGADirectory
+ 		{
+ 		public:
+-			typedef typename TSGAHeader SGAHeader;
+-			typedef typename TSGADirectoryHeader SGADirectoryHeader;
+-			typedef typename TSGASection SGASection;
+-			typedef typename TSGAFolder SGAFolder;
++			typedef TSGAHeader SGAHeader;
++			typedef TSGADirectoryHeader SGADirectoryHeader;
++			typedef TSGASection SGASection;
++			typedef TSGAFolder SGAFolder;
+ 			typedef CSGAFile::SGAFile4 SGAFile;
+ 
+ 			CSGASpecializedDirectory(CSGAFile& File);
+@@ -221,10 +221,10 @@ namespace HLLib
+ 		class CSGASpecializedDirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, SGAFile6> : public ISGADirectory
+ 		{
+ 		public:
+-			typedef typename TSGAHeader SGAHeader;
+-			typedef typename TSGADirectoryHeader SGADirectoryHeader;
+-			typedef typename TSGASection SGASection;
+-			typedef typename TSGAFolder SGAFolder;
++			typedef TSGAHeader SGAHeader;
++			typedef TSGADirectoryHeader SGADirectoryHeader;
++			typedef TSGASection SGASection;
++			typedef TSGAFolder SGAFolder;
+ 			typedef CSGAFile::SGAFile6 SGAFile;
+ 
+ 			CSGASpecializedDirectory(CSGAFile& File);
+@@ -276,10 +276,6 @@ namespace HLLib
+ 		typedef CSGADirectory<SGAHeader6, SGADirectoryHeader5, SGASection5, SGAFolder5, SGAFile6> CSGADirectory6;
+ 		typedef CSGADirectory<SGAHeader6, SGADirectoryHeader7, SGASection5, SGAFolder5, SGAFile7> CSGADirectory7;
+ 
+-		friend CSGADirectory4;
+-		friend CSGADirectory5;
+-		friend CSGADirectory6;
+-		friend CSGADirectory7;
+ 
+ 	private:
+ 		static const char *lpAttributeNames[];
diff --git a/games/hllib/pkg-descr b/games/hllib/pkg-descr
index 38807ec23b8d..2d3cb86025cb 100644
--- a/games/hllib/pkg-descr
+++ b/games/hllib/pkg-descr
@@ -6,4 +6,4 @@ standard C imports).  HLLib works natively in both Windows and *nix.  BSP,
 GCF, NCF, PAK, SGA, VPK, WAD, XZP, and ZIP (store/deflate) package formats
 are supported.
 
-WWW: http://nemesis.thewavelength.net/index.php?p=35
+WWW: https://developer.valvesoftware.com/wiki/HLLib



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106010514.1515E24i031355>