DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 14th August 2008
shep shep is offline
ISO Quartermaster
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 631
Thanked 9 Times in 9 Posts
Default Change Makefile options in ports

AMD64 FreeBSD 7 stable

Recently ffmpeg added back the swscaler (software scaler) which broke the VLC port. Other than directly editing the Makefile in /usr/ports/multimedia/ffmpeg is there a way I can pass "--disable-swscale" when I invoke "make install clean" in /usr/ports/multimedia/ffmpeg ?

I am a little nervous about directly editing Makefile.
Reply With Quote
  #2   (View Single Post)  
Old 15th August 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Thanked 4 Times in 10 Posts
Default

usually if you wanted to make permanent configurations to a port you'd edit /usr/local/etc/pkgtools.conf however in this circumstance that's not going to work and if it were to work it'd be incorrect.

What i suggest you do is create a patch and submit it to the port maintainer. Here is the patch if you're interested in using it ( i haven't tested this ):

Quote:
--- Makefile 2008-08-15 17:44:03.000000000 +0000
+++ Makefile.new 2008-08-15 17:43:50.000000000 +0000
@@ -72,7 +72,8 @@
--extra-libs="${PTHREAD_LIBS}" \
--enable-gpl \
--enable-pthreads \
- --mandir=${PREFIX}/man
+ --mandir=${PREFIX}/man \
+ --disable-swscale
CONFIGURE_ENV+= LANG=C
MAKE_ENV+= INSTALL="${INSTALL}"
SHLIB_VER= 1
__________________
"No, that's wrong, Cartman. But don't worry, there are no stupid answers, just stupid people." -- Mr. Garrison

Forum Netiquette
Reply With Quote
  #3   (View Single Post)  
Old 15th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,088
Thanked 198 Times in 156 Posts
Default

You don't need a patch, and /usr/local/etc/pkgtools.conf only works for portupgrade and family, several more portable solutions would be:

At the commandline you can just use:
# make CONFIGURE_ARGS=--disable-swscale

And you can of course put this in /etc/make.conf:
Code:
.if ${.CURDIR:M*/multimedia/ffmpeg}
CONFIGURE_ARGS=--disable-swscale
.endif
Or in /usr/ports/multimedia/ffmpeg/Makefile.local:
Code:
CONFIGURE_ARGS+=--disable-swscale
@corey_james, I think you have an old reversion of the port? The current revision (1.87) explicitly enables swscale in the CONFIGURE_ARGS...
In any case, using OPTIONS would be better anyway...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #4   (View Single Post)  
Old 16th August 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Thanked 36 Times in 34 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
At the commandline you can just use:
# make CONFIGURE_ARGS=--disable-swscale

And you can of course put this in /etc/make.conf:
Code:
.if ${.CURDIR:M*/multimedia/ffmpeg}
CONFIGURE_ARGS=--disable-swscale
.endif
Either of these options would end up overriding all other CONFIGURE_ARGS set in the Makefile. You would need to redefine all of them on the commandline or in make.conf which isn't practical.

Quote:
Originally Posted by Carpetsmoker View Post
Or in /usr/ports/multimedia/ffmpeg/Makefile.local:
Code:
CONFIGURE_ARGS+=--disable-swscale
This would work, but you would still need to add:
Code:
.include "Makefile.local"
to the end of the Makefile.

In short, it is probably just easier to edit the Makefile since that line will be obliterated the next time you update your ports tree.
Reply With Quote
  #5   (View Single Post)  
Old 16th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,088
Thanked 198 Times in 156 Posts
Default

Quote:
Either of these options would end up overriding all other CONFIGURE_ARGS set in the Makefile. You would need to redefine all of them on the commandline or in make.conf which isn't practical.
Hm?
No they won't, make.conf is sourced before the Makefile (See /usr/share/mk/sys.mk), Makefile.local is sourced after the Makefile (Which is why Makefile.local uses +=), commandline arguments are also read before the Makefile ... So it won't override anything.

Quote:
This would work, but you would still need to add:
Code:
.include "Makefile.local"
to the end of the Makefile.
No, Makefile.local is added automatically, as are several other Makefiles, see /usr/ports/Mk/bsd.port.mk line 1205

Trust me, it works as I said it does .... But don't take my word for it, try it out your self .
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 18th August 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Thanked 36 Times in 34 Posts
Default

