From 5d954398d1ebe04778a945d5c1546d9dbfb8e031 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Thu, 10 Aug 2023 20:18:37 +0900 Subject: [PATCH] Create a symlink with relative path Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/378 --- conf.d/Makefile.am | 9 +-------- conf.d/link_confs.py | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/conf.d/Makefile.am b/conf.d/Makefile.am index a844f29..fd85834 100644 --- a/conf.d/Makefile.am +++ b/conf.d/Makefile.am @@ -109,14 +109,7 @@ README: $(srcdir)/README.in cd ../fc-lang && $(MAKE) $(AM_MAKEFLAGS) $(top_builddir)/conf.d/35-lang-normalize.conf install-data-hook: - mkdir -p $(DESTDIR)$(configdir) - @(echo cd $(DESTDIR)$(configdir); \ - cd $(DESTDIR)$(configdir); \ - for i in $(CONF_LINKS); do \ - echo $(RM) $$i";" ln -s $(templatedir)/$$i .; \ - $(RM) $$i; \ - ln -s $(templatedir)/$$i .; \ - done) + $(PYTHON) $(srcdir)/link_confs.py $(templatedir) $(configdir) $(CONF_LINKS) uninstall-local: @(echo cd $(DESTDIR)$(configdir); \ cd $(DESTDIR)$(configdir); \ diff --git a/conf.d/link_confs.py b/conf.d/link_confs.py index 11e759a..f92e1c3 100644 --- a/conf.d/link_confs.py +++ b/conf.d/link_confs.py @@ -34,7 +34,7 @@ if __name__=='__main__': except FileNotFoundError: pass try: - os.symlink(src, dst) + os.symlink(os.path.relpath(src, start=args.confpath), dst) except NotImplementedError: # Not supported on this version of Windows break