Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F155256889
D8315.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8315.diff
View Options
Index: Mk/Uses/shebangfix.mk
===================================================================
--- Mk/Uses/shebangfix.mk
+++ Mk/Uses/shebangfix.mk
@@ -8,6 +8,10 @@
# Feature: shebangfix
# Usage: USES=shebangfix
#
+# SHEBANG_REGEX a regular expression to match files that needs to be converted
+# SHEBANG_FILES list of files or glob pattern relative to ${WRKSRC}
+# SHEBANG_GLOB list of glob pattern find(1) will match with
+#
# To specify that ${WRKSRC}/path1/file and all .pl files in ${WRKSRC}/path2
# should be processed:
#
@@ -75,7 +79,19 @@
_USES_patch+= 210:fix-shebang
fix-shebang:
+.if defined(SHEBANG_REGEX)
+ @cd ${WRKSRC}; \
+ ${FIND} -E . -type f -iregex '${SHEBANG_REGEX}' \
+ -exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} +
+.elif defined(SHEBANG_GLOB)
+.for f in ${SHEBANG_GLOB}
+ @cd ${WRKSRC}; \
+ ${FIND} . -type f -name '${f}' \
+ -exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} +
+.endfor
+.else
@cd ${WRKSRC}; \
${ECHO_CMD} ${SHEBANG_FILES} | ${XARGS} ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS}
+.endif
.endif
Index: math/mosesdecoder/Makefile
===================================================================
--- math/mosesdecoder/Makefile
+++ math/mosesdecoder/Makefile
@@ -23,16 +23,10 @@
GH_ACCOUNT= moses-smt
USES= compiler:c++11-lang shebangfix
-SHEBANG_FILES= scripts/analysis/weight-scan-summarize.sh \
- scripts/training/wrappers/adam-suffix-array/suffix-array-extract.sh \
- scripts/training/wrappers/adam-suffix-array/suffix-array-create.sh
+SHEBANG_REGEX= ./scripts/.*\.(sh|pl|perl|cgi)
MAKE_ENV+= BOOST_BUILD_PATH=${WRKSRC}/jam-files/boost-build
-post-patch:
- @${FIND} ${WRKSRC}/scripts \( -name "*.pl" -o -name "*.perl" -o -name "*.cgi" \) -exec \
- ${REINPLACE_CMD} -i '' -e '1s|/usr/bin/perl|${perl_CMD}|' {} \;
-
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} bjam --with-boost=${LOCALBASE} --with-irstlm=${LOCALBASE} --with-randlm=${LOCALBASE} --without-tcmalloc --notrace --toolset=${CHOSEN_COMPILER_TYPE} debug-symbols=off ${_MAKE_JOBS}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 3, 5:21 PM (22 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32631933
Default Alt Text
D8315.diff (1 KB)
Attached To
Mode
D8315: Add SHEBANG_REGEX and SHEBANG_GLOB, similar as the DOS2UNIX ones.
Attached
Detach File
Event Timeline
Log In to Comment