Skip to content

Commit

Permalink
Simplify manifest: let gir2swift do sed/awk post-processing
Browse files Browse the repository at this point in the history
  • Loading branch information
rhx committed Jul 25, 2021
1 parent 207fb36 commit dd0170c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
6 changes: 1 addition & 5 deletions gir-to-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ if [ ! -e "${GIR}" ] ; then
echo "and can be found in /usr /usr/local or by pkg-config!"
exit 1
fi
gir2swift -o Sources/${Mod} -m ${Module}.module -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GModule-2.0.gir -p ${GIR_DIR}/Gio-2.0.gir "${GIR}"
for src in Sources/${Mod}/*-*.swift ; do
sed -f ${Module}.sed < ${src} > ${src}.out
mv ${src}.out ${src}
done
exec gir2swift -o Sources/${Mod} -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GModule-2.0.gir -p ${GIR_DIR}/Gio-2.0.gir "${GIR}"
7 changes: 1 addition & 6 deletions gir2swift-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ function generate_arg-path_arg-g2s-exec_arg-gir-pre_arg-gir-path {
local NAME=$(package_name)
local GIR_PRE_ARGS=`for FILE in ${GIR_PRE}; do echo -n "-p ${GIR_PATH}/${FILE}.gir "; done`

bash -c "${G2S_EXEC} -o Sources/${NAME} -m ${GIR_NAME}.module ${GIR_PRE_ARGS} ${GIR_PATH}/${GIR_NAME}.gir"

for src in Sources/${NAME}/*-*.swift ; do
sed -f ${GIR_NAME}.sed < ${src} > ${src}.out
mv ${src}.out ${src}
done
bash -c "${G2S_EXEC} -o Sources/${NAME} ${GIR_PRE_ARGS} ${GIR_PATH}/${GIR_NAME}.gir"

cd $CALLER
}
Expand Down

0 comments on commit dd0170c

Please sign in to comment.