Possible to specify port dependency maximum version?

Is it possible to specify a maximum version for a port dependency?
It is possible to specify a minimum version: Porters Handbook makefile-version-dependency.
But what about a max version, to prevent a newer, incompatible dependency version from installing?
Specifically, the port requires Java 8, whereas the newest versions of the dependency takes a newer Java version. (It is out of the question to update the port to run on a newer Java, newer major versions of the port do allow newer Javas.)
 
From PORTSDIR/Mk/Uses/java.mk:
# JAVA_VERSION List of space-separated suitable java versions for the
# port. An optional "+" allows you to specify a range of
# versions. (allowed values: 8[+] 11[+] 17[+]
# 21[+] 22[+] 23[+] 24[+] 25[+] 26[+])

So, if you just want to support java from 11 to 22, part of the port's Makefile will look like:
Code:
USES= java
JAVA_VERSION= 11 17 21 22
 
Right, I know how to manage the Java versions for the port. I'm asking about requiring a max version for another dependency, which just so happens to also use Java. Specifying the Java version in my port, which it already does, will not control which Java versions a dependency requires/runs on as far as I know.
 
Java is a little different, it's not pulled in through a *_DEPENDS list. It uses the USES= framework.


But that's for this specific port only, it does nothing for the dependencies of a dependency.

I'm assuming your specific port needs Java 8 and only Java 8, but pulls in another dependency that pulls in Java 21? Or some other Java version? Is that the issue?

That specific port would have:
Code:
USES= java
JAVA_VERSION= 8

Maybe the dependency has flavors? Perhaps based on the Java version?
 
Back
Top