Merge pull request #137142 from AndersonTorres/new-asm

Assemblers for 8-bit chips

authored by Anderson Torres and committed by GitHub 45d44fb1 336f829f

+165
+24
pkgs/development/compilers/as31/0000-getline-break.patch
···
··· 1 + diff --git old/as31/run.c new/as31/run.c 2 + index 28c5317..9e5263b 100644 3 + --- old/as31/run.c 4 + +++ new/as31/run.c 5 + @@ -113,7 +113,8 @@ int run_as31(const char *infile, int lst, int use_stdout, 6 + } 7 + 8 + while (!feof(finPre)) { 9 + - getline(&lineBuffer,&sizeBuf,finPre); 10 + + if (getline(&lineBuffer,&sizeBuf,finPre) == -1) 11 + + break; 12 + if ((includePtr=strstr(lineBuffer,INC_CMD))) { 13 + includePtr=includePtr+strlen(INC_CMD); 14 + while ((*includePtr==' ')|| //move includePtr to filename 15 + @@ -138,7 +139,8 @@ int run_as31(const char *infile, int lst, int use_stdout, 16 + mesg_f("Cannot open include file: %s\n",includePtr); 17 + } else { 18 + while (!feof(includeFile)) { 19 + - getline(&incLineBuffer,&incSizeBuf,includeFile); 20 + + if (getline(&incLineBuffer,&incSizeBuf,includeFile) == -1) 21 + + break; 22 + fprintf(fin,"%s",incLineBuffer); 23 + if (strlen(incLineBuffer)) { 24 + incLineCount++;
+43
pkgs/development/compilers/as31/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , bison 5 + }: 6 + 7 + stdenv.mkDerivation rec { 8 + pname = "as31"; 9 + version = "2.3.1"; 10 + 11 + src = fetchurl { 12 + url = "http://wiki.erazor-zone.de/_media/wiki:projects:linux:as31:${pname}-${version}.tar.gz"; 13 + name = "${pname}-${version}.tar.gz"; 14 + hash = "sha256-zSEyWHFon5nyq717Mpmdv1XZ5Hz0e8ZABqsP8M83c1U="; 15 + }; 16 + 17 + patches = [ 18 + # Check return value of getline in run.c 19 + ./0000-getline-break.patch 20 + ]; 21 + 22 + postPatch = '' 23 + # parser.c is generated from parser.y; it is better to generate it via bison 24 + # instead of using the prebuilt one, especially in x86_64 25 + rm -f as31/parser.c 26 + ''; 27 + 28 + preConfigure = '' 29 + chmod +x configure 30 + ''; 31 + 32 + nativeBuildInputs = [ 33 + bison 34 + ]; 35 + 36 + meta = with lib; { 37 + homepage = "http://wiki.erazor-zone.de/wiki:projects:linux:as31"; 38 + description = "An 8031/8051 assembler"; 39 + license = licenses.gpl2Plus; 40 + maintainers = with maintainers; [ AndersonTorres ]; 41 + platforms = platforms.unix; 42 + }; 43 + }
+16
pkgs/development/compilers/atasm/0000-file-not-found.diff
···
··· 1 + diff -Naur atasm109-old/src/Makefile atasm109-new/src/Makefile 2 + --- atasm109-old/src/Makefile 2021-09-08 09:53:25.581598063 -0300 3 + +++ atasm109-new/src/Makefile 2021-09-08 09:55:20.366131338 -0300 4 + @@ -55,9 +55,9 @@ 5 + chown root.root $(DESTDIR)/atasm || true 6 + chmod 711 $(DESTDIR)/atasm 7 + mkdir $(DOCDIR) >/dev/null 2>&1 || echo $(DOCDIR) already exists 8 + - cp ../atasm.txt $(DOCDIR) 9 + - chown root.root $(DOCDIR)/atasm.txt || true 10 + - chmod 644 $(DOCDIR)/atasm.txt 11 + + # cp ../atasm.txt $(DOCDIR) 12 + + # chown root.root $(DOCDIR)/atasm.txt || true 13 + + # chmod 644 $(DOCDIR)/atasm.txt 14 + sed -e 's,%%DOCDIR%%,$(DOCDIR),g' < atasm.1.in > atasm.1 15 + cp atasm.1 $(MANDIR) 16 + chown root.root $(MANDIR)/atasm.1 || true
+14
pkgs/development/compilers/atasm/0001-select-flags.diff
···
··· 1 + diff -Naur atasm109-old/src/Makefile atasm109-new/src/Makefile 2 + --- atasm109-old/src/Makefile 2021-09-08 09:53:25.581598063 -0300 3 + +++ atasm109-new/src/Makefile 2021-09-08 09:55:20.366131338 -0300 4 + @@ -16,8 +16,8 @@ 5 + UNIX = -DUNIX 6 + 7 + # Compiler flags, if you are using egcs, pgcs, or gcc >2.8.1 use: 8 + -#CFLAGS = -g -Wall $(USEZ) $(DOS) $(UNIX) $(ARCH) 9 + -CFLAGS = -Wall $(USEZ) $(DOS) $(UNIX) -O3 -fomit-frame-pointer $(ARCH) 10 + +CFLAGS = -g -Wall $(USEZ) $(DOS) $(UNIX) $(ARCH) 11 + +#CFLAGS = -Wall $(USEZ) $(DOS) $(UNIX) -O3 -fomit-frame-pointer $(ARCH) 12 + 13 + L = $(ZLIB) 14 + CC = gcc
+64
pkgs/development/compilers/atasm/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , unzip 5 + , zlib 6 + }: 7 + 8 + stdenv.mkDerivation rec { 9 + pname = "atasm"; 10 + version = "1.09"; 11 + 12 + src = fetchurl { 13 + url = "https://atari.miribilist.com/${pname}/${pname}${builtins.replaceStrings ["."] [""] version}.zip"; 14 + hash = "sha256-26shhw2r30GZIPz6S1rf6dOLKRpgpLwrqCRZX3+8PvA="; 15 + }; 16 + 17 + patches = [ 18 + # make install fails because atasm.txt was moved; report to upstream 19 + ./0000-file-not-found.diff 20 + # select flags for compilation 21 + ./0001-select-flags.diff 22 + ]; 23 + 24 + dontConfigure = true; 25 + 26 + nativeBuildInputs = [ 27 + unzip 28 + ]; 29 + 30 + buildInputs = [ 31 + zlib 32 + ]; 33 + 34 + preBuild = '' 35 + makeFlagsArray+=( 36 + -C ./src 37 + CC=cc 38 + USEZ="-DZLIB_CAPABLE -I${zlib}/include" 39 + ZLIB="-L${zlib}/lib -lz" 40 + UNIX="-DUNIX" 41 + ) 42 + ''; 43 + 44 + preInstall = '' 45 + install -d $out/share/doc/${pname} $out/man/man1 46 + installFlagsArray+=( 47 + DESTDIR=$out 48 + DOCDIR=$out/share/doc/${pname} 49 + MANDIR=$out/man/man1 50 + ) 51 + ''; 52 + 53 + postInstall = '' 54 + mv docs/* $out/share/doc/${pname} 55 + ''; 56 + 57 + meta = with lib; { 58 + homepage = "https://atari.miribilist.com/atasm/"; 59 + description = "A commandline 6502 assembler compatible with Mac/65"; 60 + license = licenses.gpl2Plus; 61 + maintainers = with maintainers; [ AndersonTorres ]; 62 + platforms = with platforms; unix; 63 + }; 64 + }
+4
pkgs/top-level/all-packages.nix
··· 10843 10844 asciigraph = callPackage ../tools/text/asciigraph { }; 10845 10846 asn1c = callPackage ../development/compilers/asn1c { }; 10847 10848 aspectj = callPackage ../development/compilers/aspectj { }; 10849 10850 ats = callPackage ../development/compilers/ats { }; 10851 ats2 = callPackage ../development/compilers/ats2 { };
··· 10843 10844 asciigraph = callPackage ../tools/text/asciigraph { }; 10845 10846 + as31 = callPackage ../development/compilers/as31 { }; 10847 + 10848 asn1c = callPackage ../development/compilers/asn1c { }; 10849 10850 aspectj = callPackage ../development/compilers/aspectj { }; 10851 + 10852 + atasm = callPackage ../development/compilers/atasm { }; 10853 10854 ats = callPackage ../development/compilers/ats { }; 10855 ats2 = callPackage ../development/compilers/ats2 { };