nixpkgs/pkgs/development/compilers/harec/default.nix
Gustavo Coutinho de Souza fbbff51a1c
hare: unstable-2023-04-23 -> unstable-2023-10-22; harec: unstable-2023-04-23 -> unstable-2023-10-23
And also the following refactoring:

hare:

1. Replace `NIX_BUILD_TOP` usage with `mktemp`
2. Enable parallel building
3. Get rid of `config-template.mk`, by using `makeFlagsArray` instead
4. Move `wrapProgram` call to `postFixup`
5. Set the `LOCALVER` environment variable to `nix`, so that the `hare
   version` command outputs `dev-nix`[1]
6. Set `meta` attribute `mainProgram`
7. Make the package accessible through `all-packages.nix` instead of
   `aliases.nix`
8. Move package path from `pkgs/development/compilers/hare/hare` to
   `pkgs/development/compilers/hare`, since the scope is now made at
   `pkgs/top-level/hare-packages.nix`

harec:

1. Remove `hardeningDisable = [ "fortify" ];`, since both harec and hare
   compile normally with it enabled
2. Enable parallel building
3. Set `meta` attribute `mainProgram`
4. Make the package accessible through `all-packages.nix` instead of
   `aliases.nix`
5. Move package path from `pkgs/development/compilers/hare/harec` to
   `pkgs/development/compilers/harec`, since the scope is now made at
   `pkgs/top-level/hare-packages.nix`

harePackages:

1. Move hare packages scope from
   `pkgs/development/compilers/hare/default.nix` to
   `pkgs/top-level/hare-packages.nix`
2. Remove `hare` and `harec` from `aliases.nix`, moving them to
   `all-packages.nix`
3. Change the `callPackage` argument in `all-packages.nix` from
   `../development/compilers/hare` to `./hare-packages.nix`

[1]: 1048620a7a/item/scripts/version (L2)

Co-authored-by: starzation <nixpkgs@starzation.net>
2023-11-23 10:44:44 -03:00

64 lines
1.7 KiB
Nix

{ lib
, stdenv
, fetchFromSourcehut
, qbe
, fetchgit
}:
let
# harec needs the dbgfile and dbgloc features implemented up to this commit.
# This can be dropped once 1.2 is released, for a possible release date see:
# https://lists.sr.ht/~mpu/qbe/%3CZPkmHE9KLohoEohE%40cloudsdale.the-delta.net.eu.org%3E
qbe' = qbe.overrideAttrs (_old: {
version = "1.1-unstable-2023-08-18";
src = fetchgit {
url = "git://c9x.me/qbe.git";
rev = "36946a5142c40b733d25ea5ca469f7949ee03439";
hash = "sha256-bqxWFP3/aw7kRoD6ictbFcjzijktHvh4AgWAXBIODW8=";
};
});
in
stdenv.mkDerivation (finalAttrs: {
pname = "harec";
version = "unstable-2023-10-22";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "harec";
rev = "64dea196ce040fbf3417e1b4fb11331688672aca";
hash = "sha256-2Aeb+OZ/hYUyyxx6aTw+Oxiac+p+SClxtg0h68ZBSHc=";
};
nativeBuildInputs = [
qbe'
];
buildInputs = [
qbe'
];
strictDeps = true;
enableParallelBuilding = true;
doCheck = true;
passthru = {
# We create this attribute so that the `hare` package can access the
# overwritten `qbe`.
qbeUnstable = qbe';
};
meta = {
homepage = "https://harelang.org/";
description = "Bootstrapping Hare compiler written in C for POSIX systems";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ onemoresuza ];
mainProgram = "harec";
# The upstream developers do not like proprietary operating systems; see
# https://harelang.org/platforms/
# UPDATE: https://github.com/hshq/harelang provides a MacOS port
platforms = with lib.platforms;
lib.intersectLists (freebsd ++ linux) (aarch64 ++ x86_64 ++ riscv64);
badPlatforms = lib.platforms.darwin;
};
})