Skip to content

Commit 31ee028

Browse files
committed
add basic utils & fix
1 parent acdef5b commit 31ee028

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

default.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ let pkgs = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/430a0
44
];
55
});
66
in with pkgs; {
7+
# Basic utils
8+
inherit coreutils;
9+
inherit bash;
10+
inherit gnutar;
11+
inherit openssl;
12+
713
# C, C++
814
gcc = (callPackage ./gcc-luogu { inherit pkgs; }).gcc;
915

kotlin-native/default.nix

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# However this nix file just works on Luogu Judge.
44
let
55
pname = "kotlin-native";
6-
version = "1.5.20";
7-
sha256 = "9449219ec9465b14adda1b730ac14ef02da93e9f98219f7303bf70c4c875b7db";
6+
version = "1.5.21";
7+
sha256 = "fa3dfec9c11711c2b713a1482bcc4511bb8f73f182f12aa7d858943f6f084397";
88

99
unwrapped = stdenv.mkDerivation {
1010
pname = "${pname}-unwrapped";
@@ -14,30 +14,28 @@ let
1414
url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-native-linux-${version}.tar.gz";
1515
inherit sha256;
1616
};
17-
propagatedBuildInputs = [ jre ];
17+
propagatedBuildInputs = [ jre bash ];
1818

1919
buildPhase = ''
2020
export KONAN_DATA_DIR=$PWD/konan-data
21-
export PATH=$PATH:${jre}/bin:$PWD/build-bin
22-
cp -r bin build-bin
23-
patchShebangs build-bin
21+
export PATH=$PATH:${jre}/bin:$PWD/bin
22+
rm bin/kotlinc # kotlinc is deprecated and will be removed in the future
23+
patchShebangs bin
2424
kotlinc-native -Xcheck-dependencies
25-
rm -r build-bin
2625
'';
2726
installPhase = ''
2827
mkdir -p $out
2928
mv * $out
30-
rm $out/bin/kotlinc # kotlinc will be removed in the future
31-
patchShebangs bin
3229
'';
3330

3431
dontFixup = true;
3532
dontStrip = true;
3633
dontPatchELF = true;
34+
dontPatchShebangs = true;
3735

3836
outputHashMode = "recursive";
3937
outputHashAlgo = "sha256";
40-
outputHash = "01kxmkd9vcjl0x4g9ylihz6z426zlm7jk2y5q580zs0prncqrk7x";
38+
outputHash = "0rpb3qd6slfp6wms8aj706zhdyqsr0cz3w64ri26w4ljh4d5fns1";
4139
};
4240
in stdenv.mkDerivation {
4341
inherit pname;
@@ -56,12 +54,10 @@ in stdenv.mkDerivation {
5654
'';
5755
installPhase = ''
5856
mkdir -p $out/bin
59-
echo "$dependenciesLinkHelper" > $out/dependenciesLinkHelper.sh
60-
chmod a+x $out/dependenciesLinkHelper.sh
6157
for p in $(ls ${unwrapped}/bin/); do
6258
makeWrapper ${unwrapped}/bin/$p $out/bin/$p \
6359
--prefix PATH ":" ${jre}/bin \
64-
--run $out/dependenciesLinkHelper.sh \
60+
--run "$dependenciesLinkHelper" \
6561
;
6662
done
6763
'';

0 commit comments

Comments
 (0)