diff options
author | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2023-12-15 02:07:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-15 02:07:23 +0100 |
commit | 239c6fbc9df59192bcd9bf65a0b0ac74504c4101 (patch) | |
tree | 8e30edf168f583529e84bda5d12bf11104951396 | |
parent | adf2347f8b49860d7c82e98f17b4a4b7a72709fd (diff) | |
parent | a47d6e0fd6edf862d53ea8554a181f810acb21b5 (diff) | |
download | nixlib-239c6fbc9df59192bcd9bf65a0b0ac74504c4101.tar nixlib-239c6fbc9df59192bcd9bf65a0b0ac74504c4101.tar.gz nixlib-239c6fbc9df59192bcd9bf65a0b0ac74504c4101.tar.bz2 nixlib-239c6fbc9df59192bcd9bf65a0b0ac74504c4101.tar.lz nixlib-239c6fbc9df59192bcd9bf65a0b0ac74504c4101.tar.xz nixlib-239c6fbc9df59192bcd9bf65a0b0ac74504c4101.tar.zst nixlib-239c6fbc9df59192bcd9bf65a0b0ac74504c4101.zip |
Merge pull request #271476 from onemoresuza/hare
hare: unstable-2023-10-23 -> unstable-2023-11-27; harec: unstable-2023-10-22 -> unstable-2023-11-29
-rw-r--r-- | pkgs/by-name/ha/hare/001-tzdata.patch | 28 | ||||
-rw-r--r-- | pkgs/by-name/ha/hare/package.nix | 91 | ||||
-rw-r--r-- | pkgs/by-name/ha/hare/setup-hook.sh (renamed from pkgs/development/compilers/hare/setup-hook.sh) | 0 | ||||
-rw-r--r-- | pkgs/by-name/ha/harec/package.nix (renamed from pkgs/development/compilers/harec/default.nix) | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/hare/default.nix | 100 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 |
6 files changed, 122 insertions, 107 deletions
diff --git a/pkgs/by-name/ha/hare/001-tzdata.patch b/pkgs/by-name/ha/hare/001-tzdata.patch new file mode 100644 index 000000000000..bb510514eb53 --- /dev/null +++ b/pkgs/by-name/ha/hare/001-tzdata.patch @@ -0,0 +1,28 @@ +diff --git a/time/chrono/+freebsd.ha b/time/chrono/+freebsd.ha +index 26d78ab1..6861bfe8 100644 +--- a/time/chrono/+freebsd.ha ++++ b/time/chrono/+freebsd.ha +@@ -2,7 +2,7 @@ + // (c) Hare authors <https://harelang.org> + + def LOCALTIME_PATH: str = "/etc/localtime"; +-def ZONEINFO_PREFIX: str = "/usr/share/zoneinfo/"; ++def ZONEINFO_PREFIX: str = "@tzdata@/share/zoneinfo/"; + + // The filepath of the system's "leap-seconds.list" file, which contains UTC/TAI + // leap second data. +diff --git a/time/chrono/+linux.ha b/time/chrono/+linux.ha +index 600f606c..8d5617e2 100644 +--- a/time/chrono/+linux.ha ++++ b/time/chrono/+linux.ha +@@ -2,8 +2,8 @@ + // (c) Hare authors <https://harelang.org> + + def LOCALTIME_PATH: str = "/etc/localtime"; +-def ZONEINFO_PREFIX: str = "/usr/share/zoneinfo/"; ++def ZONEINFO_PREFIX: str = "@tzdata@/share/zoneinfo/"; + + // The filepath of the system's "leap-seconds.list" file, which contains UTC/TAI + // leap second data. +-export def UTC_LEAPSECS_FILE: str = "/usr/share/zoneinfo/leap-seconds.list"; ++export def UTC_LEAPSECS_FILE: str = "@tzdata@/share/zoneinfo/leap-seconds.list"; diff --git a/pkgs/by-name/ha/hare/package.nix b/pkgs/by-name/ha/hare/package.nix new file mode 100644 index 000000000000..c509955c6f09 --- /dev/null +++ b/pkgs/by-name/ha/hare/package.nix @@ -0,0 +1,91 @@ +{ lib +, stdenv +, fetchFromSourcehut +, binutils-unwrapped +, harec +, makeWrapper +, qbe +, scdoc +, tzdata +, substituteAll +}: + +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; + # https://harelang.org/platforms/ + arch = stdenv.hostPlatform.uname.processor; + platform = lib.strings.toLower stdenv.hostPlatform.uname.system; +in +stdenv.mkDerivation (finalAttrs: { + pname = "hare"; + version = "unstable-2023-11-27"; + + outputs = [ "out" "man" ]; + + src = fetchFromSourcehut { + owner = "~sircmpwn"; + repo = "hare"; + rev = "d94f355481a320fb2aec13ef62cb3bfe2416f5e4"; + hash = "sha256-Mpl3VO4xvLCKHeYr/FPuS6jl8CkyeqDz18mQ6Zv05oc="; + }; + + patches = [ + # Replace FHS paths with nix store + (substituteAll { + src = ./001-tzdata.patch; + inherit tzdata; + }) + ]; + + nativeBuildInputs = [ + harec + makeWrapper + qbe + scdoc + ]; + + buildInputs = [ + binutils-unwrapped + harec + qbe + tzdata + ]; + + makeFlags = [ + "HARECACHE=.harecache" + "PREFIX=${builtins.placeholder "out"}" + "PLATFORM=${platform}" + "ARCH=${arch}" + ]; + + enableParallelBuilding = true; + + # Append the distribution name to the version + env.LOCALVER = "nixpkgs"; + + strictDeps = true; + + doCheck = true; + + preConfigure = '' + ln -s config.example.mk config.mk + ''; + + postFixup = '' + wrapProgram $out/bin/hare \ + --prefix PATH : ${lib.makeBinPath [binutils-unwrapped harec qbe]} + ''; + + setupHook = ./setup-hook.sh; + + meta = { + homepage = "https://harelang.org/"; + description = "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; + }; +}) diff --git a/pkgs/development/compilers/hare/setup-hook.sh b/pkgs/by-name/ha/hare/setup-hook.sh index d2d2c34354d6..d2d2c34354d6 100644 --- a/pkgs/development/compilers/hare/setup-hook.sh +++ b/pkgs/by-name/ha/hare/setup-hook.sh diff --git a/pkgs/development/compilers/harec/default.nix b/pkgs/by-name/ha/harec/package.nix index 6ddb5ff1f01c..cbcb53b1ac4e 100644 --- a/pkgs/development/compilers/harec/default.nix +++ b/pkgs/by-name/ha/harec/package.nix @@ -19,13 +19,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "harec"; - version = "unstable-2023-10-22"; + version = "unstable-2023-11-29"; src = fetchFromSourcehut { owner = "~sircmpwn"; repo = "harec"; - rev = "64dea196ce040fbf3417e1b4fb11331688672aca"; - hash = "sha256-2Aeb+OZ/hYUyyxx6aTw+Oxiac+p+SClxtg0h68ZBSHc="; + rev = "ec3193e3870436180b0f3df82b769adc57a1c099"; + hash = "sha256-HXQIgFC4YVDJjo5xbyg1ea3jWYKLEwKkD1KFzWFz9UI= "; }; nativeBuildInputs = [ diff --git a/pkgs/development/compilers/hare/default.nix b/pkgs/development/compilers/hare/default.nix deleted file mode 100644 index a78b3706f678..000000000000 --- a/pkgs/development/compilers/hare/default.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ lib -, stdenv -, fetchFromSourcehut -, binutils-unwrapped -, harec -, makeWrapper -, qbe -, scdoc -}: - -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"; - - src = fetchFromSourcehut { - 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; - }; -}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 035f7e5382c1..1aa49171c3e5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9137,10 +9137,6 @@ with pkgs; llvmPackages = llvmPackages_16; }; - hare = callPackage ../development/compilers/hare { }; - - harec = callPackage ../development/compilers/harec { }; - hareThirdParty = recurseIntoAttrs (callPackage ./hare-third-party.nix { }); ham = pkgs.perlPackages.ham; |