forked from DGNum/infrastructure
fix(stirling-pdf): Vendor patches and update version
This commit is contained in:
parent
9e2b066cfc
commit
d553d6efe7
7 changed files with 167 additions and 30 deletions
|
@ -1,30 +0,0 @@
|
|||
{ nixpkgs, ... }:
|
||||
|
||||
let
|
||||
dgn-id = "57ac2e06a00384772bf63f055874ce2fefe4eb0a";
|
||||
in
|
||||
|
||||
{
|
||||
services.stirling-pdf = {
|
||||
enable = true;
|
||||
|
||||
package = nixpkgs.unstable.stirling-pdf.overrideAttrs (old: {
|
||||
patches = (old.patches or [ ]) ++ [
|
||||
(builtins.fetchurl "https://git.dgnum.eu/DGNum/Stirling-PDF/commit/${dgn-id}.patch")
|
||||
];
|
||||
});
|
||||
|
||||
domain = "pdf.dgnum.eu";
|
||||
port = 8084;
|
||||
|
||||
nginx = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
|
||||
environment = {
|
||||
UI_APP_NAME = "DGNum PDF";
|
||||
SYSTEM_DEFAULT_LOCALE = "fr-FR";
|
||||
};
|
||||
};
|
||||
}
|
35
machines/compute01/stirling-pdf/01-spotless.patch
Normal file
35
machines/compute01/stirling-pdf/01-spotless.patch
Normal file
|
@ -0,0 +1,35 @@
|
|||
diff --git a/build.gradle b/build.gradle
|
||||
index 78901d8e..3a14ceee 100644
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -70,20 +70,6 @@ launch4j {
|
||||
messagesInstanceAlreadyExists="Stirling-PDF is already running."
|
||||
}
|
||||
|
||||
-spotless {
|
||||
- java {
|
||||
- target project.fileTree('src/main/java')
|
||||
-
|
||||
- googleJavaFormat('1.19.1').aosp().reorderImports(false)
|
||||
-
|
||||
- importOrder('java', 'javax', 'org', 'com', 'net', 'io')
|
||||
- toggleOffOn()
|
||||
- trimTrailingWhitespace()
|
||||
- indentWithSpaces()
|
||||
- endWithNewline()
|
||||
- }
|
||||
-}
|
||||
-
|
||||
dependencies {
|
||||
//security updates
|
||||
implementation 'ch.qos.logback:logback-classic:1.5.3'
|
||||
@@ -171,9 +157,6 @@ dependencies {
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.32'
|
||||
}
|
||||
|
||||
-tasks.withType(JavaCompile).configureEach {
|
||||
- dependsOn 'spotlessApply'
|
||||
-}
|
||||
compileJava {
|
||||
options.compilerArgs << '-parameters'
|
||||
}
|
12
machines/compute01/stirling-pdf/02-propsfile.patch
Normal file
12
machines/compute01/stirling-pdf/02-propsfile.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff --git a/build.gradle b/build.gradle
|
||||
index 78901d8e..2e7ff96b 100644
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -166,6 +166,7 @@ task writeVersion {
|
||||
def props = new Properties()
|
||||
props.setProperty('version', version)
|
||||
props.store(propsFile.newWriter(), null)
|
||||
+ propsFile.text = propsFile.readLines().tail().join('\n')
|
||||
}
|
||||
|
||||
swaggerhubUpload {
|
16
machines/compute01/stirling-pdf/03-jar-timestamps.patch
Normal file
16
machines/compute01/stirling-pdf/03-jar-timestamps.patch
Normal file
|
@ -0,0 +1,16 @@
|
|||
diff --git a/build.gradle b/build.gradle
|
||||
index 2e7ff96b..f3a4a15c 100644
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -21,6 +21,11 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
+tasks.withType(AbstractArchiveTask) {
|
||||
+ preserveFileTimestamps = false
|
||||
+ reproducibleFileOrder = true
|
||||
+}
|
||||
+
|
||||
licenseReport {
|
||||
renderers = [new JsonReportRenderer()]
|
||||
}
|
25
machines/compute01/stirling-pdf/04-local-maven-deps.patch
Normal file
25
machines/compute01/stirling-pdf/04-local-maven-deps.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
diff --git a/build.gradle b/build.gradle
|
||||
index f3a4a15c..61fbd74e 100644
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -18,7 +18,7 @@ version = '0.26.1'
|
||||
sourceCompatibility = '17'
|
||||
|
||||
repositories {
|
||||
- mavenCentral()
|
||||
+ maven { url '@deps@' }
|
||||
}
|
||||
|
||||
tasks.withType(AbstractArchiveTask) {
|
||||
diff --git a/settings.gradle b/settings.gradle
|
||||
index f8139930..2c87f3cc 100644
|
||||
--- a/settings.gradle
|
||||
+++ b/settings.gradle
|
||||
@@ -1 +1,7 @@
|
||||
+pluginManagement {
|
||||
+ repositories {
|
||||
+ maven { url '@deps@' }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
rootProject.name = 'Stirling-PDF'
|
22
machines/compute01/stirling-pdf/05-java-output-test.patch
Normal file
22
machines/compute01/stirling-pdf/05-java-output-test.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
diff --git a/src/test/java/stirling/software/SPDF/utils/ProcessExecutorTest.java b/src/test/java/stirling/software/SPDF/utils/ProcessExecutorTest.java
|
||||
index cab78313..192922f3 100644
|
||||
--- a/src/test/java/stirling/software/SPDF/utils/ProcessExecutorTest.java
|
||||
+++ b/src/test/java/stirling/software/SPDF/utils/ProcessExecutorTest.java
|
||||
@@ -19,7 +19,7 @@ public class ProcessExecutorTest {
|
||||
processExecutor = ProcessExecutor.getInstance(ProcessExecutor.Processes.LIBRE_OFFICE);
|
||||
}
|
||||
|
||||
- @Test
|
||||
+ /* @Test
|
||||
public void testRunCommandWithOutputHandling() throws IOException, InterruptedException {
|
||||
// Mock the command to execute
|
||||
List<String> command = new ArrayList<>();
|
||||
@@ -32,7 +32,7 @@ public class ProcessExecutorTest {
|
||||
// Check the exit code and output messages
|
||||
assertEquals(0, result.getRc());
|
||||
assertNotNull(result.getMessages()); // Check if messages are not null
|
||||
- }
|
||||
+ } */
|
||||
|
||||
@Test
|
||||
public void testRunCommandWithOutputHandling_Error() {
|
57
machines/compute01/stirling-pdf/default.nix
Normal file
57
machines/compute01/stirling-pdf/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{ pkgs, nixpkgs, ... }:
|
||||
|
||||
let
|
||||
dgn-id = "5891e1bbda792e0546f8d785cdd4d3f570a01579";
|
||||
in
|
||||
|
||||
{
|
||||
services.stirling-pdf = {
|
||||
enable = true;
|
||||
|
||||
package = nixpkgs.unstable.stirling-pdf.overrideAttrs (old: rec {
|
||||
version = "0.26.1";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Stirling-Tools";
|
||||
repo = "Stirling-PDF";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-msxP2n8Varc7/h9RVwYRBuD253JZu6/p7zQC1lmNmqc=";
|
||||
};
|
||||
|
||||
deps = old.deps.overrideAttrs (_: {
|
||||
patches = [
|
||||
./01-spotless.patch
|
||||
./05-java-output-test.patch
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
outputHash = "sha256-i2PJmsuJ8jqTUNwj4HoiWynaK4LlLrqjIZ67rSSYypc=";
|
||||
});
|
||||
|
||||
patches = [
|
||||
./01-spotless.patch
|
||||
./02-propsfile.patch
|
||||
./03-jar-timestamps.patch
|
||||
(pkgs.substituteAll {
|
||||
src = ./04-local-maven-deps.patch;
|
||||
inherit deps;
|
||||
})
|
||||
./05-java-output-test.patch
|
||||
(builtins.fetchurl "https://git.dgnum.eu/DGNum/Stirling-PDF/commit/${dgn-id}.patch")
|
||||
];
|
||||
});
|
||||
|
||||
domain = "pdf.dgnum.eu";
|
||||
port = 8084;
|
||||
|
||||
nginx = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
|
||||
environment = {
|
||||
UI_APP_NAME = "DGNum PDF";
|
||||
SYSTEM_DEFAULT_LOCALE = "fr-FR";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue