Skip to content

Commit 04a3711

Browse files
committed
archiver-appliance: 1.1.0 -> 2.0.5
- build system changed from ant to gradle - log4j config file changed to log4j2.xml
1 parent 5710b4f commit 04a3711

File tree

8 files changed

+1247
-48
lines changed

8 files changed

+1247
-48
lines changed

docs/release-notes/2505.rst

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
25.05 Release notes
2+
===================
3+
4+
.. default-domain:: nix
5+
6+
.. role:: nix(code)
7+
:language: nix
8+
9+
Highlights
10+
----------
11+
12+
- Archiver Appliance was upgrade from 1.1.0 -> 2.0.5,
13+
see the `Archiver Appliance 2.0.5 release notes`_.
14+
None of the breaking change should affect users of the
15+
:option:`services.archiver-appliance` NixOS options.
16+
17+
.. _Archiver Appliance 2.0.5 release notes: https://github.com/archiver-appliance/epicsarchiverap/releases/tag/2.0.5

nixos/modules/archiver-appliance.nix

+15-7
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,20 @@
7171
.handlers = java.util.logging.ConsoleHandler
7272
'';
7373

74-
log4jProperties = pkgs.writeTextDir "/log4j.properties" ''
75-
log4j.rootLogger = ERROR, stdout
76-
log4j.logger.config.org.epics.archiverappliance = INFO
77-
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
78-
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
79-
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
74+
log4j2Xml = pkgs.writeTextDir "/log4j2.xml" ''
75+
<Configuration>
76+
<Appenders>
77+
<Console name="STDOUT" target="SYSTEM_OUT">
78+
<PatternLayout pattern="%p %m (%c)%n"/>
79+
</Console>
80+
</Appenders>
81+
<Loggers>
82+
<Logger name="org.apache.log4j.xml" level="info"/>
83+
<Root level="info">
84+
<AppenderRef ref="STDOUT"/>
85+
</Root>
86+
</Loggers>
87+
</Configuration>
8088
'';
8189
in {
8290
options.services.archiver-appliance = {
@@ -284,7 +292,7 @@ in {
284292
];
285293

286294
commonLibs = [
287-
"${log4jProperties}/log4j.properties"
295+
"${log4j2Xml}/log4j2.xml"
288296

289297
# We use the mariadb connecter, since it supports UNIX socket connection,
290298
# which allows us not not store the password in plaintext in the config.

pkgs/default.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ in
7777

7878
# EPICS related tools and extensions
7979

80-
archiver-appliance = callPackage ./epnix/tools/archiver-appliance {};
80+
archiver-appliance = callPackage ./epnix/tools/archiver-appliance {
81+
jdk = prev.jdk17;
82+
};
8183

8284
ca-gateway = callPackage ./epnix/tools/ca-gateway {};
8385

Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
{
22
stdenvNoCC,
33
lib,
4+
epnix,
45
epnixLib,
56
fetchFromGitHub,
67
jdk,
7-
ant,
8-
dos2unix,
8+
gradle,
9+
sphinx,
910
tomcat9,
11+
python3Packages,
1012
python3,
1113
}:
12-
stdenvNoCC.mkDerivation (self: {
14+
stdenvNoCC.mkDerivation (finalAttrs: {
1315
pname = "archiver-appliance";
14-
version = "1.1.0";
16+
version = "2.0.5";
1517

1618
src = fetchFromGitHub {
1719
owner = "archiver-appliance";
1820
repo = "epicsarchiverap";
19-
rev = self.version;
20-
fetchSubmodules = true;
21-
hash = "sha256-ezsjqp23BMLpqA6cdd6k0wXhAR1imOm0tyWJUaSWmiA=>";
21+
rev = finalAttrs.version;
22+
hash = "sha256-X1q87+3QZaNv4bY9UjTEEr0Jrv9AEIezhygI9jgNay0=";
2223
};
2324

2425
patches = [
@@ -27,34 +28,43 @@ stdenvNoCC.mkDerivation (self: {
2728

2829
# Messes up the shebang auto-patching
2930
./fix-policies-shebang.patch
31+
32+
./fix-docs-build-script.patch
3033
];
3134

32-
nativeBuildInputs = [jdk ant dos2unix];
35+
nativeBuildInputs = [
36+
jdk
37+
gradle
38+
sphinx
39+
python3Packages.myst-parser
40+
python3Packages.sphinx-rtd-theme
41+
];
3342
buildInputs = [python3];
3443

35-
TOMCAT_HOME = "${tomcat9}";
44+
gradleFlags = [
45+
"-PprojVersion=${finalAttrs.version}"
46+
"-Dorg.gradle.java.home=${jdk}"
47+
];
3648

37-
buildPhase = ''
38-
runHook preBuild
49+
# Update by running `nix build .#archiver-appliance.mitmCache.updateScript && ./result`
50+
mitmCache = gradle.fetchDeps {
51+
pkg = epnix.archiver-appliance;
52+
data = ./deps.json;
53+
};
3954

40-
ant
55+
# Some PV tests fail
56+
#doCheck = true;
4157

42-
runHook postBuild
43-
'';
58+
TOMCAT_HOME = "${tomcat9}";
4459

4560
installPhase = ''
4661
runHook preInstall
4762
48-
install -Dt $out/webapps ../retrieval.war ../engine.war ../etl.war ../mgmt.war
49-
install -Dt $out/share/doc/archappl LICENSE NOTICE
50-
cp -R docs $out/share/doc/archappl
63+
install -Dt $out/webapps build/libs/{retrieval,engine,etl,mgmt}.war
64+
install --mode=644 -Dt $out/share/doc/archappl LICENSE NOTICE
5165
52-
install -Dt $out/share/archappl/sql src/main/org/epics/archiverappliance/config/persistence/*.sql
66+
install --mode=644 -Dt $out/share/archappl/sql src/main/org/epics/archiverappliance/config/persistence/*.sql
5367
install -Dt $out/share/archappl/ src/sitespecific/tests/classpathfiles/policies.py
54-
# DOS-style line-ending messes up shebang auto-patching
55-
dos2unix $out/share/archappl/policies.py
56-
57-
install -Dt $out ../archappl*.tar.gz
5868
5969
runHook postInstall
6070
'';
@@ -75,5 +85,10 @@ stdenvNoCC.mkDerivation (self: {
7585
];
7686
maintainers = with epnixLib.maintainers; [minijackson];
7787
inherit (jdk.meta) platforms;
88+
sourceProvenance = with lib.sourceTypes; [
89+
fromSource
90+
# gradle dependencies
91+
binaryBytecode
92+
];
7893
};
7994
})

0 commit comments

Comments
 (0)