File 0001-Use-filesystem-hierarchy-compliant-install-paths.patch of Package magic
From 78e65b10fc60a7d7e1e3db8d3b8b7c6a94d9458b Mon Sep 17 00:00:00 2001
From: Staf Verhaegen <staf@fibraservi.eu>
Date: Tue, 21 Mar 2023 15:59:20 +0100
Subject: [PATCH 1/2] Use filesystem hierarchy compliant install paths
---
Makefile | 2 ++
doc/html/Makefile | 2 +-
doc/latexfiles/Makefile | 2 +-
doc/tutcells/Makefile | 2 +-
scripts/defs.mak.in | 12 +++++++-----
tcltk/strip_reflibs.tcl | 2 +-
6 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index 7cdd05c2..5589a687 100644
--- a/Makefile
+++ b/Makefile
@@ -127,6 +127,8 @@ install-tcl:
install-tcl-real: install-tcl-dirs
for dir in ${INSTALL_CAD_DIRS} ${PROGRAMS}; do \
(cd $$dir && ${MAKE} install-tcl); done
+ # Add link to fulfill $(CAD_ROOT) expectations
+ ln -s $(libexecdir)/magic/tcl $(DESTDIR)$(libdir)/magic/tcl
clean:
for dir in ${SUBDIRS_FILTERED} ${TECHS} ${BUNDLED_MODULES}; do \
diff --git a/doc/html/Makefile b/doc/html/Makefile
index bf577bcc..85de93fa 100644
--- a/doc/html/Makefile
+++ b/doc/html/Makefile
@@ -2,7 +2,7 @@ MAGICDIR = ../..
include $(MAGICDIR)/defs.mak
-HTML_INSTDIR=$(INSTALL_LIBDIR)/magic/doc/html
+HTML_INSTDIR=$(docdir)/magic/html
install: $(DESTDIR)${HTML_INSTDIR}
tar cf - . | (cd $(DESTDIR)${HTML_INSTDIR}; tar xf - )
diff --git a/doc/latexfiles/Makefile b/doc/latexfiles/Makefile
index aeba340d..39fb285e 100644
--- a/doc/latexfiles/Makefile
+++ b/doc/latexfiles/Makefile
@@ -3,7 +3,7 @@ MAGICDIR = ../..
include $(MAGICDIR)/defs.mak
PS_SRCDIR=../psfiles
-PS_INSTDIR=$(INSTALL_LIBDIR)/magic/doc
+PS_INSTDIR=$(docdir)/magic
.SUFFIXES: .dvi .tex .ps
diff --git a/doc/tutcells/Makefile b/doc/tutcells/Makefile
index 1dc05d68..976a499a 100644
--- a/doc/tutcells/Makefile
+++ b/doc/tutcells/Makefile
@@ -6,7 +6,7 @@ MAGICDIR = ../..
include ${MAGICDIR}/defs.mak
-TUTDIR = ${INSTALL_LIBDIR}/magic/tutorial
+TUTDIR = ${docdir}/magic/tutorial
TUTFILES= m3a.mag maint2a.mag tut1.mag \
tut2a.mag tut2b.mag tut2c.mag tut2d.mag \
diff --git a/scripts/defs.mak.in b/scripts/defs.mak.in
index 72c99dcf..3679fd52 100755
--- a/scripts/defs.mak.in
+++ b/scripts/defs.mak.in
@@ -12,7 +12,9 @@ prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
+libexecdir = @libexecdir@
mandir = @mandir@
+docdir = @docdir@
SCRIPTS = ${MAGICDIR}/scripts
@@ -31,15 +33,15 @@ MANDIR = ${mandir}
LIBDIR = ${libdir}
SYSDIR = ${libdir}/magic/sys
SCMDIR = ${libdir}/magic/scm
-TCLDIR = ${libdir}/magic/tcl
+TCLDIR = ${libexecdir}/magic/tcl
# Install targets may be different if dist_prefix is set by configure
-INSTALL_BINDIR = @DIST_DIR@/bin
-INSTALL_MANDIR = @DIST_DIR@/share/man
-INSTALL_LIBDIR = @DIST_DIR@/lib
+INSTALL_BINDIR = ${bindir}
+INSTALL_MANDIR = ${mandir}
+INSTALL_LIBDIR = ${libdir}
INSTALL_SYSDIR = ${INSTALL_LIBDIR}/magic/sys
INSTALL_SCMDIR = ${INSTALL_LIBDIR}/magic/scm
-INSTALL_TCLDIR = ${INSTALL_LIBDIR}/magic/tcl
+INSTALL_TCLDIR = ${TCLDIR}
MAIN_EXTRA_LIBS = @extra_libs@
LD_EXTRA_LIBS = @ld_extra_libs@
diff --git a/tcltk/strip_reflibs.tcl b/tcltk/strip_reflibs.tcl
index 897347b7..cd7bb2dd 100755
--- a/tcltk/strip_reflibs.tcl
+++ b/tcltk/strip_reflibs.tcl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/tclsh
+#!/usr/bin/tclsh
#
# Strip GDS cell references from magic files.
#
--
2.47.3