tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
urbit: remove old urbit; init at 1.20
Matthew LeVan
3 years ago
0e973e43
1f974883
+70
-17
3 changed files
expand all
collapse all
unified
split
maintainers
maintainer-list.nix
pkgs
misc
urbit
default.nix
update-bin.sh
+6
maintainers/maintainer-list.nix
reviewed
···
9183
9183
githubId = 952712;
9184
9184
name = "Matt Christ";
9185
9185
};
9186
9186
+
matthew-levan = {
9187
9187
+
email = "matthew@coeli.network";
9188
9188
+
github = "matthew-levan";
9189
9189
+
githubId = 91502660;
9190
9190
+
name = "Matthew LeVan";
9191
9191
+
};
9186
9192
matthewcroughan = {
9187
9193
email = "matt@croughan.sh";
9188
9194
github = "MatthewCroughan";
+24
-17
pkgs/misc/urbit/default.nix
reviewed
···
1
1
-
{ lib, stdenv, fetchFromGitHub, curl, git, gmp, libsigsegv, meson, ncurses, ninja
2
2
-
, openssl, pkg-config, re2c, zlib
1
1
+
{ stdenv
2
2
+
, lib
3
3
+
, fetchzip
3
4
}:
4
5
6
6
+
let
7
7
+
os = if stdenv.isDarwin then "macos" else "linux";
8
8
+
arch = if stdenv.isAarch64 then "aarch64" else "x86_64";
9
9
+
platform = "${os}-${arch}";
10
10
+
in
5
11
stdenv.mkDerivation rec {
6
12
pname = "urbit";
7
7
-
version = "0.7.3";
13
13
+
version = "1.20";
8
14
9
9
-
src = fetchFromGitHub {
10
10
-
owner = "urbit";
11
11
-
repo = "urbit";
12
12
-
rev = "v${version}";
13
13
-
sha256 = "192843pjzh8z55fd0x70m3l1vncmixljia3nphgn7j7x4976xkp2";
14
14
-
fetchSubmodules = true;
15
15
+
src = fetchzip {
16
16
+
url = "https://github.com/urbit/vere/releases/download/vere-v${version}/${platform}.tgz";
17
17
+
sha256 = {
18
18
+
x86_64-linux = "sha256-nBIpf9akK4cXnR5y5Fcl1g7/FxL8BU/CH/WHGhYuP74=";
19
19
+
aarch64-linux = "sha256-ERSYXNh/vmAKr4PNonOxTm5/FRLNDWwHSHM6fIeY4Nc=";
20
20
+
x86_64-darwin = "sha256-Kk9hNzyWngnyqlyQ9hILFM81WVw1ZYimMj4K3ENtifE=";
21
21
+
aarch64-darwin = "sha256-i3ixj04J/fcb396ncINLF8eYw1mpFCYeIM3f74K6tqY=";
22
22
+
}.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
15
23
};
16
24
17
17
-
nativeBuildInputs = [ pkg-config ninja meson ];
18
18
-
buildInputs = [ curl git gmp libsigsegv ncurses openssl re2c zlib ];
19
19
-
20
20
-
postPatch = ''
21
21
-
patchShebangs .
25
25
+
postInstall = ''
26
26
+
install -m755 -D vere-v${version}-${platform} $out/bin/urbit
22
27
'';
23
28
29
29
+
passthru.updateScript = ./update-bin.sh;
30
30
+
24
31
meta = with lib; {
25
25
-
description = "An operating function";
26
32
homepage = "https://urbit.org";
33
33
+
description = "An operating function";
34
34
+
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
35
35
+
maintainers = [ maintainers.matthew-levan ];
27
36
license = licenses.mit;
28
28
-
maintainers = with maintainers; [ mudri ];
29
29
-
platforms = with platforms; linux;
30
37
};
31
38
}
+40
pkgs/misc/urbit/update-bin.sh
reviewed
···
1
1
+
#!/usr/bin/env nix-shell
2
2
+
#!nix-shell -i bash -p curl common-updater-scripts nix-prefetch
3
3
+
4
4
+
set -euo pipefail
5
5
+
6
6
+
ROOT="$(dirname "$(readlink -f "$0")")"
7
7
+
NIX_DRV="$ROOT/default.nix"
8
8
+
if [ ! -f "$NIX_DRV" ]; then
9
9
+
echo "ERROR: cannot find urbit in $ROOT"
10
10
+
exit 1
11
11
+
fi
12
12
+
13
13
+
fetch_arch() {
14
14
+
VER="$1"; ARCH="$2"
15
15
+
URL="https://github.com/urbit/vere/releases/download/vere-v${VER}/${ARCH}.tgz";
16
16
+
nix-prefetch "{ stdenv, fetchzip }:
17
17
+
stdenv.mkDerivation rec {
18
18
+
pname = \"vere\"; version = \"${VER}\";
19
19
+
src = fetchzip { url = \"$URL\"; };
20
20
+
}
21
21
+
"
22
22
+
}
23
23
+
24
24
+
replace_sha() {
25
25
+
sed -i "s#$1 = \"sha256-.\{44\}\"#$1 = \"$2\"#" "$NIX_DRV"
26
26
+
}
27
27
+
28
28
+
VERE_VER=$(curl https://bootstrap.urbit.org/vere/live/last)
29
29
+
30
30
+
VERE_LINUX_AARCH64_SHA256=$(fetch_arch "$VERE_VER" "linux-aarch64")
31
31
+
VERE_LINUX_X64_SHA256=$(fetch_arch "$VERE_VER" "linux-x86_64")
32
32
+
VERE_DARWIN_AARCH64_SHA256=$(fetch_arch "$VERE_VER" "macos-aarch64")
33
33
+
VERE_DARWIN_X64_SHA256=$(fetch_arch "$VERE_VER" "macos-x86_64")
34
34
+
35
35
+
sed -i "s/version = \".*\"/version = \"$VERE_VER\"/" "$NIX_DRV"
36
36
+
37
37
+
replace_sha "aarch64-linux" "$VERE_LINUX_AARCH64_SHA256"
38
38
+
replace_sha "x86_64-linux" "$VERE_LINUX_X64_SHA256"
39
39
+
replace_sha "aarch64-darwin" "$VERE_DARWIN_AARCH64_SHA256"
40
40
+
replace_sha "x86_64-darwin" "$VERE_DARWIN_X64_SHA256"