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

movgrab 3.1.2 #49738

Closed
wants to merge 1 commit into from
Closed

Conversation

EricFromCanada
Copy link
Member

Created with brew bump-formula-pr.

@mistydemeo
Copy link
Member

Build failed, mostly from getxattr-related failures:

FileSystem.c:240:33: error: too few arguments to function call, expected 6, have 4
len=getxattr(Path, Name, NULL, 0);
    ~~~~~~~~                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/xattr.h:61:1: note: 'getxattr' declared here
ssize_t getxattr(const char *path, const char *name, void *value, size_t size, u_int32_t position, int options);
^
FileSystem.c:244:34: error: too few arguments to function call, expected 6, have 4
        getxattr(Path, Name, RetStr, len);
        ~~~~~~~~                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/xattr.h:61:1: note: 'getxattr' declared here
ssize_t getxattr(const char *path, const char *name, void *value, size_t size, u_int32_t position, int options);
^
FileSystem.c:259:42: error: too few arguments to function call, expected 6, have 5
return(setxattr(Path, Name, Value, Len, 0));
       ~~~~~~~~                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/xattr.h:65:1: note: 'setxattr' declared here
int setxattr(const char *path, const char *name, const void *value, size_t size, u_int32_t position, int options);
^
FileSystem.c:410:10: error: expected ';' after expression
result=-1
         ^
         ;
4 errors generated.
make[1]: *** [FileSystem.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

Looks like this is an incompatibility between the macOS and Linux functions of the same name. Neither version is POSIX.

@mistydemeo
Copy link
Member

mistydemeo commented Feb 3, 2020

Looked into this. I've got patches to fix the issues; I think the getxattr one is the only one that hasn't already been fixed upstream. I'll report it later.

diff --git a/Formula/movgrab.rb b/Formula/movgrab.rb
index 4e9ab45b40..c287658a27 100644
--- a/Formula/movgrab.rb
+++ b/Formula/movgrab.rb
@@ -16,6 +16,19 @@ class Movgrab < Formula
   end
 
   def install
+    # libUseful's configure script incorrectly detects macOS's getxattr functions,
+    # expecting them to be functionally equivalent to Linux's. They're not!
+    ENV["ac_cv_lib_c_getxattr"] = "no"
+    ENV["ac_cv_lib_c_setxattr"] = "no"
+
+    # Can you believe this? A forgotten semicolon! Probably got missed because it's
+    # behind a conditional #ifdef.
+    inreplace "libUseful-2.8/FileSystem.c", "result=-1", "result=-1;"
+
+    # Later versions of libUseful handle the fact that setresuid is Linux-only, but
+    # this one does not. https://github.com/ColumPaget/Movgrab/blob/master/libUseful/Process.c#L95-L99
+    inreplace "libUseful-2.8/Process.c", "setresuid(uid,uid,uid)", "setreuid(uid,uid)"
+
     system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
     system "make"
 

@mistydemeo
Copy link
Member

ColumPaget/libUseful#1

@EricFromCanada
Copy link
Member Author

Neat. I've also found a way to enable SSL using libressl, which slightly increases the number of sites that the released version works with (cf. ColumPaget/Movgrab#3).

@chenrui333 chenrui333 added the ready to merge PR can be merged once CI is green label Feb 4, 2020
@chenrui333 chenrui333 closed this in 0f24d9d Feb 4, 2020
@EricFromCanada EricFromCanada deleted the movgrab-3.1.2 branch February 4, 2020 20:11
@lock lock bot added the outdated PR was locked due to age label Mar 10, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age ready to merge PR can be merged once CI is green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants