Merge pull request #157305 from thiagokokada/optimize-7zz
This commit is contained in:
commit
fac98345ad
50
pkgs/development/compilers/uasm/default.nix
Normal file
50
pkgs/development/compilers/uasm/default.nix
Normal file
@ -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;
|
||||
};
|
||||
}
|
@ -1,5 +1,14 @@
|
||||
{ stdenv, lib, fetchurl, p7zip }:
|
||||
{ stdenv, lib, fetchurl, p7zip, uasm, useUasm ? stdenv.isx86_64 }:
|
||||
|
||||
let
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
platformSuffix =
|
||||
if useUasm then
|
||||
{
|
||||
x86_64-linux = "_x64";
|
||||
}.${system} or (throw "`useUasm` is not supported for system ${system}")
|
||||
else "";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "7zz";
|
||||
version = "21.07";
|
||||
@ -11,19 +20,18 @@ stdenv.mkDerivation rec {
|
||||
|
||||
sourceRoot = "CPP/7zip/Bundles/Alone2";
|
||||
|
||||
# we need https://github.com/nidud/asmc/tree/master/source/asmc/linux in order
|
||||
# to build with the optimized assembler but that doesn't support building with
|
||||
# GCC: https://github.com/nidud/asmc/issues/8
|
||||
makefile = "../../cmpl_gcc.mak"; # "../../cmpl_gcc_x64.mak";
|
||||
makeFlags = lib.optionals useUasm [ "MY_ASM=uasm" ];
|
||||
|
||||
nativeBuildInputs = [ p7zip ];
|
||||
makefile = "../../cmpl_gcc${platformSuffix}.mak";
|
||||
|
||||
nativeBuildInputs = [ p7zip ] ++ lib.optionals useUasm [ uasm ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm555 -t $out/bin b/g/7zz
|
||||
install -Dm555 -t $out/bin b/g${platformSuffix}/7zz
|
||||
install -Dm444 -t $out/share/doc/${pname} ../../../../DOC/*.txt
|
||||
|
||||
runHook postInstall
|
||||
@ -37,7 +45,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
meta = with lib; {
|
||||
description = "Command line archiver utility";
|
||||
homepage = "https://7zip.org";
|
||||
homepage = "https://7-zip.org";
|
||||
license = licenses.lgpl21Plus;
|
||||
maintainers = with maintainers; [ anna328p peterhoeg ];
|
||||
platforms = platforms.linux;
|
||||
|
@ -13408,6 +13408,8 @@ with pkgs;
|
||||
|
||||
bupc = callPackage ../development/compilers/bupc { };
|
||||
|
||||
uasm = callPackage ../development/compilers/uasm { };
|
||||
|
||||
urn = callPackage ../development/compilers/urn { };
|
||||
|
||||
urweb = callPackage ../development/compilers/urweb {
|
||||
|
Loading…
Reference in New Issue
Block a user