summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2021-11-02 18:57:27 -0300
committerGitHub <noreply@github.com>2021-11-02 18:57:27 -0300
commit53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5 (patch)
tree8969573ec245aa4e611767b851e3c501bff504be
parent5283247e3327abce1885071e281e615772bceae7 (diff)
parent2b6ba95a192dca9c1df0e8ccceffdfd085aced05 (diff)
downloadnixpkgs-53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5.tar
nixpkgs-53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5.tar.gz
nixpkgs-53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5.tar.bz2
nixpkgs-53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5.tar.lz
nixpkgs-53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5.tar.xz
nixpkgs-53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5.tar.zst
nixpkgs-53cd7a5b81636af4dc5eb068ea1d2bb822ebf4d5.zip
Merge pull request #144167 from AndersonTorres/new-asm
asl: init at 142-bld211
-rw-r--r--pkgs/development/compilers/asl/Makefile-nixos.def31
-rw-r--r--pkgs/development/compilers/asl/default.nix57
-rw-r--r--pkgs/top-level/all-packages.nix4
3 files changed, 92 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 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 ca55821a01e..a6bf5a42bc2 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -11288,6 +11288,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 { };