[136753] trunk/dports/devel/tup

ryandesign at macports.org ryandesign at macports.org
Mon May 25 18:56:15 PDT 2015


Revision: 136753
          https://trac.macports.org/changeset/136753
Author:   ryandesign at macports.org
Date:     2015-05-25 18:56:15 -0700 (Mon, 25 May 2015)
Log Message:
-----------
tup: fix build on Yosemite and later (#47824); ensure we're UsingTheRightCompiler and -arch flags; use xinstall instead of file copy in destroot; take over as maintainer

Modified Paths:
--------------
    trunk/dports/devel/tup/Portfile

Added Paths:
-----------
    trunk/dports/devel/tup/files/
    trunk/dports/devel/tup/files/patch-build.sh.diff
    trunk/dports/devel/tup/files/patch-readlinkat.diff

Modified: trunk/dports/devel/tup/Portfile
===================================================================
--- trunk/dports/devel/tup/Portfile	2015-05-26 01:51:11 UTC (rev 136752)
+++ trunk/dports/devel/tup/Portfile	2015-05-26 01:56:15 UTC (rev 136753)
@@ -7,8 +7,9 @@
 github.setup        gittup tup 0.7.1 v
 revision            1
 categories          devel
-maintainers         nomaintainer
 platforms           macosx
+maintainers         ryandesign openmaintainer
+
 description         A build system with amazingly fast incremental build cycle
 
 long_description    \
@@ -25,16 +26,23 @@
 checksums           rmd160  6233ec9e861483d5d2d80a55121bf99a06939121 \
                     sha256  c697e374194011c3c44d5c829cb776afa5cfd0421e419845464d36775efc1dba
 
-build.cmd           ./build.sh
-build.env-append    TUP_LABEL=${version}
+depends_build       port:pkgconfig
 
-depends_build       port:pkgconfig
 depends_lib         port:osxfuse \
                     port:libiconv
 
-use_configure no
+patchfiles          patch-build.sh.diff \
+                    patch-readlinkat.diff
 
+use_configure       no
+
+build.cmd           ./build.sh
+build.env-append    CC=${configure.cc} \
+                    CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
+                    LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]" \
+                    TUP_LABEL=${version}
+
 destroot {
-    file copy ${worksrcpath}/build/tup ${destroot}${prefix}/bin
-    file copy ${worksrcpath}/tup.1 ${destroot}${prefix}/share/man/man1/
+    xinstall -m 0755 ${worksrcpath}/build/tup ${destroot}${prefix}/bin/
+    xinstall -m 0644 ${worksrcpath}/tup.1 ${destroot}${prefix}/share/man/man1/
 }

Added: trunk/dports/devel/tup/files/patch-build.sh.diff
===================================================================
--- trunk/dports/devel/tup/files/patch-build.sh.diff	                        (rev 0)
+++ trunk/dports/devel/tup/files/patch-build.sh.diff	2015-05-26 01:56:15 UTC (rev 136753)
@@ -0,0 +1,32 @@
+--- build.sh.orig	2013-12-22 18:03:32.000000000 -0600
++++ build.sh	2015-05-25 20:52:59.000000000 -0500
+@@ -3,10 +3,9 @@
+ label=${TUP_LABEL:-bootstrap}
+ os=`uname -s`
+ plat_cflags="`pkg-config fuse --cflags`"
+-plat_ldflags="`pkg-config fuse --libs`"
++plat_ldflags="`pkg-config fuse --libs` -lm"
+ plat_files=""
+-LDFLAGS="-lm"
+-CC=gcc
++: ${CC:=gcc}
+ case "$os" in
+ 	Linux)
+ 	plat_files="$plat_files ../src/compat/dummy.c"
+@@ -37,7 +36,6 @@
+ 	plat_cflags="$plat_cflags -include ../src/compat/macosx.h"
+ 	plat_cflags="$plat_cflags -DAT_SYMLINK_NOFOLLOW=0x100"
+ 	plat_cflags="$plat_cflags -DAT_REMOVEDIR=0x200"
+-	CC=clang
+ 	;;
+ 	FreeBSD)
+ 	plat_files="$plat_files ../src/compat/dummy.c"
+@@ -77,7 +75,7 @@
+ $CC $CFLAGS -c ../src/sqlite3/sqlite3.c -DSQLITE_TEMP_STORE=2 -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION $plat_cflags
+ 
+ echo "  bootstrap LD tup $LDFLAGS"
+-echo "const char *tup_version(void) {return \"$label\";}" | $CC -x c -c - -o tup_version.o
++echo "const char *tup_version(void) {return \"$label\";}" | $CC $CFLAGS -x c -c - -o tup_version.o
+ $CC *.o -o tup -lpthread $plat_ldflags $LDFLAGS
+ 
+ cd ..

Added: trunk/dports/devel/tup/files/patch-readlinkat.diff
===================================================================
--- trunk/dports/devel/tup/files/patch-readlinkat.diff	                        (rev 0)
+++ trunk/dports/devel/tup/files/patch-readlinkat.diff	2015-05-26 01:56:15 UTC (rev 136753)
@@ -0,0 +1,32 @@
+Fix build on Yosemite and later by declaring readlinkat the same way as Yosemite does
+https://github.com/gittup/tup/commit/9812548b4d3833644f0cf8f70f62628a75ffbb56
+--- src/compat/macosx.h.orig
++++ src/compat/macosx.h
+@@ -24,6 +24,7 @@
+ #include <stdlib.h>
+ #include <sys/stat.h>
+ #include <dirent.h>
++#include <unistd.h>
+ 
+ /* MacOSX 10.6 does not have *at() functions */
+ DIR *fdopendir(int fd);
+@@ -33,7 +34,7 @@ int fchownat(int dirfd, const char *pathname, uid_t owner, gid_t group, int flag
+ int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags);
+ int mkdirat(int dirfd, const char *pathname, mode_t mode);
+ int openat(int dirfd, const char *pathname, int flags, ...);
+-int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz);
++ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz);
+ int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
+ int symlinkat(const char *oldpath, int newdirfd, const char *newpath);
+ int unlinkat(int dirfd, const char *pathname, int flags);
+--- src/compat/readlinkat.c.orig
++++ src/compat/readlinkat.c
+@@ -23,7 +23,7 @@
+ #include <unistd.h>
+ #include "dir_mutex.h"
+ 
+-int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz)
++ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz)
+ {
+ 	int rc;
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150525/8f6c4052/attachment.html>


More information about the macports-changes mailing list