2021-11-02 00:12:44 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchzip
|
2021-11-03 17:33:56 +01:00
|
|
|
, buildDocs ? false, tex
|
2021-11-02 00:12:44 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "asl";
|
|
|
|
version = "142-bld211";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
url = "http://john.ccac.rwth-aachen.de:8000/ftp/as/source/c_version/asl-current-${version}.tar.bz2";
|
|
|
|
hash = "sha256-Sbm16JX7kC/7Ws7YgNBUXNqOCl6u+RXgfNjTODhCzSM=";
|
|
|
|
};
|
|
|
|
|
2021-11-03 17:33:56 +01:00
|
|
|
nativeBuildInputs = lib.optionals buildDocs [ tex ];
|
2021-11-02 00:12:44 +01:00
|
|
|
|
|
|
|
postPatch = lib.optionalString (!buildDocs) ''
|
|
|
|
substituteInPlace Makefile --replace "all: binaries docs" "all: binaries"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
bindir="${placeholder "out"}/bin" \
|
|
|
|
docdir="${placeholder "out"}/doc/asl" \
|
|
|
|
incdir="${placeholder "out"}/include/asl" \
|
|
|
|
libdir="${placeholder "out"}/lib/asl" \
|
|
|
|
mandir="${placeholder "out"}/share/man" \
|
|
|
|
substituteAll ${./Makefile-nixos.def} Makefile.def
|
|
|
|
mkdir -p .objdir
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "http://john.ccac.rwth-aachen.de:8000/as/index.html";
|
|
|
|
description = "Portable macro cross assembler";
|
|
|
|
longDescription = ''
|
|
|
|
AS is a portable macro cross assembler for a variety of microprocessors
|
|
|
|
and -controllers. Though it is mainly targeted at embedded processors and
|
|
|
|
single-board computers, you also find CPU families in the target list that
|
|
|
|
are used in workstations and PCs.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
# TODO: multiple outputs
|
|
|
|
# TODO: cross-compilation support
|
|
|
|
# TODO: customize TeX input
|
|
|
|
# TODO: report upstream about `mkdir -p .objdir/`
|
|
|
|
# TODO: suggest upstream about building docs as an option
|