about summary refs log tree commit diff
path: root/pkgs/by-name/co/construct/package.nix
blob: 89833c8176088dbadc4f37a6219090fb0757a490 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ stdenv
, lib
, fetchFromGitHub
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "construct";
  version = "0.1.0";

  src = fetchFromGitHub {
    owner = "Thomas-de-Bock";
    repo = "construct";
    rev = finalAttrs.version;
    hash = "sha256-ENso0y7yEaXzGXzZOnlZ1L7+j/qayJL+f55/NYLz2ew=";
  };

  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    substituteInPlace Makefile \
        --replace g++ c++
  '';

  makeTarget = "main";

  installPhase = ''
    runHook preInstall
    install -Dm755 bin/construct -t $out/bin
    runHook postInstall
  '';

  meta = with lib; {
    description = "Construct is an abstraction over x86 NASM Assembly";
    longDescription = "Construct adds features such as while loops, if statements, scoped macros and function-call syntax to NASM Assembly.";
    homepage = "https://github.com/Thomas-de-Bock/construct";
    maintainers = with maintainers; [ rucadi ];
    platforms = platforms.all;
    license = licenses.mit;
    mainProgram = "construct";
  };
})