mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
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:
parent
f9f63cbea2
commit
c56755b92a
@ -1,28 +1,45 @@
|
||||
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
|
||||
+++ b/time/chrono/+freebsd.ha
|
||||
@@ -2,7 +2,7 @@
|
||||
@@ -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/";
|
||||
|
||||
-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 = "/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
|
||||
index 600f606c..8d5617e2 100644
|
||||
index 2756fd6f..1ea22385 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/";
|
||||
|
||||
-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_FILE: 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 = "/usr/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";
|
||||
|
@ -1,24 +1,24 @@
|
||||
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
|
||||
+++ 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 =>
|
||||
yield ncpu;
|
||||
},
|
||||
- version = build::get_version(os::tryenv("HAREC", "harec"))?,
|
||||
+ version = build::get_version(os::tryenv("HAREC", "@harec@"))?,
|
||||
arch = arch.qbe_name,
|
||||
+ version = build::get_version(os::tryenv("HAREC", "@harec_bin@"))?,
|
||||
arch = arch,
|
||||
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);
|
||||
|
||||
ctx.cmds = ["",
|
||||
- os::tryenv("HAREC", "harec"),
|
||||
- os::tryenv("QBE", "qbe"),
|
||||
+ os::tryenv("HAREC", "@harec@"),
|
||||
+ os::tryenv("QBE", "@qbe@"),
|
||||
+ os::tryenv("HAREC", "@harec_bin@"),
|
||||
+ os::tryenv("QBE", "@qbe_bin@"),
|
||||
os::tryenv("AS", arch.as_cmd),
|
||||
os::tryenv("LD", arch.ld_cmd),
|
||||
];
|
||||
|
@ -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
|
30
pkgs/by-name/ha/hare/004-use-mailcap-for-mimetypes.patch
Normal file
30
pkgs/by-name/ha/hare/004-use-mailcap-for-mimetypes.patch
Normal 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";
|
@ -8,7 +8,6 @@
|
||||
tzdata,
|
||||
mailcap,
|
||||
substituteAll,
|
||||
fetchpatch,
|
||||
callPackage,
|
||||
enableCrossCompilation ? (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit),
|
||||
pkgsCross,
|
||||
@ -78,7 +77,7 @@ let
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hare";
|
||||
version = "0.24.0";
|
||||
version = "0.24.2";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
@ -89,7 +88,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
owner = "~sircmpwn";
|
||||
repo = "hare";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-3T+BdNj+Th8QXrcsPMWlN9GBfuMF1ulneWHpDEtyBU8=";
|
||||
hash = "sha256-61lckI0F+Ez5LR/8g6ftS0W7Q/+EU/1flTDFleBg6pc=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@ -98,28 +97,18 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
src = ./001-tzdata.patch;
|
||||
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
|
||||
# cross-compilation.
|
||||
./002-dont-build-haredoc.patch
|
||||
# Hardcode harec and qbe.
|
||||
(substituteAll {
|
||||
src = ./003-hardcode-qbe-and-harec.patch;
|
||||
harec = lib.getExe harec;
|
||||
qbe = 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=";
|
||||
harec_bin = lib.getExe harec;
|
||||
qbe_bin = lib.getExe qbe;
|
||||
})
|
||||
# Use mailcap `/etc/mime.types` for Hare's mime module
|
||||
(substituteAll {
|
||||
src = ./003-use-mailcap-for-mimetypes.patch;
|
||||
src = ./004-use-mailcap-for-mimetypes.patch;
|
||||
inherit mailcap;
|
||||
})
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user