1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-22 23:47:56 +01:00

- instruct makefile to copy modules, script and icons in differents subdirectory when installing the package.

This commit is contained in:
cage 2023-02-05 14:41:03 +01:00
parent c0e2b43d3e
commit 801829b528
18 changed files with 68 additions and 54 deletions

View File

@ -42,17 +42,19 @@ confdir = $(sysconfdir)/$(PACKAGE)
dist_conf_DATA = etc/init.lisp etc/default-theme.conf etc/shared.conf
dist_pkgdata_DATA = modules/delete-by-regex.lisp \
modules/expand-abbrev-command-window.lisp \
modules/next-previous-open.lisp \
modules/rewrite-message-urls.lisp \
modules/share-gemini-link.lisp \
scripts/export-gemini-subscriptions.lisp \
scripts/gemget.lisp \
scripts/get-following.lisp \
scripts/import-following.lisp \
scripts/import-gemini-subscriptions.lisp \
scripts/welcome-bot.lisp
nobase_dist_pkgdata_DATA = \
data/modules/delete-by-regex.lisp \
data/modules/expand-abbrev-command-window.lisp \
data/modules/next-previous-open.lisp \
data/modules/rewrite-message-urls.lisp \
data/modules/share-gemini-link.lisp \
data/scripts/export-gemini-subscriptions.lisp \
data/scripts/gemget.lisp \
data/scripts/get-following.lisp \
data/scripts/import-following.lisp \
data/scripts/import-gemini-subscriptions.lisp \
data/scripts/welcome-bot.lisp \
data/icons/search.png
dist_man1_MANS = doc/tinmop.man

View File

@ -117,7 +117,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(dist_conf_DATA) $(dist_doc_DATA) \
$(dist_pkgdata_DATA) $(am__DIST_COMMON)
$(nobase_dist_pkgdata_DATA) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@ -184,7 +184,7 @@ am__can_run_installinfo = \
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(dist_man1_MANS)
DATA = $(dist_conf_DATA) $(dist_doc_DATA) $(dist_pkgdata_DATA)
DATA = $(dist_conf_DATA) $(dist_doc_DATA) $(nobase_dist_pkgdata_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
@ -406,17 +406,19 @@ doc/tinmop.org doc/send-toot.lisp NEWS.org ChangeLog AUTHORS
confdir = $(sysconfdir)/$(PACKAGE)
dist_conf_DATA = etc/init.lisp etc/default-theme.conf etc/shared.conf
dist_pkgdata_DATA = modules/delete-by-regex.lisp \
modules/expand-abbrev-command-window.lisp \
modules/next-previous-open.lisp \
modules/rewrite-message-urls.lisp \
modules/share-gemini-link.lisp \
scripts/export-gemini-subscriptions.lisp \
scripts/gemget.lisp \
scripts/get-following.lisp \
scripts/import-following.lisp \
scripts/import-gemini-subscriptions.lisp \
scripts/welcome-bot.lisp
nobase_dist_pkgdata_DATA = \
data/modules/delete-by-regex.lisp \
data/modules/expand-abbrev-command-window.lisp \
data/modules/next-previous-open.lisp \
data/modules/rewrite-message-urls.lisp \
data/modules/share-gemini-link.lisp \
data/scripts/export-gemini-subscriptions.lisp \
data/scripts/gemget.lisp \
data/scripts/get-following.lisp \
data/scripts/import-following.lisp \
data/scripts/import-gemini-subscriptions.lisp \
data/scripts/welcome-bot.lisp \
data/icons/search.png
dist_man1_MANS = doc/tinmop.man
all: $(BUILT_SOURCES)
@ -578,26 +580,29 @@ uninstall-dist_docDATA:
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
install-nobase_dist_pkgdataDATA: $(nobase_dist_pkgdata_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
@list='$(nobase_dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \
$(am__nobase_list) | while read dir files; do \
xfiles=; for file in $$files; do \
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgdatadir)/$$dir"; }; \
echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(pkgdatadir)/$$dir'"; \
$(INSTALL_DATA) $$xfiles "$(DESTDIR)$(pkgdatadir)/$$dir" || exit $$?; }; \
done
uninstall-dist_pkgdataDATA:
uninstall-nobase_dist_pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
@list='$(nobase_dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
@ -970,7 +975,7 @@ info: info-recursive
info-am:
install-data-am: install-dist_confDATA install-dist_docDATA \
install-dist_pkgdataDATA install-man
install-man install-nobase_dist_pkgdataDATA
install-dvi: install-dvi-recursive
@ -1017,8 +1022,8 @@ ps: ps-recursive
ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-dist_confDATA \
uninstall-dist_docDATA uninstall-dist_pkgdataDATA \
uninstall-man
uninstall-dist_docDATA uninstall-man \
uninstall-nobase_dist_pkgdataDATA
uninstall-man: uninstall-man1
@ -1033,17 +1038,17 @@ uninstall-man: uninstall-man1
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-binSCRIPTS install-data install-data-am \
install-dist_confDATA install-dist_docDATA \
install-dist_pkgdataDATA install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
tags-am uninstall uninstall-am uninstall-binSCRIPTS \
uninstall-dist_confDATA uninstall-dist_docDATA \
uninstall-dist_pkgdataDATA uninstall-man uninstall-man1
install-dist_confDATA install-dist_docDATA install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-man1 install-nobase_dist_pkgdataDATA install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-binSCRIPTS uninstall-dist_confDATA \
uninstall-dist_docDATA uninstall-man uninstall-man1 \
uninstall-nobase_dist_pkgdataDATA
.PRECIOUS: Makefile

View File

@ -8,8 +8,9 @@
(defun load-icon (filename)
(let ((path (if (not (re:scan "(?i)png$" filename))
(res:get-config-file (strcat +icon-dir+ filename ".png"))
(res:get-config-file (strcat +icon-dir+ filename)))))
(res:get-config-file (fs:cat-parent-dir +icon-dir+
(strcat filename ".png")))
(res:get-config-file (fs:cat-parent-dir +icon-dir+ filename)))))
(with-open-file (stream path :element-type '(unsigned-byte 8))
(let ((data (gui-utils:read-into-array stream (file-length stream))))
(gui:make-image data)))))

View File

@ -17,6 +17,12 @@
(in-package :modules)
(a:define-constant +shared-modules-dir+ "data/modules" :test #'string=)
(a:define-constant +module-sys-data-dir+ (fs:cat-parent-dir +sys-data-dir+
+shared-modules-dir+)
:test #'string=)
(defun load-sys-module (path &key (not-found-signal-error t))
(a:when-let ((file (if not-found-signal-error
(get-sys-config-file path)
@ -29,7 +35,7 @@
(let ((config-file (conditions:with-default-on-error (nil)
(get-config-file path)))
(data-file (conditions:with-default-on-error (nil)
(get-data-file path))))
(get-data-file (fs:cat-parent-dir +shared-modules-dir+ path)))))
(cond
(config-file
(%load config-file))
@ -39,7 +45,7 @@
(let ((error-message (format nil
(_ "Unrecoverable error: file ~a not found in any of the directory ~a ~a ~a ~a")
path
+sys-data-dir+
+module-sys-data-dir+
+sys-conf-dir+
(home-datadir)
(home-confdir))))