Merge pull request #281217 from wentasah/amc-fix-lib

auto-multiple-choice: use absolute paths instead of "portable" strategy
This commit is contained in:
Ryan Burns
2024-06-21 02:52:37 -07:00
committed by GitHub
@@ -37,31 +37,28 @@ stdenv.mkDerivation (finalAttrs: rec {
makeFlags = [
"PERLPATH=${perl}/bin/perl"
# We *need* to pass DESTDIR, as the Makefile ignores PREFIX.
"DESTDIR=$(out)"
# Relative paths.
"BINDIR=/bin"
"PERLDIR=/share/perl5"
"MODSDIR=/lib" # At runtime, AMC will test for that dir before
# defaulting to the "portable" strategy we use, so this test
# *must* fail. *But* this variable cannot be set to anything but
# "/lib" , because that name is hardcoded in the main executable
# and this variable controls both both the path AMC will check at
# runtime, AND the path where the actual modules will be stored at
# build-time. This has been reported upstream as
# https://project.auto-multiple-choice.net/issues/872
"TEXDIR=/tex/latex/" # what texlive.combine expects
"TEXDOCDIR=/share/doc/texmf/" # TODO where to put this?
"MAN1DIR=/share/man/man1"
"DESKTOPDIR=/share/applications"
"METAINFODIR=/share/metainfo"
"ICONSDIR=/share/auto-multiple-choice/icons"
"APPICONDIR=/share/icons/hicolor"
"LOCALEDIR=/share/locale"
"MODELSDIR=/share/auto-multiple-choice/models"
"DOCDIR=/share/doc/auto-multiple-choice"
"SHARED_MIMEINFO_DIR=/share/mime/packages"
"LANG_GTKSOURCEVIEW_DIR=/share/gtksourceview-4/language-specs"
# We *need* to set DESTDIR as empty and use absolute paths below,
# because the Makefile ignores PREFIX and MODSDIR is required to
# be an absolute path to not trigger "portable distribution" check
# in auto-multiple-choice.in.
"DESTDIR="
# Set variables from Makefile.conf to absolute paths
"BINDIR=${placeholder "out"}/bin"
"PERLDIR=${placeholder "out"}/share/perl5"
"MODSDIR=${placeholder "out"}/lib"
"TEXDIR=${placeholder "out"}/tex/latex/" # what texlive.combine expects
"TEXDOCDIR=${placeholder "out"}/share/doc/texmf/" # TODO where to put this?
"MAN1DIR=${placeholder "out"}/share/man/man1"
"DESKTOPDIR=${placeholder "out"}/share/applications"
"METAINFODIR=${placeholder "out"}/share/metainfo"
"ICONSDIR=${placeholder "out"}/share/auto-multiple-choice/icons"
"CSSDIR=${placeholder "out"}/share/auto-multiple-choice/gtk"
"APPICONDIR=${placeholder "out"}/share/icons/hicolor"
"LOCALEDIR=${placeholder "out"}/share/locale"
"MODELSDIR=${placeholder "out"}/share/auto-multiple-choice/models"
"DOCDIR=${placeholder "out"}/share/doc/auto-multiple-choice"
"SHARED_MIMEINFO_DIR=${placeholder "out"}/share/mime/packages"
"LANG_GTKSOURCEVIEW_DIR=${placeholder "out"}/share/gtksourceview-4/language-specs"
# Pretend to be redhat so `install` doesn't try to chown/chgrp.
"SYSTEM_TYPE=rpm"
"GCC=${stdenv.cc.targetPrefix}cc"
@@ -93,6 +90,7 @@ stdenv.mkDerivation (finalAttrs: rec {
XMLWriter
]}:"$out/share/perl5 \
--prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
--prefix PATH : "$out/bin" \
--set TEXINPUTS ":.:$out/tex/latex"
'';