hare: 0.24.0 -> 0.24.2

Also set the correct index for mailcap patch and change harec and qbe
binaries replacement for a more explicit placeholder.
This commit is contained in:
Coutinho de Souza 2024-07-06 10:36:16 -03:00
parent f9f63cbea2
commit c56755b92a
No known key found for this signature in database
GPG Key ID: 59081FCB8F9AABB5
5 changed files with 72 additions and 49 deletions

View File

@ -1,28 +1,45 @@
diff --git a/time/chrono/+freebsd.ha b/time/chrono/+freebsd.ha diff --git a/time/chrono/+freebsd.ha b/time/chrono/+freebsd.ha
index 26d78ab1..6861bfe8 100644 index af49080e..3dde7963 100644
--- a/time/chrono/+freebsd.ha --- a/time/chrono/+freebsd.ha
+++ b/time/chrono/+freebsd.ha +++ b/time/chrono/+freebsd.ha
@@ -2,7 +2,7 @@ @@ -2,8 +2,8 @@
// (c) Hare authors <https://harelang.org> // (c) Hare authors <https://harelang.org>
def LOCALTIME_PATH: str = "/etc/localtime"; def LOCALTIME_PATH: str = "/etc/localtime";
-def ZONEINFO_PREFIX: str = "/usr/share/zoneinfo/"; -def TZDB_PATH: str = "/usr/share/zoneinfo/";
+def ZONEINFO_PREFIX: str = "@tzdata@/share/zoneinfo/"; +def TZDB_PATH: str = "@tzdata@/share/zoneinfo/";
// The filepath of the system's "leap-seconds.list" file, which contains UTC/TAI // The filepath of the system's "leap-seconds.list" file, which contains UTC/TAI
// leap second data. // leap second data.
-export def UTC_LEAPSECS_PATH: str = "/var/db/ntpd.leap-seconds.list";
+export def UTC_LEAPSECS_PATH: str = "@tzdata@/share/zoneinfo/leap-seconds.list";
diff --git a/time/chrono/+linux.ha b/time/chrono/+linux.ha diff --git a/time/chrono/+linux.ha b/time/chrono/+linux.ha
index 600f606c..8d5617e2 100644 index 2756fd6f..1ea22385 100644
--- a/time/chrono/+linux.ha --- a/time/chrono/+linux.ha
+++ b/time/chrono/+linux.ha +++ b/time/chrono/+linux.ha
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
// (c) Hare authors <https://harelang.org> // (c) Hare authors <https://harelang.org>
def LOCALTIME_PATH: str = "/etc/localtime"; def LOCALTIME_PATH: str = "/etc/localtime";
-def ZONEINFO_PREFIX: str = "/usr/share/zoneinfo/"; -def TZDB_PATH: str = "/usr/share/zoneinfo/";
+def ZONEINFO_PREFIX: str = "@tzdata@/share/zoneinfo/"; +def TZDB_PATH: str = "@tzdata@/share/zoneinfo/";
// The filepath of the system's "leap-seconds.list" file, which contains UTC/TAI // The filepath of the system's "leap-seconds.list" file, which contains UTC/TAI
// leap second data. // leap second data.
-export def UTC_LEAPSECS_FILE: str = "/usr/share/zoneinfo/leap-seconds.list"; -export def UTC_LEAPSECS_PATH: str = "/usr/share/zoneinfo/leap-seconds.list";
+export def UTC_LEAPSECS_FILE: str = "@tzdata@/share/zoneinfo/leap-seconds.list"; +export def UTC_LEAPSECS_PATH: str = "@tzdata@/share/zoneinfo/leap-seconds.list";
diff --git a/time/chrono/+openbsd.ha b/time/chrono/+openbsd.ha
index 2756fd6f..1ea22385 100644
--- a/time/chrono/+openbsd.ha
+++ b/time/chrono/+openbsd.ha
@@ -2,8 +2,8 @@
// (c) Hare authors <https://harelang.org>
def LOCALTIME_PATH: str = "/etc/localtime";
-def TZDB_PATH: str = "/usr/share/zoneinfo/";
+def TZDB_PATH: 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_PATH: str = "/usr/share/zoneinfo/leap-seconds.list";
+export def UTC_LEAPSECS_PATH: str = "@tzdata@/share/zoneinfo/leap-seconds.list";

View File