Well, let's see:

Here are the default CONFIGURE_ARGS for ffmpeg:
Code:
# cd /usr/ports/multimedia/ffmpeg
# make configure
*SNIP*
# less work/ffmpeg-2008-07-27/config.err
# ./configure --cc=cc --prefix=/usr/local --disable-debug
--enable-memalign-hack --enable-shared --enable-postproc
--extra-cflags=-I/usr/local/include/vorbis -msse -I/usr/local/include
--extra-ldflags=-L/usr/local/lib -la52 --extra-libs=-pthread --enable-gpl
--enable-pthreads --enable-swscale --mandir=/usr/local/man
--enable-liba52 --enable-liba52bin --disable-libfaac --enable-libfaad
--enable-libfaadbin --disable-libamr-nb --disable-libamr-wb --disable-libgsm
--disable-libmp3lame --disable-ffplay --enable-libtheora --enable-libvorbis
--enable-libx264 --disable-libxvid
* SNIP *
# make clean
If I add to /etc/make.conf:
Code:
.if ${.CURDIR:M*/multimedia/ffmpeg}
CONFIGURE_ARGS=--disable-swscale
.endif
Code:
# make configure
* SNIP *
# less work/ffmpeg-2008-07-27/config.err
# ./configure --disable-swscale --cc=cc --prefix=/usr/local --disable-debug
--enable-memalign-hack --enable-shared --enable-postproc
--extra-cflags=-I/usr/local/include/vorbis -msse -I/usr/local/include
--extra-ldflags=-L/usr/local/lib -la52 --extra-libs=-pthread --enable-gpl
--enable-pthreads --enable-swscale --mandir=/usr/local/man --enable-liba52
--enable-liba52bin --disable-libfaac --enable-libfaad --enable-libfaadbin
--disable-libamr-nb --disable-libamr-wb --disable-libgsm --disable-libmp3lame
--disable-ffplay --enable-libtheora --enable-libvorbis --enable-libx264
--disable-libxvid
# make clean
Here, --disable-swscale is prepended to the CONFIGURE_ARGS. Since it comes before the --enable-swscale already defined, it will be ignored. I assumed this would behave like the commandline, so I was wrong about that.

Here they are with the commandline argument after removing the code from /etc/make.conf:
Code:
# make CONFIGURE_ARGS=--disable-swscale configure
*SNIP*
# less work/ffmpeg-2008-07-27/config.err
# ./configure --disable-swscale
*SNIP *
# make clean
All of the CONFIGURE_ARGS defined in the Makefile were overridden.

Now with Makefile.local:
Code:
# echo "CONFIGURE_ARGS+=--disable-swscale" > Makefile.local
# make configure
* SNIP *
# less work/ffmpeg-2008-07-27/config.err
# ./configure --disable-swscale --cc=cc --prefix=/usr/local --disable-debug
--enable-memalign-hack --enable-shared --enable-postproc 
--extra-cflags=-I/usr/local/include/vorbis -msse -I/usr/local/include
--extra-ldflags=-L/usr/local/lib -la52 --extra-libs=-pthread --enable-gpl
--enable-pthreads --enable-swscale --mandir=/usr/local/man --enable-liba52
--enable-liba52bin --disable-libfaac --enable-libfaad --enable-libfaadbin 
--disable-libamr-nb --disable-libamr-wb --disable-libgsm --disable-libmp3lame
--disable-ffplay --enable-libtheora --enable-libvorbis --enable-libx264 
--disable-libxvid
*SNIP*
Again, --disable-swscale is prepended to the CONFIGURE_ARGS and will be ignored.

Honestly, I think the best way to deal with this is submit a bug report and/or email the ffmpeg maintainer since this is apparently breaking another port.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
${REINPLACE_CMD} on Makefile indiocolifa FreeBSD Ports and Packages 3 26th March 2009 11:16 PM
Makefile Problem BadWolf Programming 4 15th March 2009 01:58 PM
Change compile options for a determined port Treppiede FreeBSD Ports and Packages 4 5th October 2008 05:59 AM
ports config and makefile scripting boincv FreeBSD Ports and Packages 6 1st October 2008 07:57 AM
First Post.. Woot!! --- An obvious Makefile question..? roundkat OpenBSD Packages and Ports 2 2nd May 2008 03:05 PM


All times are GMT. The time now is 10:22 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick