-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.nix
29 lines (24 loc) · 1.19 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
let
pkgsNix = import ./nix/pkgs.nix;
pkgsNative = pkgsNix.native;
pkgsRaspberryPi = pkgsNix.crossRpi;
pkgsArmv7l = pkgsNix.crossArmv7l;
hsApp = import ./default.nix;
appNative = hsApp { pkgs = pkgsNative; };
appCrossRaspberryPi = hsApp { pkgs = pkgsRaspberryPi; };
appCrossArmv7l = hsApp { pkgs = pkgsArmv7l; };
patchForNotNixLinux = {app, name}:
pkgsNative.runCommand "${app.name}-patched" { } ''
set -eu
cp ${app}/bin/${name} $out
chmod +w $out
${pkgsNative.patchelf}/bin/patchelf --set-interpreter /lib/ld-linux-armhf.so.3 --set-rpath /lib:/usr/lib $out
chmod -w $out
'';
in {
native = appNative.cross-haskell-app.components.exes.cross-haskell-app-exe;
raspberry-pi = appCrossRaspberryPi.cross-haskell-app.components.exes.cross-haskell-app-exe;
raspberry-pi-patched = patchForNotNixLinux { app = appCrossRaspberryPi.cross-haskell-app.components.exes.cross-haskell-app-exe; name ="cross-haskell-app-exe"; };
armv7l = appCrossArmv7l.cross-haskell-app.components.exes.cross-haskell-app-exe;
armv7l-patched = patchForNotNixLinux { app = appCrossArmv7l.cross-haskell-app.components.exes.cross-haskell-app-exe; name ="cross-haskell-app-exe"; };
}