mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-04 03:53:56 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
43 lines
942 B
Nix
43 lines
942 B
Nix
{ lib
|
|
, stdenv
|
|
, fetchzip
|
|
, callPackage
|
|
}:
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "qbe";
|
|
version = "1.2";
|
|
|
|
src = fetchzip {
|
|
url = "https://c9x.me/compile/release/qbe-${finalAttrs.version}.tar.xz";
|
|
hash = "sha256-UgtJnZF/YtD54OBy9HzGRAEHx5tC9Wo2YcUidGwrv+s=";
|
|
};
|
|
|
|
makeFlags = [
|
|
"PREFIX=$(out)"
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
patches = [
|
|
# Use "${TMPDIR:-/tmp}" instead of the latter directly
|
|
# see <https://lists.sr.ht/~mpu/qbe/patches/49613>
|
|
./001-dont-hardcode-tmp.patch
|
|
];
|
|
|
|
passthru = {
|
|
tests.can-run-hello-world = callPackage ./test-can-run-hello-world.nix { };
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://c9x.me/compile/";
|
|
description = "Small compiler backend written in C";
|
|
maintainers = with maintainers; [ fgaz ];
|
|
license = licenses.mit;
|
|
platforms = platforms.all;
|
|
mainProgram = "qbe";
|
|
};
|
|
})
|