Skip to content

Commit cd9fb0d

Browse files
authored
Adjust apple packaging so correct git version gets reported (#16139)
1 parent 3873c8d commit cd9fb0d

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.gitlab-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ build-retroarch-linux-i686:
349349
- ditto -c -k --sequesterRsrc --keepParent RetroArch.app ${XCPROJECT_NAME}.zip
350350
- mkdir .retroarch-repo
351351
- "cp -r ./* .retroarch-repo"
352+
- echo '#define GIT_VERSION ' $(git rev-parse --short HEAD) > .retroarch-repo/.git_version.h
352353
- "mv .retroarch-repo/ retroarch-repo/"
353354

354355
# Mac OS Universal, Metal
@@ -402,6 +403,7 @@ build-retroarch-ios-arm64:
402403
- xcodebuild -project pkg/apple/${XCPROJECT_NAME}.xcodeproj -destination ${XCDESTINATION} -config Release -scheme "${XCSCHEME}" -xcconfig pkg/apple/iOS/${XCCONFIG} build
403404
- mkdir .retroarch-repo
404405
- "cp -r ./* .retroarch-repo"
406+
- echo '#define GIT_VERSION ' $(git rev-parse --short HEAD) > .retroarch-repo/.git_version.h
405407
- "mv .retroarch-repo/ retroarch-repo/"
406408

407409
build-retroarch-ios9:
@@ -418,6 +420,7 @@ build-retroarch-ios9:
418420
- xcodebuild -project pkg/apple/${XCPROJECT_NAME}.xcodeproj -config Release -scheme "${XCSCHEME}" -xcconfig pkg/apple/iOS/GitLabCI.xcconfig build
419421
- mkdir .retroarch-repo
420422
- "cp -r ./* .retroarch-repo"
423+
- echo '#define GIT_VERSION ' $(git rev-parse --short HEAD) > .retroarch-repo/.git_version.h
421424
- "mv .retroarch-repo/ retroarch-repo/"
422425

423426
build-retroarch-tvos-arm64:

pkg/apple/RetroArch_Metal.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@
16441644
);
16451645
runOnlyForDeploymentPostprocessing = 0;
16461646
shellPath = /bin/sh;
1647-
shellScript = "if [ -d \"$MIST_PATH\" -a -f \"$MIST_PATH\"/libmist.dylib ]; then\n install_name_tool -id @rpath/libmist.dylib \"$MIST_PATH\"/libmist.dylib\nfi\n\ncd \"$SRCROOT\"\necho '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\n";
1647+
shellScript = "if [ -d \"$MIST_PATH\" -a -f \"$MIST_PATH\"/libmist.dylib ]; then\n install_name_tool -id @rpath/libmist.dylib \"$MIST_PATH\"/libmist.dylib\nfi\n\ncd \"$SRCROOT\"\nif [ -f \".git_version.h\" ] ; then\n cp .git_version.h ${DERIVED_FILE_DIR}/git_version.h\nelse\n echo '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\nfi\n";
16481648
showEnvVarsInLog = 0;
16491649
};
16501650
0720995C29B1258C001642BB /* ShellScript */ = {
@@ -1682,7 +1682,7 @@
16821682
);
16831683
runOnlyForDeploymentPostprocessing = 0;
16841684
shellPath = /bin/sh;
1685-
shellScript = "cd \"$SRCROOT\"\necho '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\n";
1685+
shellScript = "cd \"$SRCROOT\"\nif [ -f \".git_version.h\" ] ; then\n cp .git_version.h ${DERIVED_FILE_DIR}/git_version.h\nelse\n echo '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\nfi\n";
16861686
showEnvVarsInLog = 0;
16871687
};
16881688
07B7872F29EA3B7D0088B74F /* ShellScript */ = {

pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@
14161416
);
14171417
runOnlyForDeploymentPostprocessing = 0;
14181418
shellPath = /bin/sh;
1419-
shellScript = "cd \"$SRCROOT\"\necho '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\n";
1419+
shellScript = "cd \"$SRCROOT\"\nif [ -f \".git_version.h\" ] ; then\n cp .git_version.h ${DERIVED_FILE_DIR}/git_version.h\nelse\n echo '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\nfi\n";
14201420
showEnvVarsInLog = 0;
14211421
};
14221422
07340E8D2B47A4910076B75D /* ShellScript */ = {
@@ -1436,7 +1436,7 @@
14361436
);
14371437
runOnlyForDeploymentPostprocessing = 0;
14381438
shellPath = /bin/sh;
1439-
shellScript = "cd \"$SRCROOT\"\necho '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\n";
1439+
shellScript = "cd \"$SRCROOT\"\nif [ -f \".git_version.h\" ] ; then\n cp .git_version.h ${DERIVED_FILE_DIR}/git_version.h\nelse\n echo '#define GIT_VERSION ' $(git rev-parse --short HEAD) > ${DERIVED_FILE_DIR}/git_version.h\nfi\n";
14401440
showEnvVarsInLog = 0;
14411441
};
14421442
9204BE271D319EF300BD49DB /* ShellScript */ = {

0 commit comments

Comments
 (0)