From e485c921e12b00c9cda0954c17923659e35afcf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Bitteur?= Date: Mon, 17 Jun 2024 12:40:52 +0200 Subject: [PATCH] Languages files directly copied to flathub --- flatpak/build.gradle | 17 +++++++++++------ flatpak/flathub | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/flatpak/build.gradle b/flatpak/build.gradle index d8c90f3d9..7524257df 100644 --- a/flatpak/build.gradle +++ b/flatpak/build.gradle @@ -38,20 +38,25 @@ task genLanguages { description("Generate languages sources") doLast { - ///flathubDir.exists() || flathubDir.mkdirs() + println "Copying language sources to $flathubDir" + copy { + from("appdir/dev/tessdata") + include '*.traineddata' + into(flathubDir) + } + def langFile = new File(flathubDir, "lang_sources.yml") - println "Generating language sources into ${langFile}" + println "Generating language sources as ${langFile}" project.delete( fileTree(langFile) ) fileTree("$appDir/dev/tessdata").include('*.traineddata').each { f -> - def relPath = relativePath(f).replace("\\","/") + def fname = f.getName() def sha1 = calcSha1(f) // perhaps not needed langFile.append(" - type: file\n") - langFile.append(" path: ../${relPath}\n") - langFile.append(" sha1: ${sha1}\n\n") // perhaps not needed + langFile.append(" path: ${fname}\n\n") } } } @@ -143,7 +148,7 @@ task buildFlatpak (type: Exec) { // All outputs are located under the 'build' directory for an easier cleanup commandLine('flatpak-builder', -// '--verbose', + '--verbose', // '--state-dir=build/.flatpak-builder', // option to define the state-storing directory '--force-clean', // option to empty the output directory 'build', // relative path to the output directory to write diff --git a/flatpak/flathub b/flatpak/flathub index aba695343..642bcf1ee 160000 --- a/flatpak/flathub +++ b/flatpak/flathub @@ -1 +1 @@ -Subproject commit aba695343ae02d497a85ee86e844799765f4f07f +Subproject commit 642bcf1ee75f0aedfc66e2c10135204de647f02c