From 2b6ba95a192dca9c1df0e8ccceffdfd085aced05 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Mon, 1 Nov 2021 20:12:44 -0300 Subject: asl: init at 142-bld211 --- pkgs/development/compilers/asl/Makefile-nixos.def | 31 ++++++++++++ pkgs/development/compilers/asl/default.nix | 57 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 3 files changed, 92 insertions(+) create mode 100644 pkgs/development/compilers/asl/Makefile-nixos.def create mode 100644 pkgs/development/compilers/asl/default.nix diff --git a/pkgs/development/compilers/asl/Makefile-nixos.def b/pkgs/development/compilers/asl/Makefile-nixos.def new file mode 100644 index 00000000000..0f41510733c --- /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 00000000000..981dde1e7a7 --- /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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index be13115ad15..98e7a880644 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11278,6 +11278,10 @@ with pkgs; as31 = callPackage ../development/compilers/as31 { }; + asl = callPackage ../development/compilers/asl { + tex = texlive.combined.scheme-medium; + }; + asn1c = callPackage ../development/compilers/asn1c { }; aspectj = callPackage ../development/compilers/aspectj { }; -- cgit 1.4.1