@ -1,24 +1,24 @@
diff --git a/cmd/hare/build.ha b/cmd/hare/build.ha diff --git a/cmd/hare/build.ha b/cmd/hare/build.ha
index b2ac6518..417b46c6 100644 index ce19af9e..8631b325 100644
--- a/cmd/hare/build.ha --- a/cmd/hare/build.ha
+++ b/cmd/hare/build.ha +++ b/cmd/hare/build.ha
@@ -37,7 +37,7 @@ fn build(name: str, cmd: *getopt::command) (void | error) = { @@ -36,7 +36,7 @@ fn build(name: str, cmd: *getopt::command) (void | error) = {
case let ncpu: size => case let ncpu: size =>
yield ncpu; yield ncpu;
}, },
- version = build::get_version(os::tryenv("HAREC", "harec"))?, - version = build::get_version(os::tryenv("HAREC", "harec"))?,
+ version = build::get_version(os::tryenv("HAREC", "@harec@"))?, + version = build::get_version(os::tryenv("HAREC", "@harec_bin@"))?,
arch = arch.qbe_name, arch = arch,
platform = build::get_platform(os::sysname())?, platform = build::get_platform(os::sysname())?,
... ...
@@ -145,8 +145,8 @@ fn build(name: str, cmd: *getopt::command) (void | error) = { @@ -143,8 +143,8 @@ fn build(name: str, cmd: *getopt::command) (void | error) = {
set_arch_tags(&ctx.ctx.tags, arch); set_arch_tags(&ctx.ctx.tags, arch);
ctx.cmds = ["", ctx.cmds = ["",
- os::tryenv("HAREC", "harec"), - os::tryenv("HAREC", "harec"),
- os::tryenv("QBE", "qbe"), - os::tryenv("QBE", "qbe"),
+ os::tryenv("HAREC", "@harec@"), + os::tryenv("HAREC", "@harec_bin@"),
+ os::tryenv("QBE", "@qbe@"), + os::tryenv("QBE", "@qbe_bin@"),
os::tryenv("AS", arch.as_cmd), os::tryenv("AS", arch.as_cmd),
os::tryenv("LD", arch.ld_cmd), os::tryenv("LD", arch.ld_cmd),
]; ];

View File

@ -1,13 +0,0 @@
diff --git a/mime/system.ha b/mime/system.ha
index 73ff3496..42e7b640 100644
--- a/mime/system.ha
+++ b/mime/system.ha
@@ -11,7 +11,7 @@ use strings;
use types;
// Path to the system MIME database.
-export def SYSTEM_DB: str = "/etc/mime.types";
+export def SYSTEM_DB: str = "@mailcap@/etc/mime.types";
@init fn init() void = {
// Done in a separate function so we can discard errors here

View File

@ -0,0 +1,30 @@
diff --git a/mime/+freebsd.ha b/mime/+freebsd.ha
index e536d9bd..022f18c4 100644
--- a/mime/+freebsd.ha
+++ b/mime/+freebsd.ha
@@ -2,4 +2,4 @@
// (c) Hare authors <https://harelang.org>
// Path to the system MIME database.
-export def SYSTEM_DB: str = "/etc/mime.types";
+export def SYSTEM_DB: str = "@mailcap@/etc/mime.types";
diff --git a/mime/+linux.ha b/mime/+linux.ha
index e536d9bd..022f18c4 100644
--- a/mime/+linux.ha
+++ b/mime/+linux.ha
@@ -2,4 +2,4 @@
// (c) Hare authors <https://harelang.org>
// Path to the system MIME database.
-export def SYSTEM_DB: str = "/etc/mime.types";
+export def SYSTEM_DB: str = "@mailcap@/etc/mime.types";
diff --git a/mime/+openbsd.ha b/mime/+openbsd.ha
index 611b2dce..022f18c4 100644
--- a/mime/+openbsd.ha
+++ b/mime/+openbsd.ha
@@ -2,4 +2,4 @@
// (c) Hare authors <https://harelang.org>
// Path to the system MIME database.
-export def SYSTEM_DB: str = "/usr/share/misc/mime.types";
+export def SYSTEM_DB: str = "@mailcap@/etc/mime.types";

View File

@ -8,7 +8,6 @@
tzdata, tzdata,
mailcap, mailcap,
substituteAll, substituteAll,
fetchpatch,
callPackage, callPackage,
enableCrossCompilation ? (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit), enableCrossCompilation ? (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit),
pkgsCross, pkgsCross,
@ -78,7 +77,7 @@ let
in in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "hare"; pname = "hare";
version = "0.24.0"; version = "0.24.2";
outputs = [ outputs = [
"out" "out"
@ -89,7 +88,7 @@ stdenv.mkDerivation (finalAttrs: {
owner = "~sircmpwn"; owner = "~sircmpwn";
repo = "hare"; repo = "hare";
rev = finalAttrs.version; rev = finalAttrs.version;
hash = "sha256-3T+BdNj+Th8QXrcsPMWlN9GBfuMF1ulneWHpDEtyBU8="; hash = "sha256-61lckI0F+Ez5LR/8g6ftS0W7Q/+EU/1flTDFleBg6pc=";
}; };
patches = [ patches = [
@ -98,28 +97,18 @@ stdenv.mkDerivation (finalAttrs: {
src = ./001-tzdata.patch; src = ./001-tzdata.patch;
inherit tzdata; inherit tzdata;
}) })
# Use correct comment syntax for debug+riscv64.
(fetchpatch {
url = "https://git.sr.ht/~sircmpwn/hare/commit/80e45e4d931a6e90d999846b86471cac00d2a6d5.patch";
hash = "sha256-S7nXpiO0tYnKpmpj+fLkolGeHb1TrmgKlMF0+j0qLPQ=";
})
# Don't build haredoc since it uses the build `hare` bin, which breaks # Don't build haredoc since it uses the build `hare` bin, which breaks
# cross-compilation. # cross-compilation.
./002-dont-build-haredoc.patch ./002-dont-build-haredoc.patch
# Hardcode harec and qbe. # Hardcode harec and qbe.
(substituteAll { (substituteAll {
src = ./003-hardcode-qbe-and-harec.patch; src = ./003-hardcode-qbe-and-harec.patch;
harec = lib.getExe harec; harec_bin = lib.getExe harec;
qbe = lib.getExe qbe; qbe_bin = lib.getExe qbe;
})
# Display toolchains when using `hare version -v`.
(fetchpatch {
url = "https://git.sr.ht/~sircmpwn/hare/commit/e35f2284774436f422e06f0e8d290b173ced1677.patch";
hash = "sha256-A59bGO/9tOghV8/MomTxd8xRExkHVdoMom2d+HTfQGg=";
}) })
# Use mailcap `/etc/mime.types` for Hare's mime module # Use mailcap `/etc/mime.types` for Hare's mime module
(substituteAll { (substituteAll {
src = ./003-use-mailcap-for-mimetypes.patch; src = ./004-use-mailcap-for-mimetypes.patch;
inherit mailcap; inherit mailcap;
}) })
]; ];