1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-27 15:50:10 +01:00

Cleanup Mac build and subdirectory

This commit is contained in:
Leland Lucius
2015-07-21 18:45:35 -05:00
parent 2b895267e6
commit 582ee7b45e
14 changed files with 195 additions and 953 deletions

72
mac/scripts/build_dist.sh Executable file
View File

@@ -0,0 +1,72 @@
set -x
# Setup
VERSION=`awk '/^#define+ AUDACITY_VERSION / {print $3}' build/Info.plist.h`
RELEASE=`awk '/^#define+ AUDACITY_RELEASE / {print $3}' build/Info.plist.h`
REVISION=`awk '/^#define+ AUDACITY_REVISION / {print $3}' build/Info.plist.h`
VERSION=$VERSION.$RELEASE.$REVISION
cd "${DSTROOT}"
chmod -RH "${INSTALL_MODE_FLAG}" "${TARGET_BUILD_DIR}"
chown -RH "${INSTALL_OWNER}:${INSTALL_GROUP}" "${TARGET_BUILD_DIR}"
echo "Audacity has been installed to: ${DSTROOT}"
cd ..
VOL="Audacity $VERSION"
DMG="audacity-macosx-$VERSION"
# Preclean
rm -rf "$DMG" "$DMG.dmg" TMP.dmg
# Create structure
mkdir "$DMG"
cp -pR "${DSTROOT}/" "${DMG}"
#Add a custom icon for the DMG
#cp -p mac/Resources/Audacity.icns "${DMG}"/.VolumeIcon.icns
# Create and mount the image
hdiutil create -ov -format UDRW -srcdir "$DMG" -fs HFS+ -volname "$VOL" TMP.dmg
#Mount the DMG and store the name it was mounted with
TITLE=`hdiutil attach TMP.dmg | grep \/Volumes | sed "s/^.*\/Volumes\///"`
#Set the custom icon flag
#SetFile -a C /Volumes/"$TITLE"
#Make our DMG look pretty and install the custom background image
echo '
tell application "Finder"
tell disk "'${TITLE}'"
open
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {400, 100, 1000, 550}
set theViewOptions to the icon view options of container window
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 72
set background picture of theViewOptions to file ".background:Audacity-DMG-background.png"
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
set position of item "Audacity" of container window to {170, 350}
set position of item "Applications" of container window to {430, 350}
close
open
update without registering applications
delay 5
eject
end tell
end tell
' | osascript
# Compress and prepare for Internet delivery
hdiutil convert TMP.dmg -format UDZO -imagekey zlib-level=9 -o "$DMG.dmg"
# Create zip version
rm -rf "${DMG}/Audacity/help/"
zip -r9 "${DMG}.zip" "${DMG}"
# Cleanup
rm -rf ${DMG} TMP.dmg

10
mac/scripts/copy_nyquist.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
for (( i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; i++ ))
do
in="$(eval echo \${SCRIPT_INPUT_FILE_${i}})"
out="$(eval echo \${SCRIPT_OUTPUT_FILE_${i}})"
cp -pPR "${in}" "${out}"
done
exit 0

10
mac/scripts/copy_plugins.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
for (( i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; i++ ))
do
in="$(eval echo \${SCRIPT_INPUT_FILE_${i}})"
out="$(eval echo \${SCRIPT_OUTPUT_FILE_${i}})"
cp -pPR "${in}" "${out}"
done
exit 0

View File

@@ -0,0 +1,32 @@
#!/bin/sh
#
# Here we create empty xcconfig files if they do not exist. Otherwise,
# the build will fail.
#
configs='Debug Release'
for config in $configs
do
if [ ! -f $TOPLEVEL/mac/$config.xcconfig ]
then
touch $TOPLEVEL/mac/$config.xcconfig
fi
done
#
# Generate the header file for preprocessing the Info.plist
#
# It's also used for create the distribution files
#
cd ${TOPLEVEL}
eval $(gcc -E -dM src/Audacity.h | awk '/#define *AUDACITY_(VERSION|RELEASE|REVISION|MODLEVEL) /{print $2 "=" $3}')
cat >mac/build/Info.plist.h <<EOF
#define AUDACITY_EXECUTABLE Audacity
#define AUDACITY_VERSION ${AUDACITY_VERSION}
#define AUDACITY_RELEASE ${AUDACITY_RELEASE}
#define AUDACITY_REVISION ${AUDACITY_REVISION}
#define AUDACITY_DIST_VERSION ${AUDACITY_VERSION}.${AUDACITY_RELEASE}.${AUDACITY_REVISION}
#define AUDACITY_INFO_VERSION ${AUDACITY_VERSION}.${AUDACITY_RELEASE}.${AUDACITY_REVISION}.${AUDACITY_MODLEVEL}
EOF
exit 0

View File

@@ -0,0 +1,115 @@
#!/bin/sh
#
# This script builds the 2 plugins that are included in the Audacity
# distribution.
#
# Since we do not include the plugin source as part of Audacity, we
# must retrieve it first, followed by configure. However, we do not
# use the constructed Makefile since we only need 2 of the plugins and
# it is not universal binary friendly.
#
# In addition, each plugin has an initialization routine that must be
# executed before the plugin can be used. The plugin distribution does
# not provide support for this on OSX so, by default, the initialization
# routine never gets executed.
#
# Therefore, we assign the constructor attribute to the initialization
# routine which causes the routine to be executed as soon as the plugin
# is loaded.
#
# Set to the URL to the plugins source distribution
swhdist="http://plugin.org.uk/releases/0.4.15/swh-plugins-0.4.15.tar.gz"
# Set to base directory within the above distribution
swhpath="./swh-plugins-0.4.15"
#
# Builds an individual plugin
#
function build
{
# Get the plugin name
target="$1"
shift
# Create the destination directory if it's not already there
if [ ! -d "${TARGET_BUILD_DIR}" ]
then
mkdir -p "${TARGET_BUILD_DIR}"
chmod -RH "${INSTALL_MODE_FLAG}" "${TARGET_BUILD_DIR}"
chown -RH "${INSTALL_OWNER}:${INSTALL_GROUP}" "${TARGET_BUILD_DIR}"
fi
# Build the plugin if it doesn't exist
if [ ! -e "${TARGET_BUILD_DIR}/${target}.so" ]
then
GCC=gcc
if [ -e "${GCC}-${GCC_VERSION}" ]
then
GCC="${GCC}-${GCC_VERSION}"
fi
echo "Building ${target} using ${GCC}"
"${GCC}" -bundle -arch ${ARCHS/ / -arch } \
-mmacosx-version-min="${MACOSX_DEPLOYMENT_TARGET}" -isysroot "${SDKROOT}" \
-O3 -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math \
"-D_init=__attribute__ ((constructor)) _${target}_init" \
-o "${TARGET_BUILD_DIR}/${target}.so" ${*}
fi
}
function cleanAction
{
[ -d "${TARGET_TEMP_DIR}" ] && rm -rf "${TARGET_TEMP_DIR}"
rm -f "${TARGET_BUILD_DIR}/sc4_1882.so"
}
function buildAction
{
# Create the temp directory
mkdir -p "${TARGET_TEMP_DIR}"
cd "${TARGET_TEMP_DIR}"
# Get the distribution
if [ ! -e "${swhpath}" ]
then
echo "Retrieving plugins"
ftp -o '|tar xf -' "${swhdist}"
fi
# Get to where we need to be
cd "${swhpath}"
# Get rid of the existing config.h options
echo >config.h
# Build the 2 standard plugins
build sc4_1882 sc4_1882.c util/db.c util/rms.c
}
function installAction
{
# Just do the build to put things where the belong
buildAction
}
case "${ACTION}" in
"" | build)
TARGET_BUILD_DIR="${TARGET_BUILD_DIR}/plug-ins"
buildAction
;;
install)
TARGET_BUILD_DIR="${DSTROOT}/Audacity/plug-ins"
installAction
;;
clean)
TARGET_BUILD_DIR="${TARGET_BUILD_DIR}/plug-ins"
cleanAction
;;
esac
exit

61
mac/scripts/install_manual.sh Executable file
View File

@@ -0,0 +1,61 @@
#!/bin/sh
#
# This script retrieves and build the Audacity manual
#
function cleanAction
{
[ -d "${TARGET_TEMP_DIR}" ] && rm -rf "${TARGET_TEMP_DIR}"
[ -d "${TOPLEVEL}/help/manual" ] && rm -r "${TOPLEVEL}/help/manual"
rm -rf "${TARGET_BUILD_DIR}"
}
function buildAction
{
# Retrieve the manual
if [ ! -d "${TOPLEVEL}/help/manual" ]
then
cd "${TOPLEVEL}/scripts/mw2html_audacity"
./wiki2htm.sh
cd "${SRCROOT}"
fi
# Create the destination directory if it's not already there
if [ ! -d "${TARGET_BUILD_DIR}" ]
then
mkdir -p "${TARGET_BUILD_DIR}"
chmod -RH "${INSTALL_MODE_FLAG}" "${TARGET_BUILD_DIR}"
chown -RH "${INSTALL_OWNER}:${INSTALL_GROUP}" "${TARGET_BUILD_DIR}"
fi
# Copy the manual to the destination
cp -pPR "${TOPLEVEL}/help/manual/" "${TARGET_BUILD_DIR}"
# Remove svn files
find "${TARGET_BUILD_DIR}" -name .svn -print0 | xargs -0 rm -rf
}
function installAction
{
# Just do the build to put things where the belong
buildAction
}
case "${ACTION}" in
"" | build)
TARGET_BUILD_DIR="${TARGET_BUILD_DIR}/help/manual"
buildAction
;;
install)
TARGET_BUILD_DIR="${DSTROOT}/Audacity/help/manual"
installAction
;;
clean)
TARGET_BUILD_DIR="${TARGET_BUILD_DIR}/help/manual"
cleanAction
;;
esac
exit

25
mac/scripts/install_wxlibs.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
update_paths()
{
base=$(basename "${1}")
cp -p "${1}" "${LIBPATH}"
for lib in $(otool -L "${1}" | awk '/libwx/{print $1}')
do
install_name_tool -change "${lib}" @loader_path/../Frameworks/$(basename "${lib}") "${LIBPATH}/${base}"
done
}
EXEPATH="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"
LIBPATH="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${LIBPATH}"
for lib in $(otool -L "${EXEPATH}" | awk '/libwx/{print $1}')
do
install_name_tool -change "${lib}" @executable_path/../Frameworks/$(basename "${lib}") "${EXEPATH}"
update_paths "${lib}"
done
exit 0