diff options
author | Anderson Torres <torres.anderson.85@protonmail.com> | 2021-11-02 18:57:27 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-02 18:57:27 -0300 |
commit | 53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5 (patch) | |
tree | 8969573ec245aa4e611767b851e3c501bff504be /pkgs/development/compilers | |
parent | 5283247e3327abce1885071e281e615772bceae7 (diff) | |
parent | 2b6ba95a192dca9c1df0e8ccceffdfd085aced05 (diff) |
Merge pull request #144167 from AndersonTorres/new-asm
asl: init at 142-bld211
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/asl/Makefile-nixos.def | 31 | ||||
-rw-r--r-- | pkgs/development/compilers/asl/default.nix | 57 |
2 files changed, 88 insertions, 0 deletions
diff --git a/pkgs/development/compilers/asl/Makefile-nixos.def b/pkgs/development/compilers/asl/Makefile-nixos.def new file mode 100644 index 0000000000000..0f41510733c18 --- /dev/null +++ b/pkgs/development/compilers/asl/Makefile-nixos.def @@ -0,0 +1,31 @@ +# ------------------------------------------------------------------------- +# choose your compiler (must be ANSI-compliant!) and linker command, plus +# any additionally needed flags + +OBJDIR = .objdir/ +CC = cc +CFLAGS = -g -fomit-frame-pointer -Wall +HOST_OBJEXTENSION = .o +LD = $(CC) +LDFLAGS = +HOST_EXEXTENSION = + +# no cross build + +TARG_OBJDIR = $(OBJDIR) +TARG_CC = $(CC) +TARG_CFLAGS = $(CFLAGS) +TARG_OBJEXTENSION = $(HOST_OBJEXTENSION) +TARG_LD = $(LD) +TARG_LDFLAGS = $(LDFLAGS) +TARG_EXEXTENSION = $(HOST_EXEXTENSION) + +# ------------------------------------------------------------------------- +# directories where binaries, includes, and manpages should go during +# installation + +BINDIR = @bindir@ +INCDIR = @incdir@ +MANDIR = @mandir@ +LIBDIR = @libdir@ +DOCDIR = @docdir@ diff --git a/pkgs/development/compilers/asl/default.nix b/pkgs/development/compilers/asl/default.nix new file mode 100644 index 0000000000000..981dde1e7a733 --- /dev/null +++ b/pkgs/development/compilers/asl/default.nix @@ -0,0 +1,57 @@ +{ lib +, stdenv +, fetchzip +, buildDocs? false, tex +}: + +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="; + }; + + nativeBuildInputs = lib.optional buildDocs [ tex ]; + + 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 + ''; + + hardenedDisable = [ "all" ]; + + # buildTargets = [ "binaries" "docs" ]; + + 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 |