Unverified Commit f211cbd9 authored by Emily Trau's avatar Emily Trau Committed by GitHub
Browse files

rar2hashcat: init at 1.0 (#372818)

parents 514ec34b b49f2301
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
diff --git a/Makefile b/Makefile
index eca86a9..f11931b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 # Common variables
-CFLAGS = -g -static -O2 -D_GNU_SOURCE -DARCH_LITTLE_ENDIAN=1
+CFLAGS = -g -O2 -D_GNU_SOURCE -DARCH_LITTLE_ENDIAN=1
 TARGET = rar2hashcat
 
 # Variables for Linux target
diff --git a/base64_convert.c b/base64_convert.c
index 0d2635d..b101e3c 100644
--- a/base64_convert.c
+++ b/base64_convert.c
@@ -163,7 +163,7 @@ static char *strnzcpy(char *dst, const char *src, int size)
 	return dst;
 }
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__APPLE__)
 static char *strupr(char *s)
 {
 	unsigned char *ptr = (unsigned char *)s;
+46 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "rar2hashcat";
  version = "1.0";

  src = fetchFromGitHub {
    owner = "hashstation";
    repo = "rar2hashcat";
    rev = finalAttrs.version;
    hash = "sha256-GVh4Gyjn84xAwO7wKXYe2DPnpb8gnxGIMH5Szce+XpY=";
  };

  patches = [
    ./darwin-support.patch
  ];

  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration -Wno-error=int-conversion";

  makeFlags = [
    "CC_LINUX=${stdenv.cc.targetPrefix}cc"
    "rar2hashcat"
  ];

  installPhase = ''
    runHook preInstall

    install -D rar2hashcat $out/bin/rar2hashcat

    runHook postInstall
  '';

  meta = {
    changelog = "https://github.com/hashstation/rar2hashcat/releases/tag/${finalAttrs.version}";
    description = "Processes input RAR files into a format suitable for use with hashcat";
    homepage = "https://github.com/hashstation/rar2hashcat";
    license = lib.licenses.mit;
    mainProgram = "rar2hashcat";
    maintainers = with lib.maintainers; [ emilytrau ];
    platforms = lib.platforms.unix;
  };
})