diff --git a/machines/compute01/stirling-pdf.nix b/machines/compute01/stirling-pdf.nix deleted file mode 100644 index 7c83fe1..0000000 --- a/machines/compute01/stirling-pdf.nix +++ /dev/null @@ -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"; - }; - }; -} diff --git a/machines/compute01/stirling-pdf/01-spotless.patch b/machines/compute01/stirling-pdf/01-spotless.patch new file mode 100644 index 0000000..ada86c2 --- /dev/null +++ b/machines/compute01/stirling-pdf/01-spotless.patch @@ -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' + } diff --git a/machines/compute01/stirling-pdf/02-propsfile.patch b/machines/compute01/stirling-pdf/02-propsfile.patch new file mode 100644 index 0000000..0c01ccc --- /dev/null +++ b/machines/compute01/stirling-pdf/02-propsfile.patch @@ -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 { diff --git a/machines/compute01/stirling-pdf/03-jar-timestamps.patch b/machines/compute01/stirling-pdf/03-jar-timestamps.patch new file mode 100644 index 0000000..f4df198 --- /dev/null +++ b/machines/compute01/stirling-pdf/03-jar-timestamps.patch @@ -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()] + } diff --git a/machines/compute01/stirling-pdf/04-local-maven-deps.patch b/machines/compute01/stirling-pdf/04-local-maven-deps.patch new file mode 100644 index 0000000..cb97da1 --- /dev/null +++ b/machines/compute01/stirling-pdf/04-local-maven-deps.patch @@ -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' diff --git a/machines/compute01/stirling-pdf/05-java-output-test.patch b/machines/compute01/stirling-pdf/05-java-output-test.patch new file mode 100644 index 0000000..861cb39 --- /dev/null +++ b/machines/compute01/stirling-pdf/05-java-output-test.patch @@ -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 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() { diff --git a/machines/compute01/stirling-pdf/default.nix b/machines/compute01/stirling-pdf/default.nix new file mode 100644 index 0000000..f356d0b --- /dev/null +++ b/machines/compute01/stirling-pdf/default.nix @@ -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"; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index f54c130..f385dad 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -9,6 +9,7 @@ }, "pre_releases": false, "version_upper_bound": null, + "release_prefix": null, "version": "0.15.0", "revision": "564595d0ad4be7277e07fa63b5a991b3c645655d", "url": "https://api.github.com/repos/ryantm/agenix/tarball/0.15.0", @@ -34,9 +35,9 @@ "repo": "attic" }, "branch": "main", - "revision": "4dbdbee45728d8ce5788db6461aaaa89d98081f0", - "url": "https://github.com/zhaofengli/attic/archive/4dbdbee45728d8ce5788db6461aaaa89d98081f0.tar.gz", - "hash": "1iri77pbf0gvas93zra29qy1c3l61n97z84xblqxmmhsxvljzvnh" + "revision": "717cc95983cdc357bc347d70be20ced21f935843", + "url": "https://github.com/zhaofengli/attic/archive/717cc95983cdc357bc347d70be20ced21f935843.tar.gz", + "hash": "1fdj8jp9wxqix67ia6yb54nx1yyjp2n9w5k8p98fmi73wi2khzch" }, "cas-eleves": { "type": "Git", @@ -58,10 +59,11 @@ }, "pre_releases": false, "version_upper_bound": null, - "version": "v1.6.0", - "revision": "5eaf747af38dd272e1ab28a8ec4bd972424b07cf", - "url": "https://api.github.com/repos/nix-community/disko/tarball/v1.6.0", - "hash": "1dk4xi79lvm8hv1raf2snm3j8y4q23csm6d3siljg4cpf2y4wyl7" + "release_prefix": null, + "version": "v1.6.1", + "revision": "4677f6c53482a8b01ee93957e3bdd569d51261d6", + "url": "https://api.github.com/repos/nix-community/disko/tarball/v1.6.1", + "hash": "1p9vsml07bm3riw703dv83ihlmgyc11qv882qa6bqzqdgn86y8z4" }, "dns.nix": { "type": "GitRelease", @@ -71,6 +73,7 @@ }, "pre_releases": false, "version_upper_bound": null, + "release_prefix": null, "version": "v1.2.1", "revision": "66979725afe2164491be38ffff78460cc9b0ffd7", "url": null, @@ -129,9 +132,9 @@ "url": "https://git.dgnum.eu/DGNum/metis" }, "branch": "master", - "revision": "f2bbd93c7517603ae2fef6bd6a87db8790327e43", + "revision": "49b136a43a51c53226db42cf1788a4812cb9549b", "url": null, - "hash": "0gmngpaz516l5wm1l8bw32sg7skww6dd7n0s786qxmmw0dnp8mw6" + "hash": "0nzr368fg2bwwxpgsjzk2mn2dywf8f2d79pjc56rqqsvwgn2ldwi" }, "nix-lib": { "type": "GitRelease", @@ -141,6 +144,7 @@ }, "pre_releases": false, "version_upper_bound": null, + "release_prefix": null, "version": "0.1.6", "revision": "ffb3dfa4c146d48300bd4fa625acfe48e091a734", "url": null, @@ -153,9 +157,9 @@ "url": "https://git.hubrecht.ovh/hubrecht/nix-modules.git" }, "branch": "main", - "revision": "5581a8bdd43061aba8db833704158b5bc584aaa5", + "revision": "a5645b5b3bed87ce9c9d633ad20537b0edd34e74", "url": null, - "hash": "0skwalq51anr4qxihrr1ln1lw0kifb7v7ply1m313zmlasrrwnfr" + "hash": "1vmi9ldmc1vibw21bv1lg41mbii8v0w9k3809awyf1ikir99jbyf" }, "nix-patches": { "type": "GitRelease", @@ -165,6 +169,7 @@ }, "pre_releases": false, "version_upper_bound": null, + "release_prefix": null, "version": "v0.5.0", "revision": "e11ba20945f4a867f09d84343c37328288f274b4", "url": null, @@ -173,14 +178,14 @@ "nixos-23.11": { "type": "Channel", "name": "nixos-23.11", - "url": "https://releases.nixos.org/nixos/23.11/nixos-23.11.6981.27c13997bf45/nixexprs.tar.xz", - "hash": "1s4wn0m6bdzxl4rcxzmyy2fdschrdj3nqy6zl85xynaxkb0n1gpj" + "url": "https://releases.nixos.org/nixos/23.11/nixos-23.11.7777.7144d6241f02/nixexprs.tar.xz", + "hash": "17m99lkrqsz9rk899g2lfivyqpr9qalmn4g36vsz3dqyxvgks3dw" }, "nixos-24.05": { "type": "Channel", "name": "nixos-24.05", - "url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.1135.9b5328b7f761/nixexprs.tar.xz", - "hash": "0k8d0xvygkxzvs5ikcw8j0pnksvzdmxdl03i69mni3nxylszyxvl" + "url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.2411.706eef542dec/nixexprs.tar.xz", + "hash": "13cwynfypavij6asd1ll054ly5kcch63kafdvbzhm13n0s0bk6zq" }, "nixos-generators": { "type": "Git", @@ -190,21 +195,21 @@ "repo": "nixos-generators" }, "branch": "master", - "revision": "35c20ba421dfa5059e20e0ef2343c875372bdcf3", - "url": "https://github.com/nix-community/nixos-generators/archive/35c20ba421dfa5059e20e0ef2343c875372bdcf3.tar.gz", - "hash": "17mc5q7rnnldals517b8m6qv9rcv0gdvh5zsnd6yvxmzm9s617ar" + "revision": "168b220231a70e47cc1f0919048fa5914415fb18", + "url": "https://github.com/nix-community/nixos-generators/archive/168b220231a70e47cc1f0919048fa5914415fb18.tar.gz", + "hash": "12006f32zkfa34lvsdd8q6qk2jphmcxm53wmj4mycl9q0mxv7a28" }, "nixos-unstable": { "type": "Channel", "name": "nixos-unstable", - "url": "https://releases.nixos.org/nixos/unstable/nixos-24.05pre621993.25865a40d14b/nixexprs.tar.xz", - "hash": "1jpsrbpiqikmxkkwdcj9h9l83z6jmw2m48gyrkrlsy6z3g3c9ydz" + "url": "https://releases.nixos.org/nixos/unstable/nixos-24.11pre647193.9f4128e00b0a/nixexprs.tar.xz", + "hash": "02ixm7pzl0jzanv7lmwfzqg7znjmq3wwads1l8r94xhln758lm1z" }, "nixpkgs": { "type": "Channel", "name": "nixpkgs-unstable", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre622672.ad7efee13e0d/nixexprs.tar.xz", - "hash": "0ng26dp73sd5dffw8wl4pwfmrgp2p03xbp4l1lxwlhcw6874fk4l" + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre647518.1afc5440469f/nixexprs.tar.xz", + "hash": "1y526xag5s2jyrs3w08pgwa8891zv2ibwl5jmkbr94x4vpyir8hz" }, "pre-commit-hooks": { "type": "Git", @@ -214,9 +219,9 @@ "repo": "pre-commit-hooks.nix" }, "branch": "master", - "revision": "2849da033884f54822af194400f8dff435ada242", - "url": "https://github.com/cachix/pre-commit-hooks.nix/archive/2849da033884f54822af194400f8dff435ada242.tar.gz", - "hash": "0ag90l0hrkhm02mkmm8yf3fnjjawv99czc7bp0szzgknps0xrzxb" + "revision": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "url": "https://github.com/cachix/pre-commit-hooks.nix/archive/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07.tar.gz", + "hash": "0bmgc731c5rvky6qxc4f6gvgyiic8dna5dv3j19kya86idf7wn0p" }, "signal-irc-bridge": { "type": "Git", @@ -248,10 +253,10 @@ "server": "https://git.helsinki.tools/" }, "branch": "master", - "revision": "ce281a5383a4bad0b99ef3576f248bcb5393ae79", - "url": "https://git.helsinki.tools/api/v4/projects/helsinki-systems%2Fwp4nix/repository/archive.tar.gz?sha=ce281a5383a4bad0b99ef3576f248bcb5393ae79", - "hash": "13wdg2lhbdim6v85illh1zxh5j4wmw2a3l3a1nfp1514b8d2zb4b" + "revision": "c900c5c6010d57b547756470d6bf3134216e508c", + "url": "https://git.helsinki.tools/api/v4/projects/helsinki-systems%2Fwp4nix/repository/archive.tar.gz?sha=c900c5c6010d57b547756470d6bf3134216e508c", + "hash": "0vz0qz2lys544842icdapd76j9mxk7ps1m92rf3awl9r9dsmf5f7" } }, "version": 3 -} +} \ No newline at end of file