[MacPorts] howto/PatchLocal modified

MacPorts Wiki noreply at macports.org
Wed Dec 2 21:10:15 UTC 2020


Page "howto/PatchLocal" was changed by bernstei
Diff URL: <https://trac.macports.org/wiki/howto/PatchLocal?action=diff&version=8>
Revision 8
Comment: add a few missing steps needed for dealing with the renamed ("-devel") port name.
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: howto/PatchLocal
=========================================================================
--- howto/PatchLocal (version: 7)
+++ howto/PatchLocal (version: 8)
@@ -23,13 +23,19 @@
 }}}
 Create the port's category directory (using port "arb" as an example):
 {{{
-PORT_CATEGORY=`port dir arb | awk -F\/ '{ print $(NF-1) }'`
+port=arb
+PORT_CATEGORY=`port dir ${port} | awk -F\/ '{ print $(NF-1) }'`
 mkdir /usr/local/ports/$PORT_CATEGORY
 cd /usr/local/ports/$PORT_CATEGORY
-cp -r `port dir arb` .
-mv arb arb-devel
-# edit arb-devel/Portfile and replace "name arb" with "name arb-devel"
-cd arb-devel
+cp -r `port dir ${port}` .
+mv ${port} ${port}-devel
+# edit ${port}-devel/Portfile and replace "name arb" with "name arb-devel", and 
+#   create two new lines, one defining "distname arb-${version}", overriding the 
+#   default of ${name}-${version}, and one defining "dist_subdir arb",
+#   overriding the default of ${name}, otherwise the fetch  will fail to 
+#   find the distfile, because it will be including the "-devel" as part of 
+#   the path and distfile on the mirror site
+cd ${port}-devel
 port lint # to check for problems
 }}}
 
@@ -46,8 +52,8 @@
 === Step 2: '''Get your port's sourcecode''' ===
 
 {{{
-port patch arb-devel
-cd `port work arb-devel`
+port patch ${port}-devel
+cd `port work ${port}-devel`
 }}}
 
 === Step 3: '''Modify the source with your patch''' ===
@@ -62,21 +68,24 @@
 
 See http://guide.macports.org/#development.patches.source
 {{{
-diff -u Makefile.orig Makefile > `port dir arb-devel`/files/patch-ARB-makefile2.diff
-port edit arb-devel # (add the patch-ARB-makefile2.diff file to the list of patches)
+diff -u Makefile.orig Makefile > `port dir ${port}-devel`/files/patch-ARB-makefile2.diff
+port edit ${port}-devel # (add the patch-ARB-makefile2.diff file to the list of patches)
 }}}
 
 === Step 5: '''Test the modified port''' ===
 
 {{{
-port clean arb-devel
-port build arb-devel
+# leave work dir to ensure that the port clean isn't trying to remove an in-use 
+# directory and make the build fail
+cd /usr/local/ports 
+port clean ${port}-devel
+port build ${port}-devel
 }}}
 
 === Step 6: '''Make it real''' ===
 
 {{{
-port -s install arb-devel
+port -s install ${port}-devel
 }}}
 
 [wiki:howto <- Back to the HOWTO section]
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/howto/PatchLocal>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'howto/PatchLocal' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list