Commit de83df9c authored by BatteredBunny's avatar BatteredBunny
Browse files

searchix: fix darwin build

parent 9a214347
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
--- vendor/modernc.org/libc/honnef.co/go/netdb/netdb.go
+++ vendor/modernc.org/libc/honnef.co/go/netdb/netdb.go
@@ -696,7 +696,7 @@ func init() {
 	// Load protocols
 	data, err := ioutil.ReadFile("/etc/protocols")
 	if err != nil {
-		if !os.IsNotExist(err) {
+		if !os.IsNotExist(err) && !os.IsPermission(err) {
 			panic(err)
 		}
 
@@ -732,7 +732,7 @@ func init() {
 	// Load services
 	data, err = ioutil.ReadFile("/etc/services")
 	if err != nil {
-		if !os.IsNotExist(err) {
+		if !os.IsNotExist(err) && !os.IsPermission(err) {
 			panic(err)
 		}
 
+8 −1
Original line number Diff line number Diff line
@@ -31,6 +31,13 @@ buildGoModule (finalAttrs: {

  vendorHash = "sha256-yfcQgy4cQFRvtsyLHLojnJaWhle1ZR3unmaFQj8ljuw=";

  overrideModAttrs = old: {
    # netdb.go allows /etc/protocols and /etc/services to not exist and happily proceeds, but it panic()s if they exist but return permission denied.
    postBuild = ''
      patch -p0 < ${./darwin-sandbox-fix.patch}
    '';
  };

  subPackages = [ "cmd/searchix-web" ];

  tags = [ "embed" ];
@@ -45,7 +52,7 @@ buildGoModule (finalAttrs: {
    cp ${simpleCss}/simple.css frontend/static/base.css
  '';

  postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
  postInstall = ''
    $out/bin/searchix-web generate-error-page --outdir $out/share/searchix/
  '';