on master help sign in
Add extra targets

Lots of things need bash and coreutils to be available.

commit31d7b8f4bbf544470c4348296d87e1aadea81b3e authorMatthew Bauer <mjbauer95@gmail.com> dateMon 8 May 2017, 00:03 (9 years ago) parentffb2de5
2 files changed+8−7
AppRun.c+1−1 appdir.nix+7−6
AppRun.c+1−1
@@ -252,8 +252,8 @@ int main(int argc, char *argv[]) {
252252 LOAD_ENV_VAR(XDG_SESSION_ID);
253253 LOAD_ENV_VAR(XDG_SEAT);
254254
255− setenv("PATH", "", 1);
256255 setenv("HOME", "/", 1);
256+ setenv("PATH", ENV_PATH, 1);
257257 setenv("TMPDIR", "/tmp", 1);
258258
259259 /* Run */
appdir.nix+7−6
@@ -1,14 +1,14 @@
1−{ stdenv, fetchurl, perl, pathsFromGraph, fetchFromGitHub, musl }:
1+{ stdenv, fetchurl, perl, pathsFromGraph, fetchFromGitHub, musl, coreutils, bash }:
22
33let
4− AppRun = stdenv.mkDerivation {
4+ AppRun = targets: stdenv.mkDerivation {
55 name = "AppRun";
66
77 phases = [ "buildPhase" "installPhase" "fixupPhase" ];
88
99 buildPhase = ''
1010 CC="${musl}/bin/musl-gcc -O2 -Wall -Wno-deprecated-declarations -Wno-unused-result -static"
11− $CC ${./AppRun.c} -o AppRun
11+ $CC ${./AppRun.c} -o AppRun -DENV_PATH='"${stdenv.lib.makeBinPath targets}"'
1212 '';
1313
1414 installPhase = ''
@@ -19,9 +19,10 @@ let
1919
2020in
2121
22− { target, name }: stdenv.mkDerivation {
22+ { target, name, extraTargets ? [ coreutils bash ] }: let targets = ([ target ] ++ extraTargets);
23+ in stdenv.mkDerivation {
2324 name = "${name}.AppDir";
24− exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) [ target ];
25+ exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) targets;
2526 nativeBuildInputs = [ perl ];
2627 buildCommand = ''
2728 # TODO use symlinks to shrink output size
@@ -75,6 +76,6 @@ in
7576 fi
7677 fi
7778
78− cp ${AppRun}/bin/AppRun AppRun
79+ cp ${AppRun targets}/bin/AppRun AppRun
7980 '';
8081 }