git.iko.soy/typeable/nixpkgs
on master help sign in
as31: init at 2.3.1
commitae19d5c68b9ec6a886826d8f9389c7f18b582546 authorAndersonTorres <torres.anderson.85@protonmail.com> dateSun 5 Sep 2021, 22:24 (5 years ago) parentfc7e185
3 files changed+69
pkgs/development/compilers/as31/0000-getline-break.patch+24 pkgs/development/compilers/as31/default.nix+43 pkgs/top-level/all-packages.nix+2
pkgs/development/compilers/as31/0000-getline-break.patchnew file+24
@@ -0,0 +1,24 @@
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++;
pkgs/development/compilers/as31/default.nixnew file+43
@@ -0,0 +1,43 @@
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+}
pkgs/top-level/all-packages.nix+2
@@ -10822,6 +10822,8 @@ with pkgs;
1082210822
1082310823 asciigraph = callPackage ../tools/text/asciigraph { };
1082410824
10825+ as31 = callPackage ../development/compilers/as31 { };
10826+
1082510827 asn1c = callPackage ../development/compilers/asn1c { };
1082610828
1082710829 aspectj = callPackage ../development/compilers/aspectj { };