From c5e6175530b7ca26c26e27414e6483d474d16ab7 Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Sun, 23 Jun 2024 21:36:39 +0200 Subject: [PATCH] Fix the new paths to dependencies --- lib/Makefile | 12 ------------ webapp/Makefile | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 5f2e2dea763..884061c8f9d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -12,21 +12,9 @@ $(OBJECTS): %$(OBJEXT): %.c %.h clean-l: rm -f $(OBJECTS) -# Change baseDir in composer autogenerated files -define fix_composer_paths - for file in autoload_psr4.php autoload_classmap.php autoload_files.php autoload_namespaces.php ; do \ - sed -i "s#^\$$baseDir = .*#\$$baseDir = dirname('$(domserver_webappdir)');#" $(1)/composer/$$file ; \ - done - sed -i "s#__DIR__ \. '/\.\./\.\./\.\.' \. '/webapp#'$(domserver_webappdir)#" $(1)/composer/autoload_static.php -endef - install-domserver: $(INSTALL_DATA) -t $(DESTDIR)$(domserver_libdir) *.php $(INSTALL_PROG) -t $(DESTDIR)$(domserver_libdir) alert - for i in vendor/* ; do \ - $(call install_tree,$(DESTDIR)$(domserver_libvendordir),$$i) ; \ - done - $(call fix_composer_paths,$(DESTDIR)$(domserver_libvendordir)) install-judgehost: $(INSTALL_DATA) -t $(DESTDIR)$(judgehost_libdir) *.php *.sh diff --git a/webapp/Makefile b/webapp/Makefile index 40f17f5676c..6877a615631 100644 --- a/webapp/Makefile +++ b/webapp/Makefile @@ -32,27 +32,36 @@ copy-bundle-assets: # the include paths are broken. We just copy in the data we need -rm -rf public/bundles/nelmioapidoc mkdir -p public/bundles/nelmioapidoc - cp -R ../lib/vendor/nelmio/api-doc-bundle/Resources/public/* public/bundles/nelmioapidoc/ + cp -R ../webapp/vendor/nelmio/api-doc-bundle/Resources/public/* public/bundles/nelmioapidoc/ clean-l: -rm -rf public/bundles/nelmioapidoc +# Change baseDir in composer autogenerated files +define fix_composer_paths + for file in autoload_psr4.php autoload_classmap.php autoload_files.php autoload_namespaces.php ; do \ + sed -i "s#^\$$baseDir = .*#\$$baseDir = dirname('$(domserver_webappdir)');#" $(1)/composer/$$file ; \ + done + sed -i "s#__DIR__ \. '/\.\./\.\./\.\.' \. '/webapp#'$(domserver_webappdir)#" $(1)/composer/autoload_static.php +endef + install-domserver: # This must be done first to install with the rest. $(MAKE) copy-bundle-assets $(INSTALL_DIR) $(DESTDIR)$(domserver_webappdir); - for d in bin config migrations public resources src templates tests ; do \ + for d in bin config migrations public resources src templates tests vendor; do \ $(call install_tree,$(DESTDIR)$(domserver_webappdir),$$d) ; \ done + $(call fix_composer_paths,$(DESTDIR)$(domserver_webappdir)/vendor) # Change webapp/public/doc symlink rm $(DESTDIR)$(domserver_webappdir)/public/doc ln -s $(domjudge_docdir) $(DESTDIR)$(domserver_webappdir)/public/doc # Now change all relative symlinks in webapp/public to their correct paths for link in $$(find $(DESTDIR)$(domserver_webappdir)/public/$$dir -maxdepth 2 -type l); do \ target=$$(readlink $$link) ; \ - if echo $${target} | grep -q '\.\./\.\./lib/vendor' ; then \ + if echo $${target} | grep -q '\.\./\.\./webapp/vendor' ; then \ rm $$link ; \ - realtarget=$(domserver_libvendordir)$$(echo $${target} | sed 's!^.*\.\./\.\./lib/vendor!!') ; \ + realtarget=$(domserver_webappdir)/vendor$$(echo $${target} | sed 's!^.*\.\./\.\./webapp/vendor!!') ; \ ln -s $$realtarget $$link ; \ fi \ done