nixpkgs/pkgs/development/compilers/asl/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.8 KiB
Nix
Raw Normal View History

2021-11-01 23:12:44 +00:00
{ lib
, stdenv
, fetchzip
2022-11-14 15:45:27 +00:00
, tex
, buildDocs ? false
2021-11-01 23:12:44 +00:00
}:
2022-11-14 15:45:27 +00:00
stdenv.mkDerivation (finalAttrs: {
2021-11-01 23:12:44 +00:00
pname = "asl";
2022-11-14 15:45:27 +00:00
version = "142-bld232";
2021-11-01 23:12:44 +00:00
2022-11-14 15:45:27 +00:00
src = let inherit (finalAttrs) pname version; in fetchzip {
2021-11-01 23:12:44 +00:00
name = "${pname}-${version}";
url = "http://john.ccac.rwth-aachen.de:8000/ftp/as/source/c_version/asl-current-${version}.tar.bz2";
2022-11-14 15:45:27 +00:00
hash = "sha256-Q50GzXBxFMhbt5s9OgHPNH4bdqz2hhEmTnMmKowVn2E=";
2021-11-01 23:12:44 +00:00
};
2022-11-14 15:45:27 +00:00
outputs = [ "out" "doc" "man" ];
2021-11-03 16:33:56 +00:00
nativeBuildInputs = lib.optionals buildDocs [ tex ];
2021-11-01 23:12:44 +00:00
postPatch = lib.optionalString (!buildDocs) ''
substituteInPlace Makefile --replace "all: binaries docs" "all: binaries"
2022-11-01 02:38:27 +00:00
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
substituteInPlace sysdefs.h --replace "x86_64" "aarch64"
2021-11-01 23:12:44 +00:00
'';
dontConfigure = true;
preBuild = ''
bindir="${placeholder "out"}/bin" \
2022-11-14 15:45:27 +00:00
docdir="${placeholder "doc"}/share/doc/asl" \
2021-11-01 23:12:44 +00:00
incdir="${placeholder "out"}/include/asl" \
libdir="${placeholder "out"}/lib/asl" \
2022-11-14 15:45:27 +00:00
mandir="${placeholder "man"}/share/man" \
2021-11-01 23:12:44 +00:00
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;
};
2022-11-14 15:45:27 +00:00
})
2021-11-01 23:12:44 +00:00
# TODO: cross-compilation support
# TODO: customize TeX input
# TODO: report upstream about `mkdir -p .objdir/`
# TODO: suggest upstream about building docs as an option