acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / qb / qbe / package.nix
blobf37de57b535e5a07b23ee352567afd19d9c6442d
1 { lib
2 , stdenv
3 , fetchzip
4 , callPackage
5 }:
6 stdenv.mkDerivation (finalAttrs: {
7   pname = "qbe";
8   version = "1.2";
10   src = fetchzip {
11     url = "https://c9x.me/compile/release/qbe-${finalAttrs.version}.tar.xz";
12     hash = "sha256-UgtJnZF/YtD54OBy9HzGRAEHx5tC9Wo2YcUidGwrv+s=";
13   };
15   makeFlags = [
16     "PREFIX=$(out)"
17     "CC=${stdenv.cc.targetPrefix}cc"
18   ];
20   doCheck = true;
22   enableParallelBuilding = true;
24   patches = [
25     # Use "${TMPDIR:-/tmp}" instead of the latter directly
26     # see <https://lists.sr.ht/~mpu/qbe/patches/49613>
27     ./001-dont-hardcode-tmp.patch
28   ];
30   passthru = {
31     tests.can-run-hello-world = callPackage ./test-can-run-hello-world.nix { };
32   };
34   meta = with lib; {
35     homepage = "https://c9x.me/compile/";
36     description = "Small compiler backend written in C";
37     maintainers = with maintainers; [ fgaz ];
38     license = licenses.mit;
39     platforms = platforms.all;
40     mainProgram = "qbe";
41   };