From 023eed8d6fa886fec58635960e854927f706acba Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 29 Jan 2022 15:46:14 -0300 Subject: [PATCH] uasm: init at 2.53 --- pkgs/development/compilers/uasm/default.nix | 50 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/compilers/uasm/default.nix diff --git a/pkgs/development/compilers/uasm/default.nix b/pkgs/development/compilers/uasm/default.nix new file mode 100644 index 000000000000..f440208e947b --- /dev/null +++ b/pkgs/development/compilers/uasm/default.nix @@ -0,0 +1,50 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch }: + +stdenv.mkDerivation rec { + pname = "uasm"; + version = "2.53"; + + src = fetchFromGitHub { + owner = "Terraspace"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Aohwrcb/KTKUFFpfmqVDPNjJh1dMYSNnBJ2eFaP20pM="; + }; + + # https://github.com/Terraspace/UASM/pull/154 + patches = [ + # fix `invalid operands to binary - (have 'char *' and 'uint_8 *' {aka 'unsigned char *'})` + (fetchpatch { + name = "fix_pointers_compare.patch"; + url = "https://github.com/clouds56/UASM/commit/9cd3a400990e230571e06d4c758bd3bd35f90ab6.patch"; + sha256 = "sha256-8mY36dn+g2QNJ1JbWt/y4p0Ha9RSABnOE3vlWANuhsA="; + }) + # fix `dbgcv.c:*:*: fatal error: direct.h: No such file or directory` + (fetchpatch { + name = "fix_build_dbgcv_c_on_unix.patch"; + url = "https://github.com/clouds56/UASM/commit/806d54cf778246c96dcbe61a4649bf0aebcb0eba.patch"; + sha256 = "sha256-uc1LaizdYEh1Ry55Cq+6wrCa1OeBPFo74H5iBpmteAE="; + }) + ]; + + enableParallelBuilding = true; + + makefile = "gccLinux64.mak"; + + installPhase = '' + runHook preInstall + + install -Dt "$out/bin" -m0755 GccUnixR/uasm + install -Dt "$out/share/doc/${pname}" -m0644 {Readme,History}.txt Doc/* + + runHook postInstall + ''; + + meta = with lib; { + homepage = "http://www.terraspace.co.uk/uasm.html"; + description = "A free MASM-compatible assembler based on JWasm"; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ thiagokokada ]; + license = licenses.watcom; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 80896900dd13..14f07a84fe0e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13283,6 +13283,8 @@ with pkgs; bupc = callPackage ../development/compilers/bupc { }; + uasm = callPackage ../development/compilers/uasm { }; + urn = callPackage ../development/compilers/urn { }; urweb = callPackage ../development/compilers/urweb {