Skip to content

Commit

Permalink
mpgtx: clean up this mess! In the process, support build_arch and uni…
Browse files Browse the repository at this point in the history
…versal (https://trac.macports.org/ticket/28331) and ensure we're UsingTheRightCompiler

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@75824 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
ryandesign committed Feb 9, 2011
1 parent 2fd1d5a commit ca079a3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 13 deletions.
42 changes: 29 additions & 13 deletions multimedia/mpgtx/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,38 @@ checksums md5 d628060aa04ad3b40a175bf35f5167cf \
sha1 58b3d18b6dac968e8dd969a7b33c8a8fc31569cd \
rmd160 f39704aef3e2b325d77f48817ecb883ea6a2a029

configure.args --parachute \
--manprefix=${prefix}/share

post-configure {
reinplace "s|${prefix}|${destroot}${prefix}|g" \
${worksrcpath}/Makefile
reinplace "s|/usr/local|${destroot}${prefix}/share|g" \
${worksrcpath}/Makefile
reinplace "s|cpflags=d|cpflags=R|" \
${worksrcpath}/Makefile
patchfiles patch-configure.diff

post-patch {
if {[variant_isset universal]} {
set archflags ${configure.universal_cflags}
} else {
set archflags ${configure.cc_archflags}
}
reinplace "s|@CXX@|${configure.cxx}|g" ${worksrcpath}/configure
reinplace "s|@OPTFLAGS@|${configure.optflags}|g" ${worksrcpath}/configure
reinplace "s|@CFLAGS@|${configure.cflags} ${archflags}|g" ${worksrcpath}/configure
reinplace "s|@LDFLAGS@|${configure.ldflags} ${archflags}|g" ${worksrcpath}/configure
}

build.target {}
configure.pre_args --prefix=${destroot}${prefix}

configure.args --parachute \
--manprefix=${destroot}${prefix}/share

configure.universal_args-delete --disable-dependency-tracking

build.target

post-destroot {
file mkdir ${destroot}${prefix}/share/doc/${name}
file copy ${worksrcpath}/AUTHORS ${worksrcpath}/README \
xinstall -d ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 -W ${worksrcpath} AUTHORS README \
${destroot}${prefix}/share/doc/${name}
}

platform darwin {
patchfiles-append patch-bsd.diff
}
platform freebsd {
patchfiles-append patch-bsd.diff
}
12 changes: 12 additions & 0 deletions multimedia/mpgtx/files/patch-bsd.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
BSD cp doesn't support "-d" to preserve symlinks, but "-R" does the same.
--- configure.orig 2005-01-02 15:19:23.000000000 -0600
+++ configure 2011-02-09 15:34:24.000000000 -0600
@@ -29,7 +29,7 @@
LFS="yes"

# cp flags
-cpflags="d"
+cpflags="R"

# some stuff for MacOSX -----------------------------
HOSTNAME=`./config.guess`
24 changes: 24 additions & 0 deletions multimedia/mpgtx/files/patch-configure.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- configure.orig 2005-01-02 15:19:23.000000000 -0600
+++ configure 2011-02-09 15:34:24.000000000 -0600
@@ -9,17 +9,17 @@
prefix="/usr/local"
manprefix='$(PREFIX)'
#compiler flags
-CC="g++"
-common_cflags="-Wall"
+CC="@CXX@"
+common_cflags="-Wall @CFLAGS@"
devel_cflags="-g -Werror -fno-builtin"
-optimization_cflags="-O3"
+optimization_cflags="@OPTFLAGS@"
release_cflags=$optimization_cflags
OFLAGS="-ansi"
cflags=$common_cflags

#linker flags

-lflags=""
+lflags="@LDFLAGS@"

#state vars
debug="no"

0 comments on commit ca079a3

Please sign in to comment.