Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Formula/lib/libnsl.rb
Comment thread
carlocab marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Libnsl < Formula
desc "Public client interface for NIS(YP) and NIS+"
homepage "https://github.com/thkukuk/libnsl"
Expand All @@ -13,22 +13,34 @@
sha256 cellar: :any_skip_relocation, x86_64_linux: "fa7613b30e9bfe15166339d119c19115ec21f13cea259280182e0c083502ff40"
end

keg_only :shadowed_by_macos

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gettext" => :build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing a circular dependency. It's probably better to patch configure directly so that we don't need to regenerate it.

depends_on "libtool" => :build
depends_on "pkgconf" => :build
depends_on "libtirpc"
depends_on :linux

link_overwrite "include/rpcsvc"
link_overwrite "lib/libnsl.a"
link_overwrite "lib/libnsl.so"

# patch to support macos build, upstream pr ref, https://github.com/thkukuk/libnsl/pull/24
patch do
url "https://github.com/thkukuk/libnsl/commit/db614c41660fc8c06f7c4a40dd36cd82feb471d5.patch?full_index=1"
sha256 "60f4098fcb5d97fc2158e805ed8fe5936d50bfb6af57cab54a281fd9d8677b62"
end

def install
system "./configure", *std_configure_args,
"--disable-silent-rules"
system "make"
odie "check if autoreconf line can be removed" if version > "2.0.1"
system "autoreconf", "--force", "--install", "--verbose"

system "./configure", "--disable-silent-rules", *std_configure_args
system "make", "install"
end

test do

Check warning on line 43 in Formula/lib/libnsl.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew test --verbose libnsl` failed on macOS Ventura (13) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/bin/bundle clean ==> Testing libnsl ==> /usr/bin/clang test.c -I/opt/homebrew/Cellar/libnsl/2.0.1/include -L/opt/homebrew/Cellar/libnsl/2.0.1/lib -lnsl -o test test.c:7:6: error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] printf("Domain: %s\n", domain); ^ test.c:7:6: note: include the header <stdio.h> or explicitly provide a declaration for 'printf' 1 error generated. ::error::libnsl: failed An exception occurred within a child process: BuildError: Failed executing: /usr/bin/clang test.c -I/opt/homebrew/Cellar/libnsl/2.0.1/include -L/opt/homebrew/Cellar/libnsl/2.0.1/lib -lnsl -o test /opt/homebrew/Library/Homebrew/formula.rb:3118:in 'block in Formula#system' /opt/homebrew/Library/Homebrew/formula.rb:3054:in 'IO.open' /opt/homebrew/Library/Homebrew/formula.rb:3054:in 'Formula#system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Formula#_on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/lib/libnsl.rb:61:in 'block in <class:Libnsl>' /opt/homebrew/Library/Homebrew/formula.rb:2842:in 'block (3 levels) in Formula#run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:565:in 'Kernel#with_env' /opt/homebrew/Library/Homebrew/formula.rb:2841:in 'block (2 levels) in Formula#run_test' /opt/homebrew/Library/Homebrew/formula.rb:1194:in 'Formula#with_logging' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Formula#_on_method_added' /opt/homebrew/Library/Homebrew/formula.rb:2840:in 'block in Formula#run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'block in Mktemp#run' /opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'Dir.chdir' /opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'Mktemp#run' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Mktemp#_on_method_added' /opt/homebrew/Library/Homebrew/formula.rb:3180:in 'Formula#mktemp' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Formula#_on_method_added' /opt/homebrew/Library/Homebrew/formula.rb:2834:in 'Formula#run_test' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebre

Check warning on line 43 in Formula/lib/libnsl.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew test --verbose libnsl` failed on macOS Sonoma (14) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/bin/bundle clean ==> Testing libnsl ==> /usr/bin/clang test.c -I/opt/homebrew/Cellar/libnsl/2.0.1/include -L/opt/homebrew/Cellar/libnsl/2.0.1/lib -lnsl -o test test.c:7:6: error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 7 | printf("Domain: %s\n", domain); | ^ test.c:7:6: note: include the header <stdio.h> or explicitly provide a declaration for 'printf' 1 error generated. ::error::libnsl: failed An exception occurred within a child process: BuildError: Failed executing: /usr/bin/clang test.c -I/opt/homebrew/Cellar/libnsl/2.0.1/include -L/opt/homebrew/Cellar/libnsl/2.0.1/lib -lnsl -o test /opt/homebrew/Library/Homebrew/formula.rb:3118:in 'block in Formula#system' /opt/homebrew/Library/Homebrew/formula.rb:3054:in 'IO.open' /opt/homebrew/Library/Homebrew/formula.rb:3054:in 'Formula#system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Formula#_on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/lib/libnsl.rb:61:in 'block in <class:Libnsl>' /opt/homebrew/Library/Homebrew/formula.rb:2842:in 'block (3 levels) in Formula#run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:565:in 'Kernel#with_env' /opt/homebrew/Library/Homebrew/formula.rb:2841:in 'block (2 levels) in Formula#run_test' /opt/homebrew/Library/Homebrew/formula.rb:1194:in 'Formula#with_logging' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Formula#_on_method_added' /opt/homebrew/Library/Homebrew/formula.rb:2840:in 'block in Formula#run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'block in Mktemp#run' /opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'Dir.chdir' /opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'Mktemp#run' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Mktemp#_on_method_added' /opt/homebrew/Library/Homebrew/formula.rb:3180:in 'Formula#mktemp' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'T::Private::Methods::CallValidation.validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/_methods.rb:277:in 'block in Formula#_on_method_added' /opt/homebrew/Library/Homebrew/formula.rb:2834:in 'Formula#run_test' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12230/lib/types/private/methods/call_validation.rb:282:in 'UnboundMethod#bind_ca
(testpath/"test.c").write <<~'EOS'
#include <rpcsvc/ypclnt.h>

Expand Down
18 changes: 18 additions & 0 deletions Formula/lib/libtirpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class Libtirpc < Formula

depends_on "krb5"

# submitted the patch to libtirpc-devel@lists.sourceforge.net mailing list
patch :DATA

def install
ENV.append_to_cflags "-D__APPLE_USE_RFC_3542" if OS.mac?
system "./configure", "--disable-silent-rules", *std_configure_args.reject { |s| s["--disable-debug"] }
Expand All @@ -44,3 +47,18 @@ def install
system "./test"
end
end

__END__
diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
index 2e5fc0c..afde974 100644
--- a/tirpc/rpc/rpcent.h
+++ b/tirpc/rpc/rpcent.h
@@ -50,7 +50,7 @@ extern "C" {

/* These are defined in /usr/include/rpc/netdb.h, unless we are using
the C library without RPC support. */
-#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_RPC__) || !defined(__GLIBC__) && !defined(HAVE_STRUCT_RPCENT)
+#if !defined(__APPLE__) && ((defined(__UCLIBC__) && !defined(__UCLIBC_HAS_RPC__)) || (!defined(__GLIBC__) && !defined(HAVE_STRUCT_RPCENT)))

struct rpcent {
char *r_name; /* name of server for this rpc program */
Loading