git: 0276f6d332dc - main - java/sqlitejdbc: this old port requires specific (8th) version of JDK

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Thu, 07 Jul 2022 12:32:07 UTC
The branch main has been updated by danfe:

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

commit 0276f6d332dc6cea04c3e1da35f71297fdb453b5
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-07-07 12:30:52 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-07-07 12:30:52 +0000

    java/sqlitejdbc: this old port requires specific (8th) version of JDK
    
    It should be fairly easy to make it compatible against Java 8~11, but
    that's the task for another day.  While here, bump the source/target
    version to 1.6 and get rid of bogus `post-patch' target: LOCALBASE is
    already passed on the MAKE_ENV.
    
    PR:     264748
---
 java/sqlitejdbc/Makefile             |  7 ++-----
 java/sqlitejdbc/files/patch-Makefile | 21 +++++++++++++++------
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/java/sqlitejdbc/Makefile b/java/sqlitejdbc/Makefile
index 20624d73e393..894e06c792d5 100644
--- a/java/sqlitejdbc/Makefile
+++ b/java/sqlitejdbc/Makefile
@@ -14,15 +14,12 @@ COMMENT=	Java JDBC driver for SQLite
 LIB_DEPENDS=	libsqlite3.so:databases/sqlite3
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}
-USE_JAVA=	yes
+USE_JAVA=	8
 USES=		gmake tar:tgz
 MAKE_ENV=	JAVA_HOME="${JAVA_HOME}"
 ALL_TARGET=	native
 
-PLIST_FILES=	%%JAVAJARDIR%%/sqlitejdbc-native.jar lib/libsqlitejdbc.so
-
-post-patch:
-	${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/Makefile
+PLIST_FILES=	${JAVAJARDIR}/sqlitejdbc-native.jar lib/libsqlitejdbc.so
 
 do-install:
 	${INSTALL_DATA} ${WRKSRC}/build/sqlitejdbc-v${PORTVERSION}-native.jar \
diff --git a/java/sqlitejdbc/files/patch-Makefile b/java/sqlitejdbc/files/patch-Makefile
index 52e98ff6f0de..bc48bff6209f 100644
--- a/java/sqlitejdbc/files/patch-Makefile
+++ b/java/sqlitejdbc/files/patch-Makefile
@@ -1,6 +1,6 @@
---- Makefile.orig	2008-06-18 01:39:02.000000000 +0200
-+++ Makefile	2008-06-23 16:12:40.000000000 +0200
-@@ -16,6 +16,7 @@
+--- Makefile.orig	2009-06-09 10:54:22 UTC
++++ Makefile
+@@ -16,6 +16,7 @@ include Makefile.common
  #
  
  include Makefile.common
@@ -8,7 +8,7 @@
  
  default: test
  
-@@ -29,13 +30,15 @@
+@@ -29,13 +30,15 @@ build/$(sqlitejdbc)-native.jar: $(native_classes)
  build/$(sqlitejdbc)-native.jar: $(native_classes)
  	cd build && jar cf $(sqlitejdbc)-native.jar $(java_classlist)
  
@@ -17,12 +17,21 @@
  	@mkdir -p build/$(target)
  	$(JAVAH) -classpath build -jni -o build/NativeDB.h org.sqlite.NativeDB
  	$(CC) $(CFLAGS) -c -o build/$(target)/NativeDB.o \
-+		-I%%LOCALBASE%%/include \
++		-I$(LOCALBASE)/include \
  		src/org/sqlite/NativeDB.c
  	$(CC) $(CFLAGS) $(LINKFLAGS) -o build/$(target)/$(LIBNAME) \
 -		build/$(target)/NativeDB.o build/$(sqlite)-$(target)/*.o
 +		build/$(target)/NativeDB.o \
-+		-L%%LOCALBASE%%/lib -lsqlite3
++		-L$(LOCALBASE)/lib -lsqlite3
  	$(STRIP) build/$(target)/$(LIBNAME)
  
  build/$(sqlite)-%/sqlite3.o: dl/$(sqlite)-amal.zip
+@@ -51,7 +54,7 @@ build/org/%.class: src/org/%.java
+ 
+ build/org/%.class: src/org/%.java
+ 	@mkdir -p build
+-	$(JAVAC) -source 1.2 -target 1.2 -sourcepath src -d build $<
++	$(JAVAC) -source 1.6 -target 1.6 -sourcepath src -d build $<
+ 
+ build/test/%.class: src/test/%.java
+ 	@mkdir -p build