anyk: 3.44.0 -> 3.45.0
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchurl,
|
||||
maven,
|
||||
fetchzip,
|
||||
openjdk,
|
||||
openjfx,
|
||||
jre,
|
||||
writeScript,
|
||||
runCommandLocal,
|
||||
bash,
|
||||
@@ -26,39 +25,38 @@ let
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
# ÁNYK needs JavaFX for the Ügyfélkapu login webview.
|
||||
jdkWithFX = openjdk.override {
|
||||
enableJavaFX = true;
|
||||
openjfx_jdk = openjfx.override { withWebKit = true; };
|
||||
# ÁNYK uses some SOAP stuff that's not shipped with OpenJDK any more.
|
||||
# We don't really want to use openjdk8 because it's unusable on HiDPI
|
||||
# and people are more likely to have a modern OpenJDK installed.
|
||||
# We use Maven to resolve these unbundled dependencies.
|
||||
# jdk_headless is just overriden so we don't have to fetch another OpenJDK for no reason.
|
||||
soapDeps = (maven.override { jdk_headless = jre; }).buildMavenPackage {
|
||||
pname = "anyk-soap-deps";
|
||||
version = "1.0.0";
|
||||
|
||||
src = lib.sources.sourceFilesBySuffices ./. [ "pom.xml" ];
|
||||
|
||||
mvnHash = "sha256-4keHPzS8pbIIwODmBUMofJt27n5WqYh+IGqE6d9od7k=";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/java
|
||||
cp target/lib/*.jar $out/share/java/
|
||||
'';
|
||||
};
|
||||
|
||||
extraClasspath = [
|
||||
# ÁNYK uses some SOAP stuff that's not shipped with OpenJDK any more.
|
||||
# We don't really want to use openjdk8 because it's unusable on HiDPI
|
||||
# and people are more likely to have a modern OpenJDK installed.
|
||||
(fetchurl {
|
||||
url = "mirror://maven/org/glassfish/metro/webservices-rt/2.4.10/webservices-rt-2.4.10.jar";
|
||||
hash = "sha256-lHclIZn3HR2B2lMttmmQGIV67qJi5KhL5jT2WNUQpPI=";
|
||||
})
|
||||
|
||||
(fetchurl {
|
||||
url = "mirror://maven/org/glassfish/metro/webservices-api/2.4.10/webservices-api-2.4.10.jar";
|
||||
hash = "sha256-1jiabjPkRnh+l/fmTt8aKE5hpeLreYOiLH9sVIcLUQE=";
|
||||
})
|
||||
|
||||
(fetchurl {
|
||||
url = "mirror://maven/com/sun/activation/jakarta.activation/2.0.1/jakarta.activation-2.0.1.jar";
|
||||
hash = "sha256-ueJLfdbgdJVWLqllMb4xMMltuk144d/Yitu96/QzKHE=";
|
||||
})
|
||||
|
||||
# Patch one of the ÁNYK classes so it works with the packages above by removing .internal. from the package names.
|
||||
(runCommandLocal "anyk-patch" { } ''
|
||||
mkdir $out
|
||||
cd $out
|
||||
${unzip}/bin/unzip ${src}/application/abevjava.jar hu/piller/enykp/niszws/ClientStubBuilder.class
|
||||
${python3}/bin/python ${./patch_paths.py} hu/piller/enykp/niszws/ClientStubBuilder.class
|
||||
'')
|
||||
];
|
||||
# Binary patch ÁNYK so it works with the JARs we fetch above (removing .internal. from some package names).
|
||||
anykSoapPatch =
|
||||
runCommandLocal "anyk-patch"
|
||||
{
|
||||
nativeBuildInputs = [ unzip ];
|
||||
}
|
||||
''
|
||||
mkdir $out
|
||||
cd $out
|
||||
unzip ${src}/application/abevjava.jar \
|
||||
hu/piller/enykp/niszws/ClientStubBuilder.class
|
||||
shopt -s globstar; ${python3}/bin/python ${./patch_paths.py} **/*.class
|
||||
'';
|
||||
|
||||
# This script can be used to run template installation jars (or use the Szervíz -> Telepítés menu)
|
||||
anyk-java = writeScript "anyk-java" ''
|
||||
@@ -91,7 +89,7 @@ let
|
||||
SCALING_PROP="-Dsun.java2d.uiScale=''${WINDOW_SCALING_FACTOR}"
|
||||
fi
|
||||
# ÁNYK crashes with NullPointerException with the GTK look and feel so use the cross-platform one.
|
||||
exec ${jdkWithFX}/bin/java -Dswing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel $SCALING_PROP "$@"
|
||||
exec ${jre}/bin/java -Dswing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel $SCALING_PROP "$@"
|
||||
'';
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
@@ -124,8 +122,8 @@ stdenv.mkDerivation {
|
||||
substituteAll ${anyk-java} $out/bin/anyk-java
|
||||
chmod +x $out/bin/anyk-java
|
||||
|
||||
# ÁNYK has some old school dependencies that are no longer bundled with Java, put them on the classpath.
|
||||
makeWrapper $out/bin/anyk-java $out/bin/anyk --add-flags "-cp ${lib.concatStringsSep ":" extraClasspath}:$out/opt/abevjava.jar hu.piller.enykp.gui.framework.MainFrame"
|
||||
# ÁNYK has some old school dependencies that are no longer bundled with Java, put them on the classpath. The * is resolved by Java at runtime.
|
||||
makeWrapper $out/bin/anyk-java $out/bin/anyk --add-flags "-cp '${soapDeps}/share/java/*:${anykSoapPatch}:$out/opt/abevjava.jar' hu.piller.enykp.gui.framework.MainFrame"
|
||||
|
||||
mkdir -p $out/share/applications $out/share/pixmaps $out/share/icons
|
||||
|
||||
@@ -145,7 +143,7 @@ stdenv.mkDerivation {
|
||||
homepage = "https://nav.gov.hu/nyomtatvanyok/letoltesek/nyomtatvanykitolto_programok/nyomtatvany_apeh/keretprogramok/javakitolto";
|
||||
license = lib.licenses.unfree;
|
||||
maintainers = with lib.maintainers; [ chpatrick ];
|
||||
platforms = openjdk.meta.platforms;
|
||||
platforms = jre.meta.platforms;
|
||||
sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
|
||||
mainProgram = "anyk";
|
||||
};
|
||||
|
||||
@@ -1,35 +1,41 @@
|
||||
from pathlib import Path
|
||||
from struct import pack
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
def to_java_string(string) -> bytes:
|
||||
string_bytes = string.encode("utf-8")
|
||||
# Java constant pool string entries are prefixed by 0x01 and 16-bit big-endian string length.
|
||||
return pack(">BH", 1, len(string_bytes)) + string_bytes
|
||||
|
||||
class_file = Path(sys.argv[1])
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
clazz = class_file.read_bytes()
|
||||
parser.add_argument("class_files", nargs="+", type=Path)
|
||||
|
||||
# We want to fix these package names so they work with the open-source Java EE releases instead of OpenJDK 8.
|
||||
patches = [
|
||||
( "com/sun/xml/internal/ws/developer/WSBindingProvider", "com/sun/xml/ws/developer/WSBindingProvider" ),
|
||||
( "com/sun/xml/internal/ws/api/message/Header", "com/sun/xml/ws/api/message/Header" ),
|
||||
( "com.sun.xml.internal.ws.transport.http.client.streaming.chunk.size", "com.sun.xml.ws.transport.http.client.streaming.chunk.size" ),
|
||||
( "com/sun/xml/internal/ws/api/message/Headers", "com/sun/xml/ws/api/message/Headers" ),
|
||||
( "(Lorg/w3c/dom/Element;)Lcom/sun/xml/internal/ws/api/message/Header;", "(Lorg/w3c/dom/Element;)Lcom/sun/xml/ws/api/message/Header;" ),
|
||||
( "([Lcom/sun/xml/internal/ws/api/message/Header;)V", "([Lcom/sun/xml/ws/api/message/Header;)V" ),
|
||||
]
|
||||
args = parser.parse_args()
|
||||
|
||||
for old, new in patches:
|
||||
old_java = to_java_string(old)
|
||||
new_java = to_java_string(new)
|
||||
assert old_java in clazz
|
||||
clazz = clazz.replace(old_java, new_java)
|
||||
assert old_java not in clazz
|
||||
assert new_java in clazz
|
||||
for class_file in args.class_files:
|
||||
clazz = class_file.read_bytes()
|
||||
|
||||
assert b".internal." not in clazz
|
||||
# We want to fix these package names so they work with the open-source Java EE releases instead of OpenJDK 8.
|
||||
patches = [
|
||||
( "com/sun/xml/internal/ws/developer/WSBindingProvider", "com/sun/xml/ws/developer/WSBindingProvider" ),
|
||||
( "com/sun/xml/internal/ws/api/message/Header", "com/sun/xml/ws/api/message/Header" ),
|
||||
( "com.sun.xml.internal.ws.transport.http.client.streaming.chunk.size", "com.sun.xml.ws.transport.http.client.streaming.chunk.size" ),
|
||||
( "com/sun/xml/internal/ws/api/message/Headers", "com/sun/xml/ws/api/message/Headers" ),
|
||||
( "(Lorg/w3c/dom/Element;)Lcom/sun/xml/internal/ws/api/message/Header;", "(Lorg/w3c/dom/Element;)Lcom/sun/xml/ws/api/message/Header;" ),
|
||||
( "([Lcom/sun/xml/internal/ws/api/message/Header;)V", "([Lcom/sun/xml/ws/api/message/Header;)V" ),
|
||||
]
|
||||
|
||||
class_file.write_bytes(clazz)
|
||||
for old, new in patches:
|
||||
old_java = to_java_string(old)
|
||||
new_java = to_java_string(new)
|
||||
assert old_java in clazz
|
||||
clazz = clazz.replace(old_java, new_java)
|
||||
assert new_java in clazz
|
||||
assert old_java not in clazz
|
||||
|
||||
assert b".internal." not in clazz
|
||||
|
||||
class_file.write_bytes(clazz)
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>nix.deps</groupId>
|
||||
<artifactId>dependency-fetcher</artifactId>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.ws</groupId>
|
||||
<artifactId>jaxws-rt</artifactId>
|
||||
<version>2.3.7</version> </dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
<version>2.3.9</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"url": "https://web.archive.org/web/20250801205917/https://nav.gov.hu/pfile/programFile?path=%252Fnyomtatvanyok%252Fletoltesek%252Fnyomtatvanykitolto_programok%252Fnyomtatvany_apeh%252Fkeretprogramok%252FAbevJava",
|
||||
"sha256": "0b0b197ifqwsnnw375gvnhdsvmgqwmw5fkfcfw0wmh0f6xjdapam",
|
||||
"version": "3.44.0"
|
||||
"url": "https://web.archive.org/web/20251201151010/https://nav.gov.hu/pfile/programFile?path=%252Fnyomtatvanyok%252Fletoltesek%252Fnyomtatvanykitolto_programok%252Fnyomtatvany_apeh%252Fkeretprogramok%252FAbevJava",
|
||||
"sha256": "12l1ghjcaxqi80bpxqwvsy3krz7qkdcg3zcvvif3g3hvqz5wc31s",
|
||||
"version": "3.45.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user