2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, perlPackages
|
|
|
|
, makeWrapper
|
|
|
|
, wrapGAppsHook
|
|
|
|
, cairo
|
|
|
|
, dblatex
|
|
|
|
, gnumake
|
|
|
|
, gobject-introspection
|
|
|
|
, graphicsmagick
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
, gtk3
|
2022-11-04 12:27:35 +00:00
|
|
|
, hicolor-icon-theme
|
2021-12-06 16:07:01 +00:00
|
|
|
, libnotify
|
|
|
|
, librsvg
|
|
|
|
, libxslt
|
|
|
|
, netpbm
|
|
|
|
, opencv
|
|
|
|
, pango
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, poppler
|
|
|
|
, auto-multiple-choice
|
|
|
|
}:
|
2023-04-12 12:48:02 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "auto-multiple-choice";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "1.5.2";
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.auto-multiple-choice.net/${pname}_${version}_precomp.tar.gz";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-AjonJOooSe53Fww3QU6Dft95ojNqWrTuPul3nkIbctM=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# There's only the Makefile
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PERLPATH=${perl}/bin/perl"
|
|
|
|
# We *need* to pass DESTDIR, as the Makefile ignores PREFIX.
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
# Relative paths.
|
|
|
|
"BINDIR=/bin"
|
|
|
|
"PERLDIR=/share/perl5"
|
2023-02-16 17:41:37 +00:00
|
|
|
"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
|
2021-12-06 16:07:01 +00:00
|
|
|
"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"
|
|
|
|
# Pretend to be redhat so `install` doesn't try to chown/chgrp.
|
|
|
|
"SYSTEM_TYPE=rpm"
|
2022-11-04 12:27:35 +00:00
|
|
|
"GCC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"GCC_PP=${stdenv.cc.targetPrefix}c++"
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/auto-multiple-choice \
|
|
|
|
''${makeWrapperArgs[@]} \
|
2022-01-27 00:19:43 +00:00
|
|
|
--prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [
|
2021-12-06 16:07:01 +00:00
|
|
|
ArchiveZip
|
|
|
|
DBDSQLite
|
|
|
|
Cairo
|
|
|
|
CairoGObject
|
|
|
|
DBI
|
|
|
|
Glib
|
|
|
|
GlibObjectIntrospection
|
|
|
|
Gtk3
|
|
|
|
LocaleGettext
|
2022-01-27 00:19:43 +00:00
|
|
|
OpenOfficeOODoc
|
2021-12-06 16:07:01 +00:00
|
|
|
PerlMagick
|
|
|
|
TextCSV
|
|
|
|
XMLParser
|
|
|
|
XMLSimple
|
|
|
|
XMLWriter
|
|
|
|
]}:"$out/share/perl5 \
|
2022-11-04 12:27:35 +00:00
|
|
|
--prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
|
2022-01-19 23:45:15 +00:00
|
|
|
--set TEXINPUTS ":.:$out/tex/latex"
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
|
|
|
cairo.dev
|
|
|
|
dblatex
|
|
|
|
gnumake
|
|
|
|
gobject-introspection
|
|
|
|
graphicsmagick
|
|
|
|
gsettings-desktop-schemas
|
|
|
|
gtk3
|
2022-11-04 12:27:35 +00:00
|
|
|
hicolor-icon-theme
|
2021-12-06 16:07:01 +00:00
|
|
|
libnotify
|
|
|
|
librsvg
|
|
|
|
libxslt
|
|
|
|
netpbm
|
|
|
|
opencv
|
|
|
|
pango
|
|
|
|
poppler
|
|
|
|
] ++ (with perlPackages; [
|
|
|
|
perl
|
|
|
|
ArchiveZip
|
|
|
|
Cairo
|
|
|
|
CairoGObject
|
|
|
|
DBDSQLite
|
|
|
|
DBI
|
|
|
|
Glib
|
|
|
|
GlibObjectIntrospection
|
|
|
|
Gtk3
|
|
|
|
LocaleGettext
|
|
|
|
PerlMagick
|
|
|
|
TextCSV
|
|
|
|
XMLParser
|
|
|
|
XMLSimple
|
|
|
|
XMLWriter
|
|
|
|
]);
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
passthru = {
|
|
|
|
tlType = "run";
|
|
|
|
pkgs = [ finalAttrs.finalPackage ];
|
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Create and manage multiple choice questionnaires with automated marking.";
|
|
|
|
longDescription = ''
|
|
|
|
Create, manage and mark multiple-choice questionnaires.
|
|
|
|
auto-multiple-choice features automated or manual formatting with
|
|
|
|
LaTeX, shuffling of questions and answers and automated marking using
|
|
|
|
Optical Mark Recognition.
|
|
|
|
|
|
|
|
Questionnaires can be created using either a very simple text syntax,
|
|
|
|
AMC-TXT, or LaTeX. In the latter case, your TeXLive installation must
|
|
|
|
be combined with this package. This can be done in configuration.nix
|
|
|
|
as follows:
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
…
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
auto-multiple-choice
|
|
|
|
(texlive.combine {
|
|
|
|
inherit (pkgs.texlive) scheme-full;
|
2023-04-12 12:48:02 +00:00
|
|
|
inherit auto-multiple-choice;
|
2021-12-06 16:07:01 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
</screen>
|
|
|
|
|
|
|
|
For usage instructions, see documentation at the project's homepage.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.auto-multiple-choice.net/";
|
|
|
|
changelog = "https://gitlab.com/jojo_boulix/auto-multiple-choice/-/blob/master/ChangeLog";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = [ maintainers.thblt ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2023-04-12 12:48:02 +00:00
|
|
|
})
|