From 262613b94fd2256ed20a819825a8fe0584877bec Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 7 May 2025 07:04:30 +0000 Subject: [PATCH] Bug 39849: Fix makefile target dependency order This patch fixes the makefile target dependency order, so that it runs in this order: 1. Build CSS and JS assets 2. Run pm_to_blib, which is the step that copies over most of Koha's files into blib 3. Move 'vue/dist' files via "move_compiled_js" makefile target/step To test: 1a. Run 'git archive --format=tar HEAD > "koha.orig.tar"' 1b. sudo mkdir /opt/koha /opt/build_koha 1c. sudo chown kohadev-koha /opt/koha /opt/build_koha 1d. mv koha.orig.tar /opt/build_koha/. 1e. cd /opt/build_koha 1f. tar xvf koha.orig.tar 2. Run "perl Makefile.PL" Choose "single" Choose "/opt/koha" for target directory Choose the defaults for the rest 3. Run "make" 4. Note the first step is the CSS/JS build 5. Note the second step is the copying of files to "blib" 6. Run "find -name 'esm.js.map'" and note it appears in the regular build location as well as in "blib" 7. Run "find -name 'swagger_bundle.json'" and note it appears in the regular build location as well as in "blib" 8. Run "make install" 9. Run the above "find" commands using "/opt/koha" and note that the files appear in the installed directory --- Makefile.PL | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 879907e36a..cb75329ed1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1909,17 +1909,22 @@ sub top_targets { my $inherited = shift->SUPER::top_targets(@_); my $compile_step; - #NOTE: Make "all" depend on "compile_css_js" - $compile_step .= "all :: compile_css_js\n"; + #NOTE: Make "all" depend on "compile_css_js" and "move_compiled_js", so that it runs those targets/steps + $compile_step .= "all :: compile_css_js move_compiled_js\n"; $compile_step .= "\t" . '$(NOECHO) $(NOOP)' . "\n"; $compile_step .= "\n"; - #NOTE: Make compile_css_js depend on pm_to_blib, so we have access to the blib directory - $compile_step .= "compile_css_js: pm_to_blib\n"; + #NOTE: Build CSS and Javascript assets + $compile_step .= "compile_css_js:\n"; $compile_step .= "\t" . '$(PERLRUN) build-resources.PL' . "\n"; + $compile_step .= "\n"; + #NOTE: Make move_compiled_js depend on compile_css_js, so we have our generated Javascript assets + #NOTE: Make move_compiled_js depend on pm_to_blib, so we have access to the blib directory #NOTE: Copy the generated vue dist files into the relevant blib + $compile_step .= "move_compiled_js: compile_css_js pm_to_blib\n"; $compile_step .= "\t" . 'cp -r koha-tmpl/intranet-tmpl/prog/js/vue/dist blib/INTRANET_TMPL_DIR/prog/js/vue/' . "\n"; + $compile_step .= "\n"; my $top_targets = $compile_step . "\n" . $inherited; return $top_targets; -- 2.39.5