Skip to content

Commit 66d9d29

Browse files
authored
Update purs (0.15.16-7, 0.15.16-8) and purs-tidy (0.11.1) (#122)
* Skip patching for statically linked purs versions >= 0.15.16-7
1 parent 8151381 commit 66d9d29

File tree

6 files changed

+1163
-1110
lines changed

6 files changed

+1163
-1110
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules
66
.psc*
77

88
TODO.md
9+
.direnv

manifests/build-support/mkPursDerivation.nix

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,55 @@
55
gmp,
66
fetchurl,
77
ncurses5,
8-
}: {
8+
}:
9+
{
910
version,
1011
url,
1112
hash,
12-
}: let
13+
}:
14+
let
1315
dynamic-linker = stdenv.cc.bintools.dynamicLinker;
1416

15-
patchelf = libPath:
16-
if stdenv.isDarwin
17-
then ""
18-
else ''
19-
chmod u+w $PURS
20-
patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PURS
21-
chmod u-w $PURS
22-
'';
17+
# Versions >= 0.15.16-7 are statically linked and don't need patching
18+
needsPatching = lib.versionOlder version "0.15.16-7";
19+
20+
patchelf =
21+
libPath:
22+
if stdenv.isDarwin || !needsPatching then
23+
""
24+
else
25+
''
26+
chmod u+w $PURS
27+
patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PURS
28+
chmod u-w $PURS
29+
'';
2330
in
24-
stdenv.mkDerivation rec {
25-
pname = "purs";
26-
inherit version;
31+
stdenv.mkDerivation rec {
32+
pname = "purs";
33+
inherit version;
2734

28-
src = fetchurl {inherit url hash;};
35+
src = fetchurl { inherit url hash; };
2936

30-
buildInputs = [zlib gmp ncurses5];
31-
libPath = lib.makeLibraryPath buildInputs;
32-
dontStrip = true;
37+
buildInputs = lib.optionals needsPatching [
38+
zlib
39+
gmp
40+
ncurses5
41+
];
42+
libPath = lib.makeLibraryPath buildInputs;
43+
dontStrip = true;
3344

34-
installPhase = ''
35-
mkdir -p $out/bin
36-
PURS="$out/bin/purs"
37-
install -D -m555 -T purs $PURS
38-
${patchelf libPath}
39-
mkdir -p $out/etc/bash_completion.d/
40-
$PURS --bash-completion-script $PURS > $out/etc/bash_completion.d/purs-completion.bash
41-
'';
45+
installPhase = ''
46+
mkdir -p $out/bin
47+
PURS="$out/bin/purs"
48+
install -D -m555 -T purs $PURS
49+
${patchelf libPath}
50+
mkdir -p $out/etc/bash_completion.d/
51+
$PURS --bash-completion-script $PURS > $out/etc/bash_completion.d/purs-completion.bash
52+
'';
4253

43-
meta = with lib; {
44-
description = "Compiler for a strongly-typed language that compiles to JavaScript";
45-
homepage = "https://github.com/purescript/purescript";
46-
mainProgram = pname;
47-
};
48-
}
54+
meta = {
55+
description = "Compiler for a strongly-typed language that compiles to JavaScript";
56+
homepage = "https://github.com/purescript/purescript";
57+
mainProgram = pname;
58+
};
59+
}

manifests/named.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"purs-stable": "purs-0_15_15",
3-
"purs-unstable": "purs-0_15_16-6",
4-
"spago-stable": "spago-0_21_0",
5-
"spago-unstable": "spago-0_93_44",
6-
"purs-tidy-stable": "purs-tidy-0_11_0",
7-
"purs-tidy-unstable": "purs-tidy-0_11_0",
8-
"purs-backend-es-stable": "purs-backend-es-1_4_3",
9-
"purs-backend-es-unstable": "purs-backend-es-1_4_3",
10-
"purescript-language-server-stable": "purescript-language-server-0_18_5",
11-
"purescript-language-server-unstable": "purescript-language-server-0_18_5"
2+
"purs-stable": "purs-0_15_15",
3+
"purs-unstable": "purs-0_15_16-8",
4+
"spago-stable": "spago-0_21_0",
5+
"spago-unstable": "spago-0_93_44",
6+
"purs-tidy-stable": "purs-tidy-0_11_1",
7+
"purs-tidy-unstable": "purs-tidy-0_11_1",
8+
"purs-backend-es-stable": "purs-backend-es-1_4_3",
9+
"purs-backend-es-unstable": "purs-backend-es-1_4_3",
10+
"purescript-language-server-stable": "purescript-language-server-0_18_5",
11+
"purescript-language-server-unstable": "purescript-language-server-0_18_5"
1212
}

manifests/purs-tidy.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,9 @@
8282
"0.11.0": {
8383
"hash": "sha256-wJ7OG2ApRr8Zp6aVjRwSCH/yat2qx2JzozbfU4F5DYU=",
8484
"url": "https://registry.npmjs.org/purs-tidy/-/purs-tidy-0.11.0.tgz"
85+
},
86+
"0.11.1": {
87+
"hash": "sha256-+bX+NntwZw7YYgO1kkSGSLnpXb8imgPB2QCjRH6hsoE=",
88+
"url": "https://registry.npmjs.org/purs-tidy/-/purs-tidy-0.11.1.tgz"
8589
}
8690
}

0 commit comments

Comments
 (0)