1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Editing the the sources of a port before installation

Discussion in 'Installation and Maintenance of Ports or Packages' started by Michael-Sanders, Feb 1, 2012.

  1. Michael-Sanders

    Michael-Sanders New Member

    Messages:
    41
    Thanks Received:
    7
    Question: What is the preferred method of modifying the sources of a given third party package before its installed? Allow me to clarify.

    After installing Midnight Commander: sudo pkg_add -r mc

    I found the package suffered from an ftp issue I sought to fix. I next removed mc, installed its port sources and after some wrestling with make patched the sources and installed the modified version successfully.

    (Please bear with me here, I'm new to FreeBSD and am attempting to describe the problem using proper nomenclature).

    If one needs to edit the sources of a port, yet one can only invoke make (that I'm currently aware of) to start the build process, how is it possible to first edit, then build a port's sources?

    If my case to solve this, I invoked make followed by CTRL-C to disrupt the build process, edited the necessary file, then ran make again. But I'm thinking I've approached things the hard way when a better, more streamlined solution likely exists.
     
  2. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,765
    Thanks Received:
    1,870
    See the TARGETS in ports(7). There's much more you can do with make other than starting the build.
     
    Michael-Sanders thanks for this.
  3. Michael-Sanders

    Michael-Sanders New Member

    Messages:
    41
    Thanks Received:
    7
  4. phoenix

    phoenix Moderator Staff Member Moderator

    Messages:
    3,446
    Thanks Received:
    769
    Michael-Sanders thanks for this.
  5. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,622
    Thanks Received:
    2,384
    You basically want to do these:
    Code:
    make fetch     # fetches the distfile
    make extract   # extracts the distfile into the work directory
    make patch     # applies any specific FreeBSD patches
    make configure # runs ./configure
    


    After that you could edit the sources in the work directory. Once finished you can continue with the install.
     
    drhowarddrfine and Michael-Sanders thanked for this.
  6. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,704
    Thanks Received:
    2,269
    But because this is make[(1), earlier steps are done automatically. In other words, make patch is equivalent to make fetch extract patch.