File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change 3
3
name = "advent-of-code-2024-day22" ;
4
4
src = ./src ;
5
5
6
- nativeBuildInputs = [
6
+ buildInputs = [
7
7
dart
8
8
] ;
9
9
10
- buildPhase = ''
11
- mkdir -p {tmpbin,out}
12
-
13
- # Ad-hoc signing is required on arm64 macOS, this fixes it (not sure why
14
- # the dart derivation doesn't provide it)
15
- ${ if stdenv . isDarwin then ''
16
- ln -s /usr/bin/codesign tmpbin/codesign
17
- '' else "" }
18
-
19
- PATH="./tmpbin:$PATH" dart compile exe day22.dart -o out/day22
20
- '' ;
21
-
22
10
installPhase = ''
23
- mkdir -p $out/bin
24
- cp out/day22 $out/bin
11
+ mkdir -p $out/{bin,share}
12
+ cp day22.dart $out/share
13
+
14
+ cat <<EOF > $out/bin/day22
15
+ exec "${ dart . outPath } /bin/dart" run "\$(dirname "\$0")/../share/day22.dart" "\$@"
16
+ EOF
17
+ chmod +x $out/bin/day22
25
18
'' ;
26
19
}
You can’t perform that action at this time.
0 commit comments