Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmake: init at 20121212 #63181

Merged
merged 1 commit into from Jun 16, 2019
Merged

Conversation

thoughtpolice
Copy link
Member

@thoughtpolice thoughtpolice commented Jun 16, 2019

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS

Signed-off-by: Austin Seipp <as@fastly.com>
@thoughtpolice
Copy link
Member Author

@GrahamcOfBorg build bmake

@thoughtpolice thoughtpolice merged commit ebb3f4d into NixOS:master Jun 16, 2019
@thoughtpolice thoughtpolice deleted the nixpkgs/add-bmake branch June 16, 2019 05:46
@jameysharp
Copy link
Contributor

I had a local bmake recipe that I think has some advantages which could be merged in here. I found a stable versioned URL for the source, for one thing, and I think you used the wrong version number.

Also, you don't need to explicitly depend on gnugrep or coreutils, do you? I thought stdenv just always pulled those in. And I used the getopt from unixtools in hopes that this might build on non-Linux too, although I didn't test it anywhere except on NixOS, so I dunno if that helped.

stdenv.mkDerivation rec { 
  name = "bmake-${version}";
  version = "20181221";

  src = fetchurl { 
    url = "http://www.crufty.net/ftp/pub/sjg/${name}.tar.gz";
    sha256 = "0zp6yy27z52qb12bgm3hy1dwal2i570615pqqk71zwhcxfs4h2gw";
  };

  nativeBuildInputs = [ unixtools.getopt ];

  patches = [ ./bmake-bootstrap.patch ./bmake-tests.patch ];
}

I was hoping the two patches would be accepted upstream, although I didn't try to submit them anywhere.

bmake-bootstrap.patch was as follows:

--- bmake/make-bootstrap.sh.in.orig     2019-02-19 10:55:21.733606117 -0800
+++ bmake/make-bootstrap.sh.in  2019-02-19 10:56:02.150771541 -0800
@@ -4,6 +4,7 @@
 
 srcdir=@srcdir@
 
+prefix="@prefix@"
 DEFAULT_SYS_PATH="@default_sys_path@"
 
 case "@use_meta@" in

I don't remember why I thought it was important to set prefix there, but I think it made bmake work when not using the -r flag, maybe?

And bmake-tests.patch was an alternative to entirely disabling the unexport-env test:

--- bmake/unit-tests/unexport-env.mk.orig       2019-02-19 10:24:14.356713136 -0800
+++ bmake/unit-tests/unexport-env.mk    2019-02-19 10:25:43.838775388 -0800
@@ -3,8 +3,8 @@
 # pick up a bunch of exported vars
 .include "export.mk"
 
-# an example of setting up a minimal environment.
-PATH = /bin:/usr/bin:/sbin:/usr/sbin
+# preserve PATH so commands used in the "all" target are still available
+PATH := ${PATH}
 
 # now clobber the environment to just PATH and UT_TEST
 UT_TEST = unexport-env

@thoughtpolice
Copy link
Member Author

thoughtpolice commented Jun 16, 2019

@jameysharp ccee411 fixes all of this and is now in master. Thanks for the feedback!

Also, you're right, gnugrep and coreutils weren't needed; I think I left that as an artifact of testing something while I authored the first draft privately.

getopt or unixtools.getopt should both work fine I think and are portable enough; e.g. getopt was building OK on Darwin recently, though the builders are somewhat sick it seems.

Tested this by building libfsm from #63229.

thoughtpolice pushed a commit that referenced this pull request Jun 16, 2019
As noted by @jameysharp in #63181.

Signed-off-by: Austin Seipp <as@fastly.com>
bartoldeman pushed a commit to ComputeCanada/nixpkgs that referenced this pull request Feb 3, 2020
As noted by @jameysharp in NixOS#63181.

Signed-off-by: Austin Seipp <as@fastly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants