- Targets for generating snapshot Mac universal binaries by using make snapshot and packaging Mac snapshot releases
- Sets the current date for HB_BUILD in jam
- Sets the Mac .plist version and build based on the jam/make config
- Bumps the version number to 0.9.3
git-svn-id: svn://localhost/HandBrake/trunk@1346
b64f7644-9d1e-0410-96f1-
a4d463321fa5
Exit "Please run ./configure first." ;
}
-HB_VERSION = 0.9.2 ;
-HB_BUILD = 2008021900 ;
+# This line needs to be manually bumped for each release.
+HB_VERSION = 0.9.3 ;
+
+# If the user configured with the --snapshot argument,
+# generate version and build numbers that include
+# the svn revision and are marked as unstable.
+if $(SNAPSHOT) = 1
+{
+HB_VERSION = "$(HB_VERSION)svn$(SVN_REV)" ;
+HB_BUILD = "$(BUILD_DATE)01" ;
+}
+else
+{
+HB_BUILD = "$(BUILD_DATE)00" ;
+}
+
DEFINES += HB_VERSION=\\\"$(HB_VERSION)\\\" HB_BUILD=$(HB_BUILD) ;
LANGUAGES = fr de it pl ru nl es pt ja ;
RM = rm -rf ;
-# Build HandBrake.app using Xcode
+# Build HandBrake.app using Xcode --
+# Getting the right version and build numbers
+# requires editing the .plist and specifying
+# extra CFLAGs.
rule OSXApp
{
Depends exe : $(<) ;
actions OSXApp
{
$(RM) $(<) macosx/build/HandBrake.app && \
- ( cd macosx && xcodebuild -target libhb -target HandBrake -target HandBrakeCLI ) && \
+ ( cd macosx && \
+ defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleGetInfoString '"$(HB_VERSION)"' &&\
+ defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleShortVersionString '"$(HB_VERSION)"' &&\
+ defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleVersion '"$(HB_BUILD)"' &&\
+ plutil -convert xml1 "$(FULL_PATH)"/macosx/HandBrake.plist &&\
+ xcodebuild OTHER_CFLAGS_QUOTED_1="-g -HB_BUILD="$(HB_BUILD)" -HB_VERSION=\\\"$(HB_VERSION)\\\" -DHB_BUILD="$(HB_BUILD)" -DHB_VERSION=\\\"$(HB_VERSION)\\\" -CURRENT_PROJECT_VERSION=\\\"$(HB_VERSION)\\\" " -target libhb -target HandBrake -target HandBrakeCLI ) && \
for i in $(LANGUAGES) ; do \
( cd $(<)/Contents/Resources && \
cp -r English.lproj $i.lproj && \
\r
all: clean app\r
\r
+snapshot: clean snapshot-app\r
+\r
all-chunky: clean app-chunky\r
\r
test: clean cli\r
app:\r
(./DownloadMacOsXContribBinaries.sh ; cd macosx ; xcodebuild -target libhb -target HandBrake -target HandBrakeCLI -configuration UB OTHER_CFLAGS_QUOTED_1="-DHB_VERSION=\\\"$(HB_VERSION)\\\" -DHB_BUILD=$(HB_BUILD) " build | sed '/^$$/d' )\r
\r
+snapshot-app:\r
+ (./DownloadMacOsXContribBinaries.sh ; cd macosx ; defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleGetInfoString '$(SNAP_HB_VERSION)' ; defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleShortVersionString '$(SNAP_HB_VERSION)' ; defaults write "$(FULL_PATH)"/macosx/HandBrake CFBundleVersion '"$(SNAP_HB_BUILD)"' ; plutil -convert xml1 "$(FULL_PATH)"/macosx/HandBrake.plist ; xcodebuild -target libhb -target HandBrake -target HandBrakeCLI -configuration UB OTHER_CFLAGS_QUOTED_1="-g -HB_BUILD="$(SNAP_HB_BUILD)" -HB_VERSION=\\\"$(SNAP_HB_VERSION)\\\" -DHB_BUILD="$(SNAP_HB_BUILD)" -DHB_VERSION=\\\"$(SNAP_HB_VERSION)\\\" -CURRENT_PROJECT_VERSION=\\\"$(SNAP_HB_VERSION)\\\" " build | sed '/^$$/d' )\r
+\r
app-chunky:\r
(./DownloadMacOsXContribBinaries.sh ; cd macosx ; xcodebuild -alltargets -configuration UB OTHER_CFLAGS_QUOTED_1="-DHB_VERSION=\\\"$(HB_VERSION)\\\" -DHB_BUILD=$(HB_BUILD) " build | sed '/^$$/d' )\r
\r
cli-release:\r
(rm -rf HandBrake HandBrake*CLI_UB.dmg ; mkdir -p HandBrake/docs ; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrakeCLI HandBrake ; hdiutil create -srcfolder HandBrake -format UDZO HandBrake-$(HB_VERSION)-MacOSX.3_CLI_UB.dmg ; rm -rf HandBrake )\r
\r
+gui-snapshot-release:\r
+ (rm -rf HandBrake HandBrake*GUI_UB.dmg ; mkdir -p HandBrake/docs ; cp AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrake.app HandBrake ; hdiutil create -srcfolder HandBrake -format UDBZ HandBrake-$(SNAP_HB_VERSION)-MacOSX.5_GUI_UB.dmg ; rm -rf HandBrake )\r
+\r
+cli-snapshot-release:\r
+ (rm -rf HandBrake HandBrake*CLI_UB.dmg ; mkdir -p HandBrake/docs ; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrakeCLI HandBrake ; hdiutil create -srcfolder HandBrake -format UDZO HandBrake-$(SNAP_HB_VERSION)-MacOSX.5_CLI_UB.dmg ; rm -rf HandBrake )\r
+\r
endif\r
\r
#\r
-SNAP = $(shell echo $$SNAPSHOT)
-ifeq ($(SNAP), 1)
-HB_BUILD = $(shell date "+%Y%m%d")00
-HB_VERSION = 0.9.2s$(shell date "+%d")
-else
+# This line needs to be manually bumped for each release.
+HB_VERSION = 0.9.3
+
+# Use the current date for the build number
HB_BUILD = $(shell date "+%Y%m%d")00
-HB_VERSION = "0.9.2"
-endif
+
+# Do the same for snapshots but mark as unstable
+SNAP_HB_BUILD = $(shell date "+%Y%m%d")01
+
+# For snapshots add the svn revision number to the HB_VERSION
+SNAP_HB_VERSION = $(HB_VERSION)svn$(shell svnversion)
+
+# The working path is needed for editing the MacGui .plist
+FULL_PATH = $(shell pwd)
+BUILD_DATE = $(shell date "+%Y%m%d")
+
HB_DEFPPC = $(shell uname -a | grep ppc > /dev/null ; echo RES$$?)
ifeq ($(HB_DEFPPC), RES0)
HB_DEFPPC = "-DWORDS_BIGENDIAN"
else
HB_DEFPPC =
endif
-
MAKE=make
fi
+# If the user included the --snapshot argument, mark it down.
+if [[ $1 = "--snapshot" ]]
+then
+ SNAPSHOT=1
+else
+ SNAPSHOT=0
+fi
+
+# Generating the HB_BUILD and HB_VERSION for snapshots requires
+# the build date, working path, and current SVN revision.
+BUILD_DATE=$(date +%Y%m%d)
+FULL_PATH=$(pwd)
+SVN_REV=$(svnversion)
+
# Generate config.jam
rm -f config.jam
cat << EOF > config.jam
DEFINES = $DEFINES ;
LINKLIBS = $LINKLIBS ;
MAKE = $MAKE ;
+SNAPSHOT = $SNAPSHOT ;
+BUILD_DATE = $BUILD_DATE ;
+FULL_PATH = $FULL_PATH ;
+SVN_REV = $SVN_REV ;
EOF
echo