mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-28 10:10:31 +00:00
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>
This commit is contained in:
parent
ea71f1713f
commit
fbbff51a1c
@ -1,7 +1,100 @@
|
|||||||
{ config, lib, pkgs }:
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchFromSourcehut
|
||||||
|
, binutils-unwrapped
|
||||||
|
, harec
|
||||||
|
, makeWrapper
|
||||||
|
, qbe
|
||||||
|
, scdoc
|
||||||
|
}:
|
||||||
|
|
||||||
lib.makeScope pkgs.newScope (self: {
|
let
|
||||||
|
# We use harec's override of qbe until 1.2 is released, but the `qbe` argument
|
||||||
|
# is kept to avoid breakage.
|
||||||
|
qbe = harec.qbeUnstable;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
pname = "hare";
|
||||||
|
version = "unstable-2023-10-23";
|
||||||
|
|
||||||
harec = pkgs.callPackage ./harec { };
|
src = fetchFromSourcehut {
|
||||||
hare = pkgs.callPackage ./hare { };
|
owner = "~sircmpwn";
|
||||||
|
repo = "hare";
|
||||||
|
rev = "1048620a7a25134db370bf24736efff1ffcb2483";
|
||||||
|
hash = "sha256-slQPIhrcM+KAVAvjuRnqNdEAEr4Xa4iQNVEpI7Wl+Ks=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
binutils-unwrapped
|
||||||
|
harec
|
||||||
|
makeWrapper
|
||||||
|
qbe
|
||||||
|
scdoc
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
binutils-unwrapped
|
||||||
|
harec
|
||||||
|
qbe
|
||||||
|
];
|
||||||
|
|
||||||
|
# Append the distribution name to the version
|
||||||
|
env.LOCALVER = "nix";
|
||||||
|
|
||||||
|
configurePhase =
|
||||||
|
let
|
||||||
|
# https://harelang.org/platforms/
|
||||||
|
arch =
|
||||||
|
if stdenv.isx86_64 then "x86_64"
|
||||||
|
else if stdenv.isAarch64 then "aarch64"
|
||||||
|
else if stdenv.hostPlatform.isRiscV && stdenv.is64bit then "riscv64"
|
||||||
|
else "unsupported";
|
||||||
|
platform =
|
||||||
|
if stdenv.isLinux then "linux"
|
||||||
|
else if stdenv.isFreeBSD then "freebsd"
|
||||||
|
else "unsupported";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
|
cp config.example.mk config.mk
|
||||||
|
makeFlagsArray+=(
|
||||||
|
PREFIX="${builtins.placeholder "out"}"
|
||||||
|
HARECACHE="$(mktemp -d --tmpdir harecache.XXXXXXXX)"
|
||||||
|
BINOUT="$(mktemp -d --tmpdir bin.XXXXXXXX)"
|
||||||
|
PLATFORM="${platform}"
|
||||||
|
ARCH="${arch}"
|
||||||
|
)
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
|
'';
|
||||||
|
|
||||||
|
doCheck = true;
|
||||||
|
|
||||||
|
postFixup =
|
||||||
|
let
|
||||||
|
binPath = lib.makeBinPath [
|
||||||
|
binutils-unwrapped
|
||||||
|
harec
|
||||||
|
qbe
|
||||||
|
];
|
||||||
|
in
|
||||||
|
''
|
||||||
|
wrapProgram $out/bin/hare --prefix PATH : ${binPath}
|
||||||
|
'';
|
||||||
|
|
||||||
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
|
strictDeps = true;
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = "https://harelang.org/";
|
||||||
|
description =
|
||||||
|
"A systems programming language designed to be simple, stable, and robust";
|
||||||
|
license = lib.licenses.gpl3Only;
|
||||||
|
maintainers = with lib.maintainers; [ onemoresuza ];
|
||||||
|
mainProgram = "hare";
|
||||||
|
inherit (harec.meta) platforms badPlatforms;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
## Template to generate config.mk via substitute-all
|
|
||||||
|
|
||||||
# set PREFIX externally
|
|
||||||
BINDIR = $(PREFIX)/bin
|
|
||||||
MANDIR = $(PREFIX)/share/man
|
|
||||||
SRCDIR = $(PREFIX)/src
|
|
||||||
STDLIB = $(SRCDIR)/hare/stdlib
|
|
||||||
|
|
||||||
HAREPATH = $(SRCDIR)/hare/stdlib:$(SRCDIR)/hare/third-party
|
|
||||||
|
|
||||||
## Build configuration
|
|
||||||
|
|
||||||
# Platform to build for
|
|
||||||
PLATFORM = @platform@
|
|
||||||
ARCH = @arch@
|
|
||||||
|
|
||||||
# External tools and flags
|
|
||||||
HAREC = harec
|
|
||||||
HAREFLAGS = @hareflags@
|
|
||||||
QBE = qbe
|
|
||||||
AS = as
|
|
||||||
LD = ld
|
|
||||||
AR = ar
|
|
||||||
SCDOC = scdoc
|
|
||||||
|
|
||||||
# Where to store build artifacts
|
|
||||||
# set HARECACHE externally
|
|
||||||
|
|
||||||
# Cross-compiler toolchains
|
|
||||||
# # TODO: fixup this
|
|
||||||
AARCH64_AS=aarch64-as
|
|
||||||
AARCH64_AR=aarch64-ar
|
|
||||||
AARCH64_CC=aarch64-cc
|
|
||||||
AARCH64_LD=aarch64-ld
|
|
||||||
|
|
||||||
RISCV64_AS=riscv64-as
|
|
||||||
RISCV64_AR=riscv64-ar
|
|
||||||
RISCV64_CC=riscv64-cc
|
|
||||||
RISCV64_LD=riscv64-ld
|
|
||||||
|
|
||||||
X86_64_AS=as
|
|
||||||
X86_64_AR=ar
|
|
||||||
X86_64_CC=cc
|
|
||||||
X86_64_LD=ld
|
|
@ -1,98 +0,0 @@
|
|||||||
{ lib
|
|
||||||
, stdenv
|
|
||||||
, fetchFromSourcehut
|
|
||||||
, binutils-unwrapped
|
|
||||||
, harePackages
|
|
||||||
, makeWrapper
|
|
||||||
, qbe
|
|
||||||
, scdoc
|
|
||||||
, substituteAll
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (harePackages) harec;
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
|
||||||
pname = "hare";
|
|
||||||
version = "unstable-2023-04-23";
|
|
||||||
|
|
||||||
src = fetchFromSourcehut {
|
|
||||||
owner = "~sircmpwn";
|
|
||||||
repo = "hare";
|
|
||||||
rev = "464ec7a660b12ab1ef8e4dcc9d00604cec996c6e";
|
|
||||||
hash = "sha256-5/ObckDxosqUkFfDVhGA/0kwjFzDUxu420nkfa97vqM=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
binutils-unwrapped
|
|
||||||
harec
|
|
||||||
makeWrapper
|
|
||||||
qbe
|
|
||||||
scdoc
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
binutils-unwrapped
|
|
||||||
harec
|
|
||||||
qbe
|
|
||||||
];
|
|
||||||
|
|
||||||
strictDeps = true;
|
|
||||||
|
|
||||||
configurePhase =
|
|
||||||
let
|
|
||||||
# https://harelang.org/platforms/
|
|
||||||
arch =
|
|
||||||
if stdenv.isx86_64 then "x86_64"
|
|
||||||
else if stdenv.isAarch64 then "aarch64"
|
|
||||||
else if stdenv.hostPlatform.isRiscV && stdenv.is64bit then "riscv64"
|
|
||||||
else "unsupported";
|
|
||||||
platform =
|
|
||||||
if stdenv.isLinux then "linux"
|
|
||||||
else if stdenv.isFreeBSD then "freebsd"
|
|
||||||
else "unsupported";
|
|
||||||
hareflags = "";
|
|
||||||
config-file = substituteAll {
|
|
||||||
src = ./config-template.mk;
|
|
||||||
inherit arch platform hareflags;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
''
|
|
||||||
runHook preConfigure
|
|
||||||
|
|
||||||
export HARECACHE="$NIX_BUILD_TOP/.harecache"
|
|
||||||
export BINOUT="$NIX_BUILD_TOP/.bin"
|
|
||||||
cat ${config-file} > config.mk
|
|
||||||
|
|
||||||
runHook postConfigure
|
|
||||||
'';
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"PREFIX=${placeholder "out"}"
|
|
||||||
];
|
|
||||||
|
|
||||||
doCheck = true;
|
|
||||||
|
|
||||||
postInstall =
|
|
||||||
let
|
|
||||||
binPath = lib.makeBinPath [
|
|
||||||
binutils-unwrapped
|
|
||||||
harec
|
|
||||||
qbe
|
|
||||||
];
|
|
||||||
in
|
|
||||||
''
|
|
||||||
wrapProgram $out/bin/hare --prefix PATH : ${binPath}
|
|
||||||
'';
|
|
||||||
|
|
||||||
setupHook = ./setup-hook.sh;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "http://harelang.org/";
|
|
||||||
description =
|
|
||||||
"A systems programming language designed to be simple, stable, and robust";
|
|
||||||
license = lib.licenses.gpl3Only;
|
|
||||||
maintainers = with lib.maintainers; [ onemoresuza ];
|
|
||||||
inherit (harec.meta) platforms badPlatforms;
|
|
||||||
};
|
|
||||||
})
|
|
@ -1,45 +0,0 @@
|
|||||||
{ lib
|
|
||||||
, stdenv
|
|
||||||
, fetchFromSourcehut
|
|
||||||
, qbe
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
|
||||||
pname = "harec";
|
|
||||||
version = "unstable-2023-04-25";
|
|
||||||
|
|
||||||
src = fetchFromSourcehut {
|
|
||||||
owner = "~sircmpwn";
|
|
||||||
repo = "harec";
|
|
||||||
rev = "068e8da091f9053726251bc221abf40fdea630ff";
|
|
||||||
hash = "sha256-PPR0d+6JJRzPURW7AznloBSrtylMJExNCGCxFMl2LsA=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
qbe
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
qbe
|
|
||||||
];
|
|
||||||
|
|
||||||
# TODO: report upstream
|
|
||||||
hardeningDisable = [ "fortify" ];
|
|
||||||
|
|
||||||
strictDeps = true;
|
|
||||||
|
|
||||||
doCheck = true;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "http://harelang.org/";
|
|
||||||
description = "Bootstrapping Hare compiler written in C for POSIX systems";
|
|
||||||
license = lib.licenses.gpl3Only;
|
|
||||||
maintainers = with lib.maintainers; [ onemoresuza ];
|
|
||||||
# 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;
|
|
||||||
};
|
|
||||||
})
|
|
63
pkgs/development/compilers/harec/default.nix
Normal file
63
pkgs/development/compilers/harec/default.nix
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
{ 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;
|
||||||
|
};
|
||||||
|
})
|
@ -352,7 +352,6 @@ mapAliases ({
|
|||||||
|
|
||||||
### H ###
|
### H ###
|
||||||
|
|
||||||
inherit (harePackages) hare harec; # Added 2022-08-10
|
|
||||||
haxe_3_2 = throw "'haxe_3_2' has been removed because it is old and no longer used by any packages in nixpkgs"; # Added 2023-03-15
|
haxe_3_2 = throw "'haxe_3_2' has been removed because it is old and no longer used by any packages in nixpkgs"; # Added 2023-03-15
|
||||||
haxe_3_4 = throw "'haxe_3_4' has been removed because it is old and no longer used by any packages in nixpkgs"; # Added 2023-03-15
|
haxe_3_4 = throw "'haxe_3_4' has been removed because it is old and no longer used by any packages in nixpkgs"; # Added 2023-03-15
|
||||||
hepmc = throw "'hepmc' has been renamed to/replaced by 'hepmc2'"; # Converted to throw 2023-09-10
|
hepmc = throw "'hepmc' has been renamed to/replaced by 'hepmc2'"; # Converted to throw 2023-09-10
|
||||||
|
@ -9129,7 +9129,8 @@ with pkgs;
|
|||||||
llvmPackages = llvmPackages_14;
|
llvmPackages = llvmPackages_14;
|
||||||
};
|
};
|
||||||
|
|
||||||
harePackages = recurseIntoAttrs (callPackage ../development/compilers/hare { });
|
harePackages = recurseIntoAttrs (callPackage ./hare-packages.nix { });
|
||||||
|
inherit (harePackages) hare harec;
|
||||||
|
|
||||||
ham = pkgs.perlPackages.ham;
|
ham = pkgs.perlPackages.ham;
|
||||||
|
|
||||||
|
10
pkgs/top-level/hare-packages.nix
Normal file
10
pkgs/top-level/hare-packages.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ lib, newScope }:
|
||||||
|
|
||||||
|
lib.makeScope newScope (self:
|
||||||
|
let
|
||||||
|
inherit (self) callPackage;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
harec = callPackage ../development/compilers/harec { };
|
||||||
|
hare = callPackage ../development/compilers/hare { };
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user